Training data synthesis method and device based on error extrapolation and reasoning chain analysis, medium and program product

Through the methods of error extrapolation and inference chain analysis, the inference chain errors of large language models are identified and corrected, and a high-quality training dataset is constructed. This solves the problem of insufficient training data quality in existing technologies and improves the model's generalization ability and inference reliability.

CN120611192BActive Publication Date: 2025-10-17SHANGHAI COOPERS TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511122425.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-12
Publication Date
2025-10-17
Estimated Expiration
2045-08-12

AI Technical Summary

Technical Problem

The quality issues of training data in existing technologies lead to insufficient generalization ability and reasoning reliability of large language models. Existing error correction methods are costly and inefficient, and automated generation methods lack transparency, leading to the spread of erroneous information and unstable model training.

Method used

Through error extrapolation and reasoning chain analysis, a small language model is used to generate multiple reasoning chains. The chains to be corrected are identified based on preset error evaluation rules, and the large language model is used to correct them. The LoRA mechanism is combined to fine-tune the model and construct a high-confidence and highly interpretable training dataset.

Benefits of technology

The controllability and interpretability of the sample generation process are significantly enhanced. The output training dataset has good versatility and transferability, is suitable for a variety of task scenarios, and provides a solid foundation for model fine-tuning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120611192B_ABST
    Figure CN120611192B_ABST
Patent Text Reader

Abstract

The application provides a training data synthesis method and device based on error extrapolation and reasoning chain analysis, a medium and a program product, comprising: obtaining an initial sample set; using a small language model to perform multiple sampling inferences on the question of each task sample to generate multiple reasoning chains; calculating the overall error score of each reasoning chain based on a preset error evaluation rule to determine a to-be-corrected reasoning chain; inputting the to-be-corrected reasoning chain and the corresponding question into a large language model to generate a corrected answer; constructing a new task sample by the question and the corrected answer, and performing partial parameter fine-tuning on the small language model; repeating the above process until the performance index change rate of the model on the task evaluation set is lower than a preset threshold, and outputting a final task sample; and constructing a training sample set by multiple final task samples, and performing full parameter fine-tuning on the small language model. The application constructs a training data self-optimization path based on model error, and improves semantic consistency and data effectiveness.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence, in particular to a training data synthesis method and device based on error extrapolation and reasoning chain analysis, a medium and a program product. BACKGROUND

[0002] In the fine-tuning and enhancement training process of a large language model (LLM), the quality of the training data directly determines the generalization ability and reasoning reliability of the model. The existing publicly available data sets (such as ShareGPT, Alpaca, etc.) have a large number of data, but there are problems such as high data noise, incomplete reasoning chain, frequent annotation errors, etc. Such problems will have a negative impact on the performance of the model in the actual training process, and may even cause the model to fit the wrong logic or wrong facts, thereby affecting the stability and accuracy of generation.

[0003] In order to improve the quality of the training data, some studies attempt to introduce artificial annotation or expert proofreading means to improve the data quality. Although this method can correct some errors to some extent, it relies on a large amount of manual participation, which is costly and inefficient, and is difficult to meet the needs of large-scale training data construction.

[0004] In addition, some automatic generation enhancement methods are also applied to training data expansion, which use the generation ability of the language model itself to supplement sample data. However, this kind of method only uses the prompt word scoring mechanism for sample selection, lacks transparency and explainability, and it is difficult to trace the specific path and reason of the error, so that the error information is further spread and amplified in the training data, affecting the stability and effect of model training. SUMMARY

[0005] In view of the deficiencies of the prior art, the present application provides a training data synthesis method and device based on error extrapolation and reasoning chain analysis, a medium and a program product, at least to solve the problem that the training data lacks accurate error correction and structured reasoning support in the prior art, and it is difficult to meet the needs of fine-tuning of large language models.

[0006] In order to achieve the above-mentioned purposes and other advantages, some embodiments of the present application provide the following aspects:

[0007] In a first aspect, some embodiments of the present application provide a training data synthesis method based on error extrapolation and reasoning chain analysis, comprising:

[0008] Obtain an initial sample set, the initial sample set comprising a plurality of task samples, each task sample containing at least one question;

[0009] The small language model is used to sample and infer multiple times for each question of the task sample to generate a plurality of corresponding inference chains;

[0010] An overall error score of each inference chain is calculated based on a preset error evaluation rule, and the inference chain with the maximum overall error score is determined as a to-be-corrected inference chain;

[0011] The to-be-corrected inference chain and the question in the corresponding task sample are input into the large language model to generate a corrected answer;

[0012] The question and the corrected answer constitute a new task sample, and the new task sample is used for partial parameter fine-tuning training of the small language model to improve the answering ability of the model;

[0013] The sampling and inference, error scoring, answer correction and model fine-tuning process is repeated until the performance index change rate of the small language model on the preset task evaluation set is less than the preset change rate threshold, the iteration process is terminated, and the new task sample generated in the last round is output as the final task sample;

[0014] A plurality of final task samples are combined to form a training sample set, which is used for full parameter fine-tuning training of the small language model.

[0015] In a second aspect, some embodiments of the present application also provide an electronic device, which comprises:

[0016] One or more processors; and a memory storing computer program instructions which, when executed, cause the processor to perform the training data synthesis method based on error extrapolation and inference chain analysis according to any of the above.

[0017] In a third aspect, some embodiments of the present application also provide a computer-readable storage medium having stored thereon computer programs and / or instructions which, when executed by a processor, implement the training data synthesis method based on error extrapolation and inference chain analysis according to any of the above.

[0018] In a fourth aspect, some embodiments of the present application also provide a computer program product comprising computer programs and / or instructions which, when executed by a processor, implement the training data synthesis method based on error extrapolation and inference chain analysis according to any of the above.

