Multi-source verification-based large model inference error detection and first error positioning intervention method

By using multi-source verifiers and step-level conflict index calculations, combined with automatic intervention operations, the problems of dependence on reference solutions and single verification mechanisms in existing inference methods are solved. This enables precise location and repair of inference errors without reference solutions, improving the flexibility and interpretability of the inference system.

CN122133829APending Publication Date: 2026-06-02BEIJING KNOWLEDGE ATLAS TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING KNOWLEDGE ATLAS TECHNOLOGY CO LTD
Filing Date
2026-03-03
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing inference methods rely too heavily on reference solutions, making it difficult to effectively correct errors in the absence of standard solutions. They also lack the fusion of multi-source verification signals, and lack efficient strategies for inference error localization and intervention, making it impossible to perform effective intervention and error repair in the absence of standard solutions.

Method used

By replacing the standard solution with a multi-source validator and combining step-level conflict index with credibility calculation, a suitable intervention strategy is generated through a set of intervention operations (such as replacement, insertion, deletion, and rearrangement) to accurately locate the first error point in the inference chain and effectively repair it.

Benefits of technology

It achieves accurate positioning and automatic correction of the inference chain without a reference solution, improving the flexibility, stability and interpretability of the inference process, and enhancing the adaptability and automation level of the inference system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122133829A_ABST
    Figure CN122133829A_ABST
Patent Text Reader

Abstract

This invention belongs to the field of artificial intelligence technology and relates to a method for error detection and first-error localization intervention in large-scale model inference based on multi-source verification. The method includes: S1: obtaining the inference chain based on the task input; S2: constructing a set of verification signals; S3: verifying the inference steps and obtaining verification output; S4: calculating confidence and conflict indices based on the verification output; S5: setting a conflict threshold and determining the first error point; S6: generating a set of candidate interventions based on the conflict source for the first error point and selecting the final intervention; S7: updating the inference chain based on the final intervention to form a new inference chain; S8: repeating steps S3-S7 based on the new inference chain until a termination condition is met; S9: constructing patched training samples based on the final execution results and performing patched supervised fine-tuning on the large model. This method not only enables effective error localization and correction without a reference solution but also enhances the flexibility and scalability of the inference optimization process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of artificial intelligence technology and relates to a method for error localization and correction in the reasoning process of large models, especially an intervention method for error detection and first-error localization in large model reasoning based on multi-source verification. Background Technology

[0002] With the rapid development of artificial intelligence and large language model technology, especially the application of large pre-trained models (such as the GPT series and GLM series), error localization and correction in reasoning tasks has become a technical challenge in many fields. In many reasoning tasks, traditional methods rely on reference solutions (standard solutions) to verify each step of the reasoning process. However, in real-world applications, there are often no standard solutions available for reference, especially in complex reasoning tasks such as mathematical proofs, code repair, and natural language reasoning. This makes it difficult to effectively identify and correct errors in the reasoning chain, thus affecting the accuracy and stability of the reasoning results.

[0003] Specifically, the existing technical solutions have the following prominent technical problems: 1. Existing reasoning methods rely too heavily on reference solutions, making it difficult to effectively correct errors when there is no standard solution.

[0004] Currently, inference systems generally rely on standard solutions to verify and correct inference chains. However, in many practical applications, standard solutions are difficult to obtain or do not exist. This reliance limits the flexibility and robustness of inference systems in the absence of standard solutions, resulting in a significant reduction in the accuracy and stability of inference results, especially in the absence of reference solutions.

[0005] 2. Existing inference verification mechanisms are too simplistic and lack the fusion of multi-source verification signals.

[0006] Current inference optimization methods often rely on a single verification signal, such as rule verification or tool verification, lacking multi-dimensional verification of each step in the inference chain, thus failing to effectively capture potential errors. Furthermore, existing methods lack self-consistency verification, which can easily lead to errors in the inference process not being detected and corrected in a timely manner.

[0007] 3. There is a lack of efficient strategies for locating and intervening in reasoning errors.

[0008] In existing inference optimization methods, strategies for locating and intervening in inference errors often lack a systematic approach. Most existing technologies can only correct known errors, lacking effective mechanisms for identifying and intervening in unknown errors within the inference chain. This makes it difficult to accurately locate and correct errors during the inference process, impacting the quality of the inference results.

[0009] 4. Existing reasoning systems are unable to perform effective intervention operations and error correction when there is no standard solution.

[0010] While existing inference systems can improve inference results through corrective measures (such as replacing or removing erroneous steps), these corrective actions typically rely on experience or external tools in the absence of a standard solution, lacking flexible and automated error intervention mechanisms. Intervention actions in existing technologies are usually fixed and cannot automatically generate appropriate intervention strategies based on different error types in the inference chain.

[0011] Therefore, given the technical deficiencies of existing technologies, a new method for error localization and correction in the reasoning process is needed. Summary of the Invention

[0012] To address the problems existing in the prior art, this invention proposes a large-scale model inference error detection and first-error localization intervention method based on multi-source verification. It is an inference optimization method without a reference solution. By introducing a multi-source verifier to replace the standard solution and combining step-level conflict index and credibility calculation, it achieves dynamic verification and automatic correction of each inference step in the inference chain. By generating a set of intervention operations (such as replacement, insertion, deletion, and rearrangement), a suitable intervention strategy is generated to quickly correct errors in the inference chain. This method does not rely on a standard solution and can accurately locate the first error point in the inference chain without a reference solution, and effectively repair it through intervention strategies.

