Natural language generation large model construction method based on continuous learning

By freezing old branches and introducing new branches, the problem of generating large models is solved by integrating natural language to forget old tasks when learning new tasks, and efficient continuous learning and accuracy improvement are achieved.

CN120471041APending Publication Date: 2025-08-12NANJING UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510564251.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-30
Publication Date
2025-08-12

AI Technical Summary

Technical Problem

The existing natural language generation large models are prone to forget old task knowledge when continuously learning new tasks, and the training costs are high. The existing low-rank adaptive methods lead to excessive output changes, affecting the accuracy.

Method used

By freezing the old low-rank adaptive branches and gated modules when learning new tasks, introducing new low-rank adaptive branches and new gated modules, integrating new and old branches with integration coefficients, and applying initialization and update constraints, the parameters of the new low-rank adaptive branches and gated modules are updated.

Benefits of technology

It effectively avoids the forgetting of old tasks by natural language generation large models when learning new tasks, improves accuracy, and greatly reduces training costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120471041A_ABST
    Figure CN120471041A_ABST
Patent Text Reader

Abstract

The invention discloses a natural language generation large model construction method based on continuous learning, which continuously enhances the generation capability of a large model by enabling the large model to continuously learn a new natural language generation task so as to construct a natural language generation large model. When a large model receives a new natural language generation task, a new low-rank adaptive branch is expanded by introducing a dimensionality reduction matrix and a dimensionality raising matrix; a new gating module is introduced to generate an integration coefficient of a new low-rank adaptive branch, the new and old low-rank adaptive branches are integrated, the old low-rank adaptive branch and the gating module are frozen at the same time, and initialization constraint is applied to the new gating module. When the new natural language generation task is learned, the parameters of the new low-rank adaptive branch and the gating module are updated, and the updating constraint is applied to the new gating module so as to minimize the interference of the new low-rank adaptive branch on the old natural language generation task; forgetting of old natural language generation tasks in learning of new natural language generation tasks can be effectively avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of large natural language generation models, and in particular to a method of allowing a large model to continuously learn new natural language generation tasks, which is particularly suitable for natural language scenarios that require continuous learning of new tasks, such as medical and health consultation. Background Art

[0002] By converting natural language tasks into generation tasks and pre-training them on large-scale datasets, existing large models have demonstrated excellent performance on a wide range of natural language tasks and are therefore widely used in a variety of natural language task scenarios. However, the capabilities of large models are not unlimited. If the pre-training dataset lacks data for certain tasks, their performance on these tasks will be poor. In many practical scenarios, large models need to be able to expand their capabilities. For example, in a large-model-based medical and health consultation system, as medical research advances and knowledge is updated, the large model needs to continuously learn the latest medical information to provide accurate health advice. Therefore, it is necessary to build a large-scale natural language generation model based on continuous learning.

[0003] Continuous learning (also called lifelong learning or incremental learning) aims to give models the ability to continuously learn new tasks, which is of great significance for the efficient training of large models. Currently, training large models often requires kilo- or even 10,000-calorie GPU clusters and massive amounts of data, which is extremely costly. If a model has the ability to continuously learn, new versions of large models can be incrementally trained based on the old version without having to review the data of old tasks, which is expected to significantly reduce training costs. Continuous learning faces many challenges, one of which is how to effectively use knowledge learned on old tasks to assist in learning new tasks, thereby improving learning ability and efficiency on new tasks. Another important challenge is catastrophic forgetting, that is, when a model learns a new task, it is easy to forget the knowledge it has learned on old tasks. To achieve continuous learning, the model needs to have both the ability to maintain performance on old tasks (stability) and the ability to learn new tasks (plasticity).

[0004] As one of the most representative methods for efficient parameter fine-tuning, low-rank adaptation has gained increasing attention in the continuous learning of large models. This method reparameterizes the weight updates of the large model into a low-rank form, allowing the large model to master new knowledge by updating only a limited number of parameters, which is more efficient than methods that update all parameters. However, most existing continuous learning methods based on low-rank adaptation usually expand a new low-rank adaptive branch to learn a new task and integrate the new and old branches by simple addition. As a result, the new low-rank adaptive branch may cause the output of the large model on the old task to change significantly, thereby causing forgetting and reducing the accuracy of the large model in continuous learning. These problems make existing continuous learning methods ineffective in the construction of large natural language generation models. Therefore, a more efficient and more suitable continuous learning method for the construction of large natural language generation models is needed to solve the problems in the existing technology. Summary of the Invention