[0019] Compared with the related art, in the scheme provided by the embodiment of the application, an error-driven self-optimization data generation path is constructed, which can identify the logical weak points or knowledge coverage insufficient areas exposed by a small language model in an inference process from original task samples, and filter out the inference chains with the weakest logical path and the largest answer deviation. Then, by introducing a large language model with stronger inference ability, the inference chains are repaired in a targeted manner to generate optimized answers with reasonable structure and rigorous semantics. Compared with the existing training data expansion or error correction method, the method not only explicitly models the causal structure in the inference process, but also can identify and locate the inference defects in a more fine-grained manner, and accordingly guide the large language model to perform targeted rewriting, thereby significantly enhancing the controllability and explainability of the sample generation process. With the execution of iterative correction, the output sample data tends to be stable in confidence and accurate in semantic expression, thereby constructing a high-confidence and high-explainability training dataset with good generality and migration, which is suitable for various task scenarios such as mathematical calculation, logical reasoning, natural question answering, and the like, and provides a solid data foundation for fine-tuning of a target model. BRIEF DESCRIPTION OF DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other embodiments can be obtained without creative labor on the basis of these drawings.

[0021] Figure 1 is a flowchart of a training data synthesis method based on error extrapolation and inference chain analysis provided by the embodiment of the present application;

[0022] Figure 2 is a structural schematic diagram of an electronic device provided by the embodiment of the present application. DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely in combination with the drawings in the embodiments of the present application. Obviously, the described embodiments are some of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.

[0024] First embodiment

[0025] The first embodiment of the present application relates to a training data synthesis method based on error extrapolation and reasoning chain analysis. The method is applied to a terminal system as an example, hereinafter referred to as "system". The terminal includes: mobile terminal, computer terminal or similar computing device, etc. Referring to Figure 1 The method can include the following steps:

[0026] Step S1: Obtain an initial sample set, which includes multiple task samples, each of which contains at least one question.

[0027] For step S1, specifically, the initial sample set can be derived from a manually constructed labeled data set, a public question and answer data set, real question samples extracted from user logs, or a candidate question set automatically generated from a pre-trained model. Each task sample contains at least one question expressed in natural language. In the first round of processing, it can only contain questions and does not need to provide corresponding reference answers. This set serves as the seed sample set for the data synthesis process and can be set to tens to thousands of entries in size to guide the subsequent iterative generation process. The initial sample set can be derived from any existing task type, including but not limited to math problems, logical reasoning problems, and question and answer problems.

[0028] A task sample can also contain multiple questions expressed in natural language, but it must ensure that they have the same semantic intent. In the reasoning chain generation process, the system can optionally input one question as a representative or input different questions into the small language model one by one to generate multiple reasoning chains. If each task sample contains multiple questions expressed in natural language and these questions do not have the same semantic intent, the system first performs question semantic clustering and splitting on the task sample to split questions with different semantic intents into multiple sub-task samples. Each sub-task sample is input into the small language model separately to perform multiple rounds of sampling reasoning to generate structured reasoning chains.

[0029] In an actual system, the sample initializer module can complete the standardization processing and uniform input structure construction of the initial seed sample, support multi-task format uniform input, and complete sample standardization processing through a unified format adaptation mechanism, facilitating subsequent sampling reasoning and chain structure generation.

[0030] Step S2: Use the small language model to perform multiple sampling reasoning operations on the question of each task sample to generate multiple corresponding reasoning chains.

[0031] For step S2, specifically, for the question of each task sample obtained in step S1, a pre-set small language model is called to perform multiple sampling reasoning operations to generate multiple corresponding reasoning chains. Preferably, the small language model can be a lightweight language model with a parameter size of about 1B to 14B, such as Qwen-1.5B, LLaMA-7B, etc., which has reasoning ability while keeping the computing resources controllable.

[0032] Each reasoning chain needs to meet the format constraint of structured expression, and the structure is usually in the form of "step1→step2→…→stepn→answer", wherein each step represents an intermediate thinking step or a partial reasoning conclusion, and answer represents the final output answer. The above formatted reasoning chain as a whole constitutes a semantic structure conforming to the Chain-of-Thought (CoT) paradigm. The structured output constraint ensures that the number of nodes and semantic positions of the graph structure of all reasoning chains are consistent, that is, for each reasoning chain generated for the same question, the corresponding graph structure will contain the same number of reasoning nodes and be connected in consistent semantic order, thereby ensuring the alignment of reasoning paths in the topological structure.

[0033] In an actual system, the small model generator can perform multiple rounds of reasoning sampling on the input task samples in a unified format, and output a set of structured reasoning chains with intermediate conclusions and final answers.

[0034] Step S3: Calculate the overall error score of each reasoning chain based on the preset error evaluation rule, and determine the reasoning chain with the maximum overall error score as the to-be-corrected reasoning chain.

[0035] For step S3, specifically, for the multiple reasoning chains generated for each task sample in step S2, first convert each reasoning chain into a corresponding Directed Acyclic Graph (DAG) structure based on the structured modeling mechanism, wherein each node represents an intermediate reasoning step, and the edge represents the dependency relationship between steps.

[0036] On the basis of this graph structure, a dynamic confidence score mechanism is introduced to evaluate the credibility of each reasoning step node, and nodes with confidence scores significantly lower than a preset threshold are identified as potential error nodes. In combination with the hierarchical position and dependency path in the directed graph, the error propagation path of the potential error node is constructed, and the weights of the affected nodes in the path are assigned (such as normalized according to node depth, out-degree, etc.) to depict the transmission and amplification trend of reasoning errors in the chain. According to the dynamic confidence scores of the affected nodes on the influence path and their corresponding weights, the overall error score of each reasoning chain is calculated, and the reasoning chain with the highest error score is determined as the to-be-corrected reasoning chain.

[0037] In an actual system, the above construction of reasoning chain graph structure, identification of potential error nodes, and error path score calculation can be automatically completed by the error extraction analyzer module. To improve the response efficiency of the system, this module can also process the reasoning chains of multiple task samples in parallel, and quickly mark high-risk nodes and their influence range through graph traversal and local normalization mechanism.

[0038] Step S4: input the to-be-corrected reasoning chain and the question in the corresponding task sample into the large language model to generate a corrected answer.

