Large language model training method and target classification model generation method and device

By generating a set of synthetic instances and processing them using a target classification model, the problem of forgetting old knowledge in large language models during continuous learning is solved. This enables new task learning and old task memorization in the absence of real data, improving the flexibility and adaptability of the model.

CN121660025APending Publication Date: 2026-03-13ALIBABA CLOUD COMPUTING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-12
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Large language models are prone to catastrophic forgetting during continuous learning and cannot keep up with both new and old knowledge when real training data is unavailable.

Method used

The model is trained by generating a set of synthetic instances, which are then processed and classified using a target classification model. This results in a high-quality and diverse set of synthetic instances, reducing reliance on real training data. The model is trained by combining synthetic instances from historical training and target training tasks.

Benefits of technology

It improves the flexibility and adaptability of the model in continuous learning, maintains memory of old tasks, improves data utilization efficiency and model generalization ability, and solves the problem of catastrophic forgetting.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121660025A_ABST
    Figure CN121660025A_ABST
Patent Text Reader

Abstract

The invention discloses a large language model training method and device and a target classification model generating method and device. The method comprises the steps of determining a target training task and at least one historical training task to be subjected to memory training; obtaining a first synthetic instance set corresponding to the target training task; obtaining a second synthetic instance set corresponding to the historical training tasks in the at least one historical training task, and determining a target synthetic instance set according to the first synthetic instance set and the second synthetic instance set; and training a to-be-trained large language model according to the target synthesis instance set to obtain a target large language model. The technical problem that old knowledge of the model is maintained depending on real training data of a large language model in related technologies, and new and old knowledge of the large language model cannot be considered when the real training data is unavailable is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence, and more specifically, to a method for training a large language model, a method for generating a target classification model, and an apparatus. Background Technology

[0002] In the continuous learning process of Large Language Models (LLMs), catastrophic forgetting is a common problem, meaning that previously learned knowledge is often forgotten when learning new tasks. Rehearsal methods in related technologies rely on real training data from previous training phases of the LLM to maintain the model's old knowledge. However, in practical applications, this data may be unavailable or difficult to obtain, making it impossible to simultaneously incorporate both new and old knowledge into the LLM.

[0003] There is currently no effective solution to the above problems. Summary of the Invention

[0004] This application provides a training method for a large language model, a method and apparatus for generating a target classification model, to at least solve the technical problem in related technologies where the old knowledge of the model is maintained by the real training data of the large language model, and when the real training data is unavailable, the old and new knowledge of the large language model cannot be taken into account.

[0005] According to one aspect of the embodiments of this application, a training method for a large language model is provided, comprising: determining a target training task and at least one historical training task to be trained for memory; obtaining a first synthetic instance set corresponding to the target training task; obtaining a second synthetic instance set corresponding to the historical training task in at least one historical training task, and determining a target synthetic instance set based on the first synthetic instance set and the second synthetic instance set; and training the large language model to be trained based on the target synthetic instance set to obtain a target large language model.

[0006] Further, obtaining the first synthetic instance set corresponding to the target training task includes: obtaining a demonstration example of the target training task and generating first text description information based on the demonstration example, wherein the first text description information is used to guide the generation of synthetic instances with the same features as the demonstration example; generating a third synthetic instance set based on the first text description information using a first large language model; determining a fourth synthetic instance set based on the third synthetic instance set using a second large language model, wherein the model performance of the second large language model is better than that of the first large language model, and the quality of synthetic instances in the fourth synthetic instance set is better than that in the third synthetic instance set; and processing the fourth synthetic instance set using a target classification model to obtain the first synthetic instance set, wherein the target classification model is obtained by transfer learning training of a pre-trained classification model based on a training sample set.

[0007] Furthermore, the third set of synthesis instances includes multiple third synthesis instances, and each third synthesis instance in the multiple third synthesis instances consists of a first input instruction and a first output result. Determining the fourth set of synthesis instances based on the third set of synthesis instances through the second language model includes: generating a corresponding second output result based on the first input instruction of the third synthesis instance in the multiple third synthesis instances through the second language model; and determining the fourth set of synthesis instances based on the first input instruction, the first output result, and the second output result.

[0008] Further, determining the fourth set of synthetic instances based on the first input instruction, the first output result, and the second output result includes: comparing the first output result and the second output result; if the first output result and the second output result are different, then generating the fourth synthetic instance in the fourth set of synthetic instances based on the first input instruction and the second output result.

[0009] Further, the fourth synthetic instance set is processed by a target classification model to obtain the first synthetic instance set, which includes: extracting data features of the fourth synthetic instances in the fourth synthetic instance set using a target classification model; determining the target category label corresponding to the fourth synthetic instance based on the data features of the fourth synthetic instance, wherein the target category label is one of the following: a first category label or a second category label, wherein the synthetic instance represented by the first category label has a higher quality than the synthetic instance represented by the second category label; taking the fourth synthetic instance with the first category label as the first synthetic instance, and generating the first synthetic instance set based on the first synthetic instance.

[0010] Further, determining the target synthetic instance set based on the first synthetic instance set and the second synthetic instance set includes: determining the weights corresponding to the second synthetic instance set; determining multiple target second synthetic instances from the second synthetic instance set based on the weights; and generating the target synthetic instance set based on the first synthetic instance set and the multiple target second synthetic instances.

[0011] Furthermore, the target large language model is trained based on the target synthetic instance set to obtain the target large language model, which includes: training the task processing ability of the target large language model to be trained to handle the target training task based on the first synthetic instance set, and memory training based on the task processing ability of the target large language model to be trained to handle the historical training task based on multiple target second synthetic instances, thus obtaining the target large language model.

[0012] According to another aspect of the embodiments of this application, a method for generating a target classification model is also provided, comprising: acquiring a training sample set and a pre-trained classification model, wherein the pre-trained classification model is obtained by training a target neural network based on a first training sample set; locking the target network parameters of the pre-trained classification model to obtain a classification model to be trained; and training the unlocked network parameters of the classification model to be trained based on the training sample set to obtain a target classification model.

[0013] According to another aspect of the embodiments of this application, a data processing method is also provided, including: receiving text description information for analyzing target financial data through a target large language model; performing semantic recognition on the text description information to determine the target financial data and user intent information; and analyzing the target financial data based on the user intent information to obtain analysis results.

[0014] According to another aspect of the embodiments of this application, a training method for a large language model is also provided, comprising: obtaining a target training task uploaded by a client and at least one historical training task to be trained; obtaining a first synthetic instance set corresponding to the target training task in a cloud server; obtaining a second synthetic instance set corresponding to the historical training task in at least one historical training task, and determining a target synthetic instance set based on the first synthetic instance set and the second synthetic instance set; and feeding back the target synthetic instance set to the client to train the large language model to be trained based on the target synthetic instance set to obtain the target large language model.

[0015] According to another aspect of the embodiments of this application, a training apparatus for a large language model is also provided, comprising: a first determining unit, configured to determine a target training task and at least one historical training task to be trained; a first processing unit, configured to obtain a first synthetic instance set corresponding to the target training task; a second determining unit, configured to obtain a second synthetic instance set corresponding to the historical training task in at least one historical training task, and determine a target synthetic instance set based on the first synthetic instance set and the second synthetic instance set; and a second processing unit, configured to train the large language model to be trained based on the target synthetic instance set to obtain the target large language model.

