Method, device, equipment, medium and product for generating training data of large language model
By autonomously generating labeled data using a large language model and modifying input prompts in conjunction with preset standard data, the problem of model knowledge distribution bias caused by external labeled data is solved. This achieves efficient training data generation, protects the original capabilities of the model, and enhances the model's self-correction and cross-scene adaptability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING ZHONGKE JINDEZHU INTELLIGENT TECH CO LTD
- Filing Date
- 2026-03-13
- Publication Date
- 2026-07-03
Smart Images

Figure CN122334347A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a method, apparatus, device, medium and product for generating training data for a large language model. Background Technology
[0002] Large language models have become a core technology in the field of natural language processing, widely used in diverse scenarios such as intelligent interaction, content generation, data analysis, and intelligent decision-making. Their performance improvement heavily relies on high-quality training data. To adapt to the personalized task requirements of various fields, the industry generally achieves downstream task adaptation of large language models through fine-tuning. The effectiveness of fine-tuning is directly determined by the quality and distribution of the training data and its matching degree with the model's inherent knowledge.
[0003] Currently, training data for large language models is mainly obtained through two methods: manual annotation or external expert model distillation. Manual annotation relies on domain experts to perform fine-grained annotation on task data, forming a high-quality labeled dataset. External expert model distillation utilizes high-parameter, high-performance expert models to perform inference annotation on the original data, quickly generating large-scale labeled data. These two types of external data are then used as training samples for supervised fine-tuning of the target large language model, completing the model's task adaptation.
[0004] However, there are structural differences between the externally labeled data and the pre-trained knowledge distribution of the target model. Forcing a fit to a heterogeneous distribution during fine-tuning can easily damage the model's original semantic understanding and knowledge representation capabilities. Incremental training can easily trigger catastrophic forgetting, leading to a degradation of the model's ability to perform old tasks. Summary of the Invention
[0005] This application provides a method, apparatus, device, medium, and product for generating training data for large language models, in order to solve the problem of model behavior deviation caused by forced fitting.
[0006] Firstly, this application provides a method for generating training data for a large language model, the method comprising:
[0007] The model to be trained is used to perform contextual reasoning based on historical raw data of the target scene to generate first labeled data, wherein the historical raw data includes multiple raw samples;
[0008] The input prompts are modified based on the first labeled data and the preset standard data to enable the model to be trained to perform contextual reasoning again and generate the second labeled data.
[0009] Target training data is generated based on the first labeled data and the second labeled data, and the target training data is used to train the model to be trained.
[0010] In one possible design, the preset standard data includes the standard inference results and standard inference processes corresponding to each original sample, and the second labeled data includes the corrected inference results and corrected inference processes corresponding to each erroneous sample. The step of modifying the input prompts based on the first labeled data and the preset standard data to enable the model to be trained to perform contextual inference again and generating the second labeled data includes:
[0011] The set of erroneous samples in the first labeled data is determined based on preset standard data;
[0012] After fusing the historical raw data in the error sample set with the corresponding preset standard data, the data is input into the preset prompt template to construct the target input text containing reasoning instructions, historical raw data, and preset standard references;
[0013] The target input text is input into the model to be trained, so that the model to be trained can perform contextual reasoning based on the target input text to generate second labeled data.
[0014] In one possible design, after generating the second labeled data, the process further includes:
[0015] Based on the second labeled data and the preset standard data, determine whether there are erroneous samples;
[0016] If an error sample exists, a preset rich text set is obtained, which includes the error location and error reason corresponding to the error sample;
[0017] The input prompts are updated based on error samples, preset standard data, and preset rich text sets, so that the model to be trained can perform contextual reasoning based on the updated input prompts and generate third-party labeled data.
[0018] In one possible design, after generating the third labeled data, the process further includes:
[0019] Based on the third labeled data and the preset standard data, determine whether there are erroneous samples;
[0020] If there are erroneous samples, they are associated with and stored with the corresponding correct reasoning results to obtain a set of difficult samples. The set of difficult samples is used for retrieval and matching in subsequent contextual reasoning.
[0021] In one possible design, generating target training data based on the first labeled data and the second labeled data includes:
[0022] The samples with correct inference results in the first labeled data, the samples with correct inference results in the second labeled data, and the samples with correct inference results in the third labeled data are merged to generate the target training data.
[0023] One possible design also includes:
[0024] Input the correct samples of the first labeled data into the training model in batches, in the order of the correct samples of the second labeled data and the correct samples of the third labeled data;
[0025] After training with training data from each batch, the inference accuracy was verified.
[0026] Once the accuracy verification is passed, the next batch of training will begin.
[0027] Secondly, this application provides an apparatus for generating large language model training data, the apparatus comprising:
[0028] The inference module is used to perform contextual inference based on historical raw data of the target scene using the model to be trained, so as to generate first labeled data, wherein the historical raw data includes multiple raw samples;
[0029] The modification module is used to modify the input prompts based on the first labeled data and preset standard data, so that the model to be trained can re-perform contextual reasoning and generate the second labeled data;
[0030] The generation module is used to generate target training data based on the first labeled data and the second labeled data, so as to train the model to be trained using the target training data.
[0031] Thirdly, this application provides an electronic device, the device comprising: a processor, and a memory communicatively connected to the processor;
[0032] The memory stores computer-executed instructions;
[0033] The processor executes computer execution instructions stored in the memory to implement the method as described in any of the first aspects.
[0034] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method described in any of the first aspects above.
[0035] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the method described in any of the first aspects above.
[0036] The method, apparatus, device, medium, and product for generating training data for large language models provided in this application significantly reduce the manpower and time costs of data annotation by enabling the model to autonomously generate labeled data, while avoiding the risk of distribution bias introduced by external data. The first labeled data generated by the model's own reasoning has a distribution that highly matches the model's pre-trained knowledge system, avoiding the problem of forced fitting of external distributions from the source and protecting the model's original semantic understanding and knowledge representation capabilities. The process of generating labels through contextual reasoning can also activate the model's own reasoning links, preserving and strengthening its higher-order cognitive abilities such as logical reasoning and contextual understanding. After locating erroneous samples by combining preset standard data, the model is guided to re-reason by modifying input prompts, allowing the model to autonomously discover and correct deviations, strengthening its self-correction capabilities. Moreover, the correction method centered on prompt guidance avoids forcibly modifying parameters to fit external distributions, effectively mitigating the risk of catastrophic forgetting during incremental training. The target training data is formed by integrating the model's original correct samples and self-corrected samples. The distribution is fully adapted to the model's knowledge system, solving the problem of adapting static external data to dynamic tasks and improving cross-scenario generalization ability. During incremental training, the new data has high compatibility with the model's original knowledge, which can protect the boundaries of historical decisions, achieve coexistence of new and old knowledge, and completely solve the problem of catastrophic forgetting. At the same time, the model's own reasoning is the core throughout the process, avoiding the degradation of high-order capabilities caused by fine-tuning. Attached Figure Description
[0037] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0038] Figure 1 An application scenario diagram of the method for generating training data for a large language model provided in an embodiment of this application;
[0039] Figure 2 A flowchart illustrating a method for generating training data for a large language model according to an embodiment of this application;
[0040] Figure 3 A flowchart illustrating a method for generating training data for a large language model, as provided in another embodiment of this application;
[0041] Figure 4 A schematic diagram of the structure of a device for generating training data for a large language model provided in an embodiment of this application;
[0042] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0043] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0044] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0045] It should be noted that certain software, components, and models may be mentioned in the embodiments of this application. These should be considered as exemplary and are intended only to illustrate the feasibility of implementing the technical solution of this application. However, they do not mean that the applicant has used or necessarily used the solution.
[0046] To clearly understand the technical solution of this application, the solutions of the prior art will be described in detail first.
[0047] Large language models, as a core technology in the field of natural language processing, have been deeply applied in numerous scenarios such as intelligent interaction, content generation, data analysis, and intelligent decision-making. Their performance in various downstream tasks largely depends on the support of high-quality training data. To adapt large language models to the personalized task requirements of various domains, the industry mainstream adopts fine-tuning to achieve task adaptation. The effectiveness of fine-tuning hinges on the quality of the training data and the degree of matching between the data distribution and the model's inherent knowledge system. Currently, the construction of training data for large language models mainly relies on two approaches: manual annotation and external expert model distillation. Manual annotation involves domain experts performing refined annotations on task-related data to create high-quality labeled datasets. External expert model distillation utilizes expert models with larger parameters and better performance to perform inference and annotation on the original data, quickly achieving large-scale generation of labeled data. Subsequently, these two types of external labeled data are used as training samples to conduct supervised fine-tuning of the target large language model, thus completing the downstream task adaptation of the model. However, this approach has significant drawbacks. The distribution of externally labeled data differs fundamentally from the distribution of pre-trained knowledge in the target model. Forcing the model to fit this heterogeneous distribution during fine-tuning can easily damage the model's original semantic understanding ability and knowledge representation system. Furthermore, incremental training of the model can easily lead to catastrophic forgetting, directly causing a significant degradation in the model's performance on the original task.
[0048] Therefore, when facing technical problems in existing technologies, such as the introduction of distribution bias and damage to the model's native capabilities by externally labeled data, this paper abandons the external data generation methods of manual annotation and external expert model distillation. Instead, it utilizes the contextual reasoning capabilities of the model to be trained, allowing the model to autonomously generate the first labeled data based on the historical raw data of the target scene. This ensures that the distribution of the labeled data highly matches the model's pre-trained knowledge system, avoiding the problem of forced fitting of external distributions from the source, while significantly reducing data annotation costs. Considering that the first labeled data generated by the model may contain errors, directly using it as training data would affect model performance. Therefore, pre-set standard data is introduced as a reference. By modifying input prompts, the model is guided to re-infer, allowing it to autonomously discover and correct the original reasoning biases, generating the second labeled data. This achieves alignment between the labeled data and the standard while avoiding the damage to the model's original knowledge system caused by forced parameter modifications. To fully utilize the effective labeled data generated by the model and improve the adaptability of the training data, correct samples from the first labeled data and corrected samples from the second labeled data are integrated. Target training data is constructed and used to train the model to be trained, ensuring that the training data fully adapts to the model's internal knowledge and solving the problem of adapting static external data to dynamic tasks. At the same time, it ensures that new data during incremental training is highly compatible with the model's original knowledge, effectively mitigating catastrophic forgetting and guaranteeing the model's training effect.
[0049] Figure 1 An application scenario diagram of the method for generating training data for a large language model provided in an embodiment of this application is shown, such as... Figure 1 As shown in the diagram, the application scenario of the method for generating large language model training data provided in this embodiment includes: a terminal device 101 and a server 102. The device for generating large language model training data includes a model to be trained, integrated into the server 102.
[0050] It is understandable that the terminal device 101 pre-stores historical raw data of multiple target scenarios, as well as corresponding preset standard data.
[0051] Specifically, the user inputs a training data generation request through terminal device 101. After receiving the request, server 102 uses the model to be trained to perform contextual reasoning based on historical raw data of the target scene, generating first labeled data. Then, based on the first labeled data and preset standard data, the input prompt is modified to enable the model to be trained to perform contextual reasoning again, generating second labeled data. Finally, server 102 generates target training data based on the first and second labeled data, and uses the target training data to train the model to be trained.
[0052] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will be described below with reference to the accompanying drawings.
[0053] Figure 2 A flowchart illustrating a method for generating training data for a large language model according to an embodiment of this application is shown below. Figure 2 As shown, the execution entity in this embodiment is a device for generating large language model training data. This device can be implemented through a computer program, or through a medium storing the relevant computer program, such as a USB flash drive and / or optical disc, or it can be integrated into a chip or electronic device, such as a server or server cluster. The intelligent customer service response method provided in this embodiment includes the following steps:
[0054] Step 201: Use the model to be trained to perform contextual reasoning based on the historical raw data of the target scene to generate the first labeled data. The historical raw data includes multiple raw samples.
[0055] Among them, the model to be trained refers to a large language model that has not yet completed downstream task adaptation and needs to be optimized for performance through targeted training, and has basic context learning and logical reasoning capabilities.
[0056] The target scenario refers to the specific business area or task scenario where the model to be trained will be applied, such as intent recognition scenario, text classification scenario, and information extraction scenario.
[0057] Historical raw data refers to raw text data collected from the target scene that has not been manually labeled or processed by a model.
[0058] Among them, the original sample refers to the basic unit that constitutes the original historical data, which is an independent text fragment with complete information in the target scenario.
[0059] The first labeled data refers to the dataset with labeled information that is autonomously generated by the model to be trained after completing contextual reasoning on the historical raw data of the target scene.
[0060] Specifically, based on the target scene localization of the model to be trained, historical raw data for that scene is obtained. Basic cleaning of the historical raw data is performed, removing only meaningless, incomplete, or scene-irrelevant invalid content. The cleaned historical raw data is then broken down into several independent raw samples, each possessing complete scene information and independent task analysis value.
[0061] Furthermore, targeted prompts are generated for the model to be trained. These prompts must clearly inform the model of the current task objective, inference requirements, and output format, while guiding the model to utilize its own contextual learning capabilities to complete the inference. The prompts are then combined with the original samples to form a standardized input format. This standardized input, including the prompts and the original samples, is then fed into the model to be trained. Based on its knowledge system, semantic understanding, and logical reasoning abilities developed during the pre-training phase, the model independently analyzes and derives information from each original sample, combining this with the task requirements in the prompts to generate the corresponding annotation information for that original sample.
[0062] Furthermore, after the model completes contextual reasoning and annotation output for all original samples, each original sample is associated and matched with its corresponding model-generated annotation information to form a sample pair of original samples and model-generated annotation information. All matched sample pairs are then integrated to form complete first-level annotation data generated autonomously by the model.
[0063] Step 202: Modify the input prompts based on the first labeled data and the preset standard data so that the model to be trained can re-perform contextual reasoning and generate the second labeled data.
[0064] Among them, the preset standard data refers to the accurate annotation reference data corresponding to each original sample in the target scenario, such as annotation by domain experts or generated by external models, which includes the standard inference results and annotation conclusions corresponding to the original samples.
[0065] Input prompts refer to text instructions designed to guide the model to complete a specific reasoning task, including task requirements, reasoning guidance, and reference information.
[0066] The second labeled data refers to the corrected labeled dataset that the model to be trained generates autonomously after re-performing contextual reasoning on the erroneous samples in the first labeled data, guided by input prompts that incorporate preset standard data.
[0067] Specifically, all samples in the first labeled data are compared sample by sample with the preset standard data. If the labeling conclusion of a sample completely matches the standard and the reasoning logic has no obvious deviation, it is judged as a correct sample. If the labeling conclusion does not match the standard, or the reasoning logic has obvious loopholes or deviations, it is judged as an incorrect sample. For each incorrect sample, based on the original initial prompt framework, the differences between the preset standard data and the incorrect sample are integrated to modify the input prompt. For example, if the complete information of the original sample is retained, the preset standard labeling conclusion and standard reasoning logic corresponding to the sample are added, and clear comparative reasoning guidance is added to guide the model to compare the differences between its original labeling results and the preset standard and analyze the reasons for the deviation.
[0068] Furthermore, the modified input prompts are fed into the model to be trained, triggering the model's contextual reasoning ability. Based on its pre-trained knowledge system and combined with the preset standard references and comparison guidelines in the input prompts, the model will re-analyze and reason about the original samples, autonomously identifying deviations and errors in its original annotations. Following the task requirements of the prompts, it will re-derive a standard-compliant reasoning process and annotation conclusions.
[0069] Furthermore, after the model completes the re-inference for the erroneous samples, the original text of each erroneous sample is associated and matched with the revised inference process and annotation conclusions generated by the model this time, forming new sample pairs of original samples and revised annotation information. All verified new sample pairs are integrated to form complete second annotation data.
[0070] Step 203: Generate target training data based on the first labeled data and the second labeled data, so as to train the model to be trained using the target training data.
[0071] The target training data refers to the final dataset used for fine-tuning the model to be trained.
[0072] Specifically, the first and second labeled data undergo secondary verification, retaining only the correct samples whose labeled conclusions are accurate, whose reasoning processes are complete, and consistent with the preset standard data. After screening, valid sets of the first and second labeled data are formed respectively. The samples are then mixed and shuffled to eliminate the influence of sample order on model training. A unified scene identifier and task label are added to each integrated sample to form target training data that is structurally standardized, sample-balanced, and covers the core tasks of the target scene.
[0073] Optionally, the model to be trained is trained using target training data, with the reasoning logic and annotation conclusions of the model generating labeled data as the optimization target, rather than simply fitting the labels, thus preserving the model's own contextual reasoning links and avoiding the degradation of higher-order cognitive abilities.
[0074] The method for generating training data for large language models provided in this application significantly reduces the manpower and time costs of data annotation by having the model autonomously generate labeled data, while avoiding the risk of distribution bias introduced by external data. The first labeled data generated by the model's own reasoning has a distribution that highly matches the model's pre-trained knowledge system, avoiding the problem of forcibly fitting external distributions from the source and protecting the model's original semantic understanding and knowledge representation capabilities. The process of generating labels through contextual reasoning can also activate the model's own reasoning chain, preserving and strengthening its higher-order cognitive abilities such as logical reasoning and contextual understanding. After locating erroneous samples by combining preset standard data, the model is guided to re-reason by modifying input prompts, allowing the model to autonomously discover and correct deviations, strengthening its self-correction capabilities. Moreover, the correction method centered on prompt guidance avoids forcibly modifying parameters to fit external distributions, effectively mitigating the risk of catastrophic forgetting during incremental training. The target training data is formed by integrating the model's original correct samples and self-corrected samples. The distribution is fully adapted to the model's knowledge system, solving the problem of adapting static external data to dynamic tasks and improving cross-scenario generalization ability. During incremental training, the new data has high compatibility with the model's original knowledge, which can protect the boundaries of historical decisions, achieve coexistence of new and old knowledge, and completely solve the problem of catastrophic forgetting. At the same time, the model's own reasoning is the core throughout the process, avoiding the degradation of high-order capabilities caused by fine-tuning.
[0075] As an optional implementation, based on the above embodiments, the preset standard data includes the standard inference results and standard inference processes corresponding to each original sample, and the second labeled data includes the corrected inference results and corrected inference processes corresponding to each erroneous sample. The input prompts are modified according to the first labeled data and the preset standard data to enable the model to be trained to perform contextual inference again, and the second labeled data is generated, including:
[0076] Determine the set of erroneous samples in the first labeled data based on preset standard data;
[0077] After fusing the historical raw data in the error sample set with the corresponding preset standard data, the data is input into the preset prompt template to construct the target input text containing reasoning instructions, historical raw data, and preset standard references;
[0078] The target input text is fed into the model to be trained, so that the model can perform contextual reasoning based on the target input text to generate second labeled data.
[0079] Among them, the standard inference result refers to the final annotation conclusion given for the original sample in the preset standard data, which conforms to the business rules and industry standards of the target scenario, such as applying for a refund or querying an order in the intent recognition scenario.
[0080] The standard reasoning process refers to the complete logical deduction chain corresponding to the standard reasoning result in the preset standard data. For example, if a user mentions that they have not received the goods and request a refund, their core demand is to return the goods and get a refund, and their ultimate intention is to apply for a refund.
[0081] The erroneous sample set refers to the set of all samples in the first labeled data where the inference results or inference processes generated by the model itself deviate significantly or are completely inconsistent with the standard inference results or standard inference processes in the preset standard data.
[0082] Among them, the preset prompt template refers to a fixed text framework pre-designed to guide the model to be trained to complete a specific inference task, which includes a fixed inference instruction module, a fillable raw data module, a fillable reference information module, etc.
[0083] The target input text refers to the complete input text formed by filling the historical original data of the error sample and the corresponding preset standard data into the preset prompt template.
[0084] Specifically, the inference result of each sample in the first labeled data is compared one by one with the standard inference result of the corresponding original sample in the preset standard data. If the conclusions are completely inconsistent, such as the model inferring a logistics query while the standard result is to expedite delivery, it is directly judged as an incorrect sample. If the conclusions are consistent, its inference process is further compared with the standard inference process in the preset standard data. If the model's inference chain has logical breaks, omissions of key information, or errors in causal relationships, such as the model only deriving to expedite delivery based on not receiving the goods, but the standard inference process requires combining the not receiving of the goods with the user's multiple expeditions and the complete chain of the order being placed more than 7 days ago, it is still judged as an incorrect sample. Only when both the inference result and the inference process are completely consistent with the standard is it judged as a correct sample. All samples judged as incorrect are integrated to form a structured set of incorrect samples.
[0085] Furthermore, the historical raw data of each error sample in the error sample set is extracted, namely the unprocessed raw text corresponding to that sample, as well as the corresponding preset standard data, including the standard inference result and the complete standard inference process for that sample. A preset prompt template is retrieved, and the historical raw data of each error sample is filled into the historical raw data module of the template. The corresponding standard inference process and result are filled into the preset standard reference module. The inference instruction module remains fixed, ultimately generating a target input text specific to each error sample, containing inference instructions, historical raw data, and preset standard references.
[0086] Furthermore, all the target input texts constructed above are input into the model to be trained one by one according to the batch processing rules. The basic parameters of the model remain unchanged during the input process to ensure that the inference environment is consistent.
[0087] Understandably, after receiving the target input text, the model first parses the core requirements of the inference instructions, including correcting biases, outputting the inference process, and outputting the result. Then, it understands the original information based on historical raw data, while referring to the standard inference process and result in preset standard data, comparing it with the erroneous inference logic in its previously generated first-annotated data, and autonomously analyzing the biases. For example, if I hadn't paid attention to the key information about the user's repeated urging, resulting in an incomplete inference process, the model would re-perform contextual inference based on the above analysis, outputting the corrected inference process and the corrected inference result, forming the complete second-annotated data.
[0088] The method for generating training data for a large language model provided in this application uses both standard inference results and processes as a dual criterion to filter erroneous samples, accurately locating deviations while excluding qualified samples, avoiding ineffective intervention, and protecting the model's original and standard-compliant inference logic. Pre-set standard data is integrated into input prompts as a reference, rather than being forcibly labeled, allowing the model to complete inference corrections within its own knowledge system, avoiding the damage to the model's original knowledge system caused by forcibly fitting external data at the input level. The target input text guides the model to compare its own inferences with standard inferences, forcing it to utilize logical analysis and deviation identification capabilities, strengthening comparative reasoning and self-correction abilities. The correction process requires the model to output the complete inference process, explicitly calling higher-order cognitive abilities, avoiding the ability degradation caused by traditional fine-tuning that emphasizes conclusions over inference. The finally generated second-labeled data not only compensates for the errors in the first-labeled data but also highly adapts to the model, complementing the correct samples in the first-labeled data, providing accurate and adaptable dual guarantees for the subsequent construction of target training data, and improving the model training effect.
[0089] As an optional implementation, after generating the second annotation data based on the above embodiments, the method further includes:
[0090] Determine whether there are erroneous samples based on the second labeled data and the preset standard data;
[0091] If an error sample exists, a preset rich text set is obtained, which includes the error location and error reason corresponding to the error sample.
[0092] The input prompts are updated based on error samples, preset standard data, and preset rich text sets, so that the model to be trained can perform contextual reasoning based on the updated input prompts and generate third-party labeled data.
[0093] The pre-set rich text set refers to a structured text set constructed for common inference error types in the target scenario. It includes the error location corresponding to each sample, such as key sentences or keywords in the original text that cause inference bias, or logical breakpoints in the model inference process; and the error reason, such as specific reasons such as missing the keyword "urgent delivery" in the user dialogue.
[0094] The updated input prompt refers to the upgraded prompt text formed by integrating the error location and error reason from a preset rich text set on the basis of the original target input text.
[0095] The third labeled data refers to the labeled data generated by the model to be trained after re-inferring the erroneous samples in the second labeled data that have not yet been corrected, guided by the updated input prompts.
[0096] Specifically, each sample in the second labeled data is compared with its corresponding preset standard data. If any aspect of the inference result or inference process of a sample does not match the preset standard, it is determined to be an uncorrected erroneous sample. All uncorrected samples are integrated into a secondary erroneous sample set. A pre-constructed preset rich text set is retrieved, and for each sample in the secondary erroneous sample set, the corresponding rich text information is matched based on its labeled core deviation points. Based on the preset prompt template, a new rich text feedback module is added, integrating the historical raw data of the secondary erroneous samples, the corresponding preset standard data, and the bound rich text information into the template to form an updated input prompt. This prompt text includes inference instructions, a new requirement to correct inference deviations by combining the error location and cause; historical raw data, preset standard reference, and rich text feedback, ensuring that the model clearly understands where the error is, why it is wrong, and how to correct it.
[0097] Furthermore, the updated input prompts corresponding to each secondary error sample are fed into the model one by one. The model first analyzes the error location and cause in the rich text feedback, and then, combined with the original data and standard references, re-organizes the reasoning logic. Based on the updated prompt text, the model first locates the root cause of its previous reasoning error, and then re-completes the contextual reasoning according to the standard reasoning logic, outputting the corrected reasoning process and the corrected reasoning result, forming complete third-party labeled data.
[0098] The method for generating training data for a large language model provided in this application pre-defines a rich text set that clearly labels the error location and cause. It matches each persistent error sample with unique rich text information, giving subsequent prompts a clear error correction focus and avoiding indiscriminate generalization. The updated input prompt integrates the error location, error cause, and standard reference, guiding the model to first locate the root cause of the error and then re-reason based on standard logic, rather than blindly correcting it. This allows the model to avoid similar errors at their source, and the generated third-party labeled data combines accuracy with logical integrity. The rich text information is only integrated into the input prompt as an error correction guide, rather than forcibly modifying model parameters or directly providing correction results. The model still completes reasoning and correction within its own knowledge system, avoiding the destruction of the model's native knowledge system caused by the forced intervention of external information, and improving the model's ability to autonomously identify and correct errors in subsequent reasoning.
[0099] As an optional implementation, after generating the third annotation data based on the above embodiments, the method further includes:
[0100] Determine whether there are erroneous samples based on third-party labeled data and preset standard data;
[0101] If there are erroneous samples, they are associated with and stored with the corresponding correct reasoning results to obtain a set of difficult samples. The set of difficult samples is used for retrieval and matching in subsequent contextual reasoning.
[0102] Among them, the difficult sample set refers to the erroneous sample that has not been successfully corrected after the third labeled data has been verified, and the structured sample set is formed by associating and storing the correct reasoning results in the preset standard data corresponding to the sample.
[0103] Among them, retrieval matching refers to the semantic and scene feature matching of the current input sample with the samples in the difficult sample set when performing contextual reasoning on the model to be trained, including new sample reasoning and verification reasoning after model training. If the match is successful, the corresponding correct reasoning result is retrieved as a reference to assist the model in completing the reasoning.
[0104] Specifically, all samples in the third-labeled data are verified according to a dual comparison rule of standard inference results and standard inference processes. If any aspect of a sample's inference result or inference process still does not match the preset standard data, it is determined to be a difficult error sample. All difficult error samples are extracted to form a list of difficult error samples, and each sample is labeled with a unique identifier. For each sample in the list of difficult error samples, its corresponding preset standard data is matched using the unique identifier to extract the correct inference result. The historical original data of the difficult error sample is bound one-to-one with the corresponding correct inference result to form a structured set of difficult samples. During storage, the original text, feature labels, unique identifiers, and corresponding correct inference results of the samples are retained.
[0105] Optionally, search and matching rules can be set for difficult sample sets, specifying matching dimensions such as text semantic similarity, scene feature labels, and keyword overlap. For example, a threshold of semantic similarity ≥85% or core keyword overlap ≥90% can be set for successful matching.
[0106] The method for generating training data for a large language model provided in this application identifies high-difficulty samples that the model cannot correct even after two prompts. This clarifies the limits of the model's autonomous correction capabilities, stopping prompts and guidance for difficult samples that the model cannot resolve autonomously. This avoids logical confusion caused by repeated reasoning and correction, while reducing meaningless model reasoning resource consumption and ensuring the stability of the model's original correct reasoning logic. Difficult samples are associated with their corresponding correct reasoning results and stored in a structured set, serving as a dedicated fallback reference library for subsequent contextual reasoning. When the model processes new samples, it can retrieve and match the corresponding correct reasoning results, compensating for the limitations of the model's autonomous reasoning capabilities, solving the problem of low model reasoning accuracy in complex scenarios, and improving overall reasoning performance.
[0107] As an optional implementation, based on the above embodiments, target training data is generated based on the first labeled data and the second labeled data, including:
[0108] The samples with correct inference results in the first labeled data, the samples with correct inference results in the second labeled data, and the samples with correct inference results in the third labeled data are merged to generate the target training data.
[0109] Among them, the sample with correct reasoning results refers to the sample whose reasoning results and reasoning process meet the standard requirements after each group of labeled data is compared with the preset standard data.
[0110] Specifically, for the final verification of the first labeled data, only samples whose reasoning results and reasoning processes both conform to preset standards are retained. Invalid samples due to abnormal data formats or incomplete labeling information are then removed, forming the first set of correctly labeled samples. The second and third labeled data are then verified sequentially according to the above standards, forming the second and third sets of correctly labeled samples.
[0111] Furthermore, the three types of correct sample sets are uniformly classified according to the core task dimension of the target scenario, such as intent categories like refunds, inquiries, and complaints in intent recognition scenarios, ensuring that each task subclass has sample coverage from different correction stages. The three types of correct samples are then fully mixed and rearranged in a random order. A unified annotation format is applied to all integrated samples, with each sample containing three core components: historical raw data, inference process, and inference result. Target scenario identifiers, task subclass labels, and sample source labels are added to each sample to form the final target training data. This dataset can be directly input into the model to be trained for supervised fine-tuning.
[0112] The method for generating training data for large language models provided in this application retains only qualified samples after multiple rounds of verification, fundamentally ensuring the quality of training data. The data distribution closely matches the model's original knowledge system, preserving the model's core capabilities during training. Simultaneously, the equalization and standardization processes improve model training efficiency and generalization ability. Ultimately, with the support of this data, the model to be trained can accurately adapt to the target scenario task while retaining higher-order cognitive abilities, effectively solving core problems such as external distribution fitting, catastrophic forgetting, and insufficient generalization ability.
[0113] As an optional implementation, based on the above embodiments, it further includes:
[0114] Input the correct samples of the first labeled data into the training model in batches, in the order of the correct samples of the second labeled data and the correct samples of the third labeled data;
[0115] After training with training data from each batch, the inference accuracy was verified.
[0116] Once the accuracy verification is passed, the next batch of training will begin.
[0117] In this context, batch input refers to splitting the three types of correct samples in the target training data into independent training batches in a specified order, rather than inputting them all into the model at once. Each batch corresponds to an independent model training process.
[0118] Among them, inference accuracy verification refers to testing the inference performance of the model using a dedicated validation set of the target scenario after each batch of training is completed, such as verifying the accuracy of inference results and the compliance rate of the inference process.
[0119] Among them, passing the accuracy verification means that the accuracy of the model's inference results on the validation set reaches a preset threshold, such as ≥90%, and the compliance rate of the inference process reaches a preset threshold, such as ≥85%.
[0120] Specifically, the first set of correctly labeled samples, confirmed through screening, is used as the first training batch; the second set of correctly labeled samples is used as the second training batch; and the third set of correctly labeled samples is used as the third training batch. A corresponding scenario verification subset is matched for each batch for final overall verification.
[0121] Furthermore, the first batch of training data is input into the model to be trained, and a lightweight fine-tuning strategy is used for training. The optimization goal is to solidify the model's natively correct reasoning logic, and the number of training iterations is controlled within a basic range. After training is completed, the model is tested using the validation subset corresponding to the first batch, and compared with the preset standard data of the validation set to calculate the accuracy of the reasoning result and the compliance rate of the reasoning process. If both indicators reach the preset threshold, the validation is considered successful; if not, the number of training iterations is adjusted and retraining is performed until the validation is successful.
[0122] Furthermore, based on the completion and successful validation of the first batch of training data, the second and third batches of training data are sequentially input into the model, and the corresponding validation sets are used for validation.
[0123] Optionally, if the accuracy verification of the current batch passes and the reasoning ability of the original batch samples does not degrade upon retesting, then proceed directly to the training process for the next batch. If the current batch fails verification, first analyze the reasons for the failure. If it is because the model has not fully learned the sample features, the number of training iterations for this batch can be appropriately increased or the learning rate can be fine-tuned, and then retrained and verified again. If it is because the samples themselves have labeling problems, then return to the sample selection stage for re-verification, correction, and training can proceed again.
[0124] The method for generating training data for a large language model provided in this application uses gradient-based batch training, allowing the model to gradually absorb features from samples of varying difficulty according to cognitive patterns, thus reducing learning costs. A batch-by-batch verification mechanism enables precise control of training effectiveness, promptly identifying and resolving hidden problems during training. The rule of advancing only after successful verification ensures the effectiveness of each training round while effectively avoiding core issues such as catastrophic forgetting and overfitting. Ultimately, this allows the model to master reasoning capabilities across all scenarios while retaining its original semantic understanding, logical reasoning, and other higher-order cognitive abilities, achieving the training goal of non-degradation of capabilities and full coverage of effects.
[0125] Figure 3 A flowchart of a method for generating training data for a large language model provided in another embodiment of this application is shown below. Figure 3 As shown, the method for generating large language model training data provided in this embodiment includes the following steps:
[0126] Step 301: Use the model to be trained to perform contextual reasoning based on the historical raw data of the target scene to generate the first labeled data. The historical raw data includes multiple raw samples.
[0127] Step 302: Determine the set of erroneous samples in the first labeled data based on the preset standard data.
[0128] Step 303: After fusing the historical raw data in the error sample set with the corresponding preset standard data, input the data into the preset prompt template to construct the target input text containing reasoning instructions, historical raw data, and preset standard references.
[0129] Step 304: Input the target input text into the model to be trained so that the model to be trained can perform contextual reasoning based on the target input text to generate second labeled data.
[0130] Step 305: Determine whether there are erroneous samples based on the second labeled data and the preset standard data.
[0131] Step 306: If there are error samples, obtain a preset rich text set, which includes the error location and error reason corresponding to the error sample.
[0132] Step 307: Update the input prompts based on the error samples, preset standard data, and preset rich text set, so that the model to be trained can perform contextual reasoning based on the updated input prompts and generate third labeled data.
[0133] Step 308: Determine whether there are erroneous samples based on the third labeled data and the preset standard data.
[0134] Step 309: If there are erroneous samples, the erroneous samples are associated with the corresponding correct reasoning results and stored to obtain a set of difficult samples. The set of difficult samples is used for retrieval and matching in subsequent contextual reasoning.
[0135] Step 310: Merge the samples with correct inference results in the first labeled data, the samples with correct inference results in the second labeled data, and the samples with correct inference results in the third labeled data to generate target training data.
[0136] In this embodiment, the implementation method and technical effect of steps 301-310 are similar to those of the corresponding solutions in the above embodiments, and will not be repeated here.
[0137] Figure 4 This is a schematic diagram of the structure of a device for generating training data for a large language model according to an embodiment of this application, as shown below. Figure 4 As shown, the device for generating large language model training data provided in this embodiment is located in an electronic device. The device 40 for generating large language model training data provided in this embodiment includes: an inference module 41, a modification module 42, and a generation module 43.
[0138] The inference module 41 is used to perform contextual inference based on historical raw data of the target scene using the model to be trained, so as to generate first labeled data. The historical raw data includes multiple raw samples. The modification module 42 is used to modify the input prompts according to the first labeled data and preset standard data, so that the model to be trained can perform contextual inference again and generate second labeled data. The generation module 43 is used to generate target training data based on the first labeled data and the second labeled data, so as to train the model to be trained using the target training data.
[0139] The large language model training data generation device provided in this embodiment can execute... Figure 2 The methods provided in the embodiments are similar in their specific implementation principles and technical effects, and will not be described in detail here.
[0140] Optionally, the preset standard data includes the standard inference results and standard inference process corresponding to each original sample, and the second labeled data includes the corrected inference results and corrected inference process corresponding to each erroneous sample. The modification module 42, when modifying the input prompt according to the first labeled data and the preset standard data to enable the model to be trained to perform contextual inference again and generate the second labeled data, is specifically used for: determining the set of erroneous samples in the first labeled data according to the preset standard data; merging the historical original data in the set of erroneous samples with the corresponding preset standard data and inputting it into the preset prompt template to construct the target input text containing inference instructions, historical original data, and preset standard references; and inputting the target input text into the model to be trained so that the model to be trained can perform contextual inference based on the target input text to generate the second labeled data.
[0141] Optionally, the apparatus for generating large language model training data provided in this embodiment further includes a determination module, an acquisition module, and an update module.
[0142] Accordingly, the determination module is used to determine whether there are erroneous samples based on the second labeled data and the preset standard data; the acquisition module is used to acquire a preset rich text set if erroneous samples exist, the preset rich text set including the error location and error reason corresponding to the erroneous sample; the update module is used to update the input prompts according to the erroneous samples, the preset standard data and the preset rich text set, so that the model to be trained can perform contextual reasoning based on the updated input prompts and generate the third labeled data.
[0143] Optionally, the device for generating large language model training data provided in this embodiment further includes a storage module.
[0144] Accordingly, the determination module is also used to determine whether there are erroneous samples based on the third labeled data and the preset standard data; the storage module is used to associate and store the erroneous samples with the corresponding correct reasoning results if erroneous samples exist, so as to obtain a set of difficult samples, which is used for retrieval and matching in subsequent context reasoning.
[0145] Optionally, when generating target training data based on the first labeled data and the second labeled data, the generation module 43 is specifically used to: merge the samples with correct inference results in the first labeled data, the samples with correct inference results in the second labeled data, and the samples with correct inference results in the third labeled data to generate target training data.
[0146] Optionally, the large language model training data generation device provided in this embodiment further includes an input module and a verification module.
[0147] Accordingly, the input module is used to input the model to be trained in batches according to the order of the first correct labeled data sample, the second correct labeled data sample, and the third correct labeled data sample; the verification module is used to verify the inference accuracy after training with each batch of training data is completed; and in response to the accuracy verification being passed, the next batch of training is carried out.
[0148] Figure 5 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application, as shown below. Figure 5 As shown, the electronic device 50 provided in this embodiment includes a processor 51 and a memory 52 that is communicatively connected to the processor.
[0149] The memory 52 stores computer-executable instructions; the processor 51 executes the computer-executable instructions stored in the memory 52 to implement the method for generating large language model training data provided in the above embodiment. Related explanations can be understood by referring to the descriptions and effects corresponding to the steps in the accompanying drawings, and will not be elaborated further here.
[0150] The program may include program code, which includes computer-executable instructions. Memory 52 may include high-speed RAM, and may also include non-volatile memory, such as at least one disk storage device.
[0151] In this embodiment, the processor 51 and the memory 52 are connected via a bus. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 5 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0152] This application also provides a computer-readable storage medium storing computer-executable instructions. When the controller executes the computer-executable instructions, it implements the various steps in the methods described above.
[0153] This application also provides a computer program product, including a computer program that, when executed by a controller, implements the various steps in the methods described above.
[0154] The various embodiments described above in this application can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard parts (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0155] The computer-executable instructions used to implement the methods of this application may be written in any combination of one or more programming languages. These computer-executable instructions may be provided to the processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that when executed by the processor or controller, the computer-executable instructions cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer-executable instructions may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a standalone software package, or entirely on a remote machine or electronic device.
[0156] In the context of this application, a computer-readable storage medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium can be a machine-readable signal medium or a machine-readable storage medium. A computer-readable storage medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of computer-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), optical fibers, compact disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing. Alternatively, computer-readable storage media may include: resistive random access memory (RRAM), dynamic random access memory (DRAM), static random access memory (SRAM), enhanced dynamic random access memory (EDRAM), high-bandwidth memory (HBM), hybrid memory cube (HMC), and so on.
[0157] The systems and technologies described herein can be implemented in computing systems that include back-end components (e.g., as data electronic devices), or computing systems that include middleware components (e.g., application electronic devices), or computing systems that include front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0158] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps can be performed in other orders or simultaneously according to this application. Secondly, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to this application. In other words, the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps disclosed in this application can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this application can be achieved, and this is not limited herein.
[0159] It should be further noted that although the steps in the flowchart are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0160] It should be understood that the above-described device embodiments are merely illustrative, and the device of this application can also be implemented in other ways. For example, the division of units / modules in the above embodiments is only a logical functional division, and there may be other division methods in actual implementation. For example, multiple units, modules, or components may be combined, or integrated into another system, or some features may be ignored or not executed.
[0161] Furthermore, unless otherwise specified, the functional units / modules in the various embodiments of this application can be integrated into one unit / module, or each unit / module can exist physically separately, or two or more units / modules can be integrated together. The integrated units / modules described above can be implemented in hardware or as software program modules.
[0162] When an integrated unit / module is implemented in hardware, that hardware can be digital circuits, analog circuits, etc. The physical implementation of the hardware structure includes, but is not limited to, transistors, memristors, etc.
[0163] If the integrated unit / module is implemented as a software program module and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to related technologies, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned memory includes various media capable of storing computer-executable instructions, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0164] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification.
[0165] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only.
[0166] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. Therefore, the specific embodiments described above do not constitute a limitation on the scope of protection of this application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the principles of this application should be included within the scope of protection of this application.
Claims
1. A method for generating training data for a large language model, characterized in that, The method includes: The model to be trained is used to perform contextual reasoning based on historical raw data of the target scene to generate first labeled data, wherein the historical raw data includes multiple raw samples; The input prompts are modified based on the first labeled data and the preset standard data to enable the model to be trained to perform contextual reasoning again and generate the second labeled data. Target training data is generated based on the first labeled data and the second labeled data, and the target training data is used to train the model to be trained.
2. The method according to claim 1, characterized in that, The preset standard data includes the standard inference results and standard inference processes corresponding to each original sample, and the second labeled data includes the corrected inference results and corrected inference processes corresponding to each erroneous sample. Modifying the input prompts based on the first labeled data and the preset standard data to enable the model to be trained to perform contextual inference again and generating the second labeled data includes: The set of erroneous samples in the first labeled data is determined based on preset standard data; After fusing the historical raw data in the error sample set with the corresponding preset standard data, the data is input into the preset prompt template to construct the target input text containing reasoning instructions, historical raw data, and preset standard references; The target input text is input into the model to be trained, so that the model to be trained can perform contextual reasoning based on the target input text to generate second labeled data.
3. The method according to claim 2, characterized in that, After generating the second labeled data, the process also includes: Based on the second labeled data and the preset standard data, determine whether there are erroneous samples; If an error sample exists, a preset rich text set is obtained, which includes the error location and error reason corresponding to the error sample; The input prompts are updated based on error samples, preset standard data, and preset rich text sets, so that the model to be trained can perform contextual reasoning based on the updated input prompts and generate third-party labeled data.
4. The method according to claim 3, characterized in that, After generating the third labeled data, the process also includes: Based on the third labeled data and the preset standard data, determine whether there are erroneous samples; If there are erroneous samples, they are associated with and stored with the corresponding correct reasoning results to obtain a set of difficult samples. The set of difficult samples is used for retrieval and matching in subsequent contextual reasoning.
5. The method according to claim 3, characterized in that, The generation of target training data based on the first labeled data and the second labeled data includes: The samples with correct inference results in the first labeled data, the samples with correct inference results in the second labeled data, and the samples with correct inference results in the third labeled data are merged to generate the target training data.
6. The method according to claim 5, characterized in that, Also includes: Input the correct samples of the first labeled data into the training model in batches, in the order of the correct samples of the second labeled data and the correct samples of the third labeled data; After training with training data from each batch, the inference accuracy was verified. Once the accuracy verification is passed, the next batch of training will begin.
7. A device for generating training data for a large language model, characterized in that, The device includes: The inference module is used to perform contextual inference based on historical raw data of the target scene using the model to be trained, so as to generate first labeled data, wherein the historical raw data includes multiple raw samples; The modification module is used to modify the input prompts based on the first labeled data and preset standard data, so that the model to be trained can re-perform contextual reasoning and generate the second labeled data; The generation module is used to generate target training data based on the first labeled data and the second labeled data, so as to train the model to be trained using the target training data.
8. An electronic device, characterized in that, The device includes: a processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-6.
10. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method described in any one of claims 1-6.