A code generation method and apparatus

By using a multi-layer target encoding generation method, the problem of information loss in training large models with information-rich data is solved, and higher quality output data is achieved.

CN120373392BActive Publication Date: 2026-05-29SHANGHAI XIYU JIZHI TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHANGHAI XIYU JIZHI TECH CO LTD
Filing Date
2024-10-21
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

When training large models, the encoding representation cannot effectively retain key information when faced with data rich in information, resulting in coarse output data that cannot meet user needs.

Method used

The training data is encoded into multi-layer target codes. Using the encoding codebook and the bias codebook, the target codes with the highest similarity are determined layer by layer. The residuals are calculated and the codes are updated to generate multi-layer target codes, thereby improving the richness of data information and the refinement of the fit.

Benefits of technology

It improves the fineness of data discretization and fitting, and enhances the quality and accuracy of the output data of large language models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120373392B_ABST
    Figure CN120373392B_ABST
Patent Text Reader

Abstract

The application discloses a coding generation method and device, which compares a first-layer initial coding of training data with a first standard coding in a preset coding password book, determines a first target coding corresponding to a first coding with the highest similarity to the first-layer initial coding in the coding password book, determines a first-layer target coding based on the first target coding, takes the first-layer target coding as a current-layer target coding, takes a residual error between a current-layer initial coding and the current-layer target coding as a current-layer coding deviation, and determines an Nth-layer target coding. The scheme can provide more abundant data information.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application. The original application has the application number 202411470413.6, the application date is October 21, 2024, and the invention title is "A method and apparatus for training large language model encoding". Technical Field

[0002] This invention relates to the field of machine learning technology, and in particular to a method and apparatus for generating codes. Background Technology

[0003] When training existing large-scale models, the training data is typically converted into encoded inputs. For example, each smallest unit of word segment (which could be a single character, word, or radical) in a text is converted into an encoding, thus transforming the text into a set of at least one encoding input to the large-scale model. While existing encoding methods are sufficient for relatively simple data, they are inadequate for data rich in information, such as music frames (each smallest unit of word segment) containing numerous instruments and / or vocals. Each frame of music possesses a wealth of key information such as pitch, timbre, range, etc. Fitting the data using a single encoding would result in the loss of significant useful information, leading to coarse output data from the trained large-scale model that falls far short of user needs. Summary of the Invention

[0004] This invention provides a coding generation method and apparatus that, by encoding training data into multi-layer target codes, can provide richer data information and improve the precision of data discretization and fitting.

[0005] According to one aspect of the present invention, an encoding generation method is provided, comprising:

[0006] Determine the initial encoding of the first layer of the training data;

[0007] The first layer initial code is compared with each first code or the first standard code corresponding to the first code in the pre-set encoding codebook to determine the first target code corresponding to the first code in the encoding codebook that has the highest similarity to the first layer initial code;

[0008] The first layer target code is determined based on the first target code;

[0009] The first layer target code is used as the current layer target code. The residual between the current layer initial code and the current layer target code is calculated, and the residual is used as the current layer code deviation.

[0010] The current layer coding deviation is compared with each second code or the second standard code corresponding to the second code in the pre-set next layer deviation codebook to determine the second target code corresponding to the second code with the highest similarity to the current layer coding deviation in the next layer deviation codebook, and the next layer target code is determined based on the second target code.

[0011] Determine the target encoding for the Nth layer; where N is an integer greater than or equal to 2.

[0012] According to another aspect of the present invention, an encoding generation apparatus is provided, comprising:

[0013] The first-layer initial encoding determination module is used to determine the first-layer initial encoding of the training data;

[0014] The first target encoding determination module is used to compare the first layer initial encoding with each first encoding or the first standard encoding corresponding to the first encoding in a pre-set encoding codebook, and determine the first target encoding corresponding to the first encoding in the encoding codebook that has the highest similarity to the first layer initial encoding;

[0015] The first-layer target encoding determination module is used to determine the first-layer target encoding based on the first target encoding;

[0016] The current layer coding deviation determination module is used to take the first layer target coding as the current layer target coding, calculate the residual between the current layer initial coding and the current layer target coding, and use the residual as the current layer coding deviation of the current layer coding;

[0017] The next-layer target encoding determination module is used to compare the current layer encoding deviation with each second code or the second standard code corresponding to the second code in the pre-set next-layer deviation codebook, determine the second target code corresponding to the second code in the next-layer deviation codebook that has the highest similarity to the current layer encoding deviation, and determine the next-layer target code based on the second target code;

[0018] The Nth layer target encoding determination module is used to determine the Nth layer target encoding; where N is an integer greater than or equal to 2.

[0019] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0020] At least one processor; and

[0021] A memory communicatively connected to the at least one processor; wherein,

[0022] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the encoding generation method according to any embodiment of the present invention.

[0023] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the encoding generation method described in any embodiment of the present invention.

[0024] The encoding generation scheme of this invention involves: determining a first-layer initial encoding of the training data; comparing the first-layer initial encoding with each first encoding or a first standard encoding corresponding to a first encoding in a pre-set encoding codebook to determine a first target encoding corresponding to the first encoding in the encoding codebook with the highest similarity to the first-layer initial encoding; determining a first-layer target encoding based on the first target encoding; using the first-layer target encoding as the current-layer target encoding, calculating the residual between the current-layer initial encoding and the current-layer target encoding, and using the residual as the current-layer encoding deviation; comparing the current-layer encoding deviation with each second encoding or a second standard encoding corresponding to a second encoding in a pre-set next-layer deviation codebook to determine a second target encoding corresponding to the second encoding in the next-layer deviation codebook with the highest similarity to the current-layer encoding deviation, and determining the next-layer target encoding based on the second target encoding; and determining the Nth-layer target encoding; where N is an integer greater than or equal to 2. The technical solution provided by this invention, by encoding training data into multi-layer target encodings, can provide richer data information and improve the refinement of data discretization and fitting.