[0013] To achieve the above objectives, the present invention provides the following technical solution: A method for error detection and first-error localization intervention in large-scale model inference based on multi-source verification, characterized by the following steps: S1: Obtain the task input to be reasoned, and use the large model based on the task input to obtain a reasoning chain containing a series of reasoning steps; S2: Construct a set of verification signals; S3: For each reasoning step in the inference chain, the verification signal set is called to perform verification, and the verification output of that step is obtained; S4: Based on the verification output, calculate the credibility and conflict index of each reasoning step in the reasoning chain; S5: Set a conflict threshold, and determine the first error point in the inference chain based on the conflict threshold and the conflict index; S6: For the first error point, generate a set of candidate interventions based on the source of conflict and select the final intervention from the set of candidate interventions based on the credibility and conflict index; S7: Update the inference chain based on the final intervention to form a new inference chain; S8: Based on the new inference chain, repeat steps S3-S7 until the termination condition is met; S9: Construct patch training samples based on the final execution results and use the patch training samples to perform patch-supervised fine-tuning on the large model.

[0014] Preferably, in step S2, the set of verification signals includes at least one or more of the following verifiers: A rule validator is used to verify whether each reasoning step in the reasoning chain violates a rule in the rule base; Tool verifiers are used to verify the correctness of each reasoning step in the inference chain by calling external tools; A self-consistent verifier is used to obtain multiple inference chains containing a series of inference steps using a large model based on the task input, and to verify the consistency of the semantic conclusions of the same inference step in the multiple inference chains.

[0015] Preferably, step S3 specifically includes: S31: For each reasoning step in the reasoning chain, call the rule validator to perform rule verification and obtain the rule pass rate for that step. :

[0016] In the formula, It is the first in the inference chain. One reasoning step The rule pass rate; It is the total number of rules in the rule base; It is the first in the rule base Rules; It is the first in the inference chain. One reasoning step Does it violate the rule in the rule base? Rules The indicated quantity, if violation ,but ,otherwise ; It is the first in the rule base The rule weight of each rule and ; S32: For each reasoning step in the reasoning chain, call the tool verifier to perform tool verification and obtain the tool pass rate. :

[0017] In the formula, It is the first in the inference chain. One reasoning step The tool's passability; It is the first in the inference chain. One reasoning step Error measurement during tool validation and ; It is a scaling factor and ; S33: For each reasoning step in the inference chain, call the self-consistency verifier to perform self-consistency verification and obtain the self-consistency pass rate. :

[0018] In the formula, It is the first in the inference chain. One reasoning step Self-consistency pass rate; It is the total number of the aforementioned inference chains; In all In the inference chain described in the first clause, the first clause will be... One reasoning step After matching or clustering the semantic conclusions, it belongs to the first The number of inference chains in each cluster; Indicates the first One reasoning step Among all clusters, find the cluster with the largest number of inference chains and take the number of inference chains in that cluster as a modulo 1. The ratio of .

[0019] Preferably, step S4 specifically includes: S41: Calculate the confidence level of each reasoning step in the inference chain. :

[0020] In the formula, It is the first in the inference chain. One reasoning step Credibility; These are preset weights or weights obtained through training. It is the Sigmoid function; S42: Calculate the conflict index for each reasoning step in the inference chain. :

[0021]

[0022] In the formula, It is the first in the inference chain. One reasoning step Conflict indicators; , and These are the first in the inference chain. One reasoning step The rule conflict sub-items, tool conflict sub-items, and self-consistency sub-items; + + and , and All are greater than or equal to 0.

[0023] Preferably, step S5 specifically includes: S51: Set the collision threshold ; S52: Randomly compare the conflict index of each reasoning step in the reasoning chain with the conflict threshold from beginning to end. In comparison, the first one that is greater than the conflict threshold will be... Conflict indicators Corresponding reasoning steps It was determined to be the first error point in the inference chain.

[0024] Preferably, step S51 specifically involves setting the conflict threshold. :

[0025] In the formula, and Let be the mean and standard deviation of the conflict index for all reasoning steps in the inference chain, respectively. .

[0026] Preferably, step S6 includes: S61: Comparison The size of the validator is used to select the validator corresponding to the largest value as the dominant source of conflict, and its corresponding conflict evidence is extracted. These are the rule conflict sub-item, tool conflict sub-item, and self-consistency sub-item of the first error point in the inference chain, respectively. S62: The reasoning steps before the first error point in the reasoning chain. Reasoning steps corresponding to the first mistake The conflicting evidence is input into a large model to generate multiple candidate interventions; S63: For each candidate intervention Execute the candidate intervention To obtain the local update inference chain And based on the local update inference chain The first in The reasoning steps up to the first... Each reasoning step recalculates the credibility and conflict index to obtain the candidate intervention score:

[0027] In the formula, For the first One candidate intervention Candidate intervention scores; and These are the local update inference chains. The first in Credibility and conflict indicators of each reasoning step; For the weighting coefficient and ; S64: Select the candidate intervention with the highest candidate intervention score as the final intervention. :

[0028] Furthermore, this invention also provides a large model inference error detection and first-error localization intervention system based on multi-source verification, characterized in that it includes: The task input acquisition and inference chain generation module is used to acquire the task input to be inferred and to obtain an inference chain containing a series of inference steps based on the task input using a large model. The verification signal set construction module is used to construct the verification signal set; The verification module is used to call the verification signal set to verify each inference step in the inference chain and obtain the verification output of that step. A credibility and conflict index calculation module is used to calculate the credibility and conflict index of each reasoning step in the reasoning chain based on the verification output. The first error point localization module is used to set a conflict threshold and determine the first error point in the inference chain based on the conflict threshold and the conflict index. An intervention generation module is used to generate a set of candidate interventions for the first error point based on the source of conflict and to select the final intervention from the set of candidate interventions based on the credibility and conflict index. An intervention execution module is used to update the inference chain based on the final intervention to form a new inference chain; The termination condition judgment module is used to determine whether the termination condition is met. The training sample construction and supervised fine-tuning module is used to construct patch training samples based on the final execution results and to perform patch supervised fine-tuning on the large model using the patch training samples.