[0039] For step S4, specifically, the to-be-corrected reasoning chain identified in step S3 is spliced with its corresponding question text q to form a prompt sequence for input into the large language model to construct a correction request prompt. The prompt can be encapsulated in a natural language template, such as: "The following is a reasoning process, but there may be errors, please correct and output the final answer: {reasoning chain step sequence}, the question is: {q}." Among them, the reasoning chain step sequence is the expression of concatenating each intermediate step in the original reasoning chain in logical order in natural language, ensuring that the large language model can fully perceive the reasoning context when processing. To guide the model to retain the existing logical structure and correct the potential erroneous reasoning links, temperature parameters, repetition penalty parameters, or "retain reasonable part" prompt sentences can be added to the generation process to improve the quality of the answer output. The generated output is the corrected answer, which will be used to replace the original answer in the task sample in the subsequent iteration and enter the next round of reasoning chain sampling and correction process.

[0040] The large language model used can include pre-trained models with complex logical understanding and error correction capabilities, such as GPT-4, Claude, Gemini Pro, etc. It is superior to small language models in terms of parameter size, diversity of training data, breadth of knowledge, and depth of reasoning, and can more effectively identify logical flaws, ambiguous expressions, and factual or knowledge errors in the reasoning chain. The deployment form of the large language model can be API calling or local deployment, which can be flexibly configured according to the reasoning efficiency and data privacy requirements.

[0041] In actual systems, the correction generator can accept "error chain + question" as input and automatically perform rewriting and correction processes to generate high-quality corrected answers with preserved structure and logical reasoning. Structured input prompt templates are supported to output stable and accurate optimized answers.

[0042] Step S5: construct a new task sample from the question and the corrected answer, and use the new task sample to perform partial parameter fine-tuning training on the small language model to improve the answer ability of the model.

[0043] For step S5, specifically, the corrected answer a' generated by the large language model is replaced with the answer a in the task sample output in the previous iteration to construct a new task sample with preserved structure but updated semantics, in the form of {q, a'}.

[0044] Fine-tuning training refers to updating only part of the parameters in the small language model that are strongly related to output generation without changing the overall architecture of the model. The present embodiment preferably uses a low-rank adaptation mechanism (LoRA, Low-Rank Adaptation) for fine-tuning training. The LoRA mechanism introduces two low-rank matrices in part of the key weight matrices in the language model (such as the weights of the attention layer or the feedforward layer in the Transformer decoder), while keeping the original weights unchanged, and only trains the two small-scale low-rank adaptation matrices to adapt to the lightweight scenario of frequent replacement of training data within an iteration period. In each iteration, the system uses the new task samples generated in the current round to update the parameters of the small language model through the LoRA mechanism, so that the model focuses more on filling the reasoning defects or knowledge blind spots exhibited in the previous answers.

[0045] Step S6: Repeat the process of sampling reasoning, error scoring, answer correction and model fine-tuning until the performance index of the small language model on the preset task evaluation set changes at a rate lower than the preset change rate threshold, and terminate the iteration process, and output the new task samples generated in the last round as the final task samples.

[0046] For step S6, after each iteration, the system evaluates the current model version based on the preset task evaluation set. The task evaluation set is a specially constructed standardized sample set used to objectively measure the actual performance of the model in the target task scenario. Each sample in the evaluation set contains a standard question, a clear reference answer and a structured reasoning path, and has the ability to be used for chain reasoning verification. The evaluation task can cover multiple typical scenarios, for example, mathematical reasoning tasks: samples include algebraic derivation, geometric proof and probability calculation, all equipped with standard answers and complete mathematical logic steps; or medical diagnosis tasks: samples are annotated by experts, covering case symptoms, test indicators and standard diagnosis processes, to evaluate the clinical reasoning ability of the model.

[0047] The system extracts at least one performance index including F1 score, recall rate, ROC-AUC value, etc. during the evaluation process, and calculates the performance index change rate between the last iteration. When the change rate is lower than the preset threshold (for example, 1%), it is considered that the model performance has tended to be stable, and the iteration convergence condition is met.

[0048] In an actual system, the control logic and loop management in the training data synthesis process can be taken care of by an iterative controller module. This module is used to coordinate the sampling inference, error evaluation, answer correction and fine-tuning training tasks in each round, to ensure that the sample iteration process continuously introduces effective information, and to determine whether to terminate the iteration process based on the performance indicators. In terms of performance indicator calculation, the quality filter module can evaluate the performance of the task samples generated in each iteration on the preset task evaluation set, calculate key performance indicators such as F1 score, recall rate, ROC-AUC value, etc., to measure the inference accuracy and discrimination ability of the current small language model in the task scenario. The module provides the calculation results to the iterative controller module as the basis for iteration termination judgment: when the change rate of the performance indicators is lower than the preset threshold, it is considered that the model performance tends to converge, and the sample generation process is terminated.

[0049] Step S7: Grouping the plurality of final task samples into a training sample set for full-parameter fine-tuning training of the small language model.

[0050] For step S7, specifically, the task samples of all terminated iteration processes are summarized to form a unified training sample set. This sample set has the characteristics of high semantic accuracy, clear inference chain structure, reasonable logic progression, etc., and can comprehensively cover various typical problems and logic variants in the original task distribution. On this basis, the small language model is fine-tuned with full-parameter quantity, i.e., all weight parameters of the model are back-propagated and gradient updated based on the final training sample set, to maximize the overall understanding ability and generalization ability of the model for the target task. Through the above full-parameter training phase, the small language model can finally have the ability to stably and accurately perform chain reasoning tasks in the target task scenario, providing a high-quality model basis for downstream system deployment.

[0051] Compared with related technologies, in the scheme provided by the embodiments of the present application, an error-driven self-optimization data generation path is constructed, which can identify the logical weak points or knowledge coverage insufficient areas exposed by the small language model in the inference process from the original task samples, and screen out the inference chains with the weakest logical path and the largest answer deviation. Further, by introducing a large language model with stronger inference ability, the inference chains are repaired in a targeted manner, and an optimized answer with reasonable structure and rigorous semantics is generated. Compared with existing training data expansion or error correction methods, the present method not only explicitly models the causal structure in the inference process, but also can identify and locate the inference defects in a more fine-grained manner, and accordingly guide the large language model to make targeted revisions, significantly enhancing the controllability and explainability of the sample generation process. With the execution of iterative correction, the output sample data tends to be stable in confidence and accurate in semantic expression, and a high-confidence and high-explainability training data set is constructed, which has good universality and migration, and is suitable for various task scenarios such as mathematical calculation, logical reasoning, natural question answering, etc., providing a solid data foundation for fine-tuning of the target model.