[0016] Further, the first processing unit includes: an acquisition subunit, used to acquire demonstration examples of the target training task and generate first text description information based on the demonstration examples, wherein the first text description information is used to guide the generation of synthetic instances with the same features as the demonstration examples; a generation subunit, used to generate a third set of synthetic instances based on the first text description information using a first large language model; a first determination subunit, used to determine a fourth set of synthetic instances based on the third set of synthetic instances using a second large language model, wherein the model performance of the second large language model is better than that of the first large language model, and the quality of the synthetic instances in the fourth set of synthetic instances is better than that in the third set of synthetic instances; and a processing subunit, used to process the fourth set of synthetic instances using a target classification model to obtain a first set of synthetic instances, wherein the target classification model is obtained by transfer learning training of a pre-trained classification model based on a training sample set.

[0017] Furthermore, the first determining subunit includes: a generation module, used to generate a corresponding second output result based on the first input instruction of the third synthesis instance among multiple third synthesis instances using the second large language model; and a determining module, used to determine a fourth synthesis instance set based on the first input instruction, the first output result, and the second output result.

[0018] Furthermore, the determining module includes: a comparison submodule for comparing the first output result and the second output result; and a determining submodule for generating a fourth synthetic instance in the fourth synthetic instance set based on the first input instruction and the second output result if the first output result and the second output result are different.

[0019] Further, the processing subunit includes: a first processing module, used to extract data features of the fourth synthetic instance in the fourth synthetic instance set through a target classification model; a second processing module, used to determine the target category label corresponding to the fourth synthetic instance based on the data features of the fourth synthetic instance, wherein the target category label is one of the following: a first category label or a second category label, wherein the synthetic instance represented by the first category label has a higher quality than the synthetic instance represented by the second category label; and a third processing module, used to take the fourth synthetic instance with the target category label as the first category label as the first synthetic instance, and generate a first synthetic instance set based on the first synthetic instance.

[0020] Furthermore, the second determining unit includes: a second determining subunit, used to determine the weights corresponding to the second synthetic instance set; a third determining subunit, used to determine multiple target second synthetic instances from the second synthetic instance set based on the weights; and a fourth determining subunit, used to generate a target synthetic instance set based on the first synthetic instance set and the multiple target second synthetic instances.

[0021] Furthermore, the second processing unit includes a training subunit, which is used to train the task processing ability of the large language model to be trained to handle the target training task based on the first synthetic instance set, and to perform memory training based on the task processing ability of the large language model to be trained to handle the historical training task based on multiple target second synthetic instances, so as to obtain the target large language model.

[0022] According to another aspect of the embodiments of this application, a target classification model generation apparatus is also provided, comprising: an acquisition unit for acquiring a training sample set and a pre-trained classification model, wherein the pre-trained classification model is obtained by training a target neural network based on a first training sample set; a third processing unit for locking the target network parameters of the pre-trained classification model to obtain a classification model to be trained; and a fourth processing unit for training the unlocked network parameters of the classification model to be trained based on the training sample set to obtain a target classification model.

[0023] According to another aspect of the embodiments of this application, a data processing apparatus is also provided, comprising: a receiving unit, configured to receive textual description information for analyzing target financial data through a target large language model; an identification unit, configured to perform semantic recognition on the textual description information to determine the target financial data and user intent information; and an analysis unit, configured to analyze the target financial data based on the user intent information to obtain analysis results.

[0024] According to another aspect of the present invention, an electronic device is also provided, comprising: a memory storing an executable program; and a processor for running the program, wherein the program executes the training method of a large language model of any one of the above-mentioned methods during runtime.

[0025] According to another aspect of the present invention, a computer-readable storage medium is also provided, wherein a program is stored in the storage medium, and the program controls the device where the storage medium is located to execute the training method of any of the above-mentioned large language models during program execution.

[0026] According to another aspect of the present invention, a computer program product is also provided, including a computer program or instructions, which, when executed by a processor, implement a training method for a large language model of any of the above.

[0027] In this embodiment, by determining the target training task and at least one historical training task to be trained, obtaining a first synthetic instance set corresponding to the target training task, obtaining a second synthetic instance set corresponding to the historical training task in at least one historical training task, and determining the target synthetic instance set based on the first and second synthetic instance sets, and training the large language model to be trained based on the target synthetic instance set to obtain the target large language model, the synthetic instances generated by the large language model are used for repetition, reducing the dependence on real training data, enabling the model to learn new tasks without real training data, while maintaining the memory of old tasks. Training the large language model to be trained based on the target synthetic instance set improves data utilization efficiency and the model's generalization ability, effectively solving the catastrophic forgetting problem encountered by the large language model in the continuous learning process, thereby achieving the technical effect of improving the flexibility and adaptability of the model in continuous learning, and solving the technical problem in related technologies that rely on the real training data of the large language model to maintain the model's old knowledge, and that cannot take into account both the new and old knowledge of the large language model when the real training data is unavailable. Attached Figure Description

[0028] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0029] Figure 1 This is a schematic diagram of a computer terminal provided according to Embodiment 1 of this application;

[0030] Figure 2 This is a flowchart of the training method for a large language model according to Embodiment 1 of this application;

[0031] Figure 3 This is a schematic diagram of the optional training process for a large language model according to Embodiment 1 of this application;

[0032] Figure 4 This is a flowchart of the method for generating a target classification model according to Embodiment 2 of this application;

[0033] Figure 5 This is a flowchart of the data processing method provided according to Embodiment 3 of this application;

[0034] Figure 6 This is a flowchart of the training method for a large language model according to Embodiment 4 of this application;

[0035] Figure 7 This is a schematic diagram of a training device for a large language model according to Embodiment 5 of this application;

[0036] Figure 8 This is a schematic diagram of the apparatus for generating a target classification model according to Embodiment Six of this application;

[0037] Figure 9 This is a schematic diagram of a data processing apparatus provided according to Embodiment 7 of this application;

[0038] Figure 10 This is a structural block diagram of an electronic device provided according to Embodiment 8 of this application. Detailed Implementation

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

[0040] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application 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 this application 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 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.

[0041] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant regions, and corresponding operation portals are provided for users to choose to authorize or refuse.

[0042] First, some nouns or terms that appear in the description of the embodiments of this application shall be interpreted as follows:

[0043] Continual Learning (CL): A machine learning paradigm that aims to enable models to learn multiple tasks while retaining knowledge of previous tasks, rather than forgetting old tasks when training on new tasks.

[0044] Catastrophic forgetting: In continuous learning, when a model learns a new task, it may forget the knowledge of previous tasks. This phenomenon is called catastrophic forgetting.

[0045] Rehearsal: Retaining memory of old tasks by revisiting or rehearsing data from old tasks while training for new tasks, used to mitigate catastrophic forgetting.

[0046] Self-synthetic retelling: The retelling process is simulated by using synthetic instances generated by LLM, rather than relying on real historical training data.

[0047] In-Context Learning (ICL): An unsupervised learning technique in which the model learns by observing patterns in the input data, rather than through explicit training.

[0048] Synthetic examples: Simulated training data generated by LLM for training or rehearsing in the absence of real data.