[0029] Furthermore, this invention also provides a large model inference error detection and first-error localization intervention device based on multi-source verification, characterized in that it includes: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the large model inference error detection and first-error localization intervention method based on multi-source verification as described above.

[0030] Finally, the present invention also provides a computer-readable storage medium having a computer program stored thereon, characterized in that, when the program is executed by a processor, it implements the steps of the large model inference error detection and first-error localization intervention method based on multi-source verification as described above.

[0031] Compared with existing inference optimization methods that rely on reference solutions for inference verification, the large-model inference error detection and first-error localization intervention method based on multi-source verification proposed in this invention is a reference-free inference optimization method. It replaces the reference solution with a multi-source verifier and performs dynamic verification and automatic intervention at each inference step of the inference chain. This not only breaks the dependence on standard solutions, but also has the following significant advantages in terms of accuracy, stability and interpretability of the inference process: (1) Shift from standard dependency resolution to multi-source verification-driven approach to achieve flexibility and scalability in inference optimization.

[0032] Traditional inference optimization methods typically rely on a standard solution (reference solution) to verify the correctness of the reasoning. This makes it impossible for the inference system to effectively identify and correct inference errors in the absence of a standard solution. In many practical applications, the lack of a standard solution renders existing methods inadequate for handling complex inference tasks.

[0033] This invention introduces a multi-source verifier to replace the reference solution, providing multi-dimensional inference verification methods, including rule verification, tool verification, and self-consistency verification. This method not only enables effective error localization and correction in the absence of a reference solution but also enhances the flexibility and scalability of the inference optimization process. The inference system can automatically select appropriate intervention operations based on the credibility and conflict indicators of each inference step, significantly improving the system's adaptability and versatility across different tasks and scenarios.

[0034] (2) From single verification to multi-dimensional verification and automatic intervention, to achieve accurate location and repair of reasoning errors.

[0035] Existing inference optimization methods often rely on a single verification mechanism (such as tool verification or rule checking), which is prone to missing potential errors when faced with complex inference tasks. Especially in multi-step inference processes, errors may occur in the middle of the inference chain, and a single verification signal is insufficient to accurately capture the root cause of the error.

[0036] This invention, through step-level conflict indices and credibility calculations combined with a multi-source verification mechanism, can comprehensively and accurately verify each inference step, automatically locate errors in the inference process, and generate targeted intervention operations (such as replacement, insertion, deletion, and rearrangement). This combination of multi-dimensional verification and automatic intervention makes the location and correction of inference errors more accurate and significantly improves the stability and consistency of the inference results.

[0037] (3) From manual design to automated reasoning intervention, the reasoning process is optimized and automatically corrected.

[0038] Most existing inference optimization methods rely on manually set rules or predefined standard solutions for error correction. This reliance on manual design is not only inefficient but also lacks flexibility, making it difficult to cope with the varied situations in complex inference tasks.

[0039] This invention achieves fully automated optimization of the reasoning process by automatically calculating the credibility and conflict index of each reasoning step and combining it with a dynamically generated set of intervention operations. The system automatically generates appropriate intervention strategies based on each erroneous step in the reasoning chain, avoiding the inefficiency and limitations of manual intervention and significantly improving the automation level and engineering usability of the reasoning system.

[0040] (4) Improve the interpretability of the system and the credibility of the reasoning results by moving from “black box” reasoning to “explainable” reasoning process.

[0041] Existing inference systems often employ a black-box reasoning process when handling complex tasks, making it difficult for users to understand the reasons behind the inference results. This lack of interpretability not only reduces the system's reliability but also makes the optimization and debugging of the inference process challenging.

[0042] This invention quantifies and analyzes each step of the reasoning process through a mechanism of step-level conflict indices and credibility calculations, ensuring that every stage of the reasoning process is traceable and explainable. By combining multi-source validators and intervention operations, the system not only optimizes the reasoning results but also provides a clear reasoning path, making the reasoning process and results more transparent and explainable, thereby improving the system's credibility and user acceptance.

[0043] In summary, this invention significantly overcomes the bottlenecks of existing inference optimization methods, such as reliance on reference solutions, a single verification mechanism, and insufficient error localization and intervention strategies, by introducing innovative mechanisms such as multi-source verification, step-by-step conflict calculation, and automatic intervention. The reference-free inference optimization method not only enhances the flexibility and adaptability of the inference system but also improves the stability, accuracy, and interpretability of the inference results. Through this innovation, this invention achieves a significant upgrade in the intelligence level, automation capability, and engineering application capability of inference systems, possessing broad application prospects and industrial value. Attached Figure Description

[0044] Figure 1 This is a flowchart of the large model inference error detection and first-error localization intervention method based on multi-source verification of the present invention.

[0045] Figure 2 This is a schematic diagram of the structure of the large model inference error detection and first-error localization intervention system based on multi-source verification of the present invention.

[0046] Figure 3 This is a structural block diagram of the large model inference error detection and first-error localization intervention device based on multi-source verification of the present invention. Detailed Implementation