[0025] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0026] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0027] Figure 1 A flowchart of a large language model encoding training method provided in Embodiment 1 of the present invention;

[0028] Figure 2This is a flowchart of a large language model encoding training method provided in Embodiment 2 of the present invention;

[0029] Figure 3 This is a schematic diagram of the structure of a large language model encoding training device provided in Embodiment 3 of the present invention;

[0030] Figure 4 A schematic diagram of the structure of an electronic device for implementing the large language model encoding training method of this invention. Detailed Implementation

[0031] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0032] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0033] Example 1

[0034] Figure 1 The flowchart of a large language model encoding training method is provided in Embodiment 1 of the present invention. This embodiment is applicable to the case of encoding training of a large language model. The method can be executed by a large language model encoding training device, which can be implemented in hardware and / or software and can be configured in an electronic device.

[0035] like Figure 1 As shown, the method includes:

[0036] S110. Obtain the training dataset; wherein the training dataset contains at least two training sample data groups, and each training sample data group consists of at least two corresponding training data.

[0037] In this embodiment of the invention, a training dataset is obtained, which contains multiple training sample data groups, each consisting of at least two types of data. For example, a training sample data group may include input data and fitted data; or, alternatively, a training sample data group may include reference data, input data, and fitted data. Input data refers to the data that needs to be used to generate corresponding content based on the input content during subsequent large language model training, such as questions in question-and-answer data or lyrics in music generation data. Reference data refers to the data that needs to be used to generate corresponding content based on some information during subsequent large language model training, such as reference images in text-to-image data, reference songs in music generation data, or reference accompaniment, reference singing style, etc., in reference songs, used to ensure that the large language model generates output data with the same style. Fitted data is standard answer data, used to compare the results with the output of the large language model one by one during subsequent large language model training, calculate the loss value, and thus correct the probability of the next output result of the large model; it is the ideal data that the large language model needs to fit. The training dataset is a dataset that matches the application scenario of the large language model to be trained later. For example, if the large language model to be trained later is a music generation model, each training sample data set in the training dataset can include fitted music and target lyrics, or it can refer to music, fitted music and target lyrics.

[0038] It should be noted that the embodiments of the present invention do not limit the number of input data and the number of reference data included in the training sample data set. For example, when training a large language model for music generation, the input data in the training sample data set can be a piece of lyrics or multiple pieces of lyrics, and the reference data in the training sample data set can be a reference song, or reference accompaniment and reference singing style in a reference song, etc.

[0039] S120. For at least one training data in each of the training sample data groups, determine the first layer target encoding of the training data.

[0040] In this embodiment of the invention, for each training sample data group in the training dataset, a first-layer target encoding for at least one training data in the training sample data group is determined. It is understood that a first-layer target encoding for any one or more or all training data in the training sample data group can be determined, wherein the types of training data for the determined first-layer target encoding in each training sample data group in the training dataset can be the same or different. For example, an encoder can encode at least one training data in the training sample data group to determine the first-layer target encoding, wherein the encoder can include a MERT encoder and a Mel encoder.

[0041] Optionally, before determining the first-layer target encoding of the training data for at least one training data in each training sample data group, the method further includes: discretizing the at least one training data to generate multiple smallest discrete units; determining the first-layer target encoding of the training data for at least one training data in each training sample data group includes: encoding each smallest discrete unit of the at least one training data in each training sample data group to determine the first-layer target encoding of the training data. For example, at least one training data in the training sample data group is discretized to generate at least two smallest discrete units, and then each of the at least two smallest discrete units is encoded by an encoder to determine the corresponding first target encoding. It is understood that the number of first target encodings is the same as the number of smallest discrete units.

[0042] Using a large language model trained subsequently as the music generation model, and taking a training sample data set consisting of reference music, fitted music, and target lyrics as an example, the process is illustrated below. The fitted music is discretized to generate at least two frames of fitted audio data. For example, the fitted music can be discretized into 10 frames per second; for instance, if the fitted music is a 10-second segment, it can be discretized into 100 frames. Alternatively, the fitted music can be discretized as a whole, for example, into 500 frames. The number of frames in the discretized fitted audio data can be determined based on the length of the reference music; the longer the fitted music, the more frames are needed. Each frame of fitted audio data is encoded using an encoder to generate a corresponding first-layer target code, where the number of first-layer target codes is the same as the number of frames in the fitted audio data. Optionally, the same encoder can be used to encode each frame of fitted audio data, or different encoders can be used. The encoder can be an open-source encoder, such as the MERT encoder or the Mel encoder. In this embodiment of the invention, the discretization processing of the target lyrics may include: segmenting the target lyrics into multiple segmentation units based on a preset word segmentation algorithm, wherein each segmentation unit may be a single character, a single word, or a single sentence. Each segmentation unit in the target lyrics is then encoded using an encoder to generate a first-layer target code corresponding to each segmentation unit. The method for determining the first-layer target code of the reference music can be similar to the method for fitting the first-layer target code of the music, and will not be elaborated further here.

