Government affair field big language model-oriented data screening method, electronic equipment and medium

By using scoring models and mixed sampling techniques in the training data screening method of large language models, the problem of inaccurate training data is solved, and the performance and efficiency of the model in the government affairs field is significantly improved.

CN119416878APending Publication Date: 2025-02-11PEKING UNIV (TIANJIN BINHAI) NEW GENERATION INFORMATION TECH RES INST +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411417952.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-11
Publication Date
2025-02-11

AI Technical Summary

Technical Problem

The training data of large language models in the prior art is not accurate enough, resulting in poor performance in areas with high precision and professional knowledge requirements, such as the medical field.

Method used

A training data screening method for large language models in the government affairs field is proposed. By obtaining the original data set, training the scoring model, quality evaluation of the data set is obtained, seed data sets are obtained, and high-quality screening is selected through mixed sampling and data augmentation technology. Training dataset.

Benefits of technology

Through accurate training data screening, the performance and efficiency of the large language model are improved, ensuring the high-quality output of the model in the government affairs field, especially in tasks such as medical record analysis and clinical decision support.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119416878A_ABST
    Figure CN119416878A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of computer natural languages, and discloses a training data screening method for a large language model in the government affair field, electronic equipment and a storage medium, and the training data screening method for the large language model in the government affair field comprises the following steps: obtaining an original data set based on the government affair field; training based on the original data set to obtain a scoring model; calling a scoring model to perform quality evaluation on the original data set to obtain a quality data set; obtaining a seed data set according to the quality data set; and obtaining a training data set according to the seed data set. According to the method, the scoring model is trained based on the original data set, so that the scoring model has better adaptability to the large voice model, and the scoring model is used for evaluating the quality of the instruction, so that the screened training data is more accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer natural language technology, and specifically relates to a training data screening method, electronic equipment and storage medium for a large language model in the government affairs field. Background Art

[0002] Large Language Models (LLMs), such as ChatGPT and LLama, have made significant progress in the field of Natural Language Processing (NLP). These models have demonstrated excellent language understanding and generation capabilities and are widely used in various tasks. However, in some professional fields, such as medicine, traditional language models cannot meet their strict requirements for high accuracy and expertise. For example, in tasks such as medical record analysis and clinical decision support, models need to have a high degree of accuracy and professionalism. This puts a higher demand on instruction fine-tuning (IFT) technology to ensure that the model can perform professional tasks.

[0003] In related technologies, fine-tuning of large language models mainly relies on large-scale pre-training and abundant training data, which makes the training data inaccurate. Summary of the invention

[0004] In view of this, the present invention provides a training data screening method, electronic device and storage medium for a large language model in the government field to solve the problem of insufficient accuracy of training data in the prior art.

[0005] In a first aspect, the present invention provides a method for screening training data for a large language model in the government field, comprising: obtaining an original data set based on the government field, the original data set comprising multiple data, the data being represented as x=(I,O), wherein I is an instruction and O is an answer; training a scoring model based on the original data set; calling the scoring model to perform quality assessment on the original data set to obtain a quality data set; obtaining a seed data set based on the quality data set; and obtaining a training data set based on the seed data set.

[0006] In some implementations, training a scoring model based on the original data set specifically includes: performing mixed sampling on the original data set to obtain a sub-data set; enhancing the sub-data set to obtain an enhanced data set; and training the scoring model based on the enhanced data set.

[0007] In some embodiments, the original data set is mixed sampled to obtain a sub-data set, which specifically includes: encoding the original data set to obtain an encoded data set; dividing the encoded data set into a plurality of clusters, each cluster including a plurality of data points; obtaining a cluster center of each cluster; obtaining a sampling probability based on the cluster center and the plurality of data points; and mixing the original data set according to the sampling probability to obtain the sub-data set.

[0008] In some implementations, training the scoring model based on the enhanced data set specifically includes: annotating the enhanced data set to generate an annotated data set; and fine-tuning a base model using the annotated data set to obtain the scoring model.

[0009] In some implementations, the seed dataset and the enhanced dataset are merged to obtain the training dataset.

[0010] In some embodiments, calling the scoring model to perform quality assessment on the original data set to obtain a quality data set specifically includes: calling the scoring model to annotate the instruction set of the original data set to obtain a quality score; if the quality score is lower than a scoring threshold, filtering out the corresponding data to obtain the quality data set.