[0047] Before detailing any embodiment of the invention, it should be understood that the invention, in its application, is not limited to the details of the construction and arrangement of the components set forth in the following description or illustrated in the following figures. The invention can have other embodiments and can be practiced or carried out in various ways. Furthermore, it should be understood that the wording and terminology used herein are for descriptive purposes and should not be considered limiting. The use of “comprising” or “having” and variations thereof in this invention is intended to cover the items set forth below and their equivalents, as well as any additional items. Unless otherwise specified or limited, the terms “installation,” “connection,” “support,” and “linkage,” and variations thereof are used broadly and cover both direct and indirect installation, connection, support, and linking. Moreover, “connection” and “linkage” are not limited to physical or mechanical connections or links.

[0048] Furthermore, firstly, in the disclosure of this invention, the terms "longitudinal," "lateral," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, the above terms should not be construed as limiting this invention. Secondly, the term "a" should be understood as "at least one" or "one or more," that is, in one embodiment, the number of an element can be one, while in another embodiment, the number of the element can be multiple. The term "a" should not be construed as a limitation on the quantity.

[0049] Compared with existing technologies, this invention proposes a method for error detection and first-error localization intervention in large-scale model inference based on multi-source verification. This method is a reference-no-solution inference optimization approach that does not rely on a standard solution. It replaces the reference solution with multi-source verifiers (including rule verification, tool verification, and self-consistency verification). By calculating the credibility and conflict index of each inference step and combining it with a set of intervention operations (such as replacement, insertion, deletion, and rearrangement), errors in the inference chain can be located and corrected efficiently and automatically. This method not only breaks through the dependence on a standard solution but also enables efficient inference error correction in the absence of a reference solution, greatly improving the versatility and robustness of the inference system.

[0050] This invention proposes innovative technical solutions in the following aspects: 1. Inference optimization method without reference solution: Replace the reference solution with a multi-source validator, and optimize the inference chain by combining multi-dimensional signals such as rule verification, tool verification, and self-consistency verification during the inference process, so as to accurately locate and correct errors.

[0051] 2. Step-by-step conflict index and credibility calculation: By calculating the credibility and conflict index of each reasoning step in the reasoning chain, the system automatically selects the optimal intervention time and intervention strategy to ensure that the correction process of the reasoning chain is accurate and efficient.

[0052] 3. Flexible set of intervention operations: Through intervention operations such as replacement, insertion, deletion, and rearrangement, flexible correction strategies are provided for different types of errors, which significantly improves the correction capability of the inference system.

[0053] By introducing a multi-dimensional verification mechanism and a flexible error intervention method, this invention not only effectively solves the limitations of existing reasoning systems, but also provides stable and accurate error correction in complex reasoning tasks, promoting the application and development of reasoning technology in multiple fields.

[0054] Figure 1 A flowchart of the large model inference error detection and first-error localization intervention method based on multi-source verification of the present invention is shown. Figure 1 As shown, the large model inference error detection and first-error localization intervention method based on multi-source verification of the present invention includes the following steps: S1: Task input acquisition and inference chain generation.

[0055] Obtain the task input to be reasoned, and use a large model based on the task input to obtain a reasoning chain containing a series of reasoning steps.

[0056] In this invention, the first step is to obtain the task input to be reasoned. The task input It can be natural language text, mathematical problems, code snippets, etc., depending on the specific application scenario. For example: task input. It can be "proof" ", or a code snippet "for i in range(10)".

[0057] The second step is to generate the inference chain. This involves using a pre-trained model (e.g., the GPT series, GLM series, etc.) from the task input. A preliminary reasoning chain is generated. That is, a series of reasoning steps The inference chain The CCP One reasoning step.

[0058] Each reasoning step It refers to a specific step in the reasoning process of generating a large model, such as the specific steps in deriving an equation or the intermediate result of the code. This is part of the task input. It is "proof" In the case of "", the generated inference chain may contain something like "will Transformed into The reasoning steps of "".

[0059] Finally, candidate answers can be generated. Based on the generated inference chain, the pre-trained model can generate candidate answers. That is, the final result obtained through the reasoning chain. For example, in a mathematical proof task, the candidate answer might be " The final proof result of "".

[0060] S2: Construction of the verification signal set.

[0061] In this invention, the constructed set of verification signals includes at least one or more of the following verifiers: 1. Rule validator.

[0062] The rule validator is used to verify whether each reasoning step in the reasoning chain violates a rule in the rule base. Of course, the rule validator can also be used to verify whether the candidate answer violates a rule in the rule base.

[0063] The rules in the rule base may include logical constraint rules, format constraint rules, type constraint rules, domain rules, or consistency rules. For example, the rules in the rule base include: (1) Mathematical formula identity: for example, checking Does it conform to the commutative law of addition?

[0064] (2) Consistency of physical units: Check for unit mismatches, such as whether “1 kg” is incorrectly multiplied by “m”.

[0065] (3) Logical consistency: Check for logical conflicts in the reasoning process, such as Does the reasoning violate basic principles of logic?

[0066] 2. Tool Validator.

[0067] The tool verifier is used to verify the correctness of each reasoning step in the reasoning chain by invoking external tools. Of course, the tool verifier can also be used to verify the correctness of candidate answers by invoking external tools.

[0068] The external tools may include one or more of the following: compilers, unit testing frameworks, symbolic calculators, numerical calculators, retrieval systems, constraint solvers, or static analyzers, used to output verification results and error metrics related to each inference step. For example, a symbolic calculator (such as SymPy) can be used to verify the correctness of mathematical formula derivations, or a compiler (such as Python) can be used to verify whether the generated code has syntax errors.

