The embodiment of the invention provides a model training method and device, a
text generation method and device, equipment and a medium, a large
language model comprises an embedding layer and a
processing layer, the embedding layer comprises a first embedding layer and a second embedding layer, the first embedding layer corresponds to a first embedding weight matrix, and the second embedding layer corresponds to a second embedding weight matrix; the model training method comprises the following steps: performing mapping
processing on an input matrix by utilizing a first embedding layer to obtain an activation matrix; multiplying the activation matrix by a second embedded weight matrix to obtain an embedded representation;
processing the embedded representation; and determining loss information according to the text information. According to the embodiment of the invention, the training fullness and the overall
training effect of the parameters of the large
language model can be improved, the
data transmission amount of the large
language model in the training process can be reduced, the hardware processing speed and the response speed corresponding to the large language model can be improved, and the storage space occupied by the training of the large language model can be saved.