[0043] Optionally, determining the first-layer target encoding of the training data includes: determining the first-layer initial encoding of the training data; comparing the first-layer initial encoding with each first encoding or the first standard encoding corresponding to the first encoding in a pre-set encoding codebook, and determining the first target encoding corresponding to the first encoding in the encoding codebook with the highest similarity to the first-layer initial encoding; and determining the first-layer target encoding based on the first target encoding. For example, at least one training data in the training sample data group is encoded by an encoder, and the obtained encoding information is used as the first-layer initial encoding of the training data. A pre-set encoding codebook is obtained, wherein the encoding codebook consists of multiple first encodings. Optionally, the first encodings in the encoding codebook can be standard encodings (also called special encodings), or standard encodings can be replaced with special characters, such as using the first standard encoding as encoding 0, the second standard encoding as encoding 1, and so on, generating an encoding codebook such as [0,1,2,...,1023]. This greatly simplifies the complexity of the codebook and isolates the encoding (i.e., special characters such as 0, 1, 2, etc.) from the standard encoding, making it easier to adjust the format and / or content of the standard encoding in the future. For example, the first standard encoding can be a multi-dimensional vector, or it can be any one or more of audio encoding, image encoding, character encoding, etc.; or the first standard encoding is originally a 256-dimensional encoding vector, and if it is subsequently adjusted to be converted into a 1024-dimensional encoding vector, the codebook will still be [0,1,2,...,1023].

[0044] The initial encoding of the first layer is compared sequentially with each first encoding or the first standard encoding corresponding to the first encoding in the encoding codebook. The similarity between the two is calculated, and the first encoding in the encoding codebook with the highest similarity to the initial encoding of the first layer is taken as the first target encoding. The first target encoding of the training data is then determined based on the first target encoding. Specifically, the first target encoding in the encoding codebook can be directly used as the first target encoding, or the first standard encoding corresponding to the first target encoding in the encoding codebook can be used as the first target encoding, or the first target encoding in the encoding codebook can be encoded based on a preset encoding strategy to generate the first target encoding corresponding to the standard data.

[0045] S130. Take the first layer target code as the current layer target code, determine the current layer code deviation of the current layer target code, and determine the next layer target code based on the current layer code deviation.

[0046] In this embodiment of the invention, the first-layer target encoding of the training data is updated to the current-layer target encoding, and the current-layer encoding deviation of the current-layer target encoding is determined. The current-layer encoding deviation can be the difference between the current-layer initial encoding and the current-layer target encoding. The next-layer target encoding of the training data is determined based on the current-layer encoding deviation. For example, the current-layer encoding deviation can be encoded based on a preset encoding algorithm to generate the next-layer target encoding of the training data. It is understood that the first-layer encoding deviation of the first-layer target encoding of the training data can be determined by using the residual between the first-layer initial encoding and the first-layer target encoding of the training data as the first-layer encoding deviation. The second-layer target encoding of the training data is determined based on the first-layer encoding deviation.

[0047] Optionally, determining the current layer coding deviation of the current layer target code and determining the next layer target code based on the current layer coding deviation includes: calculating the residual between the current layer initial code and the current layer target code, and using the residual as the current layer coding deviation of the current layer code; comparing the current layer coding deviation with each second code or the second standard code corresponding to the second code in a pre-set next layer deviation codebook, determining the second target code corresponding to the second code with the highest similarity to the current layer coding deviation in the next layer deviation codebook, and determining the next layer target code based on the second target code.

[0048] For example, the residual between the initial encoding and the target encoding of the current layer is used as the current layer encoding deviation. The next layer deviation cipherbook is obtained, where the next layer deviation cipherbook consists of multiple second encodings, which can be understood as residual encodings. Optionally, the second encodings in the deviation cipherbook can be standard residual encodings (also called special residual encodings), or the standard residual encodings can be replaced with special characters, such as using the first standard residual encoding as encoding 0, the second standard residual encoding as encoding 1, and so on, generating a deviation cipherbook such as [0,1,2,...,1023]. This greatly simplifies the complexity of the biased codebook and isolates the encoding (i.e., special characters such as 0, 1, 2) from the standard residual encoding, making it easier to adjust the format and / or content of the standard residual encoding in the future. For example, the first standard residual encoding can be a multi-dimensional vector, or it can be any one or more of audio encoding, image encoding, character encoding, etc.; or the first standard residual encoding is originally a 256-dimensional encoding vector, which is later adjusted to be a 1024-dimensional encoding vector. At this time, the biased codebook is still [0,1,2,...,1023].

[0049] The current layer encoding bias is compared sequentially with each second code or its corresponding second standard code in the next layer bias codebook, and the similarity between them is calculated. The second code in the next layer bias codebook with the highest similarity to the current layer encoding bias is taken as the second target code, and the next layer target code for the training data is determined based on the second target code. Specifically, the second target code in the next layer bias codebook can be directly used as the next layer target code, or the second standard code corresponding to the second target code in the next layer bias codebook can be used as the next layer target code, or the second target code in the next layer bias codebook can be encoded based on a preset encoding strategy to generate the next layer target code corresponding to the standard data.

[0050] S140. Update the next layer target code to the current layer target code, and return to the current layer code deviation for determining the current layer target code, thereby determining the Nth layer target code; where N is an integer greater than or equal to 2.