[0069] In addition, the external tools may include external fact databases (such as Wikidata or other knowledge bases) for verifying the facts mentioned in the reasoning process.

[0070] 3. Self-consistent verifier.

[0071] The self-consistency verifier is used to obtain multiple inference chains containing a series of inference steps using a large model based on the task input, and to verify the consistency of the semantic conclusions of the same inference step in the multiple inference chains.

[0072] In this invention, the task input is... Multiple sampling is possible, meaning the task input can be... The input is processed multiple times in the pre-trained model to generate multiple inference chains. For example, the input... Next, generate A chain of reasoning, each chain of reasoning comprising a series of reasoning steps. .

[0073] At the same time, it is possible to Reasoning steps at the same position in the reasoning chain described in the first clause, for example, the first... One reasoning step The semantic conclusions are matched or clustered to form Clusters. For example, after 20 samplings, there are 20 inference chains. The semantic conclusions of the 5th inference step in these 20 inference chains are clustered into 3 clusters. Specifically, the semantic conclusions of the 5th inference step in 3 inference chains belong to cluster 1, the semantic conclusions of the 5th inference step in 5 inference chains belong to cluster 2, and the semantic conclusions of the 5th inference step in 12 inference chains belong to cluster 3. This facilitates self-consistency verification.

[0074] S3: Verification.

[0075] For each reasoning step in the inference chain, the verification signal set is invoked for verification to obtain the verification output of that step.

[0076] The verification specifically includes: 1. Rule validation.

[0077] For each reasoning step in the inference chain, the rule validator is invoked to perform rule verification, and the rule pass rate for that step is obtained. :

[0078] In the formula, It is the first in the inference chain. One reasoning step The rule pass rate; It is the total number of rules in the rule base; It is the first in the rule base Rules; It is the first in the inference chain. One reasoning step Does it violate the rule in the rule base? Rules The indicated quantity, if violation ,but ,otherwise ; It is the first in the rule base The rule weights of each rule can be preset as needed. .

[0079] 2. Tool verification.

[0080] For each reasoning step in the inference chain, the tool verifier is invoked to perform tool verification, and the tool pass rate is obtained. :

[0081] In the formula, It is the first in the inference chain. One reasoning step The tool's passability; It is the first in the inference chain. One reasoning step The error metric output during tool validation and ; It is a scaling factor, which can be preset as needed and .

[0082] Meanwhile, in this invention, if the external tool does not return an error measurement... If only success / failure is returned, then return success. When the return fails .

[0083] 3. Self-consistency verification.

[0084] For each reasoning step in the inference chain, the self-consistency verifier is invoked to perform self-consistency verification, and the self-consistency pass rate is obtained. :

[0085] In the formula, It is the first in the inference chain. One reasoning step Self-consistency pass rate; It is the total number of the aforementioned inference chains; In all In the inference chain described in the first clause, the first clause will be... One reasoning step After matching or clustering the semantic conclusions, it belongs to the first The number of inference chains in each cluster; Indicates the first One reasoning step Among all clusters, find the cluster with the largest number of inference chains and take the number of inference chains in that cluster as a modulo 1. The ratio of .

[0086] For example, in the example of step S2 above, =3、 =5、 =12, then .

[0087] S4: Calculation of credibility and conflict indicators.

[0088] Based on the verification output, the credibility and conflict index of each reasoning step in the reasoning chain are calculated.

[0089] 1. Calculate the credibility.

[0090] For each reasoning step in the reasoning chain, its credibility is calculated based on the rule verification results, tool verification results, and consistency verification results. If the reasoning step passes rule verification, tool verification, and has high consistency, its credibility is high. If the reasoning step has obvious conflicts, its credibility is low.

[0091] In this invention, the reliability of a reasoning step can be calculated based on its rule pass rate, tool pass rate, and self-consistency pass rate. And through normalization .

[0092] In a specific example, the credibility can be calculated by weighting the rule pass rate, tool pass rate, and self-consistency pass rate and mapping it to the Sigmoid function:

[0093] In the formula, It is the first in the inference chain. One reasoning step Credibility; These are preset weights or weights obtained through training. It's the Sigmoid function. Specifically, when a certain degree of passivity, such as self-consistency, is excessive... If it does not exist, the corresponding item can be set to zero or not participate in the fusion.

[0094] 2. Calculate the conflict index.

[0095] A conflict index is calculated to measure the degree of conflict at each reasoning step. The conflict index increases if a reasoning step is inconsistent with the tool's verification results or if there is a significant conflict with the preceding and following reasoning steps.

[0096] In this invention, the conflict index of the inference step can be calculated based on the rule pass rate, tool pass rate, and self-consistency pass rate of the inference step. And through normalization .

[0097] In a specific example, the conflicting sub-items of each validator are first calculated:

[0098] In the formula, , and These are the first in the inference chain. One reasoning step The rules conflict sub-items, tool conflict sub-items, and self-consistency sub-items.

[0099] Then, the conflict indicators are obtained by weighting and merging the conflict sub-items:

[0100] In the formula, It is the first in the inference chain. One reasoning step Conflict indicators; , and They can be preset as needed, and all of them are greater than or equal to 0 and satisfy the condition. + + .

[0101] In this invention, the conflict index and the credibility are derived from each other, that is, This is to achieve consistency constraints.

[0102] S5: Location of the first misaligned point.

[0103] Set a conflict threshold, and determine the first error point in the inference chain based on the conflict threshold and the conflict index.