[0052] Second embodiment

[0053] The second embodiment of the present application relates to a training data synthesis method based on error extrapolation and reasoning chain analysis. The second embodiment is an improvement based on the first embodiment, and the specific improvement is that in the second embodiment of the present application, a specific implementation of enhancing the diversity of the generated reasoning chain is provided, that is, step S2 can further include the following steps:

[0054] The same question in the task sample is input into the small language model multiple times to trigger the generation of multiple reasoning chains with different semantics but consistent structures, wherein each reasoning chain is composed of the same number of reasoning steps with the same logical structure, each reasoning step has a preset logical progression order, and each reasoning step corresponds to an intermediate reasoning result.

[0055] Specifically, for each question in the task sample, the same text content is input into the small language model multiple times to trigger the built-in generation diversity mechanism, thereby generating multiple reasoning chains with different semantics but consistent structures. The multi-round sampling reasoning process does not depend on input changes, but naturally generates semantic diversity through the sampling strategy of the language model (such as temperature control, token selection strategy, etc.). In each sampling reasoning process, the small language model uses a step-by-step generation method to output multiple reasoning steps with logical progression relationships one by one, forming a complete reasoning chain. Each reasoning chain is composed of multiple intermediate reasoning steps, and each step outputs an intermediate result, which embodies strong coherence and clear structure.

[0056] Exemplarily, the generation process of the reasoning chain can be divided into the following stages:

[0057] Step 1: question analysis and task decomposition. The model first performs semantic understanding and structural analysis on the input question, identifies key concepts, implicit conditions and reasoning targets, and forms a basic analysis framework.

[0058] Step 2: intermediate calculation and basic reasoning. Based on the identified key elements, the model performs preliminary logical deduction or numerical calculation to obtain the first key intermediate result as a support node for subsequent reasoning.

[0059] Step 3...step(n): in-depth reasoning and reflection backtracking. The model continues to develop multiple logical progressions based on the generated intermediate conclusions, including deriving new knowledge, integrating intermediate conditions, identifying potential contradictions and adjusting backtracking, which embodies the dynamic optimization ability of the model to its reasoning path.

[0060] Step(n+1): The model logically integrates and induces all intermediate steps to generate the final answer of the question, and thus forms a complete and explainable reasoning chain.

[0061] As can be seen, in the scheme provided by the embodiments of the application, different random seeds or temperature parameters are set for each input question to prompt it to start from different angles and multiple thinking paths, and to construct reasoning chains with different styles but logical coherence. The generated reasoning chain adopts a structured step-by-step expression manner, has a clear logical progressive structure, is convenient for subsequent error positioning and chain correction operations, and is helpful to improve the explainability of the training data and the reasoning transparency of the model.

[0062] Third Embodiment

[0063] The third embodiment of the application relates to a training data synthesis method based on error extrapolation and reasoning chain analysis. The third embodiment is an improvement based on the first embodiment, and the specific improvement is that in the third embodiment of the application, a specific implementation of identifying reasoning chain errors based on graph structure modeling and error propagation analysis is provided, that is, step S3 can further include the following steps:

[0064] Step S301: A directed acyclic graph corresponding to the reasoning chain is constructed, and each node in the directed acyclic graph represents a reasoning step and an intermediate reasoning result thereof, and each edge represents a causal dependency relationship between two reasoning steps.

[0065] For each reasoning chain generated by the small language model in step S2, the system structures it into a directed acyclic graph. In the graph, each node represents a reasoning step and its corresponding intermediate reasoning result, and each directed edge represents the dependency relationship between reasoning steps. For example, if the reasoning of step2 depends on the output result of step1, a directed edge is established from step1 to step2 in the graph. The upstream and downstream causal paths between the reasoning steps can be explicitly modeled through the graph structure.

[0066] Step S302: Based on the directed acyclic graph, the overall error score of each reasoning chain is calculated, and the overall error score is used to evaluate the influence degree of the potential error node in the reasoning chain on the subsequent nodes depending on it.

[0067] Specifically, step S302 can further include the following steps:

[0068] Step S3021: For each node in the directed acyclic graph, the intermediate reasoning result of the node is generated by multiple samplings, and the average confidence of the node is calculated based on the confidence of each sampling result.

[0069] Each time a sample reasoning is performed on the same problem, the resulting reasoning chain may be slightly different, thus constructing multiple directed acyclic graphs. In these different directed acyclic graphs, if a certain logical node (i.e., a specific intermediate reasoning step) appears in multiple graphs, even though its upstream path or expression details may be slightly different, it can be considered to represent a "logically equivalent" step. After evaluating the confidence values ​​of the reasoning results of this logical node in multiple directed acyclic graphs, taking the average value, we can obtain the average confidence of the node under various contextual perturbations. The calculation formula is:

[0070]

[0071] in, Representation node The average of confidence levels across multiple rounds of sampling; Represents the node corresponding to a certain reasoning step in the directed acyclic graph; Indicates the number of sampling times; Indicates the Inference chain generated by subsampling; Indicates in In the subsampling, the language model is used to calculate the node The confidence value of the generated result.

[0072] The system can calculate the confidence value using a confidence perception method based on adversarial perturbation evaluation. That is, in the process of generating an inference chain using a small language model, a small noise perturbation (such as Gaussian perturbation or perturbation based on the adversarial gradient direction) is introduced into the most recent hidden layer before outputting the answer, and the output results before and after the perturbation are observed to calculate the confidence value.

[0073] The higher the average value, the more "confident" the model is in the reasoning step, and the more stable the node is under different reasoning paths, which can be used as an indicator of node stability or step credibility.

[0074] Step S3022: Calculate the consistency of the node's answer based on the semantic difference between the intermediate reasoning results generated by multiple samplings.

[0075] For the inference chain generated by multiple sampling, for the same nodes that appear in it , which can extract the corresponding intermediate inference results in different samples By calculating the semantic difference between these results, the answer consistency score of the node is constructed, and the calculation formula is:

[0076]