[0051] In this embodiment of the invention, the first-layer encoding deviation of the first-layer target code in the training data is compared with the second standard code corresponding to each second code in the second-layer deviation codebook. The second target code corresponding to the second code in the second-layer deviation codebook with the highest similarity to the first-layer encoding deviation is determined, and the second-layer target code is determined based on the second target code. The first-layer encoding deviation is used as the second-layer initial code, and the residual between the second initial code and the second-layer target code is calculated. This residual is used as the second-layer encoding deviation, i.e., the residual between the first-layer encoding deviation and the second-layer target code is used as the second-layer encoding deviation. For ease of description, the second code in the i-th layer deviation codebook can also be called the i-th code, and the standard code corresponding to the i-th code can be called the i-th standard code. Therefore, the second-layer encoding deviation is compared with the third standard code corresponding to each third code in the third-layer deviation codebook. The third target code corresponding to the third code in the third-layer deviation codebook with the highest similarity to the second-layer encoding deviation is determined, and the third-layer target code is determined based on the third target code. The second-layer coding bias is used as the initial coding of the third layer. The residual between the third initial coding and the third-layer target coding is calculated, and this residual is used as the third-layer coding bias. In other words, the residual between the second-layer coding bias and the third-layer target coding is used as the third-layer coding bias. This process is repeated until the Nth-layer target coding of the training data is determined, where N is an integer greater than or equal to 2.

[0052] It is understandable that, based on S120-S130, the N-layer target encoding corresponding to at least one training data point in the training sample data group can be determined. It should be noted that the number of layers in the target encoding of at least one training data point in each training sample data group in the training dataset can be the same or different.

[0053] S150. Train the large language model based on the target encoding described in the N layers to generate the target model.

[0054] In this embodiment of the invention, at least one N-layer target encoding corresponding to training data from each training sample data group in the training dataset is input into a large language model to train the large language model and generate a target model. The large language model can be any open-source large model, such as GPT. It should be noted that this embodiment of the invention does not limit the application scenario of the target model. For example, the target model can be a music generation model, in which case each training sample data group in the training dataset used to train the target model can include reference music, sample lyrics, and fitted music; or, for example, the target model can be a text-to-image model, that is, a model that generates images from text, in which case each training sample data group in the training dataset used to train the target model can include sample text and fitted images.

[0055] The large language model encoding training method of this invention involves acquiring a training dataset, wherein the training dataset contains at least two training sample data groups, each training sample data group consisting of at least two corresponding training data; for at least one training data in each training sample data group, determining a first-layer target encoding for the training data; using the first-layer target encoding as the current-layer target encoding, determining the current-layer encoding deviation of the current-layer target encoding, and determining the next-layer target encoding based on the current-layer encoding deviation; updating the next-layer target encoding to the current-layer target encoding, and returning to determine the current-layer encoding deviation of the current-layer target encoding to determine the Nth-layer target encoding; wherein N is an integer greater than or equal to 2; and training a large language model based on the N layers of target encodings to generate a target model. The technical solution provided by this invention, by encoding at least one training data in the training sample data group into multi-layer target encodings, can provide richer data information, improve the fineness of data discretization and fitting, thereby improving the quality of the output data of the trained large language model.

[0056] In some embodiments, before determining the first layer target encoding for at least one training data in each training sample data group, the method further includes: extracting partial training data of at least one dimension for the at least one training data; encoding the partial training data of at least one dimension respectively to generate at least one layer of enhanced target encoding; and training a large language model based on the N layers of target encoding to generate a target model, including: superimposing the at least one layer of enhanced target encoding with the N layers of target encoding to train the large language model and generate the target model. The advantage of this configuration is that it can enhance the training effect of the large language model in certain dimensions, resulting in better training performance of the large language model.

[0057] In this embodiment of the invention, for at least one training data in each training sample data group, partial training data of at least one dimension is extracted from the training data, and the partial training data of each dimension is encoded to generate at least one layer of reinforcement target encoding. Alternatively, the partial training data of each dimension can be encoded as a whole to generate at least one layer of reinforcement target encoding, or the partial training data of each dimension can be discretized, and each generated smallest discrete unit is encoded to generate at least one layer of reinforcement target encoding. It should be noted that when the reinforcement target encoding is a multi-layer encoding, the method for determining the multi-layer reinforcement target encoding is the same as the method for determining the N-layer target encoding of the training data in the above embodiments, and will not be repeated here.

[0058] For example, if the training sample data set includes reference music, fitted music, and target lyrics, the fitted music can be split into a predetermined number of dimensions, such as splitting it into at least one dimension (e.g., a fitted music part consisting of an accompaniment and vocals). Each dimension of the fitted music part is then discretized to generate at least two frames of fitted audio data. Each frame of fitted audio data is then encoded using an encoder to generate at least one layer of enhancement target code. Similarly, the reference sample music is split into a predetermined number of dimensions, such as splitting it into at least one dimension (e.g., a reference music part consisting of an accompaniment and vocals). Each of these at least one dimension of reference music part is then uniformly encoded to generate at least one layer of enhancement target code. Alternatively, the at least one dimension of the split reference music part can be discretized to generate at least two frames of reference audio data. Each frame of reference audio data is then encoded using an encoder to generate at least one layer of enhancement target code. Finally, the target lyrics are encoded to generate at least one layer of enhancement target code. For example, the bass, midrange, and treble frequencies in a frame of audio data can be encoded at different layers to generate corresponding enhancement target codes, or different instruments and vocals in a frame of audio data can be separated and encoded at different layers to generate corresponding enhancement target codes.