[0049] Example 1

[0050] According to an embodiment of this application, a method for training a large language model is also provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0051] The method embodiment provided in Embodiment 1 of this application can be executed on a mobile terminal, computer terminal, or similar computing device. Figure 1 A hardware block diagram of a computer terminal (or mobile device) for implementing a training method for large language models is shown. Figure 1 As shown, the computer terminal (or mobile device) 10 may include a processor set 102 (the processor set 102 may include, but is not limited to, processing devices such as microprocessors (MCUs) or field-programmable gate arrays (FPGAs), and the processor set 102 may include a processor set, Figure 1(Illustrated using 102a, 102b, ..., 102n), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may include: a display, an input / output interface (I / O interface), a Universal Serial Bus (USB) port (which may be included as one of the ports of a BUS bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0052] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be wholly or partially embodied in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be wholly or partially integrated into any other element within the computer terminal 10 (or mobile device).

[0053] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the large language model training method in this embodiment. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby realizing the above-mentioned large language model training method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0054] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.

[0055] The display may be a touchscreen LCD display that allows the user to interact with the user interface of the computer terminal 10 (or mobile device).

[0056] In the continuous learning process of Large Language Models (LLMs), catastrophic forgetting is a common problem, meaning that previously learned knowledge is often forgotten when learning new tasks. For example, a model trained on text classification using a generalized base model and labeled data may perform well on text classification but show a significant drop in performance on other tasks. The main causes of catastrophic forgetting include differences in data distribution, conflicting parameter updates, differing optimization objectives, and an excessive number of parameters. Among these factors, data distribution differences refer to discrepancies between the distribution of new task data and old task data. If the distribution of new task data differs significantly from that of old task data, the model may over-adjust to adapt to the new task, leading to a performance degradation on the old task. Parameter update conflicts refer to the possibility that model parameters may be updated during training for a new task, causing previously learned knowledge to be overwritten or lost. Gradient updates for the new task may conflict with those for the old task, resulting in catastrophic forgetting. Optimization objective differences refer to the fact that when training for a new task, a specific loss function for the new dataset is often used for optimization, rather than the loss function used during the original training. This difference may cause the model to adjust parameters unbalancedly during optimization, further exacerbating catastrophic forgetting. Excessive parameters refer to the fact that large language models typically have a large number of parameters. These parameters are adjusted as much as possible during training for a new task to minimize the loss function. If the coverage of the new task data is insufficient to encompass all aspects previously learned by the model, the model may lose its ability to perform previous tasks when learning the new task.

[0057] Rehearsal methods in related technologies rely on real training data from previous training phases of large language models to maintain the model's old knowledge. For example, past training samples are stored in a memory, and then these past samples are trained together with new samples when training a new task. This helps the model readjust weights to retain old knowledge. However, in practical applications, this data may be unavailable or difficult to obtain (e.g., although some large language models are open source, their training data is not open source, making it impossible to obtain the training data), resulting in an inability to simultaneously consider both the old and new knowledge of the large language model.

[0058] Against the above-mentioned technical background, this application provides as follows Figure 2 The training method for the large language model is shown. Figure 2 This is a flowchart of a training method for a large language model according to Embodiment 1 of this application. The method includes:

[0059] Step S201: Determine the target training task and at least one historical training task to be used for memory training.

[0060] Optionally, with the training system of the large language model as the execution entity, the user can input a new task to be trained (i.e., the target training task) and an old task to be reviewed (i.e., the historical training task), or randomly select at least one historical training task. For example, the training system receives the relevant task information input by the user and determines the target training task and at least one historical training task to be trained. The training task is used to enable the large language model to have the task processing capability corresponding to the training task. For example, the target training task can be a risk assessment task, and the historical training task can be a financial data analysis task, a document analysis task, etc.

[0061] Step S202: Obtain the first set of synthetic instances corresponding to the target training task.

[0062] Optionally, the first set of synthetic instances is a collection of diverse, high-quality synthetic instances constructed for a new training task. For example, context learning is performed using a basic LLM to generate synthetic instances for the new training task, and the output of the synthetic instances is refined using a newer LLM (such as correcting erroneous outputs) to obtain optimized synthetic instances. The optimized synthetic instances are then classified, and diverse, high-quality synthetic instances are selected from them to obtain the first set of synthetic instances.

[0063] Step S203: Obtain the second synthetic instance set corresponding to the historical training task in at least one historical training task, and determine the target synthetic instance set based on the first synthetic instance set and the second synthetic instance set.

[0064] Optionally, this solution uses synthetic instances to train the model. Therefore, the second synthetic instance set corresponding to historical training tasks can be directly obtained, such as the second synthetic instance set corresponding to financial data analysis tasks and document analysis tasks. Then, based on the first synthetic instance set corresponding to the new training task and the second synthetic instance set corresponding to the old training task, the target synthetic instance set can be determined. The target synthetic instance set includes synthetic instances from both the new and old training tasks. For example, certain weights can be assigned to the second synthetic instance set according to training requirements, and a portion of the second synthetic instances can be selected based on these weights. These selected second synthetic instances are then combined with the first synthetic instance set to form the target synthetic instance set. Alternatively, the first synthetic instance set corresponding to the new training task and the second synthetic instance set corresponding to the old training task can be directly mixed, and the resulting mixed synthetic instance set is used as the target synthetic instance set. The target synthetic instance set is used to train the large language model, enabling it to learn new tasks while retaining its memory of old tasks.

[0065] Step S204: Train the large language model to be trained based on the target synthetic instance set to obtain the target large language model.

[0066] Optionally, a target large language model can be obtained by training the large language model to be trained based on the target synthetic instance set containing synthetic instances of the new training task and synthetic instances of the old training task. The large language model to be trained can be the LLM in the current training stage, and the target large language model refers to the LLM that has learned the new task and reviewed the old task.

[0067] In this scheme, synthetic instances generated by a large language model are used for repetition, reducing the reliance on real training data. This allows the model to learn new tasks without real training data while retaining memory of old tasks. The large language model to be trained is trained based on the target synthetic instance set, improving data utilization efficiency and the model's generalization ability. This effectively solves the catastrophic forgetting problem encountered by large language models during continuous learning, thereby improving the model's flexibility and adaptability in continuous learning. Furthermore, it addresses the technical problem in related technologies that rely on real training data of large language models to maintain the model's old knowledge, and cannot balance the new and old knowledge of the large language model when real training data is unavailable.

[0068] To obtain a set of synthetic instances for a new training task, the training method for a large language model provided in Embodiment 1 of this application includes obtaining a first set of synthetic instances corresponding to the target training task, which involves: obtaining a demonstration example of the target training task and generating first text description information based on the demonstration example, wherein the first text description information is used to guide the generation of synthetic instances with the same features as the demonstration example; generating a third set of synthetic instances based on the first text description information using a first large language model; determining a fourth set of synthetic instances based on the third set of synthetic instances using a second large language model, wherein the model performance of the second large language model is better than that of the first large language model, and the quality of synthetic instances in the fourth set of synthetic instances is better than that in the third set of synthetic instances; and processing the fourth set of synthetic instances using a target classification model to obtain a first set of synthetic instances, wherein the target classification model is obtained by transfer learning training of a pre-trained classification model based on a training sample set.