[0104] In this invention, the location of the first error point specifically includes: 1. Set a conflict threshold.

[0105] Set conflict threshold ,in, In one alternative implementation, For a fixed threshold, a value range of 0.5 to 0.8 is preferred. In another optional embodiment, It can be adaptively determined based on the distribution of conflict indicators in the reasoning steps, that is, In the formula, and Let be the mean and standard deviation of the conflict index for all reasoning steps in the inference chain, respectively. .

[0106] 2. Base conflict threshold is used to locate the first error point.

[0107] The conflict index of each reasoning step in the inference chain is sequentially compared with the conflict threshold from beginning to end. In comparison, the first one that is greater than the conflict threshold will be... Conflict indicators Corresponding reasoning steps This is identified as the first error point in the inference chain, i.e. .

[0108] In this invention, when the first error point is located, that is, when the first error point is located... One reasoning step After the first reasoning step that significantly conflicts with rule verification, tool verification, and self-consistency verification, extract the relevant information from that reasoning step. All relevant conflict information, such as tool error messages, sets of violated rules, and majority opinion conclusions, serves as evidence of conflict and provides information for subsequent interventions.

[0109] If no reasoning step meets the conditions, it is determined that no significant conflict has been detected in the reasoning chain, and no intervention is required, thus ending the optimization of the reasoning.

[0110] S6: Intervention generation.

[0111] For the initial error point, a set of candidate interventions is generated based on the source of the conflict, and the final intervention is selected from the set of candidate interventions based on the credibility and conflict index.

[0112] In this invention, the types of intervention may include: (1) Replacement: Replace the wrong reasoning steps with the correct reasoning steps.

[0113] (2) Insertion: Inserting new reasoning steps into the reasoning chain to correct errors.

[0114] (3) Deletion: Delete the incorrect reasoning steps in the reasoning chain to maintain the coherence of the reasoning.

[0115] (4) Rearrangement: Adjust the order of reasoning steps in the reasoning chain to make the reasoning process logical.

[0116] The intervention generation specifically includes: 1. Identify the primary source of conflict.

[0117] Compare The size of the validator is used to select the validator corresponding to the largest one as the dominant source of conflict, and its corresponding conflict evidence is extracted. These are the rule conflict sub-item, tool conflict sub-item, and self-consistency sub-item of the first error point in the inference chain, respectively.

[0118] For example, if The largest, then the first One reasoning step If the dominant source of conflict is the tool validator, then extracting the first... One reasoning step The conflict information during tool verification is used as evidence of conflict.

[0119] 2. Generate candidate interventions.

[0120] The reasoning steps preceding the first error point in the reasoning chain Reasoning steps corresponding to the first mistake The conflict evidence is input into the large model to generate multiple candidate interventions, forming a candidate intervention set. The candidate intervention set contains m candidate interventions. It is the first One candidate intervention.

[0121] 3. Calculate the candidate intervention scores.

[0122] First, for each candidate intervention Execute the candidate intervention To obtain the local update inference chain That is, based on the candidate interventions Update the existing reasoning chain To obtain the local update inference chain For example, replacing the original inference chain. Reasoning steps in and insert candidate interventions The local update inference chain is obtained. .

[0123] Next, based on the local update inference chain The first in The reasoning steps up to the first... (Where, h can be selected as needed, for example, h is 10 or 15, etc.) After several reasoning steps, the credibility and conflict index are recalculated to obtain the candidate intervention score:

[0124] In the formula, For the first One candidate intervention Candidate intervention scores; and These are the local update inference chains. The first in The credibility and conflict index of each reasoning step can be calculated using the same method as in step S4. For the weighting coefficient and .

[0125] 4. Determine the final intervention.

[0126] The candidate intervention with the highest score was selected as the final intervention. :

[0127] Through the above steps, credibility can be applied in intervention selection, thereby not only using conflict indicators to locate the first point of error, but also using credibility to screen candidate interventions.

[0128] S7: Intervention implementation.

[0129] The inference chain is updated based on the final intervention to form a new inference chain.

[0130] In this invention, the intervention execution may include: 1. Update the inference chain.

[0131] The final intervention to be determined Application to the original inference chain Above, a new reasoning chain is obtained. For example, replacing the original inference chain. Reasoning steps in and insert final intervention A new inference was obtained. .

[0132] 2. Continue generating answers.

[0133] Based on the new inference chain New candidate answers are generated by a large model. .

[0134] S8: Termination condition judgment.

[0135] Based on the new inference chain, repeat steps S3-S7 until the termination condition is met. That is, use the set of verification signals to verify each inference step in the new inference chain (of course, self-consistency verification is not required for each inference step in the new inference chain), calculate the credibility and conflict index of each inference step in the new inference chain, locate the first error point in the new inference chain, and intervene to generate and execute interventions for the first error point in the new inference chain until the termination condition is met.

[0136] In this invention, the termination condition is any of the following termination conditions: 1. There is no condition in the new inference chain that satisfies... The reasoning steps; 2. The final output result is that the new candidate answer meets the requirements, that is, it can pass the verification of the rule validator and the tool validator; 3. Reach the preset maximum number of iterations. .

[0137] S9: Training sample construction and supervised fine-tuning.

[0138] Based on the final execution results, patch training samples are constructed and used to perform patch-supervised fine-tuning of the large model.