[0059] In this embodiment of the invention, at least one layer of enhanced target encoding is superimposed with N layers of target encoding, and the superimposed encoding is input into a large language model to train the large language model and generate a target model. Optionally, superimposing at least one layer of enhanced target encoding with N layers of target encoding to train the large language model includes: placing at least one layer of enhanced target encoding before the N layers of target encoding, and inputting at least a portion of the enhanced target encoding into the large language model before the N layers of target encoding for training the large language model.

[0060] For example, taking the fitted music in the training sample data set as an example, the enhanced target encoding of the vocal part extracted from the fitted music is used as the first layer, and the four target encodings corresponding to the fitted music are used as the second, third, fourth, and fifth layers, respectively. The enhanced target encoding of the vocal part of the fitted music is first input into the large language model for prediction output. Then, the four target encodings corresponding to the fitted music are sequentially input into the large language model to continue training based on the four target encodings, generating the target model. The advantage of this setup is that it allows the large language model to first perform fitting output from the simple vocal part corresponding to the fitted music, and then perform fitting training for complex songs, obtaining a clearer fitting of the vocal part than simply fitting songs, thus achieving a better training effect for the large language model.

[0061] Example 2

[0062] Figure 2 This is a flowchart of a large language model encoding training method provided in Embodiment 2 of the present invention, as shown below. Figure 2 As shown, the method includes:

[0063] S210. Obtain a training dataset; wherein the training dataset contains at least two training sample data groups, each training sample data group consists of at least two corresponding training data, and each training sample data includes input data and fitted data, or each training sample data group includes reference data, input data and fitted data.

[0064] S220. For at least one training data in each of the training sample data groups, determine the first layer target encoding of the training data.

[0065] S230. Take the first layer target code as the current layer target code, determine the current layer code deviation of the current layer target code, and determine the next layer target code based on the current layer code deviation.

[0066] S240. Update the next layer target code to the current layer target code, and return to the current layer code deviation for determining the current layer target code, thereby determining the Nth layer target code; where N is an integer greater than or equal to 2.

[0067] S250. Input the input encoding of the unfitted data and the first-layer target encoding of the fitted data into the large language model to determine the first output encoding of the large language model; wherein, the unfitted data includes the input data, or the unfitted data includes the reference data and the input data.

[0068] Each training sample data set can include input data and fitted data, or it can include reference data, input data, and fitted data. When the training sample data includes input data and fitted data, the input data is considered as unfitted data; when the training sample data includes reference data, input data, and fitted data, the reference data and input data are considered as unfitted data.

[0069] In this embodiment of the invention, the N-layer target encoding of the unfitted data is used as the input encoding of the unfitted data. The input encoding of the unfitted data and the first-layer target encoding of the fitted data are input into a large language model to train the large language model and obtain the first output encoding of the large language model. It can be understood that the first output encoding is the encoding output by the large language model after learning the input encoding of the unfitted data and the first-layer target encoding of the fitted data.

[0070] S260. Based on all previously input codes and the second-layer target code of the input fitted data, determine the second output code of the large language model; until the Nth output code of the large language model is determined based on all previously input codes of the large language model and the Nth-layer target code of the input fitted data.

[0071] In this embodiment of the invention, the second output code of the large language model is determined based on all previous input codes of the large language model and the second-layer target code of the fitted data input to the large language model. Similarly, the third output code of the large language model is determined based on all previous input codes of the large language model and the third-layer target code of the fitted data input to the large language model; the third output code of the large language model is determined based on all previous input codes of the large language model and the fourth-layer target code of the fitted data input to the large language model. This process continues until the Nth output code of the large language model is determined based on all previous input codes of the large language model and the Nth-layer target code of the fitted data input to the large language model.

[0072] S270. Based on at least one N-layer target encoding and the corresponding number of output encodings of the fitted data, the large language model is iteratively optimized to generate a target model.

[0073] In this embodiment of the invention, the N-layer target encoding of the fitted data may be one or more. When the fitted data corresponds to multiple N-layer target encodings, the output encoding corresponding to each N-layer target encoding is obtained through steps S260-S270. Based on at least one N-layer target encoding and the corresponding number of output encodings of the fitted data, the large language model is continuously iteratively optimized to generate the target model.

[0074] Optionally, the fitted data corresponds to M N-layer target codes, where M is an integer greater than 1. The method further includes: inputting the input codes of the unfitted data and the first first-layer target code of the fitted data into a large language model to determine the first output code of the large language model; determining the second output code of the large language model based on all previously input codes and the first second-layer target code and the second first-layer target code of the fitted data, wherein the first second-layer target code and the second first-layer target code of the fitted data are input by superposition and summation or concatenation; until the (M+N-1)th output code of the large language model is determined based on all previously input codes of the large language model and the Mth Nth target code of the fitted data; combining the M+N-1th output codes of the large language model into M N-layer final output codes; and iteratively optimizing the large language model based on at least M N-layer target codes and M N-layer final output codes of the fitted data to generate a target model.