[0005] The content of this application is used to briefly introduce concepts that will be described in detail in the detailed description section below. The content of this application is not intended to identify key features or essential features of the technical solution for which protection is sought, nor is it intended to limit the scope of the technical solution for which protection is sought.

[0006] In response to the problems and shortcomings in the prior art, the present invention aims to provide a method for constructing a large natural language generation model based on continuous learning. This method expands a new low-rank adaptive branch when learning each new task, introduces a gating module to integrate the old and new low-rank adaptive branches, and uses the new gating module to minimize the interference of the new low-rank adaptive branch on the old task. This effectively prevents the large natural language model from forgetting the capabilities of the old task when learning a new task, improves the accuracy, and significantly reduces the training cost, thereby solving the problems raised in the above background technology.

[0007] To achieve the above object, the present invention provides the following technical solutions:

[0008] The present invention discloses a method for constructing a large model for natural language generation based on continuous learning, comprising the following steps:

[0009] Step 1, in response to obtaining a dataset for a new natural language generation task;

[0010] Step 2: Freeze the parameters of the old low-rank adaptive branch and the old gating module, and introduce a new low-rank adaptive branch and a new gating module;

[0011] Step 3: generating an integration coefficient based on the new and old gating modules to integrate the new and old low-rank adaptive branches;

[0012] Step 4: applying initialization constraints to the new gating module so that the output of the old natural language generation task is close to zero;

[0013] Step 5: Calculate the loss function using the data of the new natural language generation task, and calculate the gradients of the new low-rank adaptive branch and the new gating module through back propagation to update the new low-rank adaptive branch and the new gating module.

[0014] Step 6: applying update constraints to the new gating module to minimize the new low-rank adaptive branch;

[0015] Step 7: Learning the new natural language generation task based on the new low-rank adaptive branch and the new gating module.

[0016] Preferably, the new low-rank adaptive branch introduced in step 2 includes a dimension-increasing matrix and a dimension-reducing matrix.

[0017] Preferably, the step 3 further comprises the following steps:

[0018] Step 3.1: Use the input text in the new natural language generation task to perform word segmentation and average pooling operations to obtain a fixed-length vector;

[0019] Step 3.2, inputting the fixed-length vector into a multilayer perceptron to obtain an integration coefficient;

[0020] Step 3.3: Integrate the new low-rank adaptive branch and the old low-rank adaptive branch based on the integration coefficient.

[0021] Preferably, in step 3.3, the integration of the new low-rank adaptive branch and the old low-rank adaptive branch is completed based on the integration coefficient, and the integration weight is expressed as,

[0022]

[0023] Among them, W represents the initial weight of the large model, A i represents the dimension-raising matrix, B i represents the dimension reduction matrix.

[0024] Preferably, the initialization constraint imposed in step 4 is expressed as,

[0025]

[0026] Among them, Init(·) represents the initialization operation, Represents the linear spanned input space of the first t-1 natural language generation tasks at the L+1 layer, and ⊥ represents orthogonality.

[0027] Preferably, to implement the initialization constraint in step 4, first set f(·) to f(c) = |2*sigmoid(c)-1|, and then set Init(W t,L+1 ) falls in a linear space The part in Init(W t,L+1 ) is deleted, expressed as,

[0028]

[0029] in, Init(W t,L+1 ) falls in a linear space Part of.

[0030] Preferably, the update constraint imposed in step 6 is expressed as,

[0031]

[0032] Where ΔW t,l Represents the weight W of the lth layer t,l The update amount, Represents the input linear span space of the first t-1 natural language generation tasks at the lth layer.

[0033] Preferably, to implement the update constraint in step 6, ΔW t,l Falling into linear space The part in ΔW t,l Delete to satisfy the update constraint, expressed as:

[0034]

[0035] in, Indicates ΔW before operation t,l Falling into linear space Part of.

[0036] As a second aspect of the present application, the present invention further discloses an electronic device, comprising:

[0037] at least one processor, and a memory communicatively coupled to the at least one processor;