[0011] In some embodiments, any of the methods for screening training data for a large language model in the government affairs field further includes: fine-tuning the base model based on the seed data set to obtain an intermediate model; using the intermediate model to infer the quality data set to obtain an inference result; using the scoring model to perform quality assessment on the inference result to identify negative samples; and performing mixed collection of the negative samples and combining them with the seed data set to obtain the training data set.

[0012] In some implementations, the original data set is mixed and sampled to obtain a sub-data set; data enhancement is performed on each data in the sub-data set, and a corresponding answer is generated for each instruction; and corresponding instructions for which the corresponding answers are inappropriate are identified and set as the negative samples.

[0013] In a second aspect, the present invention also provides an electronic device, comprising: at least one processor; 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 so that the at least one processor can: obtain an original data set based on the government affairs field; train a scoring model based on the original data set; call the scoring model to perform quality assessment on the original data set to obtain a quality data set; obtain a seed data set based on the quality data set; and obtain a training data set based on the seed data set.

[0014] In a third aspect, the present invention provides a storage medium storing a computer program, which, when executed by a processor, implements any one of the methods for screening training data for a large language model in the government affairs field.

[0015] The beneficial effects of the present invention are:

[0016] The present invention trains a scoring model based on the original data set, so that the scoring model has better adaptability to the large speech model, and the scoring of the original data set through the scoring model is more accurate. The scoring model is specifically used to evaluate the quality of instructions, and the scoring model is used to screen instructions, so that the screened training data is more accurate. Fine-tuning the base model according to the screened more accurate training data can improve the performance of the large language model, thereby ensuring the efficiency and effect of the fine-tuning process. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0018] Figure 1 It is a flow chart of a method for screening training data for a large language model in the government affairs field according to an embodiment of the present invention;

[0019] Figure 2 It is a flowchart of a method for screening training data for a large language model in the government affairs field according to another embodiment of the present invention;

[0020] Figure 3 The figure is a block diagram of an electronic device according to an embodiment of the present invention.

[0021] Description of reference numerals:

[0022] 110. Processor;

[0023] 120. Memory. DETAILED DESCRIPTION

[0024] In related technologies, existing fine-tuning methods usually face the following problems:

[0025] Huge demand for training data: Existing fine-tuning methods require a large amount of labeled data, which not only increases the difficulty and cost of data acquisition, but also prolongs the time for model training.

[0026] Uniqueness of data characteristics and difficulty: Existing methods often fail to fully consider the diversity and difficulty of data when selecting training data, which leads to insufficient performance of the model when processing complex tasks.

[0027] High consumption of computing resources: Existing fine-tuning methods require a lot of computing resources, which is a huge challenge for research teams or institutions with limited resources.

[0028] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0029] Combine the following Figures 1 to 3 , describing an embodiment of the present invention.

[0030] like Figure 1 and Figure 2 As shown, according to an embodiment of the present invention, on the one hand, a method for screening training data for a large language model in the government affairs field is provided, comprising the following steps:

[0031] Step S101: obtaining an original data set based on the government affairs field, the original data set includes multiple pieces of data, and the data is represented by x=(I,O), where I is an instruction and O is an answer;

[0032] Step S103: training a scoring model based on the original data set.

[0033] Step S105: calling the scoring model to perform quality assessment on the original data set to obtain a quality data set.

[0034] Step S107: Obtain a seed data set according to the quality data set.

[0035] Step S109: Obtain a training data set according to the seed data set.

[0036] The present invention can be applied to the government affairs field, such as the medical field. In this embodiment, the large language model is an open source large model, and the open source large model M, for example, can be QWen. It can be referred to as the base model. Given an open source large model M, a fine-tuning data set V, that is, the original data set, the data x based on the original data set is expressed as x = (I, O), where I is the instruction, O is the answer, and x∈V. Let M V Denotes the model obtained by fine-tuning the model θ using the dataset V. The primary goal of the present invention is to select an instruction subset The instruction subset S fine-tunes the model θ to obtain a ratio θV Better model θ S The instruction subset is the training data set.

[0037] We can first set up an instruction screening framework, filter out the most suitable instruction subset S through the screening framework, and train a better model θ with less overhead S .