[0069] Optionally, a synthetic instance set is constructed for the new training task. First, demonstration examples of the new training task are obtained, and first text description information is generated based on the demonstration examples. The demonstration examples are a small number of samples of the new training task. For example, if the new training task is a translation task, the demonstration examples can be Chinese-English translation sentence pairs obtained from public datasets or manually constructed. Then, the first text description information is generated based on the demonstration examples. For example, users can add these demonstration examples to the text description information (prompt) to obtain a prompt containing the demonstration examples (i.e., the first text description information).

[0070] Optionally, the first large language model can be a base LLM. Since large language models have the ability to learn from few samples, inputting a prompt containing demonstration examples into the first large language model allows it to generate a third set of synthetic instances based on the first text description information. For example, inputting a prompt containing demonstration examples into the base LLM, guided by this prompt, and using the base LLM for context learning, can generate synthetic instances with the same features as the demonstration examples, thus obtaining the initial set of synthetic instances (i.e., the third set of synthetic instances) corresponding to the new training task.

[0071] The fourth set of synthesized instances can be determined by using the second language model based on the third set of synthesized instances. The second language model can be the LLM used in the current training phase or a newer LLM. For example, to improve the quality of synthesized instances, a newer LLM can be used to refine the output of synthesized instances in the initial set of synthesized instances (such as correcting erroneous outputs) to obtain an optimized set of synthesized instances (i.e., the fourth set of synthesized instances).

[0072] By processing the fourth synthetic instance set using a target classification model, the first synthetic instance set can be obtained. The target classification model can classify the optimized synthetic instance set and select diverse high-quality synthetic instances from it to obtain the first synthetic instance set.

[0073] It should be noted that using the contextual learning capabilities of basic LLM to generate synthetic instances can simulate the distribution of real data, providing the model with richer training data. In this way, the model can learn new tasks without real data while retaining its memory of old tasks. By using a newer LLM to refine the output of synthetic instances, the quality of the synthetic instances is improved, ensuring that the output of the synthetic instances matches the capabilities of the model, thereby improving the model's performance in the rehearsal process. By using a target classification model to classify the synthetic instances, the diversity and quality of the synthetic instances are improved, which helps the model generalize to new tasks better.

[0074] To improve the quality of synthesized instances, in the training method of the large language model provided in Embodiment 1 of this application, the third synthesized instance set includes multiple third synthesized instances. Each third synthesized instance in the multiple third synthesized instances consists of a first input instruction and a first output result. Determining the fourth synthesized instance set based on the third synthesized instance set by the second large language model includes: generating a corresponding second output result based on the first input instruction of the third synthesized instance in the multiple third synthesized instances by the second large language model; and determining the fourth synthesized instance set based on the first input instruction, the first output result, and the second output result.

[0075] Optionally, the third synthesis instance consists of a first input instruction and a first output result, that is, the initial synthesis instance consists of an initial input instruction and a corresponding initial output result. Among them, there may be erroneous output results in the initial output results. Therefore, a newer LLM is used to refine the output of the synthesis instances in the initial synthesis instance set (such as correcting erroneous outputs). That is, the second language model generates the corresponding second output result based on the first input instruction of the third synthesis instance in multiple third synthesis instances. For example, the newer LLM can generate the corresponding output result (i.e., the second output result) based on the initial input instruction. Then, the fourth synthesis instance set can be determined based on the first input instruction, the first output result, and the second output result.

[0076] It should be noted that the output of the synthesized instances in the initial set of synthesized instances is refined by using the second language model, thereby improving the quality of the synthesized instances.

[0077] To improve the quality of synthesized instances, in the training method of the large language model provided in Embodiment 1 of this application, determining the fourth synthesized instance set based on the first input instruction, the first output result, and the second output result includes: comparing the first output result and the second output result; if the first output result and the second output result are different, then generating the fourth synthesized instance in the fourth synthesized instance set based on the first input instruction and the second output result.

[0078] Optionally, the second language model can compare the first and second output results. If the first and second output results are different, a fourth synthetic instance in the fourth synthetic instance set is generated based on the first input instruction and the second output result. For example, a newer LLM can compare the initial output result given by the base LLM with its own second output result. If they are different, the second output result can replace the initial output result, that is, a new synthetic instance (i.e., the fourth synthetic instance) is generated using the initial input instruction and the second output result, achieving refined processing of the synthetic instance. For example, if the initial input instruction (i.e., the first input instruction) is input A, and the corresponding initial output result (i.e., the first output result) is output B, then the initial synthetic instance is an input-output pair consisting of input A and output B. If the second output result is output C, then input A and output C can be combined to form a new input-output pair, resulting in a new synthetic instance (i.e., the fourth synthetic instance).

[0079] It should be noted that by comparing the first output result and the second output result, the better output result can be selected from the first output result and the output of the synthesized instance can be refined, thereby improving the quality of the synthesized instance.

[0080] To improve the diversity of synthesized instances, in the training method of the large language model provided in Embodiment 1 of this application, the processing of the fourth synthesized instance set by the target classification model to obtain the first synthesized instance set includes: extracting the data features of the fourth synthesized instances in the fourth synthesized instance set by the target classification model; determining the target category label corresponding to the fourth synthesized instance based on the data features of the fourth synthesized instance, wherein the target category label is one of the following: a first category label or a second category label, wherein the quality of the synthesized instance represented by the first category label is better than the quality of the synthesized instance represented by the second category label; taking the fourth synthesized instance with the target category label as the first category label as the first synthesized instance, and generating the first synthesized instance set based on the first synthesized instance.

[0081] Optionally, the first category label represents high-quality samples, and the second category label represents ordinary samples. Data features of the fourth synthetic instance in the fourth synthetic instance set are extracted using a target classification model. Based on these features, the target category label corresponding to the fourth synthetic instance can be determined. The fourth synthetic instance with the first category label is then used as the first synthetic instance, and a first synthetic instance set is generated based on this first synthetic instance. For example, the target classification model can select diverse high-quality synthetic instances from the optimized synthetic instance set and use them as synthetic instances for a new training task.

[0082] In an optional embodiment, the optimized set of synthetic instances can also be clustered using a clustering algorithm. The synthetic instance closest to the cluster center can be selected from each cluster and used as the first synthetic instance to obtain the set of synthetic instances corresponding to the new training task.

[0083] It should be noted that using the target classification model can classify the synthetic instances generated by the model, obtain the first set of synthetic instances, and improve the diversity of synthetic instances.

[0084] To improve data utilization efficiency, in the training method of the large language model provided in Embodiment 1 of this application, determining the target synthetic instance set based on the first synthetic instance set and the second synthetic instance set includes: determining the weights corresponding to the second synthetic instance set; determining multiple target second synthetic instances from the second synthetic instance set based on the weights; and generating the target synthetic instance set based on the first synthetic instance set and the multiple target second synthetic instances.

[0085] Optionally, the weights corresponding to the second synthetic instance set are first determined. For example, a certain weight (such as 0.5) can be assigned to the second synthetic instance set according to the training requirements. Then, multiple target second synthetic instances are determined from the second synthetic instance set according to the weights. For example, if the weight is 0.5, the target second synthetic instances are half of the second synthetic instances in the second synthetic instance set. Then, the target synthetic instance set can be generated based on the first synthetic instance set and multiple target second synthetic instances. That is, the target synthetic instance set is constructed by using a portion of the synthetic instances in the synthetic instance set corresponding to the old task and the synthetic instance set corresponding to the new task.