[0038] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the steps of the above-mentioned method for constructing a large model for natural language generation based on continuous learning.

[0039] As a third aspect of the present application, the present invention further discloses a computer storage medium on which a computer program is stored, characterized in that when the computer program is executed by a processor, the steps of the above-mentioned method for constructing a large model of natural language generation based on continuous learning are implemented.

[0040] Compared with the prior art, the present invention has the following beneficial effects:

[0041] The present invention provides a method for constructing a large natural language generation model based on continuous learning, which can solve the catastrophic forgetting problem faced by the large model when continuously learning new natural language generation tasks. First, a data set of a new natural language generation task is obtained, the parameters of the old low-rank adaptive branch and the old gating module are frozen, and a new low-rank adaptive branch and a new gating module are introduced. An integration coefficient is generated based on the new gating module and the old gating module to integrate the new and old low-rank adaptive branches. An initialization constraint is imposed on the new gating module to ensure that the integration coefficient on the old natural language generation task is close to zero. The loss function is calculated using the data of the new natural language generation task, and the gradients of the new low-rank adaptive branch and the new gating module are calculated through backpropagation. The new low-rank adaptive branch and the new gating module are updated using the gradients, and at the same time, an update constraint is imposed on the new gating module to minimize the new low-rank adaptive branch. The method of the present invention can effectively avoid the large natural language model from forgetting the old task capabilities when learning new tasks, improve the accuracy, and significantly reduce the training cost. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] The drawings constituting a part of this application are used to provide a further understanding of this application and make other features, purposes and advantages of this application more apparent. The drawings and descriptions of the exemplary embodiments of this application are used to explain this application and do not constitute an improper limitation on this application.

[0043] In the attached figure:

[0044] Figure 1 A connection diagram of the main steps of the method for building a large model for natural language generation in an embodiment of the present invention;

[0045] Figure 2 This is a flowchart of the overall steps of the method for building a large natural language generation model in an embodiment of the present invention. DETAILED DESCRIPTION

[0046] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.

[0047] It should also be noted that, for ease of description, only the parts related to the invention are shown in the drawings. In the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other.

[0048] The present invention discloses a method for constructing a large model of natural language generation based on continuous learning. The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments. The present invention includes an intervention utility identification part, a blocking set update part, and an intervention utility set determination part. Figure 1 and Figure 2 As shown, it mainly includes the following steps:

[0049] Step 1, in response to obtaining a dataset for a new natural language generation task;

[0050] Step 2: Freeze the parameters of the old low-rank adaptive branch and the old gating module, and introduce a new low-rank adaptive branch and a new gating module;

[0051] Step 3: Generate an integration coefficient based on the new and old gating modules to integrate the new and old low-rank adaptive branches;

[0052] Step 4: impose initialization constraints on the new gating module so that the output on the old natural language generation task is close to zero;

[0053] In step 5, the loss function is calculated using the data of the new natural language generation task, and the gradients of the new low-rank adaptive branch and the new gating module are calculated through backpropagation to update the new low-rank adaptive branch and the new gating module.

[0054] Step 6: Apply update constraints to the new gating module to minimize the new low-rank adaptive branch;

[0055] Step 7: Learn the new natural language generation task based on the new low-rank adaptive branch and the new gating module.

[0056] First, obtain the dataset for the new natural language generation task, represented as in It is the input text, which represents a question or requirement raised by the user in a new task. This represents the response that the large model needs to generate based on the question or requirement. Datasets for natural language generation tasks are structured data sets specifically used to train and evaluate text generation models. They associate non-linguistic input (such as structured data, keywords, conversation context, etc.) with output text that conforms to human language conventions. Datasets for natural language generation tasks can be collected through public dataset platforms.