[0075] In this embodiment of the invention, since the output data of the large language model depends on the input data of the large language model corresponding to the previously fitted data, a delayed method is used to superimpose the M N-layer target codes corresponding to the fitted data into the large language model. Specifically, the fitted data corresponds to M N-layer target codes, and all N-layer target codes of the unfitted data are used as the input codes of the unfitted data. The input codes of the unfitted data and the first first-layer target code of the fitted data are input into the large language model so that the large language model can make predictions and obtain the first output code of the large language model. It can be understood that the first output code is the code output by the large language model after learning the input codes of the unfitted data and the first first-layer target code of the fitted data. Based on all the previously input codes of the large language model, the first second-layer target code and the second first-layer target code of the fitted data input into the large language model, the second output code of the large language model is determined. Specifically, the first second-layer target code and the second first-layer target code of the fitted data are superimposed and summed or concatenated, and the second output code of the large language model is determined based on the superimposed, summed or concatenated code and all the previously input codes. This process continues until the Mth-Nth layer target code of the large language model is determined, based on all previous input codes of the large language model and the Mth-Nth layer target code of the fitted input data.

[0076] For example, M=4, N=4, Table 1 is an input table for the delay method superposition of four 4-layer target codes corresponding to fitting data provided in an embodiment of the present invention:

[0077] Table 1

[0078] t(14) t(24) t(34) t(44) t(13) t(23) t(33) t(43) t(12) t(22) t(32) t(42) t(11) t(21) t(31) t(41)

[0079] After inputting the input codes of the unfitted data and the first target code t(11) of the fitted data into the large language model, the first output code of the large language model is determined. Then, the first target code t(12) of the second layer and the second target code t(21) of the first layer are superimposed and summed and input into the large language model. The large language model determines the second output code based on all the previously input codes and the code after superimposing and summing t(12) and t(21). The first third-layer target code t(13), the second second-layer target code t(22), and the third first-layer target code t(31) of the fitted data are summed and then input into the large language model. The large language model determines the third output code based on all previously input codes and the summed code of t(13), t(22), and t(31). The first fourth-layer target code t(14), the second third-layer target code t(23), the third second-layer target code t(32), and the fourth first-layer target code t(41) of the fitted data are summed and then input into the large language model. The large language model determines the fourth output code based on all previously input codes and the summed code of t(14), t(23), t(32), and t(41). This process is repeated to obtain the seventh output code of the large language model in the manner described in Table 1. It is understandable that inputting the M N-layer target codes of the fitted data into the large language model in a delayed manner allows the large language model to first obtain the target codes of each unit at the lower level and then obtain the target codes at the higher level, which is beneficial to the training of the large language model.

[0080] Since the output data of a large language model depends on all inputs of the non-fit data (input data, or reference data and input data), a conventional overlay or concatenation method can be used to input the N-layer target codes corresponding to the non-fit data into the large language model. This means inputting all N-layer target codes of the non-fit data into the large language model at once, allowing the large model to acquire all N-layer target codes of the non-fit data simultaneously, thus making the training of the large language model faster and more efficient. Optionally, a DELAY method can also be used to overlay the N-layer target codes of the non-fit data into the large language model for training. For example, Table 2 is a conventional overlay input table for four 4-layer target codes corresponding to non-fit data provided in an embodiment of the present invention:

[0081] Table 2

[0082] t(14) t(24) t(34) t(44) t(13) t(23) t(33) t(43) t(12) t(22) t(32) t(42) t(11) t(21) t(31) t(41)

[0083] When the N-layer target codes of the unfitted data are superimposed into the large language model in a conventional manner, the multi-dimensional encoding vectors obtained by adding or concatenating the N-layer target codes of each unit can be obtained. For example, adding 256-dimensional t(11), t(12), t(13), and t(14) results in a 256-dimensional vector, or concatenating them to obtain a 1024-dimensional vector. Similarly, adding 256-dimensional t(21), t(22), t(23), and t(24) results in a 256-dimensional vector, which is still a 256-dimensional vector, or concatenating them to obtain a 1024-dimensional vector. The multi-layer encoding vectors are then input into the large language model, and the output of the large language model is also a multi-layer encoding vector, thereby improving the accuracy of the output of the large language model.

[0084] The M+N-1 output codes of the large language model are combined into M N-layer final output codes. Then, based on at least M N-layer target codes and M N-layer final output codes of the fitted data, the large language model is iteratively optimized to generate the target model.

[0085] The technical solution provided by the embodiments of the present invention can provide richer data information by encoding at least one training data in the training sample data group into a multi-layer target code, thereby improving the fineness of data discretization and fitting, and thus improving the quality of the output data of the trained large language model.

[0086] Example 3

[0087] Figure 3 This is a schematic diagram of the structure of a large language model encoding training device provided in Embodiment 3 of the present invention. Figure 3 As shown, the device includes:

[0088] The training dataset acquisition module 310 is used to acquire a training dataset; wherein the training dataset contains at least two training sample data groups, and each training sample data group consists of at least two corresponding training data;

[0089] The first-layer target encoding determination module 320 is used to determine the first-layer target encoding of the training data for at least one training data in each training sample data group;

[0090] The next-layer target encoding determination module 330 is used to take the first-layer target encoding as the current-layer target encoding, determine the current-layer encoding deviation of the current-layer target encoding, and determine the next-layer target encoding based on the current-layer encoding deviation;

[0091] The encoding deviation cyclic determination module 340 is used to update the next layer target encoding to the current layer target encoding, and return the current layer encoding deviation for determining the current layer target encoding, thereby determining the Nth layer target encoding; where N is an integer greater than or equal to 2;

[0092] The target model generation module 350 is used to train the large language model based on the target encoding of the N layers to generate the target model.

[0093] Optionally, the device further includes:

[0094] A partial training data extraction module is used to extract partial training data of at least one dimension for each of the at least one training data in each training sample data group before determining the first layer target encoding of the training data.