[0086] It should be noted that determining multiple target second synthetic instances from the second synthetic instance set based on weights achieves a reasonable allocation of training data for new and old tasks, thereby effectively preventing the model from outperforming the new task in terms of performance on the old task. By generating the target synthetic instance set using the second synthetic instance set corresponding to the old task, data reuse is achieved, improving data utilization efficiency and providing a data foundation for model training. This enables the large language model to learn new tasks while retaining its memory of old tasks.

[0087] To effectively address the catastrophic forgetting problem encountered by large language models during continuous learning, the training method for large language models provided in Embodiment 1 of this application trains the large language model to be trained based on a target synthetic instance set to obtain the target large language model. This includes: training the task processing ability of the large language model to be trained to handle the target training task based on a first synthetic instance set, and performing memory training on the task processing ability of the large language model to be trained to handle historical training tasks based on multiple target second synthetic instances, thereby obtaining the target large language model.

[0088] Optionally, the target large language model is trained based on the task processing ability of the large language model to be trained to handle the target training task according to the first set of synthetic instances, and memory training is performed based on the task processing ability of the large language model to be trained to handle the historical training task according to multiple target second synthetic instances, so as to obtain the target large language model.

[0089] For example, if the new training task is risk assessment and the old training tasks are financial data analysis and document analysis, then the target synthetic instance set contains synthetic instances corresponding to the risk assessment task (i.e., the first synthetic instance set) and synthetic instances corresponding to the financial data analysis and document analysis tasks (i.e., multiple target second synthetic instances). Based on the synthetic instances corresponding to the risk assessment task, the LLM's risk assessment task processing capability in the current training phase can be trained. Based on the synthetic instances corresponding to the financial data analysis and document analysis tasks, the LLM in the current training phase can review its processing capability for the financial data analysis and document analysis tasks, thus enabling the model to learn the new task while reviewing the old task.

[0090] It should be noted that training the large language model based on the target synthetic instance set improves data utilization efficiency and the model's generalization ability, effectively solving the catastrophic forgetting problem encountered by large language models during continuous learning.

[0091] In an alternative embodiment, the following can be employed: Figure 3 The diagram shown illustrates the training of a large language model. Figure 3 This is a schematic diagram of an optional training process for a large language model according to Embodiment 1 of this application, as shown below. Figure 3 As shown, a prompt containing demonstration examples is input into the base LLM. Guided by this prompt, context learning is performed using the base LLM to generate synthetic instances with the same features as the demonstration examples, resulting in an initial set of synthetic instances corresponding to the new training task. Then, a newer LLM is used to refine the outputs of the synthetic instances in the initial set (such as correcting erroneous outputs), resulting in an optimized set of synthetic instances. A classification model is then used to classify the optimized set of synthetic instances, selecting diverse high-quality synthetic instances to obtain a diverse set of high-quality synthetic instances. Finally, the large language model to be trained is trained based on the diverse set of high-quality synthetic instances corresponding to the new training task and the set of synthetic instances from the old training task, resulting in the target large language model.

[0092] In this embodiment, by determining the target training task and at least one historical training task to be trained, obtaining a first synthetic instance set corresponding to the target training task, obtaining a second synthetic instance set corresponding to the historical training task in at least one historical training task, and determining the target synthetic instance set based on the first and second synthetic instance sets, and training the large language model to be trained based on the target synthetic instance set to obtain the target large language model, the synthetic instances generated by the large language model are used for repetition, reducing the dependence on real training data, enabling the model to learn new tasks without real training data, while maintaining the memory of old tasks. Training the large language model to be trained based on the target synthetic instance set improves data utilization efficiency and the model's generalization ability, effectively solving the catastrophic forgetting problem encountered by the large language model in the continuous learning process, thereby achieving the technical effect of improving the flexibility and adaptability of the model in continuous learning, and solving the technical problem in related technologies that rely on the real training data of the large language model to maintain the model's old knowledge, and that cannot take into account both the new and old knowledge of the large language model when the real training data is unavailable.

[0093] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0094] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.

[0095] Example 2

[0096] According to embodiments of this application, a method for generating a target classification model is also provided, such as... Figure 4 As shown, the method includes:

[0097] Step S401: Obtain the training sample set and the pre-trained classification model, wherein the pre-trained classification model is obtained by training the target neural network based on the first training sample set;

[0098] Step S402: Lock the target network parameters of the pre-trained classification model to obtain the classification model to be trained.

[0099] Step S403: Train the target classification model by using the unlocked network parameters of the classification model to be trained based on the training sample set.

[0100] Optionally, to improve classification efficiency, transfer learning techniques are employed. Model parameters learned on the first training sample set are transferred to the training sample set to obtain the target classification model. This eliminates the need to retrain the model, reducing reliance on large amounts of labeled data. For example, the first training sample set contains e-commerce related data, while the second training sample set contains financial related data. An e-commerce related classification model (i.e., a pre-trained classification model) is pre-trained based on the first training sample set. The target neural network can be a convolutional neural network, etc. The training sample set and the e-commerce related classification model are obtained, and then the target network parameters of this classification model are locked to obtain the classification model to be trained. The target network parameters can be the parameters of the network layers to be locked, for example, locking the parameters of the first and second layers. Then, the unlocked network parameters of the classification model to be trained are used to train the model to be trained based on the training sample set, thus obtaining the financial related classification model (i.e., the target classification model).

[0101] Example 3

[0102] According to embodiments of this application, a data processing method is also provided, such as... Figure 5 As shown, the method includes:

[0103] Step S501: Receive text description information for analyzing the target financial data through the target large language model;

[0104] Step S502: Perform semantic recognition on the text description information to determine the target financial data and user intent information;

[0105] Step S503: Analyze the target financial data based on user intent information to obtain analysis results.

[0106] Optionally, the target large language model can be an intelligent financial assistant. For example, if a user wants to analyze the net profit of Company A, the target financial data can be the net profit data of Company A. The text description information (prompt) entered by the user can be: "Analyze the net profit data of Company A in xx year". The target large language model can perform semantic recognition on the prompt to determine the target financial data and user intent information. Then, it can analyze the target financial data based on the user intent information, obtain the analysis results, and display the analysis results to the user.

[0107] Optionally, the target large language model can also help financial institutions conduct customer risk assessment and credit rating, provide accurate risk control advice, and provide intelligent investment decision support for financial institutions.

[0108] Example 4

[0109] According to embodiments of this application, a method for training a large language model is also provided, such as... Figure 6 As shown, the method includes:

[0110] Step S601: Obtain the target training task uploaded by the client and at least one historical training task to be used for memory training.

[0111] Step S602: Obtain the first synthetic instance set corresponding to the target training task in the cloud server; obtain the second synthetic instance set corresponding to the historical training task in at least one historical training task, and determine the target synthetic instance set based on the first synthetic instance set and the second synthetic instance set;

[0112] Step S603: Feed back the target synthetic instance set to the client so as to train the large language model to be trained based on the target synthetic instance set and obtain the target large language model.