[0139] In this invention, after multiple iterations, when the inference chain starts from... Repair to At that time, construct patch training samples The patch training samples The inputs include: task inputs First misplaced point prefix Reasoning steps corresponding to the first mistake and evidence of conflict; outputs include: post-intervention repair steps or repair segments (e.g., replacements) (Or the set of inserted steps). Patch training samples can be used. The large model is fine-tuned with patch supervision; and further reinforcement learning training can be performed using the degree of verification as a reward signal to improve the reasoning and error correction capabilities of the large model.

[0140] This invention has broad application prospects in the fields of inference optimization and artificial intelligence, and is particularly suitable for the following scenarios: (1) Automated reasoning system: applied to various reasoning tasks (such as mathematical proof, code repair, logical reasoning, etc.) to improve the accuracy and stability of reasoning.

[0141] (2) Intelligent question answering system: In the absence of a reference solution, the reasoning process is optimized through multi-source verification and intervention mechanisms to provide accurate and reliable answers.

[0142] (3) Enterprise knowledge management and decision support: In the absence of a standard solution, the reasoning process is automatically optimized to improve the stability and intelligence of the decision support system.

[0143] (4) Education and research fields: Improve the automation level of research tasks such as academic paper reasoning and experimental design by optimizing the reasoning chain.

[0144] This invention provides a novel technical approach to inference optimization through referenceless solution inference optimization and automated error localization and correction mechanisms, significantly improving the flexibility, scalability, and robustness of inference. This technology has broad application value in practical applications and provides a reliable technical foundation for the engineering application of intelligent inference systems.

[0145] Figure 2 A schematic diagram of the structure of the large model inference error detection and first-error localization intervention system based on multi-source verification of the present invention is shown. Figure 2As shown, the large model inference error detection and first-error localization intervention system based on multi-source verification of the present invention includes: 1. Task input acquisition and inference chain generation module.

[0146] The task input acquisition and inference chain generation module is used to acquire the task input to be inferred, and to obtain an inference chain containing a series of inference steps using a large model based on the task input.

[0147] 2. Verification signal set construction module.

[0148] The verification signal set construction module is used to construct the verification signal set.

[0149] 3. Verification module.

[0150] The verification module is used to call the verification signal set to verify each inference step in the inference chain and obtain the verification output of that step.

[0151] 4. Credibility and conflict index calculation module.

[0152] The credibility and conflict index calculation module is used to calculate the credibility and conflict index of each reasoning step in the reasoning chain based on the verification output.

[0153] 5. First error point location module.

[0154] The first error point localization module is used to set a conflict threshold and determine the first error point in the inference chain based on the conflict threshold and conflict index.

[0155] 6. Intervention generation module.

[0156] The intervention generation module is used to generate a set of candidate interventions for the first error point based on the source of conflict, and select the final intervention from the set of candidate interventions based on the credibility and conflict index.

[0157] 7. Intervention Execution Module.

[0158] The intervention execution module is used to update the inference chain based on the final intervention to form a new inference chain.

[0159] 8. Termination condition judgment module.

[0160] The termination condition determination module is used to determine whether the termination condition is met.

[0161] 9. Training sample construction and supervised fine-tuning module.

[0162] The training sample construction and supervised fine-tuning module is used to construct patch training samples based on the final execution results and to perform patch supervised fine-tuning on the large model using the patch training samples.

[0163] Furthermore, this invention also provides a device for detecting and intervening in large-scale model inference errors based on multi-source verification, and for locating the first error. For example... Figure 3 As shown, the large model inference error detection and first-error localization intervention device based on multi-source verification of the present invention includes: a memory 11 for storing one or more programs; one or more processors 12; when the one or more programs are executed by the one or more processors 12, the one or more processors 12 implement the large model inference error detection and first-error localization intervention method based on multi-source verification of the present invention.

[0164] Finally, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the large model inference error detection and first-error localization intervention method based on multi-source verification in the present invention.

[0165] The computer-readable storage medium includes both permanent and non-permanent, removable and non-removable media, and information storage can be achieved by any method or technology. 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 (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device. As defined in this invention, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0166] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this invention can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0167] The steps of the methods or algorithms described in conjunction with the embodiments disclosed in this invention can be implemented in hardware, software modules executed by a processor, or a combination of both. The software modules can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, or any other form of storage medium known in the art.

[0168] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit the scope of protection of the present invention. Those skilled in the art can modify or make equivalent substitutions to the technical solutions of the present invention based on the concept of the present invention, without departing from the essence and scope of the technical solutions of the present invention.

Claims

1. A method for error detection and first-error localization intervention in large-scale model inference based on multi-source validation, characterized in that, Includes the following steps: S1: Obtain the task input to be reasoned, and use the large model based on the task input to obtain a reasoning chain containing a series of reasoning steps; S2: Construct a set of verification signals; S3: For each reasoning step in the inference chain, the verification signal set is called to perform verification, and the verification output of that step is obtained; S4: Based on the verification output, calculate the credibility and conflict index of each reasoning step in the reasoning chain; S5: Set a conflict threshold, and determine the first error point in the inference chain based on the conflict threshold and the conflict index; S6: For the first point of error, generate a set of candidate interventions based on the source of conflict and select the final intervention from the set of candidate interventions based on credibility and conflict index; S7: Update the inference chain based on the final intervention to form a new inference chain; S8: Based on the new inference chain, repeat steps S3-S7 until the termination condition is met; S9: Construct patch training samples based on the final execution results and use the patch training samples to perform patch-supervised fine-tuning on the large model.