[0057] Then, before learning the new natural language generation task, we need to freeze the parameters of the old low-rank adaptive branch and the old gating module, and then introduce a new low-rank adaptive branch and a new gating module. Low-rank adaptation is an efficient fine-tuning method for large-scale pre-trained models. By introducing low-rank matrix decomposition technology, it can dynamically adjust the parameter structure for specific tasks or scenarios while keeping the core parameters of the model unchanged. The gating module is the key to optimizing information flow and control in recurrent neural networks, especially playing a core role in gated recurrent units and long short-term memory networks. In the present invention, the purpose of freezing the old low-rank adaptive branch is to overcome the forgetting problem of the old task, and the purpose of introducing a new low-rank adaptive branch is to learn the new task. Among them, the new low-rank adaptive branch is consistent with the old low-rank adaptive structure, including a dimensionality increase matrix and a dimensionality reduction matrix. Expressed as, the i-th new low-rank adaptive branch contains a dimensionality increase matrix A i and a dimension reduction matrix B i The purpose of freezing the old gating module is to overcome the forgetting problem of the old task, and the purpose of introducing the new gating module is to generate the integration coefficient of the new low-rank adaptive branch for integrating the new low-rank adaptive branch.

[0058] Next, an integration coefficient is generated based on the new gating module and the old gating module, and the new low-rank adaptive branch and the old low-rank adaptive branch are integrated using the integration coefficient, which specifically includes the following steps:

[0059] Step 3.1: Use the input text from the new natural language generation task to perform word segmentation and average pooling operations to obtain a fixed-length vector;

[0060] Step 3.2, input the fixed-length vector into the multilayer perceptron to obtain the integration coefficient;

[0061] In step 3.3, the new low-rank adaptive branch and the old low-rank adaptive branch are integrated based on the integration coefficient.

[0062] Specifically, the input text x obtained in step 1 in the new natural language generation task dataset is subjected to word segmentation and average pooling operations in sequence, which can be expressed as:

[0063] p0=Pool(Token(x)),

[0064] p l =σ(W i,l p l-1 ),l∈{1,2,…,L};

[0065] Among them, Token(·) represents the word segmenter, Pool(·) represents the average pooling operation, σ(·) is the nonlinear activation function, and W i,l Represents the weight matrix of the multilayer perceptron at layer l, p0 represents the input of the multilayer perceptron, pl Represents the output of the middle layer of the multi-layer perceptron. Specifically, first, the input text x words in the new natural language generation task dataset are divided into token sequences, and then the token sequence after word segmentation is pooled to obtain a fixed-length vector, and then the fixed-length vector is input into the multi-layer perceptron to calculate the integration coefficient a i , expressed as:

[0066] a i =g i (x) = f(W i,l+1 p l );

[0067] Among them, f(·) represents the function that maps the scalar to the interval [0,1]. The weight matrix W of the multilayer perceptron at layer l is i,l and the output p of the middle layer of the multilayer perceptron l The product of is processed by f(·) to obtain the integration coefficient a i . Get the integration coefficient a i Finally, the new low-rank adaptive branch and the old low-rank adaptive branch are integrated using the integration coefficient, which can be expressed as:

[0068]

[0069] Among them, W represents the initial weight of the large model, A i represents the dimension-raising matrix, B i Represents the dimensionality reduction matrix. Here, based on the initial weight W, by gradually accumulating the adjustment items a at different times i A i B i , in order to achieve the integrated weight W t The update is done by integrating the weight W t to achieve the integration of new and old low-rank adaptive branches.

[0070] As described in step 4, the initialization constraints need to be imposed on the new gating module. The initialization constraints imposed on the new gating module can be expressed as:

[0071]

[0072] Among them, Init(·) represents the initialization operation, Represents the linear span of the input space of the first t-1 new natural language generation tasks at the L+1 layer, and ⊥ represents orthogonality. In this way, the new gating module can be initialized so that the integration coefficient generated on the old task can be expressed as a t =g t (x)=f(Init(W t,L+1 )p L)=f(0)=0, thus ensuring that its output on the old natural language generation task is close to 0. The reason why the third equal sign is true is that and

[0073] In order to implement the initialization constraint, first set the function f(·) to f(c) = |2*sigmoid(c)-1|. Since the output of the sigmoid function at 0 is Therefore, this setting can ensure that f(·) satisfies the constraint of f(0) = 0. In addition, since the output of f(·) is restricted to between 0 and 1, the numerical stability can be guaranteed. This method learns the matrix M with the help of the existing dual gradient projection strategy. t,L+1 , so that M t,L+1 The column vector represents the linear space Finally, perform the following operations to make Init(W t,L+1 ) satisfies the initialization constraints:

[0074]