[0038] Among them, the scoring model is trained based on the original data set, so that the scoring model has better adaptability to the large speech model, and the scoring of the original data set is more accurate through the scoring model. The scoring model can ensure the high quality of the fine-tuning data and prevent low-quality data from having a negative impact on the model. The scoring model is specifically used to evaluate the quality of instructions, and the scoring model is used to screen instructions, making the screened training data more accurate. Fine-tuning the base model based on the more accurate screened training data can improve the performance of the large language model, thereby ensuring the efficiency and effectiveness of the fine-tuning process.

[0039] Further, based on step S103, a scoring model is trained based on the original data set, specifically including the following steps:

[0040] Step S1031: Perform mixed sampling on the original data set to obtain a sub-data set.

[0041] Step S1033: Enhance the sub-dataset to obtain an enhanced data set.

[0042] Step S1035: training a scoring model based on the enhanced data set.

[0043] In this embodiment, in order to ensure the high quality of the fine-tuning data and prevent low-quality data from having a negative impact on the model, a scoring model is trained based on the original data set to obtain a scoring model. The scoring model can score the instruction quality of the data. Unlike the traditional reward model that only evaluates the quality of the answer, the training process of the scoring model focuses on both the quality and complexity of the instructions. To this end, a smaller LLM model can be fine-tuned using high-quality labeled data and used as a scoring model, and GPT-3.5 can be used for labeling to enhance the interpretability of the results. Few-shot learning and paired data labeling methods can be used to improve the accuracy of labeling.

[0044] First, the dataset V is mixed and sampled to obtain a subset V'. Then, each piece of data in V' is enhanced to obtain an enhanced dataset, and the base model M is used to generate the corresponding answer O' for each instruction I. The base model performs reasoning on the sub-dataset to enhance the data of the sub-dataset.

