Large model training and data enhancement method, device, equipment and medium
Through active learning of pre-trained large models and screening of quality classification models in target fields, combined with fine-tuning technology, the data quality and generation effect of large language models in specific fields are improved.
Patent Information
- Application Number
- CN202411266526.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2044-09-10
AI Technical Summary
Existing large language models cannot guarantee data quality during the data generation process, which affects the performance of the model after training.
Active learning is performed using a pre-trained large model. Target prompt words are generated based on seed sentences and initial prompt words. Initial results are obtained through data enhancement. Active learning is performed using the quality classification model of the target domain. Finally, the pre-trained large model is fine-tuned to obtain the target large model of the target domain.
The quality of data augmentation results is improved, and the generation ability and performance of the model in specific fields are enhanced.
Smart Images

Figure CN119336906B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, specifically natural language processing, deep learning, large models and other technical fields, and in particular to a large model training and data enhancement method, device, equipment and storage medium. Background Art
[0002] Based on the generative capabilities of large language models (LLMs), large amounts of synthetic data can be generated by expanding and imitating seed sentences. However, this data quality cannot be guaranteed. High-quality training data is crucial to the performance of the trained model.
[0003] How to improve the quality of data augmentation results is a problem that needs to be solved. Summary of the Invention
[0004] The present disclosure provides a large model training and data enhancement method, apparatus, device and storage medium.
[0005] According to one aspect of the present disclosure, a large model training method is provided, including: using a pre-trained large model to perform active learning based on a seed sentence and an initial prompt word to obtain a target prompt word; using the pre-trained large model to perform data enhancement based on the seed sentence and the target prompt word to obtain an initial data enhancement result; based on a quality classification model of a target domain, actively learning the initial data enhancement result to obtain a target data enhancement result; based on the seed sentence, the target prompt word and the target data enhancement result, fine-tuning the pre-trained large model to obtain a target large model of the target domain.
[0006] According to another aspect of the present disclosure, a data enhancement method based on a large model is provided, comprising: obtaining a seed sentence and a prompt word; using a target large model to perform data enhancement on the seed sentence and the prompt word to obtain a data enhancement result; wherein the target large model is trained using any of the methods described in any of the above aspects.
[0007] According to another aspect of the present disclosure, a large model training device is provided, including: a preheating module, used to adopt a pre-trained large model, and perform active learning based on a seed sentence and an initial prompt word to obtain a target prompt word; an enhancement module, used to adopt the pre-trained large model, and perform data enhancement based on the seed sentence and the target prompt word to obtain an initial data enhancement result; a learning module, used to actively learn the initial data enhancement result based on a quality classification model of a target domain, and obtain a target data enhancement result; a fine-tuning module, used to fine-tune the pre-trained large model based on the seed sentence, the target prompt word and the target data enhancement result to obtain a target large model of the target domain.
[0008] According to another aspect of the present disclosure, a data enhancement device based on a large model is provided, comprising: an acquisition module for acquiring seed sentences and prompt words; an enhancement module for performing data enhancement on the seed sentences and the prompt words using a target large model to obtain a data enhancement result; wherein the target large model is trained using a method as described in any one of the above aspects.
[0009] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute any one of the methods described in any one of the above aspects.
[0010] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute any one of the methods according to any one of the above aspects.
[0011] According to another aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the method according to any one of the above aspects.
[0012] The disclosed embodiments can improve the quality of data enhancement results.
[0013] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The accompanying drawings are provided to facilitate a better understanding of the present invention and do not constitute a limitation of the present disclosure.
[0015] Figure 1is a schematic diagram according to a first embodiment of the present disclosure;
[0016] Figure 2 is a schematic diagram of an application scenario for implementing an embodiment of the present disclosure;
[0017] Figure 3 is a schematic diagram according to a second embodiment of the present disclosure;
[0018] Figure 4 is a schematic diagram according to a third embodiment of the present disclosure;
[0019] Figure 5 is a schematic diagram according to a fourth embodiment of the present disclosure;
[0020] Figure 6 is a schematic diagram according to a fifth embodiment of the present disclosure;
[0021] Figure 7 It is a schematic diagram of an electronic device used to implement the large model training method or the large model-based data enhancement method of the embodiment of the present disclosure. DETAILED DESCRIPTION
[0022] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0023] To better understand the embodiments of the present disclosure, the terms used in the embodiments of the present disclosure are explained as follows:
[0024] Data augmentation is the process of generating new data from existing data, primarily used to train new machine learning (ML) models. ML models require large and diverse datasets during training. Data augmentation techniques modify existing data to generate new training samples, thereby improving the model's generalization and robustness.
[0025] Synthetic data: data generated by a model rather than real-world data.
[0026] Active learning: A machine learning method that allows a model to select the most valuable data to learn from during training, thereby optimizing its performance. During the learning process, the learner selects unlabeled examples and requests external labels, with the goal of achieving good learning performance using the fewest queries possible.
[0027] In order to improve the quality of data enhancement results, the present disclosure provides the following embodiments.
[0028] Figure 1 is a schematic diagram according to the first embodiment of the present disclosure. This embodiment provides a large model training method, the method comprising:
[0029] 101. Use a pre-trained large model to perform active learning based on seed sentences and initial prompt words to obtain the target prompt words.
[0030] 102. Using the pre-trained large model, perform data enhancement based on the seed sentence and the target prompt word to obtain an initial data enhancement result.
[0031] 103. Based on the classification model of the target domain, actively learn the initial data enhancement result to obtain the target data enhancement result.
[0032] 104. Based on the seed sentence, the target prompt word and the target data enhancement result, fine-tune the pre-trained large model to obtain a target large model for the target domain.
[0033] Among them, the large model (LLM) is a deep learning model with a large parameter scale. It can generate natural language text or understand the meaning of language text. The large model can handle a variety of natural language tasks, such as text classification, question answering, dialogue, etc., and is an important path to artificial intelligence.
[0034] Deep learning models can be divided into pre-training models and fine-tuning models. Pre-training models are pre-trained on a large dataset containing a large amount of data to learn common features, while fine-tuning models are fine-tuned on a small dataset for a specific task to optimize performance.
[0035] In the disclosed embodiment, for the large model, the general model in each field is called the pre-trained large model, and the model fine-tuned for the target field is called the target large model.
[0036] In addition, the embodiment of the present disclosure mainly utilizes the generation capability of the large model to perform data enhancement through the large model to obtain data enhancement results, that is, the large model is used to perform data enhancement processing on the existing data to obtain synthetic data as the data enhancement result.
[0037] Seed sentences are a type of text data that serves as the basic data for data enhancement and is existing data.
[0038] Prompts are used to guide the large model to perform data enhancement processing. They are also text. For example, they instruct the large model to add details, transform emotions, or convert context to the seed sentence.
[0039] In the embodiment of the present disclosure, prompt words are divided into initial prompt words and target prompt words.
[0040] The initial prompt word is an initially set prompt word, for example, manually designed.
[0041] The target prompt words are obtained by adjusting the initial prompt words, such as modifying the language style, adding contextual information, adjusting the question wording, etc., to improve the quality of the synthetic data obtained by the large model.
[0042] The seed sentence, initial prompt word and target prompt word can be one or more. In the case of multiple, they can respectively form a seed sentence set, an initial prompt word set and a target prompt word set.
[0043] In the disclosed embodiment, the target prompt word is obtained based on active learning. Specifically, a pre-trained large model can be used to perform data augmentation on the input seed sentence and initial prompt word to obtain a small amount of synthetic data (e.g., hundreds to thousands of pieces). This synthetic data is manually annotated, and the pre-trained large model then adjusts the initial prompt word based on the manual annotation results to obtain the target prompt word.
[0044] After obtaining the seed sentences and target cue words, they are fed into a pre-trained large model. This model is then used to perform batch data augmentation on these sentences and target cue words, yielding the initial data augmentation results. Batch processing involves processing each seed sentence separately using each target cue word. For example, assuming there are M seed sentences and N target cue words, we can obtain M*N pieces of synthetic data (the initial data augmentation results), where M and N are both positive integers.
[0045] After obtaining the initial data enhancement results, the quality classification model of the target domain is used to actively learn the initial data enhancement results to obtain the target data enhancement results.
[0046] The quality classification model is used to determine the quality category of the initial data augmentation results. Specifically, the quality classification can be divided into high, medium, and low. High-quality initial data augmentation results can be directly used as the target data augmentation results. Low-quality initial data augmentation results can be directly discarded. Medium-quality initial data augmentation results can be manually annotated to indicate whether they are usable. If so, they are used as the target data augmentation results; otherwise, they are discarded.
[0047] The quality classification model is pre-trained. The quality classification models in different fields are trained using training samples from the corresponding fields to evaluate the quality of the synthetic data (data enhancement results) in the corresponding fields.
[0048] After obtaining the target data enhancement results, the pre-trained large model is fine-tuned using the seed sentences, target prompt words, and target data enhancement results to obtain the target large model for the target domain.
[0049] After obtaining the target large model, in the application stage, the target large model can be used to perform data enhancement to obtain data enhancement results.
[0050] In this embodiment, the target prompt word is obtained by actively learning the seed sentence and the initial prompt word, the initial data enhancement result is obtained based on the seed sentence and the target prompt word, the initial data enhancement result is actively learned to obtain the target data enhancement result, and the pre-trained large model is fine-tuned based on the seed sentence, the target prompt word and the target data enhancement result to obtain the target large model, which can improve the effect of the target large model and then improve the quality of the data enhancement result when using the target large model for data enhancement.
[0051] In order to better understand the embodiments of the present disclosure, application scenarios to which the embodiments of the present disclosure can be applied are described.
[0052] Figure 2 It is a schematic diagram of an application scenario for implementing the embodiment of the present disclosure.
[0053] like Figure 2 As shown in Figure 1, the training phase mainly includes: warm-up phase, data enhancement phase, active learning phase and enhanced data application phase.
[0054] In this embodiment, it is taken as an example that seed sentences constitute a seed sentence set, initial prompt words constitute an initial prompt word set, and target prompt words constitute a target prompt word set.
[0055] Initially, we obtain an existing pre-trained large model M, a seed sentence set Q, and an initial prompt word set p. The pre-trained large model is obtained by pre-training with a large amount of data; the seed sentence set is existing data; and the initial prompt word set can be manually set to indicate data augmentation operations.
[0056] For the warm-up stage: the main task is to obtain the target prompt word set P.
[0057] Specifically, at least part of the seed sentences in the seed sentence set and at least part of the initial prompt words in the initial prompt word set are input into the pre-trained large model, and the output is synthetic data obtained after data enhancement of the seed sentences according to the initial prompt words.
[0058] In order to reduce the amount of subsequent manual labeling, a small amount of synthetic data can be generated in the warm-up stage, such as dozens of synthetic data, but in order to improve generalization, all fields should be covered as much as possible.
[0059] After obtaining the synthetic data, a labeling team will manually annotate the synthetic data. Specifically, the professional labeling team can conduct a detailed review of the generated synthetic data, including assessments of thematic relevance, content accuracy, logical coherence, etc., and based on the evaluation results, annotate whether the synthetic data meets expectations.
[0060] If it meets expectations, the initial prompt word set p is used as the target prompt word set P.
[0061] If it does not meet expectations, the initial prompt word set p is updated, for example, by modifying the language style, adding contextual information, adjusting the question statement, etc. Then, the above data augmentation process is repeated using the updated prompt word set until the target prompt word set that meets expectations is obtained.
[0062] For the data enhancement stage: use the pre-trained large model M, perform data enhancement based on the seed sentence set Q and the target prompt word set P, and obtain the initial data enhancement result D.
[0063] Specifically, the pre-trained large model M will traverse each sentence in the seed sentence set Q and operate on it in combination with different prompt words in the target prompt word set P. For each sentence in Q, M will generate a series of variants or related sentences based on the prompt words in P. These variants may include but are not limited to:
[0064] Adding details: adding descriptive details to the sentence to make it richer;
[0065] Sentiment transformation: adjust the sentiment of a sentence, such as changing it from a positive evaluation to a negative one;
[0066] Context transfer: placing sentences in different contexts to test the model’s performance in different scenarios.
[0067] Finally, the pre-trained large model M generates the initial data enhancement result D based on the seed sentence set Q and the prompt word set P for subsequent data fine screening.
[0068] For the active learning stage: the main task is to screen the initial data enhancement result D to obtain the target data enhancement result D'.
[0069] Among them, data filtering can be performed first, and then the filtered results can be further screened based on the active learning method.
[0070] Specifically, regarding filtering: low-quality data and duplicate data in the initial data enhancement results can be removed based on pre-defined rules.
[0071] This may include: defining low-quality data standards: based on business needs and data characteristics, defining low-quality data standards, such as missing key fields, extreme data distribution, etc.
[0072] Strategy-based screening of low-quality data: Use sentence attribute features (such as word repetition, sentence length, and repetition between generated and seed sentences) to screen and remove low-quality data.
[0073] Detect and delete duplicate data: Use the K-Nearest Neighbor (KNN) algorithm, similarity calculation and other methods to identify and delete semantically duplicate data to ensure the semantic uniqueness of the data.
[0074] For active learning: the retained data after filtering in the initial data augmentation results is input into the quality classification model, and the output is the quality classification result.
[0075] The quality classification model is used to classify the quality of data. It is a pre-trained classification model. Different fields can train their own quality classification models.
[0076] In this embodiment, the quality classification model is a three-classification model, based on which the quality classification results include: high, medium, and low. High-quality data is directly used in subsequent applications, that is, as the target data data addition result; medium-quality data is sent for labeling; and low-quality data is removed.
[0077] The labeling team manually labels medium-quality data to indicate whether it is usable. If so, it is retained as the target data enhancement result; otherwise, it is removed.
[0078] In addition, the quality classification model can be iteratively trained based on the manual labeling results to update the quality classification model, and then the updated quality classification model can be used to reclassify the data. This can improve the accuracy of the quality classification model, improve the accuracy of the data classification results, and improve the quality of the enhanced results of the screened target data.
[0079] For the application stage: mainly use the target prompt word set P, seed sentence set Q and target data enhancement result D' to fine-tune the pre-trained large model M to obtain the target large model M'.
[0080] Specifically, the target prompt word set P, seed sentence set Q and target data enhancement result D' are used as the Supervised Fine-Tuning (SFT) dataset, and the pre-trained large model M is fine-tuned using the SFT dataset to obtain the target large model M' of the target domain.
[0081] The target large model M' not only inherits the broad knowledge base and strong generation capabilities of the pre-trained large model M, but also acquires the ability to accurately respond to special task prompts through SFT training, and can generate high-quality data that better meets task requirements.
[0082] In combination with the above application scenarios, the present disclosure also provides the following embodiments.
[0083] Figure 3 is a schematic diagram according to a second embodiment of the present disclosure. This embodiment provides a large model training method, the method comprising:
[0084] 301. Use a pre-trained large model to perform data augmentation on the input seed sentences and initial prompt words to obtain synthetic data.
[0085] 302. Obtain manual annotation results of the synthetic data.
[0086] 303. Obtain a target prompt word based on the manual labeling result.
[0087] Among them, the seed sentence and the initial prompt word are existing data. The initial prompt word is used to indicate the data enhancement operation on the seed sentence. The seed sentence and the initial prompt word are input into the pre-trained large model. The pre-trained large model performs data enhancement on the seed sentence according to the instruction of the initial prompt word, and the output is synthetic data.
[0088] After obtaining the synthetic data, it is manually annotated to obtain the manual annotation results.
[0089] If the manual labeling results show that the synthesized data meets expectations, the initial prompt word is used as the target prompt word; otherwise, if it does not meet expectations, the initial prompt word is updated, the updated prompt word is used to re-enhance the data, and the newly generated synthetic data is manually labeled until the synthetic data meets expectations, and the corresponding prompt word is used as the target prompt word.
[0090] In this embodiment, by manually labeling the synthetic data and obtaining the target prompt words based on the manual labeling results, the target prompt words can be obtained by active learning, which can improve the accuracy of the target prompt words, and then improve the quality of the data enhancement results when the target prompt words are used for data enhancement.
[0091] 304. Using the pre-trained large model, perform data enhancement based on the seed sentence and the target prompt word to obtain an initial data enhancement result.
[0092] Among them, the seed sentence and the target prompt word can be input into the pre-trained large model. The pre-trained large model performs data enhancement on the seed sentence according to the prompt of the target prompt word, and the output is the initial data enhancement result.
[0093] 305. Filter the initial data enhancement result to obtain a filtering result.
[0094] Among them, filtering rules can be pre-defined, such as removing results with missing key fields, removing results that are too long or too short, etc., and low-quality initial data enhancement results can be removed based on the filtering rules; the similarity between different initial data enhancement results can also be calculated, and the results with similarity greater than the preset value can be deduplicated.
[0095] In this embodiment, by filtering the initial data enhancement results, data with potential risks can be removed and data quality can be improved.
[0096] 306. Use a quality classification model of the target domain to perform quality classification on the filtering results to determine a quality classification result of the filtering results.
[0097] The filtering result can be input into the quality classification model, and the output is the quality classification result.
[0098] Different fields can pre-train quality classification models corresponding to their respective fields.
[0099] In this embodiment, quality classification is performed through a quality classification model instead of using a pre-trained large model to perform quality classification on the data generated by itself. This can reduce the resource overhead of the pre-trained large model and ensure its reasoning ability.
[0100] 307. Based on the quality classification result, actively learn the filtering result to obtain the target data enhancement result.
[0101] Among them, it can include: if the quality classification result is the first category, using the initial data enhancement result as the target data enhancement result; if the quality classification result is the second category, obtaining the manual annotation result of the initial data enhancement result, and obtaining the target data enhancement result based on the manual annotation result; if the quality classification result is the third category, removing the initial data enhancement result; the quality of the first category is higher than that of the second category, and the quality of the second category is higher than that of the third category.
[0102] Specifically, the quality classification model is a three-category model, which is the first category, the second category, and the third category in order of data quality from high to low, which can also be called high, medium, and low.
[0103] For the first category (high), the initial data results can be used as the target data enhancement results;
[0104] For the second category (middle), it is provided to the labeling team for manual labeling, and the target data enhancement results are obtained based on the manual labeling results. For example, the initial data enhancement results marked as available are used as the target data enhancement results, and the initial data enhancement results marked as unavailable are removed.
[0105] For the third category (low), the corresponding initial data enhancement results are removed.
[0106] In this embodiment, the target data augmentation results are derived based on the quality classification results, which can improve the accuracy of the data augmentation results and thus enhance the effectiveness of the target large model. In addition, manual labeling of the medium-quality initial data augmentation results can introduce a human factor, avoid the limitations of model scoring, obtain data that is more in line with human habits, and improve data quality.
[0107] 308. Based on the seed sentence, the target prompt word and the target data enhancement result, fine-tune the pre-trained large model to obtain a target large model for the target domain.
[0108] Specifically, the seed sentence and target prompt word can be input into the pre-trained large model to obtain the prediction result, and the target data enhancement result can be used as the true value. The loss function is constructed through the prediction result and the target data enhancement result, and the parameters of the pre-trained large model are adjusted based on the loss function until the preset end condition is reached to obtain the final target large model.
[0109] The target large model can be used for data augmentation during the inference phase.
[0110] Figure 4 is a schematic diagram according to a third embodiment of the present disclosure. This embodiment provides a data enhancement method based on a large model, the method comprising:
[0111] 401. Obtain seed sentences and prompt words.
[0112] 402. Using the target large model, perform data enhancement on the seed sentence and the prompt word to obtain a data enhancement result.
[0113] The target large model is trained using the method described in any of the above embodiments.
[0114] Among them, the seed sentence is the existing data, and the prompt word is used to indicate the data enhancement operation, which can be set by the user. Afterwards, the seed sentence and the prompt word can be input into the target large model, and the output is the data enhancement result for the seed sentence, that is, the synthetic data corresponding to the seed sentence.
[0115] In this embodiment, a data enhancement result is obtained based on the above-mentioned target large model. Since the target large model has a better effect, a higher-quality data enhancement result can be obtained.
[0116] Figure 5 This is a schematic diagram of the fourth embodiment of the present disclosure. This embodiment provides a large model training device, which includes: a preheating module 501, an enhancement module 502, a learning module 503 and a fine-tuning module 504.
[0117] The warm-up module 501 is used to adopt the pre-trained large model to perform active learning based on the seed sentence and the initial prompt word to obtain the target prompt word; the enhancement module 502 is used to adopt the pre-trained large model to perform data enhancement based on the seed sentence and the target prompt word to obtain the initial data enhancement result; the learning module 503 is used to actively learn the initial data enhancement result based on the quality classification model of the target field to obtain the target data enhancement result; the fine-tuning module 504 is used to fine-tune the pre-trained large model based on the seed sentence, the target prompt word and the target data enhancement result to obtain the target large model of the target field.
[0118] In this embodiment, the target prompt word is obtained by actively learning the seed sentence and the initial prompt word, the initial data enhancement result is obtained based on the seed sentence and the target prompt word, the initial data enhancement result is actively learned to obtain the target data enhancement result, and the pre-trained large model is fine-tuned based on the seed sentence, the target prompt word and the target data enhancement result to obtain the target large model, which can improve the effect of the target large model and then improve the quality of the data enhancement result when using the target large model for data enhancement.
[0119] In some embodiments, the preheating module 501 is further configured to:
[0120] Using a pre-trained large model, data augmentation is performed on the input seed sentence and initial prompt word to obtain synthetic data;
[0121] Obtaining manual annotation results of the synthetic data;
[0122] A target prompt word is obtained based on the manual annotation result.
[0123] In this embodiment, by manually labeling the synthetic data and obtaining the target prompt words based on the manual labeling results, the target prompt words can be obtained by active learning, which can improve the accuracy of the target prompt words, and then improve the quality of the data enhancement results when the target prompt words are used for data enhancement.
[0124] In some embodiments, the learning module 503 is further configured to:
[0125] Filtering the initial data enhancement result to obtain a filtering result;
[0126] Using the quality classification model, the filtering results are quality classified to determine the quality classification results of the filtering results;
[0127] Based on the quality classification result, active learning is performed on the filtering result to obtain the target data enhancement result.
[0128] In this embodiment, by filtering the initial data enhancement results, data with potential risks can be removed and data quality can be improved; by performing quality classification through a quality classification model instead of using a pre-trained large model to perform quality classification on the data generated by itself, the resource overhead of the pre-trained large model can be reduced and its reasoning ability can be guaranteed.
[0129] In some embodiments, the learning module 503 is further configured to:
[0130] If the quality classification result is the first category, using the initial data enhancement result as the target data enhancement result;
[0131] If the quality classification result is the second category, obtaining a manual labeling result of the initial data enhancement result, and obtaining the target data enhancement result based on the manual labeling result;
[0132] If the quality classification result is the third category, removing the initial data enhancement result;
[0133] The quality of the first category is higher than that of the second category, and the quality of the second category is higher than that of the third category.
[0134] In this embodiment, the target data augmentation results are derived based on the quality classification results, which can improve the accuracy of the data augmentation results and thus enhance the effectiveness of the target large model. In addition, manual labeling of the medium-quality initial data augmentation results can introduce a human factor, avoid the limitations of model scoring, obtain data that is more in line with human habits, and improve data quality.
[0135] Figure 6 This is a schematic diagram of the fifth embodiment of the present disclosure. This embodiment provides a data enhancement device based on a large model. The device 600 includes: an acquisition module 601 and an enhancement module 602.
[0136] The acquisition module 601 is used to acquire seed sentences and prompt words; the enhancement module 602 is used to use the target large model to perform data enhancement on the seed sentences and the prompt words to obtain data enhancement results.
[0137] The target large model is trained using the method described in any of the above embodiments.
[0138] Among them, the seed sentence is the existing data, and the prompt word is used to indicate the data enhancement operation, which can be set by the user. Afterwards, the seed sentence and the prompt word can be input into the target large model, and the output is the data enhancement result for the seed sentence, that is, the synthetic data corresponding to the seed sentence.
[0139] In this embodiment, a data enhancement result is obtained based on the above-mentioned target large model. Since the target large model has a better effect, a higher-quality data enhancement result can be obtained.
[0140] It can be understood that in the embodiments of the present disclosure, the same or similar contents in different embodiments can be referenced to each other.
[0141] It can be understood that the terms “first”, “second”, etc. in the embodiments of the present disclosure are only used for distinction and do not indicate the degree of importance, time sequence, etc.
[0142] It is understandable that, unless otherwise specified, the order of the steps in the process indicates that the temporal relationship between these steps is not limited.
[0143] In the technical solutions disclosed herein, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0144] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0145] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement embodiments of the present disclosure is shown. The electronic device 700 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are provided as examples only and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0146] like Figure 7 As shown, the electronic device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 into a random access memory (RAM) 703. Various programs and data required for the operation of the electronic device 700 can also be stored in the RAM 703. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0147] Multiple components in the electronic device 700 are connected to the I / O interface 705, including an input unit 706, such as a keyboard, a mouse, etc.; an output unit 707, such as various types of displays, speakers, etc.; a storage unit 708, such as a magnetic disk, an optical disk, etc.; and a communication unit 709, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 709 allows the electronic device 700 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0148] The computing unit 701 can be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 701 performs the various methods and processes described above, such as the large model training method or the data enhancement method based on the large model. For example, in some embodiments, the large model training method or the data enhancement method based on the large model can be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as the storage unit 708. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 700 via the ROM 702 and / or the communication unit 709. When the computer program is loaded into the RAM 703 and executed by the computing unit 701, one or more steps of the large model training method or the data enhancement method based on the large model described above can be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to execute a large model training method or a large model-based data enhancement method in any other appropriate manner (e.g., by means of firmware).
[0149] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0150] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0151] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0152] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0153] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.
[0154] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact via a communication network. This client-server relationship is established by computer programs running on the respective computers, establishing a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host, a host product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosts and VPS services ("Virtual Private Servers" or simply "VPS"). The server may also be a server in a distributed system or a server integrated with blockchain.
[0155] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not a limitation herein.
[0156] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.
Claims
1. A large model training method, comprising: Using a pre-trained large model commonly used in various fields, active learning is performed based on seed sentences and initial prompt words to obtain the target prompt words; Inputting the seed sentence and the target prompt word into the pre-trained large model, and using the pre-trained large model to perform batch processing of data enhancement based on the seed sentence and the target prompt word to obtain an initial data enhancement result; The batch processing includes: processing each seed sentence using each target prompt word; Based on the quality classification model of the target field, the initial data enhancement result is actively learned to obtain the target data enhancement result; the quality classification models of different fields are trained using training samples of the corresponding fields; Based on the seed sentence, the target prompt word and the target data enhancement result, fine-tuning the pre-trained large model to obtain a target large model of the target domain; The target domain-based quality classification model actively learns the initial data enhancement result to obtain a target data enhancement result, including: Filtering the initial data enhancement result to obtain a filtering result; Using the quality classification model, the filtering results are quality classified to determine the quality classification results of the filtering results; Based on the quality classification result, actively learning the filtering result to obtain the target data enhancement result; The quality classification results include: a first category, a second category, and a third category, wherein the quality of the first category is higher than that of the second category, and the second category is higher than that of the third category; The actively learning the filtering result based on the quality classification result to obtain the target data enhancement result includes: If the quality classification result is the second category, a manual labeling result of the initial data enhancement result is obtained, and the target data enhancement result is obtained based on the manual labeling result.
2. The method according to claim 1, wherein The pre-trained large model is used to perform active learning based on the seed sentence and the initial prompt word to obtain the target prompt word, including: Using a pre-trained large model, data augmentation is performed on the input seed sentence and initial prompt word to obtain synthetic data; Obtaining manual annotation results of the synthetic data; A target prompt word is obtained based on the manual annotation result.
3. The method according to claim 1, wherein The actively learning the filtering result based on the quality classification result to obtain the target data enhancement result further includes: If the quality classification result is the first category, using the initial data enhancement result as the target data enhancement result; If the quality classification result is the third category, the initial data enhancement result is removed.
4. A data enhancement method based on a large model, comprising: Get seed sentences and prompt words; Using the target large model, data enhancement is performed on the seed sentence and the prompt word to obtain a data enhancement result; Wherein, the target large model is trained using the method according to any one of claims 1-3.
5. A large model training device comprising: The warm-up module is used to use the pre-trained large model to perform active learning based on the seed sentence and the initial prompt word to obtain the target prompt word; an enhancement module, configured to input the seed sentence and the target prompt word into the pre-trained large model, and perform batch processing of data enhancement based on the seed sentence and the target prompt word using the pre-trained large model to obtain an initial data enhancement result; The batch processing includes: processing each seed sentence using each target prompt word; A learning module is used to actively learn the initial data enhancement results based on the quality classification model of the target field to obtain the target data enhancement results; the quality classification models of different fields are trained using training samples of the corresponding fields; A fine-tuning module, configured to fine-tune the pre-trained large model based on the seed sentence, the target prompt word, and the target data enhancement result to obtain a target large model for the target domain; The learning module is further configured to: Filtering the initial data enhancement result to obtain a filtering result; Using the quality classification model, the filtering results are quality classified to determine the quality classification results of the filtering results; Based on the quality classification result, actively learning the filtering result to obtain the target data enhancement result; The quality classification results include: a first category, a second category, and a third category, wherein the quality of the first category is higher than that of the second category, and the second category is higher than that of the third category; The learning module is further configured to: If the quality classification result is the second category, a manual labeling result of the initial data enhancement result is obtained, and the target data enhancement result is obtained based on the manual labeling result.
6. The device according to claim 5, wherein The preheating module is further used for: Using a pre-trained large model, data augmentation is performed on the input seed sentence and initial prompt word to obtain synthetic data; Obtaining manual annotation results of the synthetic data; A target prompt word is obtained based on the manual annotation result.
7. The device according to claim 5, wherein The learning module is also used to: If the quality classification result is the first category, using the initial data enhancement result as the target data enhancement result; If the quality classification result is the third category, the initial data enhancement result is removed.
8. A data enhancement device based on a large model, comprising: Acquisition module, used to obtain seed sentences and prompt words; An enhancement module, configured to perform data enhancement on the seed sentence and the prompt word using a target large model to obtain a data enhancement result; Wherein, the target large model is trained using the method according to any one of claims 1-3.
9. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 4.
10. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-4.
11. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Prompt word optimization method for processing multi-label classification task for large language model
CN118350361A
Large model fine tuning method and device based on supervised fine tuning, equipment and medium
CN118445397A