[0113] The above scheme uses synthetic instances generated by a large language model for repetition, reducing the reliance on real training data. This allows the model to learn new tasks without real training data while retaining memory of old tasks. Training the large language model to be trained based on the target synthetic instance set improves data utilization efficiency and the model's generalization ability. This effectively solves the catastrophic forgetting problem encountered by large language models during continuous learning, thereby enhancing the model's flexibility and adaptability in continuous learning. Furthermore, it addresses the technical problem in related technologies where the model relies on real training data to maintain its old knowledge, and cannot balance new and old knowledge when real training data is unavailable.

[0114] The specific method for training the large language model on the cloud server is the same as that in Example 1, and will not be repeated here.

[0115] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0116] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.

[0117] Example 5

[0118] According to embodiments of this application, a training apparatus for a large language model used to implement the above-described training method for large language models is also provided, such as... Figure 7 As shown, the device includes: a first determining unit 701, a first processing unit 702, a second determining unit 703, and a second processing unit 704.

[0119] The first determining unit 701 is used to determine the target training task and at least one historical training task to be trained in memory.

[0120] The first processing unit 702 is used to obtain the first synthetic instance set corresponding to the target training task;

[0121] The second determining unit 703 is used to obtain a second synthetic instance set corresponding to a historical training task in at least one historical training task, and to determine a target synthetic instance set based on the first synthetic instance set and the second synthetic instance set.

[0122] The second processing unit 704 is used to train the large language model to be trained based on the target synthetic instance set to obtain the target large language model.

[0123] In the training apparatus for the large language model provided in Embodiment 5 of this application, the first determining unit 701 determines the target training task and at least one historical training task to be trained; the first processing unit 702 obtains the first synthetic instance set corresponding to the target training task; the second determining unit 703 obtains the second synthetic instance set corresponding to the historical training task in at least one historical training task, and determines the target synthetic instance set based on the first synthetic instance set and the second synthetic instance set; the second processing unit 704 trains the large language model to be trained based on the target synthetic instance set to obtain the target large language model. In this scheme, synthetic instances generated by a large language model are used for repetition, reducing the reliance on real training data. This allows the model to learn new tasks without real training data while retaining memory of old tasks. The large language model to be trained is trained based on the target synthetic instance set, improving data utilization efficiency and the model's generalization ability. This effectively solves the catastrophic forgetting problem encountered by large language models during continuous learning, thereby improving the model's flexibility and adaptability in continuous learning. Furthermore, it addresses the technical problem in related technologies that rely on real training data of large language models to maintain the model's old knowledge, and cannot balance the new and old knowledge of the large language model when real training data is unavailable.

[0124] Optionally, in the training apparatus for the large language model provided in Embodiment 5 of this application, the first processing unit 702 includes: an acquisition subunit, used to acquire demonstration examples of the target training task and generate first text description information based on the demonstration examples, wherein the first text description information is used to guide the generation of synthetic instances with the same features as the demonstration examples; a generation subunit, used to generate a third set of synthetic instances based on the first text description information through a first large language model; a first determination subunit, used to determine a fourth set of synthetic instances based on the third set of synthetic instances through a second large language model, wherein the model performance of the second large language model is better than that of the first large language model, and the quality of synthetic instances in the fourth set of synthetic instances is better than that in the third set of synthetic instances; and a processing subunit, used to process the fourth set of synthetic instances through a target classification model to obtain a first set of synthetic instances, wherein the target classification model is obtained by transfer learning training of a pre-trained classification model based on a training sample set.

[0125] Optionally, in the training apparatus for the large language model provided in Embodiment 5 of this application, the first determining subunit includes: a generation module, used to generate a corresponding second output result based on the first input instruction of the third synthesis instance among multiple third synthesis instances through the second large language model; and a determining module, used to determine a fourth synthesis instance set based on the first input instruction, the first output result, and the second output result.

[0126] Optionally, in the training device for the large language model provided in Embodiment 5 of this application, the determining module includes: a comparison submodule, used to compare the first output result and the second output result; and a determining submodule, used to generate a fourth synthetic instance in the fourth synthetic instance set based on the first input instruction and the second output result if the first output result and the second output result are different.

[0127] Optionally, in the training apparatus for the large language model provided in Embodiment 5 of this application, the processing subunit includes: a first processing module, used to extract data features of the fourth synthetic instance in the fourth synthetic instance set through a target classification model; a second processing module, used to determine the target category label corresponding to the fourth synthetic instance based on the data features of the fourth synthetic instance, wherein the target category label is one of the following: a first category label, a second category label, wherein the quality of the synthetic instance represented by the first category label is better than the quality of the synthetic instance represented by the second category label; and a third processing module, used to take the fourth synthetic instance with the target category label as the first category label as the first synthetic instance, and generate a first synthetic instance set based on the first synthetic instance.

[0128] Optionally, in the training apparatus for the large language model provided in Embodiment 5 of this application, the second determining unit 703 includes: a second determining subunit, used to determine the weights corresponding to the second synthetic instance set; a third determining subunit, used to determine multiple target second synthetic instances from the second synthetic instance set based on the weights; and a fourth determining subunit, used to generate a target synthetic instance set based on the first synthetic instance set and the multiple target second synthetic instances.

[0129] Optionally, in the training apparatus for the large language model provided in Embodiment 5 of this application, the second processing unit 704 includes: a training subunit, used to train the task processing ability of the large language model to be trained to handle the target training task based on the first synthetic instance set, and to perform memory training based on the task processing ability of the large language model to be trained to handle the historical training task based on multiple target second synthetic instances, so as to obtain the target large language model.

[0130] It should be noted that the first determining unit 701, the first processing unit 702, the second determining unit 703, and the second processing unit 704 mentioned above correspond to steps S201 to S204 in Embodiment 1. The instances and application scenarios implemented by the above units and corresponding steps are the same, but are not limited to the content disclosed in Embodiment 1. It should be noted that the above modules, as part of the device, can run in the computer terminal 10 provided in Embodiment 1.

[0131] It should be noted that the preferred implementation schemes involved in the above embodiments of this application are the same as the schemes, application scenarios and implementation processes provided in Embodiment 1, but are not limited to the schemes provided in Embodiment 1.

[0132] Example 6

[0133] According to embodiments of this application, an apparatus for generating a target classification model for implementing the above-described target classification model generation method is also provided, such as... Figure 8 As shown, the device includes: an acquisition unit 801, a third processing unit 802, and a fourth processing unit 803.

[0134] The acquisition unit 801 is used to acquire a training sample set and a pre-trained classification model, wherein the pre-trained classification model is obtained by training the target neural network based on the first training sample set;

[0135] The third processing unit 802 is used to lock the target network parameters of the pre-trained classification model to obtain the classification model to be trained.

[0136] The fourth processing unit 803 is used to train the unlocked network parameters of the classification model to be trained based on the training sample set, so as to obtain the target classification model.

[0137] It should be noted that the above-mentioned acquisition unit 801, third processing unit 802, and fourth processing unit 803 correspond to steps S401 to S403 in Embodiment 2. The above-mentioned units and corresponding steps implement the same instances and application scenarios, but are not limited to the content disclosed in Embodiment 2.

