A large language model model combination method for personalized long-period information
Patent Information
- Application Number
- CN202311005152.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-10
- Publication Date
- 2026-09-08
- Estimated Expiration
- 2043-08-10
AI Technical Summary
[0003]本发明所要解决的技术问题是,提供一种使用成本低,可以解决LLM模型进行局部信息更新时影响其他用户使用的问题以及可以大大加速整体模型的推理速度的大语言模型针对个性化长周期信息的模型组合方法
1.该方法核心利用了矩阵分离的思路,将用户个性化的信息,单独设计为一个子网络,并且叠加每次的输入向量,可以实现模型内的个性化信息的表达,同时因为用户参数部分的网络参数虽然整体规模较大(与用户数量直接相关),但到每次推理时,只需要与其中的一行参数进行计算,因此在推理阶段可以做到非常小的计算规模,进而可以低成本的完成个性化信息在模型中的使用;
Smart Images

Figure CN117151077B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of large prophecy model technology, and in particular to a method for combining large language models for personalized long-term information. Background Technology
[0002] Current large language models are multi-task language models learned from publicly available information and knowledge data on the internet. While these models can fully utilize public knowledge and data, they also suffer from the problem of not being able to use personalized data in a low-cost and targeted manner. In other words, in scenarios based on individual needs, current large language models cannot utilize each individual's data at low cost. This limits the degree of personalization that large language models can achieve in practical applications, thus affecting user experience. Specifically, the following problems arise when using personalized data under the current technical methods of large language models: 1. The model parameters cannot be effectively isolated, which means that adding a user's data directly to the current model architecture will interfere with the use of other users during the model inference stage. That is, user A's use will be directly affected by user B's data. 2. Based on this, due to the current hierarchical design of the parameters in large language models, even updating a certain local parameter requires learning and training over a large range of parameters, resulting in high update costs and low update frequency, which affects the timeliness of knowledge and information in the model. 3. Due to the multi-task capabilities of large language models, if we directly fine-tune personalized data on the current basis, it will be difficult to obtain good fine-tuning results on different user datasets. This will also make it impossible to update the model with personalized information in a low-cost and short-cycle manner. 4. In addition, there is a solution on the market that can input user-personalized information into the model during the model inference stage by adding context and prompts in order to achieve a similar personalized effect. However, this solution will also lead to a continuous increase in inference costs when personalizing long-term information, and cannot fundamentally solve the problem of utilizing personalized information. Summary of the Invention
[0003] The technical problem to be solved by this invention is to provide a method for combining large language models for personalized long-term information that is low in cost, can solve the problem of LLM model affecting other users when updating local information, and can greatly accelerate the inference speed of the overall model.
[0004] To address the aforementioned technical problems, this invention is implemented through the following technical solution: a large language model for personalized long-cycle information, comprising a main parameter part, a side parameter part, and a user parameter part. After external text input, it first undergoes word vector embedding and then enters the user parameter part to complete the combination with information related to the current user. After the combination is formed, the calculation processes of the main parameter part and the side parameter part begin respectively, and vector superposition is performed based on the calculation results to form the final output. The main parameter part is a multi-layer M×N(W) self-attention model network structure, utilizing the massive parameters in the network structure to complete knowledge compression and knowledge storage of public data and knowledge, and the main parameter part has the reasoning ability of thought chains. The side parameter part is a multi-layer m×m self-attention model network architecture. The user parameter part is a U×D vector space, where each Ui represents each user's own data, represented by a vector of length D. Therefore, the length of this vector space is determined by the number of user data.
[0005] Furthermore, the main parameter part has the largest number of parameters and is used for knowledge compression and knowledge storage of public knowledge. Its essence is the current general-purpose large language model. Due to the large number of parameters in this part, it has the lowest update frequency in the parameter updates of the model.
[0006] Furthermore, the side branch parameter part is divided into multiple m×n (B) and n×m (A) sub-network structures according to different tasks, and each sub-network structure is a model parameter that can complete a certain independent task.
[0007] Furthermore, in the user parameter part, each Ui represents a fixed-length D, which is formed by extracting features from the user's plaintext information and projecting them into a vector space of dimension D.
[0008] Furthermore, the side parameter section and the user parameter section are isolated from the main parameter section, and the number of parameters in the side parameter section and the user parameter section is significantly smaller than the parameter size in the main parameter section.
[0009] Furthermore, the side parameter section and user parameter section will further isolate the corresponding parameters according to different tasks and users, which can achieve parameter update results for specific users or specific tasks.
[0010] Compared with existing technologies, the advantages of this large language model approach for combining models of personalized long-term information are: 1. The core of this method utilizes the idea of matrix separation, designing user-personalized information as a separate sub-network and superimposing it on the input vector each time. This enables the expression of personalized information within the model. At the same time, although the network parameters of the user parameter part have a large overall scale (directly related to the number of users), only one row of parameters needs to be calculated during each inference. Therefore, the computational scale can be very small during the inference stage, thus enabling the use of personalized information in the model at low cost. 2. Based on the parameter separation design and multi-path inference mechanism, this model combination architecture can perform targeted updates and iterations only on local model parameters. During this process, the remaining parameters, especially the massive number of parameters in the main parameter part, do not need to be updated. This solves the problem that local information updates in the LLM model affect the use of other users. 3. Based on this, user-personalized parameters are all incorporated into the model. Therefore, it is not necessary to input the user's historical information separately during each model inference stage, which can greatly accelerate the overall model inference speed and reduce token consumption. Attached Figure Description
[0011] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 This is a schematic diagram of a model combination architecture for personalized long-term information based on a large language model according to the present invention. Detailed Implementation
[0013] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0014] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention. It should be noted that similar reference numerals and letters in the following drawings denote similar items; therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. In the description of the embodiments of the invention, it should be noted that if terms such as "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," or "outer" indicate orientation or positional relationships based on the orientation or positional relationships shown in the drawings, or the orientation or positional relationships commonly used when the product is in use, they are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, terms such as "first" and "second" are only used to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0015] Furthermore, the use of terms such as "horizontal" or "vertical" does not imply that the component must be absolutely horizontal or vertical, but rather that it can be slightly tilted. For example, "horizontal" simply means that its direction is more horizontal than "vertical," and does not mean that the structure or component must be completely horizontal, but can be slightly tilted.
[0016] In the description of the embodiments of the present invention, "multiple" means at least two.
[0017] In the description of the embodiments of the present invention, it should also be noted that, unless otherwise explicitly specified and limited, the terms "set," "install," "connect," and "link" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in the present invention according to the specific circumstances. Example
[0018] This invention discloses a model combination method for personalized long-term information using a large language model. Instead of using prompt engineering outside the model for personalized information input, it extends the existing large language model architecture by splitting the model and introducing models with user-personalized parameters, forming new model combinations. This achieves parameter isolation and allows personalized data to be used within the model. The specific model combination architecture is as follows: Figure 1 As shown, the large language model for personalized long-term information consists of the following three parts: The first part is the main parameter part in the upper left corner, abbreviated as MP. This part is a multi-layer M×N (W) self-attention model (transformer) network structure, similar to the network structure of existing large language models. It mainly uses the massive parameters in the network structure to complete the knowledge compression and knowledge storage of public data and knowledge. In addition, this part has the reasoning ability of thought chain and is also the part with the largest number of model parameters in the whole method.
[0019] The second part is the side parameter part in the upper right corner, which mainly realizes personalized multi-task capabilities, abbreviated as TP. This part is a multi-layer m×m self-attention model (transformer) network architecture. At the same time, it is divided into multiple m×n (B) and n×m (A) sub-network structures according to different tasks. Each sub-network structure is a model parameter that can complete a certain independent task, such as summarizing, concluding, writing, etc.
[0020] The third part is the user parameter section, which mainly stores user personalized information and personalized feedback data, abbreviated as UP. This part is a U×D vector space. For each Ui, it represents each user's own data, represented by a vector of length D. Therefore, the length of this vector space is determined by the number of user data. However, for each Ui, the length of D it represents is fixed. It is formed by extracting features from the user's plaintext information and projecting them into a vector space of dimension D.
[0021] In the overall model architecture, the main parameter part (MP) in the upper left corner has the largest number of parameters and is used for knowledge compression and storage of common knowledge. Its essence is the current general-purpose large language model. Because of the large number of parameters in this part, it also has the lowest update frequency in the model's parameter updates. The other two parts, the side parameter part (TP) and the user parameter part (UP), store and express the personalized information parameters of each user and each user in each task. Because the side parameter part (TP) and the user parameter part (UP) are isolated from the main parameter part (MP), the number of parameters in the side parameter part (TP) and the user parameter part (UP) is significantly smaller than that in the main parameter part (MP). Furthermore, the parameters in the side parameter part (TP) and the user parameter part (UP) are further isolated according to different tasks and users, which can achieve parameter update results for specific users or specific tasks.
[0022] The implementation steps of this language model for personalized long-term information model combination method are as follows: Step 1) As an external text token input, it first undergoes word embedding and then enters the user parameter part (UP). This completes the combination with the information related to the current user in the user parameter part (UP), i.e., X. i =X O +U i , (where X O U is the word vector input from the outside. i (User parameters saved for the current user within the user parameters section (UP)) Step 2) X from the first step i After formation, the calculation processes for the primary parameter part (MP) in the upper left corner and the secondary parameter part (TP) in the upper right corner are started separately. Based on the calculation results, the vectors are superimposed to form the final output, i.e.: H i =MP·X i +TP·X i =W·X i +B·A·X i Where H i For the output of this model, W is the parameter matrix in the principal parameter part (MP) subnetwork, B and A are the upper and lower half parameter matrices of the corresponding task subnetwork in the side parameter part (TP), and X is the parameter matrix. i This is the input for this session.
[0023] This large language model approach for personalized long-term information utilizes matrix separation to design a separate sub-network for user-personalized information, superimposed on each input vector. This allows for the expression of personalized information within the model. While the user parameter part (UP) has a large overall network parameter size (directly related to the number of users), only one row of parameters needs to be calculated during each inference, resulting in a very small computational scale during the inference phase. This enables the low-cost use of personalized information within the model. Furthermore, based on the parameter separation design and multi-path inference mechanism, this model architecture allows for targeted updates and iterations of only local model parameters. During this process, the remaining parameters, especially the massive parameters in the master parameter part (MP), do not need to be updated. This solves the problem of LLM models affecting other users when updating local information. Since user-personalized parameters are all integrated into the model, there is no need to input user history information separately during each model inference phase, significantly accelerating the overall model inference speed and reducing token consumption.
[0024] It should be emphasized that the above are merely preferred embodiments of the present invention and are not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for combining large language models for personalized long-cycle information, characterized in that: The system consists of a main parameter part, a side parameter part, and a user parameter part. After external text input, it first undergoes word vector embedding and then enters the user parameter part to combine with information relevant to the current user. After combination, the calculation processes for the main parameter part and the side parameter part begin, and the vectors are superimposed based on the results of each calculation to form the final output. The main parameter part is a multi-layered M×N(W) self-attention model network structure, utilizing the massive parameters in the network structure to perform knowledge compression and storage of common data and knowledge, and the main parameter part possesses reasoning capabilities based on thought chains. The side parameter part is a multi-layered m×m self-attention model network architecture. The user parameter part is a U×D vector space, where each... Each user's data is represented by a vector of length D; therefore, the length of this vector space depends on the number of user data points. The side-branch parameter part is divided into multiple m×n (B) and n×m (A) sub-network structures based on the different tasks being implemented. Each sub-network structure represents the model parameters that can complete a specific task. Each user parameter part... The length of D, which represents the data, is fixed. It is formed by extracting features from the user's plaintext information and projecting them into a vector space of dimension D. The implementation steps of the model combination method are as follows: Step 1) As an external text token input, it first undergoes word vector embedding and then enters the user parameter part UP, completing the combination with the information related to the current user in the user parameter part UP, that is, = + ,in The word vectors are external inputs. The user parameters saved for the current user within the UP section of the user parameters section; Step 2) The first step After formation, the calculation processes for the main parameter part MP in the upper left corner and the side parameter part TP in the upper right corner are started separately. Based on the calculation results, the vectors are superimposed to form the final output, namely: ; in The output of this model is W, which is the parameter matrix of the MP subnetwork in the principal parameter part, and B and A are the upper and lower half parameter matrices of the corresponding task subnetwork in the TP side parameter part. This is the input for this session.
2. The method for combining large language models for personalized long-term information according to claim 1, characterized in that, The main parameter section has the largest number of parameters and is used for knowledge compression and storage of common knowledge. Its essence is the current general-purpose large language model. Due to the large number of parameters in this section, it has the lowest update frequency in the model's parameter updates.
3. The method for combining large language models for personalized long-cycle information according to claim 1, characterized in that, The side parameter section and user parameter section are isolated from the main parameter section, and the number of parameters in the side parameter section and user parameter section is significantly smaller than the number of parameters in the main parameter section.
4. The method for combining large language models for personalized long-term information according to claim 1, characterized in that, The side parameter section and user parameter section will further isolate the corresponding parameters according to different tasks and users, so as to achieve parameter update results for specific users or specific tasks.
Citation Information
Patent Citations
Combination method of manufacturing grid resource services orienting whole life cycle and supporting semantemes
CN101719933A
Pre-training language model construction method, system and device
CN115423105A