[0077] in, Representation node Response consistency score; Indicates that the node The number of answers obtained by multiple sampling; Indicates the Subsampling generated nodes The intermediate reasoning answer; Indicates the The function of the semantic difference between the intermediate answer generated by the m-th sampling can be implemented based on the cosine distance calculation method of semantic embedding; Represents a normalization factor used to normalize the sum of all pairwise differences to an average value between 0 and 1.

[0078] The closer the score is to 1, the more consistent the results generated by the node in different reasoning paths, and the higher the reasoning stability. If the score is low, it means that the node may have potential problems of logical instability or semantic ambiguity, which helps to identify error-prone nodes in the reasoning chain.

[0079] Step S3023: Calculate the node confidence consistency based on the fluctuation range of the confidence score corresponding to each sampling.

[0080] For a node in the reasoning chain , under different sampling paths, the node will correspond to multiple confidence scores output by the language model. If these confidence scores are close in multiple sampling paths, it means that the node reasoning is stable and the credibility is high; otherwise, it means that the node may have logical uncertainty or semantic fluctuations. Node The confidence consistency score can be calculated as follows:

[0081]

[0082] in, Representation node The confidence consistency score of ; L represents the number of sampling times; Indicates that the language model Nodes in subsampling Confidence output of Representation node The average of the confidence scores across all sampled paths.

[0083] The closer the score value is to 1, the smaller the confidence fluctuation is and the higher the node reasoning stability is; the smaller the value is, the more unstable the reasoning process is at that node, which may be a potential source of error propagation.

[0084] Step S3024: Based on the average confidence, answer consistency and confidence consistency, a dynamic confidence score of the node is generated by fusion.

[0085] Based on the three indicators obtained in the preceding steps: average confidence, answer consistency, and confidence consistency, any node in the reasoning graph is assigned a dynamic confidence score The dynamic confidence score of the node is calculated. The score is used to measure the stability and credibility of the node under multi-path disturbance. The dynamic confidence score of the node is defined as:

[0086]

[0087] wherein, represents the dynamic confidence score of the node ; represents the average confidence of the node ; represents the answer consistency of the node ; represents the confidence consistency of the node .

[0088] The three indicators are multiplied to form a comprehensive measurement value. The higher the value, the more stable and credible the node performs in the reasoning graph, and the less likely it is to be a source node that triggers downstream errors; on the contrary, when the value is low, it may indicate that the node is a potential source of reasoning errors.

[0089] Step S3025: The dynamic confidence scores of the nodes in the reasoning chain are summarized as the overall error score of the reasoning chain.

[0090] Specifically, step S3025 can further include the following steps:

[0091] Step S30251: Based on the dynamic confidence scores of the nodes in the directed acyclic graph, nodes with dynamic confidence scores lower than a pre-set confidence threshold are identified to determine potential error nodes in the reasoning chain;

[0092] Step S30252: Based on the dependency structure of each potential error node in the directed acyclic graph, an error propagation path associated with the potential error node is constructed;

[0093] Step S30253: Each affected node in the error propagation path is assigned a weight, which is normalized according to the graph level depth and out-degree information of the affected node relative to the potential error node, to reflect the attenuation trend of the error along the path;

[0094] Step S30254: Based on the dynamic confidence score of each affected node and the corresponding weight, a weighted cumulative operation is performed to obtain the overall error score of the potential error node.

[0095] Specifically, for the directed acyclic graph corresponding to the inference chain, the system traverses all nodes in the graph to determine whether the dynamic confidence score of a node is lower than a preset confidence threshold. If the dynamic confidence score of a node is lower than the preset confidence threshold, the node is marked as a potential error node . For each potential error node , the system identifies, based on the edge structure of the directed acyclic graph, a set of all subsequent nodes that depend on the node and constructs an error propagation path. For each affected node in the error propagation path, a propagation weight is calculated, and the calculation formula of the propagation weight is as follows:

[0096]

[0097] wherein a represents a depth diffusion factor, which is a constant greater than 1 and is used to control the attenuation or amplification of the error when it propagates from the root node to the subsequent nodes. The greater the value, the smaller the weight of the nodes deeper in the propagation path, which reflects the assumption that the error closer to the source has a greater impact; represents the hierarchical depth of the node relative to in the graph, that is, the number of edges crossed in the path; represents the out-degree of the node , that is, the number of subsequent nodes directly dependent on the node.

[0098] The denominator is a normalization factor, that is, the sum of all affected nodes according to the same rule, to ensure that all weights satisfy the normalization: .

[0099] The weight allocation mechanism considers two factors: one is the propagation distance of the node from the root error node (controlled by exponential attenuation); the other is the connectivity or influence range of the node in the graph structure (reflected by the out-degree). Through this mechanism, the system can more reasonably depict the influence degree of the potential error node on different nodes in the entire inference chain. This provides a basis for subsequent calculation of the overall error score of the potential error node.

[0100] The system calculates the overall error score of the potential error node by combining the dynamic confidence score of each affected node in the propagation path with the corresponding propagation weight , and the calculation formula is as follows:

[0101]

[0102] wherein represents the potential error node identified; represents all subsequent nodes ​a successor node set of the successor node; representing any one of the affected nodes in is a weight coefficient, representing the degree of influence of .

[0103] Step S303: From the plurality of reasoning chains, select the reasoning chain with the highest overall error score as the to-be-corrected reasoning chain.

[0104] For the plurality of reasoning chains generated by the small language model, the overall error score corresponding to each reasoning chain is calculated respectively, and then the overall error scores of all reasoning chains are compared, and the reasoning chain with the highest overall error score is selected as the current to-be-corrected reasoning chain. The selection strategy is based on the following considerations: the higher the overall error score of the reasoning chain, the greater the potential error influence range and the more extensive error propagation, and preferential correction will significantly improve the correctness of the final answer and the overall performance of the system.