[0138] It should be noted that the preferred implementation schemes involved in the above embodiments of this application are the same as the schemes, application scenarios and implementation processes provided in Embodiment 2, but are not limited to the schemes provided in Embodiment 2.

[0139] Example 7

[0140] According to embodiments of this application, a data processing apparatus for implementing the above-described data processing method is also provided, such as... Figure 9 As shown, the device includes: a receiving unit 901, an identification unit 902, and an analysis unit 903.

[0141] The receiving unit 901 is used to receive text description information for analyzing target financial data through the target large language model;

[0142] The identification unit 902 is used to perform semantic recognition on the text description information in order to determine the target financial data and user intent information;

[0143] Analysis unit 903 is used to analyze target financial data based on user intent information and obtain analysis results.

[0144] It should be noted that the receiving unit 901, the identification unit 902, and the analysis unit 903 mentioned above correspond to steps S501 to S503 in Embodiment 3. The instances and application scenarios implemented by the units and the corresponding steps are the same, but are not limited to the content disclosed in Embodiment 3.

[0145] It should be noted that the preferred implementation schemes involved in the above embodiments of this application are the same as the schemes, application scenarios and implementation processes provided in Embodiment 3, but are not limited to the schemes provided in Embodiment 3.

[0146] Example 8

[0147] Embodiments of this application may provide an electronic device, which may be any one of a group of electronic devices. Optionally, in this embodiment, the aforementioned electronic device may also be replaced by a terminal device such as a mobile terminal.

[0148] Optionally, in this embodiment, the aforementioned electronic device may be located in at least one of a plurality of network devices in a computer network.

[0149] In this embodiment, the above-mentioned electronic device can execute the program code of the following steps in the training method of a large language model: determining the target training task and at least one historical training task to be trained; obtaining the first synthetic instance set corresponding to the target training task; obtaining the second synthetic instance set corresponding to the historical training task in at least one historical training task, and determining the target synthetic instance set based on the first synthetic instance set and the second synthetic instance set; training the large language model to be trained based on the target synthetic instance set to obtain the target large language model.

[0150] The aforementioned electronic device can also execute the following steps in the training method of a large language model: obtaining a demonstration example of the target training task and generating first text description information based on the demonstration example, wherein the first text description information is used to guide the generation of synthetic instances with the same features as the demonstration example; generating a third set of synthetic instances based on the first text description information using a first large language model; determining a fourth set of synthetic instances based on the third set of synthetic instances using a second large language model, wherein the model performance of the second large language model is better than that of the first large language model, and the quality of synthetic instances in the fourth set of synthetic instances is better than that in the third set of synthetic instances; processing the fourth set of synthetic instances using a target classification model to obtain a first set of synthetic instances, wherein the target classification model is obtained by transfer learning training of a pre-trained classification model based on a training sample set.

[0151] The aforementioned electronic device can also execute the program code for the following steps in the training method of the large language model: generating a corresponding second output result based on the first input instruction of the third synthesis instance among multiple third synthesis instances using the second large language model; determining the fourth synthesis instance set based on the first input instruction, the first output result, and the second output result.

[0152] The aforementioned electronic device can also execute the following steps in the training method of a large language model: comparing the first output result and the second output result; if the first output result and the second output result are different, generating the fourth synthetic instance in the fourth synthetic instance set based on the first input instruction and the second output result.

[0153] The aforementioned electronic device can also execute the following steps in the training method of the large language model: extracting data features of the fourth synthetic instance in the fourth synthetic instance set through the target classification model; determining the target category label corresponding to the fourth synthetic instance based on the data features of the fourth synthetic instance, wherein the target category label is one of the following: a first category label or a second category label, wherein the synthetic instance represented by the first category label has a higher quality than the synthetic instance represented by the second category label; taking the fourth synthetic instance with the target category label as the first category label as the first synthetic instance, and generating the first synthetic instance set based on the first synthetic instance.

[0154] The aforementioned electronic device can also execute program code for the following steps in the training method of a large language model: determining the weights corresponding to the second synthetic instance set; determining multiple target second synthetic instances from the second synthetic instance set based on the weights; and generating a target synthetic instance set based on the first synthetic instance set and the multiple target second synthetic instances.

[0155] The aforementioned electronic device can also execute the program code for the following steps in the training method of a large language model: training the task processing ability of the large language model to be trained to handle the target training task based on the first synthetic instance set, and performing memory training on the task processing ability of the large language model to be trained to handle the historical training task based on multiple target second synthetic instances, thereby obtaining the target large language model.

[0156] Optionally, Figure 10 This is a structural block diagram of an electronic device according to an embodiment of this application. Figure 10 As shown, the electronic device 100 may include: one or more ( Figure 10 (Only one is shown) Processor 1002 and memory 1004. The electronic device 100 may also include a memory controller to control and manage the memory 1004; the electronic device 100 may also include a peripheral interface to connect to a radio frequency module, an audio module, and a display screen, etc.

[0157] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the large language model training method and apparatus in this embodiment. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby realizing the aforementioned large language model training method. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0158] The processor can invoke information and applications stored in the memory via a transmission device to perform the following steps: determine the target training task and at least one historical training task to be trained; obtain a first synthetic instance set corresponding to the target training task; obtain a second synthetic instance set corresponding to the historical training task in at least one historical training task, and determine the target synthetic instance set based on the first synthetic instance set and the second synthetic instance set; train the large language model to be trained based on the target synthetic instance set to obtain the target large language model.

[0159] Optionally, the processor may also execute program code for the following steps: obtaining a demonstration example of the target training task and generating first text description information based on the demonstration example, wherein the first text description information is used to guide the generation of synthetic instances with the same features as the demonstration example; generating a third set of synthetic instances based on the first text description information using a first large language model; determining a fourth set of synthetic instances based on the third set of synthetic instances using a second large language model, wherein the model performance of the second large language model is better than that of the first large language model, and the quality of synthetic instances in the fourth set of synthetic instances is better than that in the third set of synthetic instances; processing the fourth set of synthetic instances using a target classification model to obtain a first set of synthetic instances, wherein the target classification model is obtained by transfer learning training of a pre-trained classification model based on a training sample set.

[0160] Optionally, the processor may also execute program code that performs the following steps: generating a corresponding second output result based on the first input instruction of the third synthesis instance among multiple third synthesis instances using the second language model; and determining a fourth synthesis instance set based on the first input instruction, the first output result, and the second output result.

[0161] Optionally, the processor may also execute program code that performs the following steps: comparing the first output result and the second output result; if the first output result and the second output result are different, generating a fourth synthetic instance in the fourth synthetic instance set based on the first input instruction and the second output result.

[0162] Optionally, the processor may also execute program code for the following steps: extracting data features of the fourth synthetic instance from the fourth synthetic instance set using a target classification model; determining the target category label corresponding to the fourth synthetic instance based on the data features of the fourth synthetic instance, wherein the target category label is one of the following: a first category label or a second category label, wherein the synthetic instance represented by the first category label has a higher quality than the synthetic instance represented by the second category label; taking the fourth synthetic instance with the first category label as the first synthetic instance, and generating a first synthetic instance set based on the first synthetic instance.