[0075] in, Init(W t,L+1 ) falls in a linear space This operation is done by Init(W t,L+1 ) falls in a linear space The part in Init(W t,L+1 ) is deleted, thus ensuring that the Init(W t,L+1 ) and linear space Orthogonal.

[0076] As described in step 5, the loss function is calculated using the data of the new natural language generation task, and the gradients of the new low-rank adaptive branch and the new gating module are calculated through backpropagation. The loss function L is expressed as:

[0077]

[0078] Among them, y k represents the kth component of the response content y, P(y k+1 |x,y1,…,y k ) represents the probability of the k+1th response obtained by the large model based on the input x and the first k responses y, and |y| represents the length of the output. Backpropagation is used to calculate the gradients of the new low-rank adaptive branch and the new gating module, and these gradients are used to update the new low-rank adaptive branch and the new gating module. Gradients are calculated using the PyTorch framework's backpropagation mechanism, further improving the model's adaptability and robustness.

[0079] Finally, an update constraint is also imposed on the new gating module to minimize the new low-rank adaptive branch. Specifically, the update constraint imposed on the new gating module can be expressed as:

[0080]

[0081] Where ΔW t,l Represents the weight W of the lth layer t,l The update amount, represents the linear span of the inputs of the first t-1 new natural language generation tasks at layer l. This constraint ensures that the output of the new gating module on the old task remains unchanged when learning a new task. Combined with the initialization constraint, the output of the new gating module on the old task is close to 0 before learning the new task. Therefore, the update constraint ensures that the output of the new gating module on the old task is close to 0 when learning the new task, thereby minimizing the interference of the new low-rank adaptive branch on the old task. This effectively prevents the generative ability of the old task from being forgotten when learning the new natural language generation task during the construction of a large natural language generation model based on continuous learning.

[0082] To implement the update constraint, we use the existing dual gradient projection strategy to learn the matrix M t,l , so that M t,l The column vector represents A set of standard orthogonal bases. By the following operation, ΔW t,l Satisfy the update constraints:

[0083]

[0084] in, Represents ΔW before operation t,l Falling into linear space This operation is done by adding ΔW t,l Falling into linear space The part in ΔW t,l Delete, thus ensuring ΔW after operation t,l and linear space Orthogonal.

[0085] Example Application

[0086] The present invention conducted experiments on two different natural language generation task sequences and two different model structures, comparing the performance of the present invention with the best existing methods. The first task sequence, Long Sequence, contains 15 commonly used classification tasks, all converted into generation tasks. The input is a classification request and the corresponding text to be classified, and the output is the label of the text. The second task sequence, SuperNI, contains 15 tasks from five task types: dialogue generation, information extraction, question answering, summarization, and sentiment analysis. Similarly, these tasks can all be converted into generation tasks. The first model structure is T5-Large with an encoder-decoder architecture, and the second model structure is Llama-2-7B with a decoder architecture. Test results based on the T5-Large and Llama-2-7B model structures on the Long Sequence and SuperNI task sequences show that the large-scale natural language generation model construction method proposed in this invention based on continuous learning can continuously learn new tasks and avoid forgetting the capabilities of old tasks when learning new tasks, thus outperforming existing state-of-the-art methods in overall performance.

[0087] In order to realize the above-mentioned embodiment, the present application discloses and also proposes an electronic device. The electronic device may include a processing device (such as a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) or a program loaded from a storage device into a random access memory (RAM). In the RAM, various programs and data required for the operation of the electronic device are also stored. The processing device, ROM and RAM are connected to each other via a bus. The input / output (I / O) interface is also connected to the bus. Usually the following devices can be connected to the I / O interface: input devices including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.: output devices including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices including, for example, a magnetic tape, a hard disk, etc. and a communication device. The communication device can allow the electronic device to communicate with other devices wirelessly or wired to exchange data.

[0088] It should be noted that the computer storage medium described above in some embodiments of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0089] In some embodiments of the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In some embodiments of the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer storage medium other than a computer-readable storage medium that can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0090] The computer storage medium may be included in the electronic device or may exist independently without being incorporated into the electronic device. The computer storage medium carries one or more programs that, when executed by the electronic device, enable the electronic device to implement a method for constructing a large model for natural language generation based on continuous learning.