[0105] As can be seen, in the scheme provided by the embodiments of the present application, by introducing the reasoning chain overall error evaluation mechanism based on dynamic confidence score, the logical path with the widest error influence range and the highest error propagation degree can be preferentially identified among the plurality of candidate reasoning paths, and the positioning ability of the system for the complex reasoning failure reason is significantly improved. The mechanism comprehensively considers the confidence level, semantic consistency and confidence stability of the reasoning node and combines the hierarchical depth and out-degree information of the error node to construct the overall error score for measuring the propagation strength of the error to the subsequent nodes, and realizes the accurate quantitative evaluation of the potential key error node. Based on the error score strategy, the system can preferentially correct the reasoning chain with the most interference, thereby improving the overall accuracy and robustness of the generated reasoning process, avoiding repeated attempts without difference among multiple error paths, and optimizing the filtering efficiency of the reasoning chain and the priority ranking of the answer correction.

[0106] It should be noted that the third embodiment of the present application can also be an improvement based on any one or more of the first embodiment to the second embodiment.

[0107] Fourth Embodiment

[0108] The fourth embodiment of the present application relates to a training data synthesis method based on error extrapolation and reasoning chain analysis. The fourth embodiment is an improvement based on the first embodiment, and the specific improvement is that in the fourth embodiment of the present application, a performance change rate driven iteration termination mechanism is provided, that is, step S6 can further include the following steps:

[0109] Step S601: After completing the model fine-tuning training in each round, the current round of small language model is used to perform a test task on the preset task evaluation set to obtain the performance indicator score of the current round.

[0110] Step S602: The performance indicator score of the current round is compared with the performance indicator score of the last round, and the change rate of the performance indicator is calculated.

[0111] Step S603: It is judged whether the change rate of the performance indicator is less than the preset change rate threshold. If yes, step S604 is executed: terminate the iterative optimization process of the current task sample, and output the new task sample of the current round as the final task sample; if not, continue to perform the sampling inference, error scoring, answer correction and model fine-tuning process of the next round.

[0112] Specifically, after completing the partial parameter fine-tuning training of the small language model in each round, the updated small language model of the current round is used to perform an evaluation test on the preset task evaluation set to obtain the model performance indicator score of the round. The performance indicators can include but are not limited to F1 score, recall, ROC-AUC value, etc. The performance indicator score of the current round is compared with the performance indicator score of the last round, and the change rate of the performance indicator is calculated as a basis for measuring the improvement trend of the model capability.

[0113] It is judged whether the change rate of the performance indicator is less than the preset change rate threshold (for example, set to 0.5%, 1.0%, etc.). If the condition is met, it means that the model performance tends to be stable and enters the convergence phase, and step S604 is executed; otherwise, the sampling inference, error scoring, answer correction and fine-tuning process of the small language model of the next round are continued.

[0114] It can be found that in the scheme provided by the embodiments of the present application, the dynamic termination mechanism based on the change rate of the performance indicator is introduced in the data synthesis iteration process, which realizes the fine control of the training sample optimization process and the adaptive adjustment of the data quality. This mechanism effectively avoids the sample redundancy and overfitting risk caused by blind iteration, ensures that each round of data update is driven based on actual performance gain, and improves the efficiency and scientificity of data optimization.

[0115] It should be noted that the fourth embodiment of the present application can also be an improvement based on any one or more of the first to third embodiments.

[0116] Fifth Embodiment

[0117] The fifth embodiment of the present application relates to a training data synthesis method based on error extrapolation and reasoning chain analysis. The fifth embodiment is an improvement based on the first embodiment, and the specific improvement is that in the fifth embodiment of the present application, a specific implementation of semantic reconstruction for large language models is provided, that is, step S4 can further include the following steps:

[0118] Step S401: Express each reasoning step in the to-be-corrected reasoning chain in a natural language form in series to construct a reasoning chain input sequence for context understanding;

[0119] Step S402: Splice the reasoning chain input sequence with the question in the task sample to form an input context for a large language model;

[0120] Step S403: Control the large language model to retain the effective logical structure in the to-be-corrected reasoning chain during generation, and rewrite the potential error content in the to-be-corrected reasoning chain to generate a corrected answer with coherent semantics and logical reasoning, and output.

[0121] Specifically, each reasoning step may originally be presented in the form of code, expression, or templated text. Each reasoning step in the to-be-corrected reasoning chain is described in a natural language form in series to form a coherent and readable reasoning chain input sequence, which facilitates global modeling and semantic understanding of the context by the large language model.

[0122] After constructing the reasoning chain input sequence, splice it with the question in the original task sample to form a unified input context. This context can be used to guide the large language model to understand the logical relationship between the original question background and the existing reasoning path. After completing the context construction, the system controls the large language model to conditionally generate the above input, requiring the model to retain the effective logical structure in the original reasoning chain while logically rewriting and semantically correcting the potential error content. The control mechanism can include: a prompt template (“Please point out whether there is a logical error in the above reasoning, and provide a more reasonable reasoning process”); limit the model output structure and input format to be consistent, retain the naming and value association of intermediate variables; use the retain-rewrite mechanism to retain as many intermediate steps as possible and only adjust the error path. In this way, not only the order error in the original reasoning is corrected, but also the reusability of part of the intermediate results is maintained, avoiding unnecessary rewriting of the correct part, thereby more effectively improving the data sample quality.

[0123] It can be found that, in the scheme provided by the embodiments of the present application, the reasoning chain to be corrected is expressed in the form of natural language and concatenated to form a unified context input by splicing with the task question, which can fully stimulate the understanding ability of the large language model to the global semantics and logical structure. In the generation process, the model controls to retain the effective reasoning path and only performs directional rewriting on the potential error link, which not only effectively avoids the redundant disturbance to the correct part, but also significantly improves the semantic coherence and logical rationality of the generated answer. Compared with the traditional data cleaning and sentence replacement method, the embodiment introduces a structured context-driven correction mechanism, so that the training sample can realize high-quality updating of semantic information while maintaining the stability of the original problem representation structure, and significantly improve the availability and generalization ability of the training data set.

[0124] It should be noted that the fifth embodiment of the present application can also be an improvement based on any one or more of the first to fourth embodiments.

[0125] The step division of the above methods is only for the purpose of clear description, and in implementation, one step can be combined or some steps can be split and decomposed into multiple steps, as long as the same logical relationship is included, and all are within the protection scope of the present application; adding insignificant modifications or introducing insignificant designs in the algorithm or process, but not changing the core design of the algorithm and process, are within the protection scope of the present application.