[0045] Next, use GPT-3.5 to annotate the original answer pair (I, O) and the generated corresponding answer pair (I, O') at the same time to obtain an annotated dataset. This allows GPT-3.5 to capture the quality differences between different answers and improve the reliability of the scoring.

[0046] Furthermore, based on step S1031, the original data set is mixed and sampled to obtain a sub-data set, which specifically includes the following steps:

[0047] Step S10311: Encode the original data set to obtain an encoded data set.

[0048] Step S10313: Divide the encoded data set into several clusters, each cluster including multiple data points.

[0049] Step S10315: Obtain the cluster center of each cluster.

[0050] Step S10317: Obtain sampling probability according to the cluster center and multiple data points.

[0051] Step S10319: Perform mixed sampling on the original data set according to the sampling probability to obtain a sub-data set.

[0052] By proposing a hybrid sampling method, most of the redundant data can be screened out while retaining the data characteristics and difficulty diversity. A common encoder, such as BERT, can be used to encode the instruction dataset V of the original dataset to obtain V embed , which is the encoded data set. If the training data set used is all Chinese data, the encoder uses Chinese-BERT. The K-means clustering algorithm can be applied to divide the data into K clusters, where the data in each cluster is more similar in feature space.

[0053] Existing instruction screening work usually selects central data or random data from each cluster as core samples that can represent the entire data set. However, the data at the center of the cluster is often a simple sample, which is easier for the model to learn, while the data at the edge of the cluster may be a more challenging difficult sample, which is more difficult for the model to learn. These difficult samples are especially important in the fine-tuning stage. In order to balance the learning needs of the model and avoid forgetting, a mixed sampling strategy is introduced to retain a certain proportion of simple samples and difficult samples.

[0054] Specifically, given a data set V = {X 0 ,X 1 …X n}, the corresponding encoding obtained by the encoder Chinese BERT is {w 0 ,w 1 …wn}, use K-means clustering algorithm to divide the data into K clusters. Let C i is the i-th cluster center. For each data point X in the cluster j , calculate the data point X j To the corresponding cluster center C k(j) The Euclidean distance ‖w j -C k(j) ‖ 2 , where k(j) represents the data point X j The cluster index to which it belongs.

[0055] Then for the i-th cluster, assuming there are m samples in this cluster, the corresponding code is The sampling probability of each node is:

[0056]

[0057] Among them, ε is a constant very close to 0. A round of mixed sampling is performed on each cluster, and finally an instruction set that takes into account both the data space feature and the complexity diversity can be obtained.

[0058] Experimental results show that after fine-tuning using the hybrid sampling method of the present invention, the model outperforms the results using the full amount of data when using only 5% of the data. This not only significantly saves computing resources, but also improves training efficiency and the practical application effect of the model.

[0059] Furthermore, based on step S1035: training the scoring model according to the enhanced data set specifically includes the following steps:

[0060] Step S10351: label the enhanced data set to generate a labeled data set.

[0061] Step S10351: Use the labeled data to fine-tune the base model to obtain a scoring model.

[0062] In this embodiment, the enhanced data set can be annotated by GPT annotation to generate an annotated data set. The base model is fine-tuned using the annotated data set to obtain a scoring model.

[0063] Furthermore, the seed dataset and the enhanced dataset are merged to obtain the training dataset.

[0064] Further, based on step S105: calling the scoring model to perform quality assessment on the original data set to obtain a quality data set, specifically includes the following steps:

[0065] Step S1051: Call the scoring model to annotate the instruction set of the original data set to obtain a quality score.

[0066] Step S1053: If the quality score is lower than the score threshold, the corresponding data is filtered out to obtain a quality data set.

[0067] In this embodiment, the instruction set is first labeled with a scoring model, and a threshold is set. Data with scores below this threshold will be filtered out, so that the retained data sets are all high-quality quality data sets. Next, the quality data set can be mixed sampled after using Chinese-BERT to obtain a seed data set. This step screens out a large amount of low-quality data and redundant data in the original instruction set, and the seed data set will be used to fine-tune the model to obtain a seed model. At this step, it seems that a good screening of the data set has been done, but due to mixed sampling, some data that is important to the model may be missed, that is, the model cannot answer appropriately and needs to be fine-tuned.

[0068] Furthermore, any of the training data screening methods for a large language model in the government affairs field further includes the following steps:

[0069] Step S1011: fine-tune the base model based on the seed data set to obtain an intermediate model.

[0070] Step S1013: Use the intermediate model to infer the quality data set to obtain an inference result.

[0071] Step S1015: Use a scoring model to evaluate the quality of the inference results and identify negative samples.

[0072] Step S1017: negative samples are mixed and collected, and combined with the seed data set to obtain a training data set.

[0073] The seed model obtained based on the above steps may miss some key data during the fine-tuning process, which is manifested as the generation of some negative samples with low answer quality. To this end, these negative samples are screened out from the training set for further fine-tuning of the model. The specific operation is as follows: First, let the seed model generate new answers to the instructions in the quality dataset, and re-score these new answers and their corresponding instructions using the scoring model. In this process, negative samples with low scores are particularly retained because these negative samples are likely to be important and previously ignored data. Use an efficient model architecture to accelerate the generation and scoring process of new answers. Subsequently, sub-datasets corresponding to these negative samples are extracted from the original dataset and mixed and sampled to form an enhanced dataset. Finally, the seed dataset and the enhanced dataset are merged to obtain the final selected dataset for the final fine-tuning of the model. This improved data processing flow aims to maximize the performance and generalization ability of the model by comprehensively considering high-quality data and key negative samples.

[0074] Furthermore, the definition of negative samples is: first, the original data set is mixed and sampled to obtain a sub-data set, and then each data in the sub-data set is enhanced, a corresponding answer is generated for each instruction, and the corresponding instructions with inappropriate corresponding answers are identified and set as negative samples.

[0075] Understandably, if the generated answer Oj of a certain instruction Ij is inappropriate, it means that the data may be filtered but is crucial to model learning. In particular, (Ij, Oj) in this case is set as a positive sample, and (Ij, Oj') is set as a negative sample. A key task of the scoring model is to accurately identify these negative samples. Therefore, these positive and negative samples can be annotated in pairs by GPT-3.5, and the annotation results can be used to train the scoring model.

[0076] In the present invention, during the seed instruction screening process, the instruction set V is first annotated with a scoring model, and a threshold r is set. Data with scores below this threshold will be filtered out, so that the retained data set VQ is a high-quality quality data set. Then, Chinese-BERT is used to perform mixed sampling on the data set VQ to obtain the seed data set Vseed. This step screens out a large amount of low-quality data and redundant data in the original instruction set, and Vseed will be used to fine-tune the model M to obtain Mseed.

[0077] During the fine-tuning process of Mseed, some key data may be missed, which is manifested as the generation of some negative samples with low answer quality. To this end, these negative samples are screened out from the training set V to further fine-tune the model. The specific operations are as follows: First, let the Mseed model generate new answers to the instructions in VQ, and re-score these new answers and their corresponding instructions using the scoring model. In this process, negative samples with low scores are especially retained because these are likely to be important and previously ignored data. The vllm architecture is used to accelerate the generation and scoring process of new answers. Subsequently, the sub-dataset VNegative corresponding to these negative samples is extracted from the original dataset, and mixed sampling is performed to form the enhanced dataset VAugumented.

[0078] Finally, Vseed and VAugumented are merged to obtain the final selected dataset Vselected for final fine-tuning of the model M. This improved data processing pipeline aims to maximize the performance and generalization ability of the model by comprehensively considering high-quality data and key negative samples.

[0079] The present invention proposes a training data screening method for fine-tuning a large language model in the government affairs field, which can quickly screen out high-quality subsets based on the given training data, thereby significantly improving the training efficiency and effect of the model. This method combines hybrid sampling technology and scoring models. First, the data is encoded through Chinese-BERT, then clustered using the K-means clustering algorithm, and mixed sampling is performed based on the distance from the data point to the cluster center, retaining the ratio of simple samples to difficult samples. Subsequently, the scoring model is used to evaluate the data, filter low-quality data, and generate a final high-quality quality data set.

[0080] like Figure 3 As shown, according to an embodiment of the present invention, on the other hand, an electronic device is provided, including: at least one processor 110; a memory 120 communicatively connected to the at least one processor, wherein the memory 120 stores instructions executable by the at least one processor 110, and the instructions are executed by the at least one processor 110, so that the at least one processor 110 can perform the following steps:

[0081] Step S101: Acquire an original data set based on the government affairs field.

[0082] Step S103: training a scoring model based on the original data set.

[0083] Step S105: calling the scoring model to perform quality assessment on the original data set to obtain a quality data set.

[0084] Step S107: Obtain a seed data set according to the quality data set.

[0085] Step S109: Obtain a training data set according to the seed data set.

[0086] According to an embodiment of the present invention, on the other hand, a storage medium is provided, storing a computer program, which, when executed by a processor, implements any one of the training data screening methods for a large language model in the government affairs field.

[0087] The computer executes the instructions to perform the following steps:

[0088] Step S101: obtaining an original data set based on the government affairs field, the original data set includes multiple pieces of data, and the data is represented by x=(I,O), where I is an instruction and O is an answer;

[0089] Step S103: training a scoring model based on the original data set.

[0090] Step S105: calling the scoring model to perform quality assessment on the original data set to obtain a quality data set.

[0091] Step S107: Obtain a seed data set according to the quality data set.

[0092] Step S109: Obtain a training data set according to the seed data set.

[0093] The technical solution of the present invention significantly optimizes the performance of large language models in the medical vertical field through a series of innovative designs and methods, which is mainly reflected in improving the accuracy and generalization ability of the model, ensuring the diversity of training data in features and difficulty, so that the model can better cope with different types of medical tasks such as medical record analysis and clinical decision support, thereby improving overall accuracy and reliability. At the same time, the amount of data and computing resources required for training are significantly reduced. Through hybrid sampling technology and efficient vllm architecture, only a small amount of data set is used for fine-tuning to make the model performance surpass the fine-tuning result of the full amount of data, greatly reducing the training cost and time, making the fine-tuning process more efficient and economical. In addition, through hybrid sampling technology and scoring models, the model can quickly adapt to and optimize new data and tasks. This adaptability is particularly important for the ever-changing and developing medical field, ensuring that the model can continue to maintain high performance and quickly respond to new needs, and overall improving the competitiveness of the product. While the model performance is significantly improved, it brings better user experience and higher market competitiveness. The reduced training cost and resource consumption also give the product a greater cost advantage in the commercialization process.

[0094] The technical solution of the present invention provides a new instruction screening and fine-tuning method, which not only solves the key problems in traditional methods, but also provides new ideas and directions for future research and applications. For example, in medical record analysis, clinical decision support and medical research, the model can accurately extract and analyze the patient's historical medical record information, provide scientific clinical decision support and help researchers quickly screen and analyze large amounts of medical data, accelerate the research process and transformation of results, and overall promote the development of intelligent solutions in the medical industry and promote the advancement and application of medical technology.

[0095] Therefore, the present invention proposes a new instruction screening framework that combines scoring models, hybrid sampling and vllm architecture to optimize the performance of large models in the medical vertical field. The main benefits are as follows:

[0096] 1. The mixed sampling method adopted is to calculate the distance from the data point to the cluster center through K-means clustering, and perform mixed sampling to ensure the diversity of training data in terms of features and difficulty, thereby improving the generalization ability of the model.

[0097] 2. In the process of training the scoring model based on the original data set, combined with the actual application needs, it is possible to more accurately evaluate and select training data and improve the efficiency and effectiveness of fine-tuning.

[0098] 3. The VLLM architecture is used to optimize the model training process, forming an efficient fine-tuning architecture that can greatly reduce training overhead while significantly improving the accuracy and efficiency of the model.

[0099] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment, and non-volatile computer storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0100] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A training data screening method for a large language model in the government affairs field, characterized in that: include: Acquire an original data set based on the government affairs field, the original data set includes multiple pieces of data, and the data is represented by x=(I,O), where I is an instruction and O is an answer; A scoring model is obtained by training based on the original data set; Calling the scoring model to perform quality assessment on the original data set to obtain a quality data set; Obtaining a seed data set according to the quality data set; A training data set is obtained according to the seed data set.

2. The method for screening training data for a large language model in the government affairs field according to claim 1 is characterized in that: Training a scoring model based on the original data set specifically includes: Performing mixed sampling on the original data set to obtain a sub-data set; enhancing the sub-dataset to obtain an enhanced data set; The scoring model is trained according to the enhanced dataset.

3. The method for screening training data for a large language model in the government affairs field according to claim 2 is characterized in that: The original data set is mixed and sampled to obtain a sub-data set, which specifically includes: Encode the original data set to obtain an encoded data set; Dividing the encoded data set into a plurality of clusters, each cluster including a plurality of data points; Obtaining the cluster center of each cluster; Obtaining a sampling probability according to the cluster center and the plurality of data points; The original data set is mixed and sampled according to the sampling probability to obtain the sub-data set.

4. The method for screening training data for a large language model in the government affairs field according to claim 2 is characterized in that: Training the scoring model according to the enhanced data set specifically includes: Annotating the enhanced data set to generate an annotated data set; The base model is fine-tuned using the labeled data to obtain the scoring model.

5. The method for screening training data for a large language model in the government affairs field according to any one of claims 2 to 4, characterized in that: The seed data set and the enhanced data set are merged to obtain the training data set.

6. The method for screening training data for a large language model in the government affairs field according to any one of claims 1 to 4, characterized in that: Calling the scoring model to perform quality assessment on the original data set to obtain a quality data set specifically includes: Calling the scoring model to annotate the instruction set of the original data set to obtain a quality score; If the quality score is lower than the score threshold, the corresponding data is filtered out to obtain the quality data set.

7. The method for screening training data for a large language model in the government affairs field according to any one of claims 1 to 4, characterized in that: Also includes: Fine-tune the base model based on the seed data set to obtain an intermediate model; Using the intermediate model to infer the quality data set to obtain an inference result; Using the scoring model to perform quality assessment on the inference result and identify negative samples; The negative samples are mixed and collected, and combined with the seed data set to obtain the training data set.

8. The method for selecting training data for a large language model in the government affairs field according to claim 7 is characterized in that: Performing mixed sampling on the original data set to obtain a sub-data set; Performing data enhancement on each piece of data in the sub-dataset, and generating a corresponding answer for each instruction; The corresponding instructions for which the corresponding answers are inappropriate are identified and set as the negative samples.

9. An electronic device, characterized in that: include: at least one processor (110); a memory (120) communicatively coupled to the at least one processor (110); The memory (120) stores instructions executable by the at least one processor (110), and the instructions are executed by the at least one processor (110) to enable the at least one processor (110) to: Obtain original data sets based on the government affairs field; Training a scoring model based on the original data set; Calling the scoring model to perform quality assessment on the original data set to obtain a quality data set; Obtaining a seed data set according to the quality data set; A training data set is obtained according to the seed data set.

10. A storage medium, characterized in that: A computer program is stored, and when the computer program is executed by a processor, the training data screening method for a large language model in the government affairs field as described in any one of claims 1 to 8 is implemented.

Citation Information

Cited By

  • Method and system for screening high-scientific-value corpora from large-scale webpages

    CN121683780A