2. The method for error detection and first-error localization intervention in large model inference based on multi-source verification according to claim 1, characterized in that, In step S2, the set of verification signals includes at least one or more of the following verifiers: A rule validator is used to verify whether each reasoning step in the reasoning chain violates a rule in the rule base; Tool verifiers are used to verify the correctness of each reasoning step in the inference chain by calling external tools; A self-consistent verifier is used to obtain multiple inference chains containing a series of inference steps using a large model based on the task input, and to verify the consistency of the semantic conclusions of the same inference step in the multiple inference chains.

3. The method for error detection and first-error localization intervention in large model inference based on multi-source verification according to claim 2, characterized in that, Step S3 specifically includes: S31: For each reasoning step in the reasoning chain, call the rule validator to perform rule verification and obtain the rule pass rate for that step. : In the formula, It is the first in the inference chain One reasoning step The rule pass rate; It is the total number of rules in the rule base; It is the first in the rule base Rules; It is the first in the inference chain One reasoning step Does it violate the rule in the rule base? Rules The indicated quantity, if violation ,but ,otherwise ; It is the first in the rule base The rule weight of each rule and ; S32: For each reasoning step in the reasoning chain, call the tool verifier to perform tool verification and obtain the tool pass rate. : In the formula, It is the first in the inference chain One reasoning step The tool's passability; It is the first in the inference chain One reasoning step Error measurement during tool validation and ; It is a scaling factor and ; S33: For each reasoning step in the inference chain, call the self-consistency verifier to perform self-consistency verification and obtain the self-consistency pass rate. : In the formula, It is the first in the inference chain One reasoning step Self-consistency pass rate; It is the total number of the aforementioned inference chains; In all In the inference chain described in the first clause, the first clause will be... One reasoning step After matching or clustering the semantic conclusions, it belongs to the first The number of inference chains in each cluster; Indicates the first One reasoning step Among all clusters, find the cluster with the largest number of inference chains and take the number of inference chains in that cluster as a modulo 1. The ratio of .

4. The method for error detection and first-error localization intervention in large model inference based on multi-source verification according to claim 3, characterized in that, Step S4 specifically includes: S41: Calculate the confidence level of each reasoning step in the inference chain. : In the formula, It is the first in the inference chain One reasoning step Credibility; These are preset weights or weights obtained through training. It is the Sigmoid function; S42: Calculate the conflict index for each reasoning step in the inference chain. : In the formula, It is the first in the inference chain One reasoning step Conflict indicators; , and These are the first in the inference chain. One reasoning step The rule conflict sub-items, tool conflict sub-items, and self-consistency sub-items; + + and , and All are greater than or equal to 0.

5. The method for error detection and first-error localization intervention in large model inference based on multi-source verification according to claim 4, characterized in that, Step S5 specifically includes: S51: Set the collision threshold ; S52: Randomly compare the conflict index of each reasoning step in the reasoning chain with the conflict threshold from beginning to end. In comparison, the first one that is greater than the conflict threshold will be... Conflict indicators Corresponding reasoning steps It was determined to be the first error point in the inference chain.

6. The method for error detection and first-error localization intervention in large model inference based on multi-source verification according to claim 5, characterized in that, Specifically, step S51 involves setting the conflict threshold. : In the formula, and Let be the mean and standard deviation of the conflict index for all reasoning steps in the inference chain, respectively. .

7. The method for error detection and first-error localization intervention in large model inference based on multi-source verification according to claim 6, characterized in that, Step S6 includes: S61: Comparison The size of the validator is used to select the validator corresponding to the largest value as the dominant source of conflict, and its corresponding conflict evidence is extracted. These are the rule conflict sub-item, tool conflict sub-item, and self-consistency sub-item of the first error point in the inference chain, respectively. S62: The reasoning steps before the first error point in the reasoning chain. Reasoning steps corresponding to the first mistake point The conflicting evidence is input into a large model to generate multiple candidate interventions; S63: For each candidate intervention Execute the candidate intervention To obtain the local update inference chain And based on the local update inference chain The first in The reasoning steps up to the first... Each reasoning step recalculates the credibility and conflict index to obtain the candidate intervention score: In the formula, For the first One candidate intervention Candidate intervention scores; and These are the local update inference chains. The first in Credibility and conflict indicators of each reasoning step; For the weighting coefficient and ; S64: Select the candidate intervention with the highest candidate intervention score as the final intervention. : 。 8. A large-scale model inference error detection and first-error localization intervention system based on multi-source verification, characterized in that, include: The task input acquisition and inference chain generation module is used to acquire the task input to be inferred and to obtain an inference chain containing a series of inference steps based on the task input using a large model. The verification signal set construction module is used to construct the verification signal set; The verification module is used to call the verification signal set to verify each inference step in the inference chain and obtain the verification output of that step. A credibility and conflict index calculation module is used to calculate the credibility and conflict index of each reasoning step in the reasoning chain based on the verification output. The first error point localization module is used to set a conflict threshold and determine the first error point in the inference chain based on the conflict threshold and the conflict index. An intervention generation module is used to generate a set of candidate interventions for the first error point based on the source of conflict and to select the final intervention from the set of candidate interventions based on the credibility and conflict index. An intervention execution module is used to update the inference chain based on the final intervention to form a new inference chain; The termination condition judgment module is used to determine whether the termination condition is met. The training sample construction and supervised fine-tuning module is used to construct patch training samples based on the final execution results and to perform patch supervised fine-tuning on the large model using the patch training samples.

9. A large-scale model inference error detection and first-error localization intervention device based on multi-source verification, characterized in that, include: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the large model inference error detection and first-error localization intervention method based on multi-source verification as described in any one of claims 1-7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of the large model inference error detection and first-error localization intervention method based on multi-source verification as described in any one of claims 1-7.