[0126] In addition, some embodiments of the present application also provide an electronic device. The electronic device can be various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and the like. The electronic device can also be various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices.

[0127] The electronic device includes one or more processors and a memory storing computer program instructions that, when executed, cause the processor to perform a training data synthesis method based on error extrapolation and reasoning chain analysis as provided by any one or more of the above embodiments. Figure 2An exemplary configuration of the electronic device is disclosed. The electronic device includes one or more processors 1101, a memory 1102, and an interface for connecting the components, including a high-speed interface and a low-speed interface. The components are interconnected through different buses, and can be mounted on a common main board or otherwise installed as needed. The processor can process instructions executed within the electronic device, including instructions stored in the memory or on the memory to display a GUI on an external input / output device such as a display device coupled to the interface. In some other embodiments, a plurality of processors and / or buses can be used with a plurality of memories and a plurality of memory, if necessary. Also, a plurality of electronic devices can be connected, each device providing part of the necessary operations. Among them, the components shown herein, their connections and relationships, and their functions are merely examples, and are not intended to limit the implementation of the present application described and / or claimed herein.

[0128] The electronic device can further include an input device 1103 and an output device 1104. The processor 1101, the memory 1102, the input device 1103, and the output device 1104 can be connected through a bus or otherwise, Figure 2 The connection through the bus is taken as an example in the middle.

[0129] The input device 1103 can receive input digital or character information, and generate key signal input related to user settings and function control of the electronic device, such as a touch screen, a keypad, a mouse, a trackpad, a touchpad, a pointing stick, one or more mouse buttons, a trackball, a joystick, etc. The output device 1104 can include a display device, an auxiliary lighting device (e.g., an LED), and a tactile feedback device (e.g., a vibration motor), etc. The display device can include, but is not limited to, a liquid crystal display, a light-emitting diode display, and a plasma display. In some embodiments, the display device can be a touch screen.

[0130] To provide interaction with the user, the electronic device can be a computer. The computer has a display device (e.g., a cathode ray tube or an LCD monitor) for displaying information to the user, and a keyboard and a pointing device (e.g., a mouse) through which the user can provide input to the computer. Other kinds of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback); and input from the user can be received in any form (e.g., voice input or tactile input).

[0131] In the embodiments of the present application, the computer readable medium stores computer programs / instructions, and the computer programs / instructions are executed by the processor to implement the method for training data synthesis based on error extrapolation and reasoning chain analysis provided by any one or more of the above embodiments. The computer readable medium can be included in the electronic device described in the above embodiments, or can exist separately and not be assembled into the device. The computer readable medium carries one or more computer readable instructions.

[0132] The memory 1102 can be used to store non-transitory software programs, non-transitory computer executable programs and modules as a kind of non-transitory computer readable storage medium. The processor 1101 executes various functions and data processing of the server by running the non-transitory software programs, instructions and modules stored in the memory 1102, so as to implement the program instructions / modules corresponding to the method provided by any one or more of the above embodiments in the embodiments of the present application.

[0133] The memory 1102 can include a program storage area and a data storage area. The program storage area can store an operating system and at least one application required by a function. The data storage area can store data created according to the use of the electronic device. In addition, the memory 1102 can include a high-speed random access memory, and can also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state memory device. In some embodiments, the memory 1102 can optionally include a memory remotely arranged with respect to the processor 1101, and these remote memories can be connected to the electronic device through a network. Examples of the above network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0134] It should be noted that the computer readable medium described in the present application can be a computer readable signal medium or a computer readable storage medium or any combination of the above two. The computer readable medium may, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared or semiconductor system, device or component, or any combination of the above. More specific examples of computer readable storage media can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory, an optical fiber, a portable compact disk read-only memory, an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, the computer readable medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or component.

[0135] Computer-readable media includes permanent and non-permanent, movable and non-movable media that can be implemented by any method or technology for information storage. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase-change memory, static random access memory, dynamic random access memory, other types of random access memory, read-only memory, electrically erasable programmable read-only memory, flash memory or other memory technologies, read-only optical discs, digital versatile discs or other optical storage, magnetic cassette tapes, magnetic tape discs storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device.

[0136] Computer program code for carrying out operations of the present application can be written in one or more programming languages or combinations of languages including object-oriented, such as Java, Smalltalk, C++, conventional procedural programming languages, such as the C programming language or similar programming languages. Program code can be executed entirely on a user computer, partially on a user computer, as a standalone software package, partially on a user computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user computer through any kind of network, including a local area network or a wide area network, or can be connected to an external computer (for example, through the Internet using an Internet service provider).

[0137] In the above embodiments, all or part can be implemented by software, hardware, firmware or any combination thereof. For example, a dedicated integrated circuit, a general-purpose computer or any other similar hardware device can be used. In some embodiments, the software program of the present application can be executed by a processor to implement the above steps or functions. Similarly, the software program of the present application (including related data structures) can be stored in a computer-readable recording medium, such as RAM memory, magnetic or optical drive or soft disc and similar devices. In addition, some steps or functions of the present application can be implemented by hardware, for example, as a circuit cooperating with the processor to perform each step or function.

[0138] The computer program product provided in the embodiments of the present application includes one or more computer programs / instructions that, when executed by a processor, fully or partially produce the processes or functions described in accordance with the embodiments of the present application. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive).

[0139] The flowcharts or block diagrams in the accompanying drawings illustrate the possible architectures, functions and operations of the devices, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, program segment or part of code, and the module, program segment or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, as well as the combination of boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-specific system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0140] The scope of this application is defined by the appended claims rather than the foregoing description and is therefore intended to encompass within this application all changes that come within the meaning and range of equivalents of the claims. Any reference signs in the claims should not be construed as limiting the claims to which they relate. In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in a device claim may also be implemented by one unit or device through software or hardware. Words such as "first" and "second" are only used to distinguish the description and do not indicate any particular order, nor should they be understood as indicating or implying relative importance.

[0141] The above merely provides specific examples of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical scope disclosed by the present application, which should be covered by the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims, and the above examples should be regarded as exemplary and non-limiting.

Claims