[0091] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, program segment or a part of code, and the part of the module, program segment or code includes one or more executable instructions for realizing the logical function of the specification. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings.

[0092] For example, two boxes shown in succession may actually be executed substantially in parallel, or they may sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of boxes in the block diagram and / or flow chart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or may be implemented using a combination of dedicated hardware and computer instructions. The units described in some embodiments of the present disclosure may be implemented in software or in hardware. The units described may also be provided in a processor, and the names of these units do not, in some cases, constitute limitations on the units themselves.

[0093] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.

[0094] The above description is only an illustration of some preferred embodiments of the present disclosure and the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but should also cover other technical solutions formed by any combination of the above-mentioned technical features or their equivalent features without departing from the above-mentioned inventive concept. For example, the above-mentioned features are replaced with (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure.

Claims

1. A method for constructing a large model for natural language generation based on continuous learning, characterized in that: The steps include: Step 1, in response to obtaining a dataset for a new natural language generation task; Step 2: Freeze the parameters of the old low-rank adaptive branch and the old gating module, and introduce a new low-rank adaptive branch and a new gating module; Step 3: generating an integration coefficient based on the new and old gating modules to integrate the new and old low-rank adaptive branches; Step 4: applying initialization constraints to the new gating module so that the output of the old natural language generation task is close to zero; Step 5: Calculate the loss function using the data of the new natural language generation task, and calculate the gradients of the new low-rank adaptive branch and the new gating module through back propagation to update the new low-rank adaptive branch and the new gating module. Step 6: applying update constraints to the new gating module to minimize the new low-rank adaptive branch; Step 7: Learning the new natural language generation task based on the new low-rank adaptive branch and the new gating module.

2. The method for constructing a large model for natural language generation based on continuous learning according to claim 1, characterized in that: The new low-rank adaptive branch introduced in step 2 includes a dimension-increasing matrix and a dimension-reducing matrix.

3. The method for constructing a large model for natural language generation based on continuous learning according to claim 2, characterized in that: The step 3 further comprises the following steps: Step 3.1: Use the input text in the new natural language generation task to perform word segmentation and average pooling operations to obtain a fixed-length vector; Step 3.2, inputting the fixed-length vector into a multilayer perceptron to obtain an integration coefficient; Step 3.3: Integrate the new low-rank adaptive branch and the old low-rank adaptive branch based on the integration coefficient.

4. The method for constructing a large model for natural language generation based on continuous learning according to claim 3, characterized in that: In step 3.3, the integration of the new low-rank adaptive branch and the old low-rank adaptive branch is completed based on the integration coefficient, and the integration weight is expressed as: Among them, W represents the initial weight of the large model, A i represents the dimension-raising matrix, B i represents the dimension reduction matrix.

5. The method for constructing a large model for natural language generation based on continuous learning according to claim 3, characterized in that: The initialization constraint imposed in step 4 is expressed as, Among them, Init(·) represents the initialization operation, Represents the linear spanned input space of the first t-1 natural language generation tasks at the L+1 layer, and ⊥ represents orthogonality.

6. The method for constructing a large model for natural language generation based on continuous learning according to claim 5, characterized in that: To implement the initialization constraint in step 4, first set f(·) to f(c) = |2*sigmoid(c)-1|, and then set Init(W t,L+1 ) falls in a linear space The part in Init(W t,L+1 ) is deleted, expressed as, in, Init(W t,L+1 ) falls in a linear space Part of.

7. The method for constructing a large model for natural language generation based on continuous learning according to claim 5, characterized in that: The update constraint imposed in step 6 is expressed as, Where ΔW t,l Represents the weight W of the lth layer t,l The update amount, Represents the input linear span space of the first t-1 natural language generation tasks at the lth layer.

8. The method for constructing a large natural language generation model based on continuous learning according to claim 7, characterized in that: To implement the update constraint in step 6, ΔW t,l Falling into linear space The part in ΔW t,l Delete to satisfy the update constraint, expressed as: in, Indicates ΔW before operation t,l Falling into linear space Part of.

9. An electronic device, characterized in that: include: at least one processor, and a memory communicatively coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the steps of the method according to any one of claims 1 to 8.

10. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps according to any one of claims 1 to 8 are implemented.