[0163] Optionally, the processor may also execute program code that performs the following steps: determining the weights corresponding to the second synthetic instance set; determining multiple target second synthetic instances from the second synthetic instance set based on the weights; and generating a target synthetic instance set based on the first synthetic instance set and the multiple target second synthetic instances.

[0164] Optionally, the processor may also execute program code that performs the following steps: training the large language model to be trained to handle the target training task based on the first set of synthetic instances, and performing memory training on the large language model to be trained to handle the historical training task based on multiple target second synthetic instances, thereby obtaining the target large language model.

[0165] Those skilled in the art will understand that Figure 10 The structure shown is for illustrative purposes only. Electronic devices can also be smartphones (such as Android phones, iOS phones, etc.), tablets, PDAs, mobile internet devices (MIDs), PADs, and other terminal devices. Figure 10 This does not limit the structure of the aforementioned electronic device. For example, electronic device 100 may also include components that are more... Figure 10 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same Figure 10 The different configurations shown.

[0166] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0167] Example 9

[0168] Embodiments of this application also provide a computer-readable storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the training method of the large language model provided in Embodiment 1.

[0169] Optionally, in this embodiment, the storage medium may be located in any one of the electronic devices in the group of electronic devices in the computer network, or in any one of the mobile terminals in the group of mobile terminals.

[0170] Example 10

[0171] Embodiments of this application also provide a computer program product. Optionally, in this embodiment, the computer program product may include a computer program that, when executed by a processor, implements the training method for the large language model provided in Embodiment 1.

[0172] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0173] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0174] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection of units or modules may be electrical or other forms.

[0175] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0176] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0177] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.

[0178] The above are merely preferred embodiments of this application. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A training method for a large language model, characterized in that, include: Identify the target training task and at least one historical training task to be used for memory training; Obtain the first set of synthetic instances corresponding to the target training task; Obtain the second synthetic instance set corresponding to the historical training task in the at least one historical training task, and determine the target synthetic instance set based on the first synthetic instance set and the second synthetic instance set; The target large language model is trained based on the target synthetic instance set to obtain the target large language model.

2. The method according to claim 1, characterized in that, Obtaining the first set of synthetic instances corresponding to the target training task includes: Obtain a demonstration example of the target training task, and generate first text description information based on the demonstration example, wherein the first text description information is used to guide the generation of a synthetic instance with the same features as the demonstration example; The third set of synthetic instances is generated based on the first text description information using the first major language model; A fourth set of synthesized instances is determined by the second language model based on the third set of synthesized instances, wherein the model performance of the second language model is better than that of the first language model, and the quality of synthesized instances in the fourth set of synthesized instances is better than that in the third set of synthesized instances. The fourth synthetic instance set is processed by a target classification model to obtain the first synthetic instance set, wherein the target classification model is obtained by transfer learning training of a pre-trained classification model based on a training sample set.

3. The method according to claim 2, characterized in that, The third set of synthesis instances includes multiple third synthesis instances, each of which consists of a first input instruction and a first output result. The fourth set of synthesis instances is determined based on the third set of synthesis instances using the second language model, including: The second language model generates a corresponding second output result based on the first input instruction of the third synthesis instance among the plurality of third synthesis instances; The fourth set of synthetic instances is determined based on the first input instruction, the first output result, and the second output result.

4. The method according to claim 3, characterized in that, The fourth set of synthetic instances is determined based on the first input instruction, the first output result, and the second output result, including: Compare the first output result and the second output result; If the first output result and the second output result are different, then the fourth synthesis instance in the fourth synthesis instance set is generated based on the first input instruction and the second output result.

5. The method according to claim 2, characterized in that, The first synthetic instance set is obtained by processing the fourth synthetic instance set using a target classification model, and includes: The data features of the fourth synthetic instance in the fourth synthetic instance set are extracted using the target classification model. The target category label corresponding to the fourth synthetic instance is determined based on the data characteristics of the fourth synthetic instance, wherein the target category label is one of the following: a first category label or a second category label, wherein the synthetic instance represented by the first category label is of higher quality than the synthetic instance represented by the second category label; The fourth synthetic instance with the target category label of the first category label is used as the first synthetic instance, and the first synthetic instance set is generated based on the first synthetic instance.

6. The method according to claim 1, characterized in that, Determining the target composition instance set based on the first composition instance set and the second composition instance set includes: Determine the weights corresponding to the second set of synthetic instances; Multiple target second synthetic instances are determined from the second synthetic instance set based on the weights; The target synthesis instance set is generated based on the first synthesis instance set and the plurality of target second synthesis instances.

7. The method according to claim 6, characterized in that, The target large language model is trained based on the target synthetic instance set to obtain the following: The target large language model is obtained by training the task processing ability of the large language model to be trained to handle the target training task based on the first set of synthesized instances, and by performing memory training on the task processing ability of the large language model to be trained to handle the historical training task based on the multiple target second synthesized instances.

8. A method for generating a target classification model, characterized in that, include: Obtain a training sample set and a pre-trained classification model, wherein the pre-trained classification model is obtained by training the target neural network based on the first training sample set; The target network parameters of the pre-trained classification model are locked to obtain the classification model to be trained. The target classification model is obtained by training the unlocked network parameters of the classification model to be trained based on the training sample set, thereby obtaining the target classification model as described in any one of claims 2 to 5.

9. A data processing method, characterized in that, include: Receive textual description information for analyzing target financial data through the target large language model as described in any one of claims 1 to 7; Semantic recognition is performed on the text description information to determine the target financial data and user intent information; The target financial data is analyzed based on the user intent information to obtain the analysis results.

10. A training method for a large language model, characterized in that, include: Obtain the target training task uploaded by the client and at least one historical training task to be used for memory training; Obtain the first set of synthetic instances corresponding to the target training task from the cloud server; Obtain the second synthetic instance set corresponding to the historical training task in the at least one historical training task, and determine the target synthetic instance set based on the first synthetic instance set and the second synthetic instance set; The target synthetic instance set is fed back to the client so that the large language model to be trained can be trained based on the target synthetic instance set to obtain the target large language model.

11. A training device for a large language model, characterized in that, include: The first determining unit is used to determine the target training task and at least one historical training task to be trained in memory. The first processing unit is used to obtain the first set of synthetic instances corresponding to the target training task; The second determining unit is used to obtain a second synthetic instance set corresponding to the historical training task in the at least one historical training task, and to determine a target synthetic instance set based on the first synthetic instance set and the second synthetic instance set. The second processing unit is used to train the large language model to be trained based on the target synthetic instance set to obtain the target large language model.

12. A device for generating a target classification model, characterized in that, include: An acquisition unit is used to acquire a training sample set and a pre-trained classification model, wherein the pre-trained classification model is obtained by training the target neural network based on the first training sample set; The third processing unit is used to lock the target network parameters of the pre-trained classification model to obtain the classification model to be trained. The fourth processing unit is used to train the unlocked network parameters of the classification model to be trained based on the training sample set, so as to obtain the target classification model as described in any one of claims 2 to 5.

13. An electronic device, characterized in that, include: Memory, which stores executable programs; A processor for running the program, wherein the program, when running, executes the training method for a large language model according to any one of claims 1 to 7 and 10.

14. A computer program product, characterized in that, It includes a computer program or instructions that, when executed by a processor, implement the training method for a large language model according to any one of claims 1 to 7, 10.