1. A training data synthesis method based on error extrapolation and inference chain analysis, characterized in that: include: Acquire an initial sample set, wherein the initial sample set includes a plurality of task samples, each of the task samples includes at least one question; Using a small language model to perform multiple sampling reasoning on the questions of each task sample, generating corresponding multiple reasoning chains; Calculating an overall error score for each of the reasoning chains based on a preset error evaluation rule, and determining the reasoning chain with the largest overall error score as the reasoning chain to be corrected; Inputting the to-be-corrected reasoning chain and the question in the corresponding task sample into the large language model to generate a corrected answer; The question and the corrected answer constitute a new task sample, and the new task sample is used to fine-tune some parameters of the small language model to improve the model's answering ability; Repeat the sampling inference, error scoring, answer correction, and model fine-tuning process until the rate of change of the performance indicator of the small language model on the preset task evaluation set is lower than the preset rate of change threshold. Then terminate the above iterative process and output the new task sample generated in the last round as the final task sample. A plurality of the final task samples are combined into a training sample set for performing full parameter fine-tuning training on the small language model.

2. The training data synthesis method according to claim 1, characterized in that The step of performing multiple sampling reasoning on the questions of each task sample using the small language model to generate corresponding multiple reasoning chains includes: The same question in the task sample is input into the small language model multiple times to trigger its generation diversity mechanism, thereby generating multiple semantically different but structurally consistent reasoning chains, wherein each of the reasoning chains consists of the same number of reasoning steps with the same logical structure, each reasoning step has a preset logical progressive order, and each reasoning step corresponds to an intermediate reasoning result.

3. The training data synthesis method according to claim 1, characterized in that The step of calculating the overall error score of each of the reasoning chains based on a preset error evaluation rule and determining the reasoning chain with the largest overall error score as the reasoning chain to be corrected includes: Constructing a directed acyclic graph corresponding to the reasoning chain, wherein each node in the directed acyclic graph represents an inference step and its intermediate inference result, and each edge represents a causal dependency relationship between two inference steps; Calculating an overall error score for each of the inference chains based on the directed acyclic graph, wherein the overall error score is used to evaluate the degree of impact of a potential error node in the inference chain on subsequent nodes that depend on it; From the multiple reasoning chains, the reasoning chain with the highest overall error score is selected as the reasoning chain to be corrected.

4. The training data synthesis method according to claim 3, characterized in that: The step of calculating the overall error score of each of the inference chains based on the directed acyclic graph comprises: For each node in the directed acyclic graph, generate an intermediate inference result of the node through multiple samplings, and calculate an average confidence of the node based on the confidence of each sampling result; Calculating the consistency of the answer of the node based on the semantic difference between the intermediate reasoning results generated by multiple samplings; Calculating the confidence consistency of the node based on the fluctuation range of the confidence score corresponding to each sampling; Based on the average confidence, the answer consistency and the confidence consistency, a dynamic confidence score of the node is generated by fusion; The dynamic confidence scores of the nodes in the reasoning chain are aggregated to serve as the overall error score of the reasoning chain.

5. The training data synthesis method according to claim 4, characterized in that: The step of aggregating the dynamic confidence scores of the nodes in the inference chain as the overall error score of the inference chain includes: Based on the dynamic confidence scores of the nodes in the directed acyclic graph, identifying the nodes whose dynamic confidence scores are lower than a preset confidence threshold, so as to determine them as potential error nodes in the reasoning chain; Constructing an error propagation path associated with each potential error node based on a dependency structure of the potential error node in the directed acyclic graph; Assigning a weight to each affected node in the error propagation path, wherein the weight is normalized according to the hierarchical depth and out-degree information of the affected node relative to the potential error node in the graph to reflect the attenuation trend of the error propagation along the path; Based on the dynamic confidence score of each affected node and the corresponding weight, a weighted accumulation operation is performed to obtain the overall error score of the potential error node.

6. The training data synthesis method according to claim 1, characterized in that: The steps of repeatedly performing the sampling inference, error scoring, answer correction, and model fine-tuning processes until the rate of change of the performance indicator of the small language model on the preset task evaluation set is lower than a preset rate of change threshold, terminating the above iterative process, and outputting the new task sample generated in the last round as the final task sample include: After completing model fine-tuning training in each round, the small language model of the current round is used to perform test tasks on the preset task evaluation set to obtain the performance indicator score of the current round; Comparing the performance indicator score of the current round with the performance indicator score of the previous round, and calculating the change rate of the performance indicator; Determine whether the rate of change of the performance indicator is less than the preset change rate threshold. If so, terminate the iterative optimization process of the current task sample and output the new task sample of the current round as the final task sample; if not, continue to execute the next round of sampling reasoning, error scoring, answer correction and model fine-tuning process.

7. The training data synthesis method according to claim 1, characterized in that: The step of inputting the to-be-corrected reasoning chain and the question in the corresponding task sample into the large language model to generate a corrected answer includes: Expressing each reasoning step in the to-be-corrected reasoning chain in series in natural language to construct a reasoning chain input sequence for context understanding; Concatenate the inference chain input sequence with the question in the task sample to form an input context for a large language model; The large language model is controlled to retain the valid logical structure in the to-be-corrected reasoning chain during the generation process, and to rewrite the potential erroneous content in the to-be-corrected reasoning chain to generate and output a semantically coherent and logically reasonable corrected answer.

8. An electronic device, characterized in that: The electronic device comprises: One or more processors; and a memory storing computer program instructions, wherein when the computer program instructions are executed, the processor executes the training data synthesis method based on error extrapolation and inference chain analysis according to any one of claims 1 to 7.

9. A computer-readable storage medium having a computer program and / or instructions stored thereon, characterized in that: When the computer program and / or instructions are executed by a processor, the training data synthesis method based on error extrapolation and inference chain analysis according to any one of claims 1 to 7 is implemented.

10. A computer program product comprising a computer program and / or instructions, characterized in that When the computer program and / or the instructions are executed by a processor, the training data synthesis method based on error extrapolation and inference chain analysis as described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Model distillation method and system based on teacher model and situational reasoning

    CN119539011A

  • Natural language question and answer framework, method and device based on self-reflection

    CN120011491A