[0095] The reinforcement target encoding generation module is used to encode a portion of the training data in at least one dimension separately to generate at least one layer of reinforcement target encoding;

[0096] The target model generation module includes:

[0097] The target model generation unit is used to superimpose at least one layer of the enhanced target encoding with N layers of the target encoding to train a large language model and generate a target model.

[0098] Optionally, the target model generation unit is used for:

[0099] At least one layer of the enhanced target encoding is placed before the N layers of target encoding, and at least a portion of the enhanced target encoding is input into the large language model before the N layers of target encoding for training the large language model.

[0100] Optionally, the device further includes:

[0101] The minimum discrete unit generation module is used to discretize the at least one training data for each training sample data group before determining the first layer target encoding of the training data, and generate multiple minimum discrete units.

[0102] The first-layer target encoding determination module is used for:

[0103] Encode each smallest discrete unit of at least one training data in each training sample data group to determine the first layer target encoding of the training data.

[0104] Optionally, the first-layer target encoding determination module is used for:

[0105] Determine the first-layer initial encoding of the training data;

[0106] The first layer initial code is compared with each first code or the first standard code corresponding to the first code in the pre-set encoding codebook to determine the first target code corresponding to the first code in the encoding codebook that has the highest similarity to the first layer initial code;

[0107] The first layer target code is determined based on the first target code.

[0108] Optionally, the next-layer target encoding determination module is used for:

[0109] Calculate the residual between the initial encoding of the current layer and the target encoding of the current layer, and use the residual as the current layer encoding deviation of the current layer encoding;

[0110] The current layer coding deviation is compared with each second code or the second standard code corresponding to the second code in the pre-set next layer deviation codebook to determine the second target code corresponding to the second code with the highest similarity to the current layer coding deviation in the next layer deviation codebook, and the next layer target code is determined based on the second target code.

[0111] Optionally, the target code is determined based on the code with the highest similarity in the codebook, including:

[0112] The code with the highest similarity in the codebook is directly determined as the target code; or...

[0113] The target code is generated by encoding the code with the highest similarity in the codebook based on a preset encoding strategy.

[0114] Optionally, each training sample data includes input data and fitted data, or each training sample data group includes reference data, input data and fitted data;

[0115] The target model generation module is used for:

[0116] The input encoding of the non-fitted data and the first-layer target encoding of the fitted data are input into the large language model to determine the first output encoding of the large language model; wherein, the non-fitted data includes the input data, or the non-fitted data includes the reference data and the input data;

[0117] Based on all previously input codes and the second-layer target code of the input fitted data, the second output code of the large language model is determined; until the Nth output code of the large language model is determined based on all previously input codes of the large language model and the Nth-layer target code of the input fitted data.

[0118] Based on at least one N-layer target encoding and the corresponding number of output encodings of the fitted data, the large language model is iteratively optimized to generate the target model.

[0119] Optionally, the fitted data corresponds to M N-layer target codes, where M is an integer greater than 1;

[0120] The target model generation module is used for:

[0121] Based on the input encoding of the unfitted data and the first first-layer target encoding of the fitted data, input the large language model to determine the first output encoding of the large language model;

[0122] Based on all previously input codes and the first and second first-layer target codes of the input fitted data, the second output code of the large language model is determined, wherein the first and second first-layer target codes of the fitted data are input by superposition and summation or concatenation; until the M+N-1th output code of the large language model is determined based on all previously input codes of the large language model and the Mth and Nth layer target codes of the input fitted data.

[0123] The M+N-1 output codes of the large language model are combined into M final output codes of N layers;

[0124] Based on at least M N-layer target codes and M N-layer final output codes of the fitted data, the large language model is iteratively optimized to generate the target model.

[0125] The large language model encoding training device provided in the embodiments of the present invention can execute the large language model encoding training method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0126] Example 4

[0127] Figure 4 A schematic diagram of an electronic device 10 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0128] like Figure 4 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0129] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0130] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as large language model encoding training methods.

[0131] In some embodiments, the large language model coding training method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or mounted on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the large language model coding training method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the large language model coding training method by any other suitable means (e.g., by means of firmware).

[0132] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0133] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0134] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0135] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0136] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0137] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0138] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0139] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method for generating an encoding, characterized in that, include: Determine the first-level initial encoding of the training data; wherein the training data is any one or more of the reference music, the fitted music, and the target lyrics; The first layer initial code is compared with each first code or the first standard code corresponding to the first code in the pre-set encoding codebook to determine the first target code corresponding to the first code in the encoding codebook that has the highest similarity to the first layer initial code; The first layer target code is determined based on the first target code; The first layer target code is used as the current layer target code. The residual between the current layer initial code and the current layer target code is calculated, and the residual is used as the current layer code deviation. The current layer coding deviation is compared with each second code or the second standard code corresponding to the second code in the pre-set next layer deviation codebook to determine the second target code corresponding to the second code with the highest similarity to the current layer coding deviation in the next layer deviation codebook, and the next layer target code is determined based on the second target code. Determine the target encoding for the Nth layer; where N is an integer greater than or equal to 2; This process, prior to determining the initial encoding of the first layer of the training data, also includes: Obtain a training dataset; wherein the training dataset contains at least two training sample data groups, and each training sample data group consists of at least two corresponding training data; Determine the initial encoding of the first layer of the training data, including: For each training sample data group, determine the first layer initial encoding of the training data; The target encoding of the Nth layer is determined, including: The target code of the next layer is updated to the target code of the current layer, and the current layer code deviation for determining the target code of the current layer is returned, thereby determining the target code of the Nth layer; After determining the target encoding for the Nth layer, the following is also included: The target model is generated by training the large language model based on the target encoding described in the N layers. Before determining the first-layer initial encoding of the training data for at least one training data in each of the training sample data groups, the method further includes: Extract partial training data of at least one dimension from the at least one of the training data; Encode at least one dimension of the training data separately to generate at least one layer of reinforcement target encoding; The large language model is trained based on the target encoding described in the N layers to generate the target model, including: The target model is generated by superimposing at least one layer of the enhanced target encoding with N layers of the target encoding and training the large language model.

2. The method according to claim 1, characterized in that, The step of superimposing at least one layer of the enhanced target encoding with N layers of the target encoding to train a large language model includes: At least one layer of the enhanced target encoding is placed before the N layers of target encoding, and at least a portion of the enhanced target encoding is input into the large language model before the N layers of target encoding for training the large language model.

3. The method according to any one of claims 1 to 2, characterized in that, Before determining the first-layer initial encoding of the training data for at least one training data in each of the said training sample data groups, the method further includes: The at least one training data is discretized to generate multiple smallest discrete units; For at least one training data point in each of the said training sample data groups, determining the first-layer initial encoding of the training data includes: Encode each smallest discrete unit of at least one training data in each training sample data group to determine the first layer initial encoding of the training data.

4. The method according to claim 1, characterized in that, The target code is determined based on the code with the highest similarity in the codebook, including: The code with the highest similarity in the codebook is directly determined as the target code; or... The target code is generated by encoding the code with the highest similarity in the codebook based on a preset encoding strategy.

5. The method according to claim 1, characterized in that, Each training sample data includes input data and fitted data, or each training sample data group includes reference data, input data, and fitted data. The step of training the large language model based on the N layers of target encoding to generate the target model includes: The input encoding of the non-fitted data and the first-layer target encoding of the fitted data are input into the large language model to determine the first output encoding of the large language model; wherein, the non-fitted data includes the input data, or the non-fitted data includes the reference data and the input data; Based on all previously input codes and the second-layer target code of the input fitted data, the second output code of the large language model is determined; until the Nth output code of the large language model is determined based on all previously input codes of the large language model and the Nth-layer target code of the input fitted data. Based on at least one N-layer target encoding and the corresponding number of output encodings of the fitted data, the large language model is iteratively optimized to generate the target model.

6. The method according to claim 5, characterized in that, The fitted data corresponds to M N-layer target codes, where M is an integer greater than 1. The method further includes: Based on the input encoding of the unfitted data and the first first-layer target encoding of the fitted data, input the large language model to determine the first output encoding of the large language model; Based on all previously input codes and the first and second first-layer target codes of the input fitted data, the second output code of the large language model is determined, wherein the first and second first-layer target codes of the fitted data are input by superposition and summation or concatenation; until the M+N-1th output code of the large language model is determined based on all previously input codes of the large language model and the Mth and Nth layer target codes of the input fitted data. The M+N-1 output codes of the large language model are combined into M final output codes of N layers; Based on at least M N-layer target codes and M N-layer final output codes of the fitted data, the large language model is iteratively optimized to generate the target model.

7. An encoding generation device, characterized in that, include: The first-layer initial encoding determination module is used to determine the first-layer initial encoding of the training data; wherein, the training data is any one or more of the reference music, the fitted music, and the target lyrics; The first target encoding determination module is used to compare the first layer initial encoding with each first encoding or the first standard encoding corresponding to the first encoding in a pre-set encoding codebook, and determine the first target encoding corresponding to the first encoding in the encoding codebook that has the highest similarity to the first layer initial encoding; The first-layer target encoding determination module is used to determine the first-layer target encoding based on the first target encoding; The current layer coding deviation determination module is used to take the first layer target coding as the current layer target coding, calculate the residual between the current layer initial coding and the current layer target coding, and use the residual as the current layer coding deviation of the current layer coding; The next-layer target encoding determination module is used to compare the current layer encoding deviation with each second code or the second standard code corresponding to the second code in the pre-set next-layer deviation codebook, determine the second target code corresponding to the second code in the next-layer deviation codebook that has the highest similarity to the current layer encoding deviation, and determine the next-layer target code based on the second target code; Determine the target encoding for the Nth layer; where N is an integer greater than or equal to 2; This process, prior to determining the initial encoding of the first layer of the training data, also includes: Obtain a training dataset; wherein the training dataset contains at least two training sample data groups, and each training sample data group consists of at least two corresponding training data; Determine the initial encoding of the first layer of the training data, including: For each training sample data group, determine the first layer initial encoding of the training data; The target encoding of the Nth layer is determined, including: The target code of the next layer is updated to the target code of the current layer, and the current layer code deviation for determining the target code of the current layer is returned, thereby determining the target code of the Nth layer; After determining the target encoding for the Nth layer, the following is also included: The target model is generated by training the large language model based on the target encoding described in the N layers. Before determining the first-layer initial encoding of the training data for at least one training data in each of the training sample data groups, the method further includes: Extract partial training data of at least one dimension from the at least one of the training data; Encode at least one dimension of the training data separately to generate at least one layer of reinforcement target encoding; The large language model is trained based on the target encoding described in the N layers to generate the target model, including: The target model is generated by superimposing at least one layer of the enhanced target encoding with N layers of the target encoding and training the large language model.