A method and system for inference enhancement of a large language model

By transforming user questions into multi-step reasoning plans and executing knowledge graph retrieval and revision at the step-by-step granularity, the problem of inaccurate reasoning results and unstable corrections in knowledge graph-enhanced large language model question answering is solved, achieving efficient and interpretable reasoning result output.

CN123140243APending Publication Date: 2026-11-20GUANGZHOU HKUST FOK YING TUNG RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611407442.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-11
Publication Date
2026-11-20

AI Technical Summary

Technical Problem

In existing knowledge graph-enhanced large language model question answering technologies, entity recognition errors and relation selection errors cannot be verified in a timely manner during multi-hop reasoning, resulting in inaccurate reasoning results and unstable corrections.

Method used

By transforming user questions into multi-step reasoning plans, using action identifiers to drive knowledge graph retrieval and prediction verification, timely corrections are triggered. Multiple revision methods and adaptive selection mechanisms are adopted to dynamically adjust the revision granularity, and high-quality revision plans are selected by combining comprehensive reward evaluation.

Benefits of technology

It improves the accuracy and interpretability of reasoning results, avoids the propagation of errors, ensures that the reasoning process conforms to the facts and maintains the problem objective, and outputs structured answers and evidence paths.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123140243A_ABST
    Figure CN123140243A_ABST
Patent Text Reader

Abstract

The application discloses a reasoning enhancement method and system of a large language model, and is applied to the technical field of model reasoning enhancement, and the method comprises the following steps: processing a user input question through a large language model to obtain a multi-step reasoning plan text; obtaining a feedback triple set corresponding to a current reasoning step based on the action identifier of the current reasoning step; when the consistency check result of the predicted triple of the current reasoning step and the feedback triple set is inconsistent, processing the revision prompt context corresponding to a target preset revision mode through the large language model to obtain a candidate revised reasoning plan; updating the multi-step reasoning plan text based on the comprehensive reward value of the candidate revised reasoning plan; and associating the question answer and the evidence path obtained based on the updated multi-step reasoning plan text to obtain the reasoning result of the user input question. The application improves the accuracy and stability of the large language model question and answer reasoning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of model reasoning enhancement technology, and in particular to a reasoning enhancement method and system for large language models. Background Technology

[0002] In the existing field of question-answering technology using knowledge graphs to enhance large language models, one approach parses user input into entities, relations, or query statements, and then uses knowledge graph retrieval results to enhance the question-answer generation of the large language model. Another approach focuses on the construction of candidate subgraphs, structural inductive reasoning, or entity relation extraction training. For example, CN118797017A discloses an intelligent question-answering method based on the collaboration of a large language model and a knowledge graph. This method decomposes complex questions into multiple simpler questions to form multi-hop reasoning paths and uses knowledge graph information to verify the reasoning results.

[0003] However, existing solutions typically use knowledge graph retrieval results as a one-time basis for generating context or the final answer. In multi-hop knowledge graph question answering scenarios, entity recognition errors, relation selection errors, or prediction / observation errors occurring in early steps propagate through subsequent reasoning steps. Existing solutions, which validate the answer at the final answer stage or perform structural reasoning on candidate subgraphs, struggle to promptly detect inconsistencies between intermediate steps and the knowledge graph facts. Furthermore, existing solutions often employ fixed revision strategies when triggering revisions, leading to inconsistent revision results. In summary, existing solutions suffer from inaccurate question answering reasoning results and unstable correction processes during the reasoning process. Summary of the Invention

[0004] This invention provides a reasoning enhancement method and system for large language models to solve the technical problems of inaccurate reasoning results and unstable correction during the reasoning process in existing knowledge graph-enhanced question-answering reasoning schemes for large language models.

[0005] To address the aforementioned technical problems, embodiments of the present invention provide a reasoning enhancement method for large language models, comprising: The user input question is processed by the large language model to obtain a multi-step reasoning plan text; each reasoning step of the multi-step reasoning plan text includes an action identifier and a prediction triple. Based on the action identifier of the current reasoning step, the set of feedback triples corresponding to the current reasoning step is obtained; When the consistency check result between the predicted triplet and the feedback triplet set in the current inference step is inconsistent, the revision prompt context corresponding to the target preset revision method is processed by the large language model to obtain a candidate revision inference plan. Update the multi-step reasoning plan text based on the comprehensive reward value of the candidate modified reasoning plan; By associating the question answer and evidence path obtained based on the updated multi-step reasoning plan text, the reasoning result of the user input question is obtained.

[0006] As one preferred embodiment, the process of processing the user input question through the large language model to obtain the multi-step reasoning plan text includes: The large language model is invoked to process the user input question and obtain the initial plan text; The initial plan text is parsed to obtain a multi-step reasoning plan text; the recorded data for each reasoning step in the multi-step reasoning plan text includes action data and predicted entity relationship data; Action data for each reasoning step includes a retrieval action identifier and a termination action identifier; the retrieval action identifier is associated with the retrieval prompt text, and the termination action identifier is associated with the candidate answer text; Based on the predicted head entity, predicted relation, and predicted tail entity in the predicted entity relation data, predictive triples are constructed for each inference step.

[0007] As one preferred embodiment, the step of processing the user input question through the large language model to obtain the multi-step reasoning plan text includes: When the action data of the current reasoning step is a retrieval action identifier, each entity in the feedback triple set corresponding to the previous reasoning step is used as the retrieval starting point. Based on the search prompt text associated with the search action identifier and the search starting point, a knowledge graph search operation is performed to obtain the set of feedback triples corresponding to the current reasoning step. When the action data of the current reasoning step is a termination action identifier, the feedback triple set corresponding to each reasoning step is combined in the order of the steps to obtain the evidence path; Based on the candidate answer text associated with the termination action identifier and the evidence path, the reasoning result of the user input question is obtained.

[0008] As one preferred embodiment, obtaining the set of feedback triples corresponding to the current inference step includes: When the consistency check result between the predicted triples and the feedback triples set of the current reasoning step is consistent, a reasoning scheme for the next reasoning step is constructed based on the feedback triples set of the current reasoning step; the reasoning scheme includes a knowledge graph retrieval sub-scheme or an evidence path combination sub-scheme.

[0009] As one preferred embodiment, when the consistency check result between the predicted triples and the feedback triples set in the current inference step is inconsistent, the candidate correction inference plan is obtained by processing the revision prompt context corresponding to the target preset revision method through the large language model, including: When the consistency check result between the predicted triplet and the feedback triplet set in the current inference step is inconsistent, obtain the historical selection count and cumulative reward value of each preset revision method; Based on the historical selection count and cumulative reward value of each preset revision method, the target preset revision method among the preset revision methods is selected; The large language model is used to process the revision prompt context corresponding to the target preset revision method to obtain a candidate revision inference plan.

[0010] Another embodiment of the present invention provides a reasoning enhancement system for a large language model, comprising: The multi-step inference plan text determination module is used to process the user input question through the large language model to obtain the multi-step inference plan text; each inference step of the multi-step inference plan text includes an action identifier and a prediction triple. The feedback triple set determination module is used to obtain the feedback triple set corresponding to the current inference step based on the action identifier of the current inference step. The candidate correction inference plan determination module is used to process the revision prompt context corresponding to the target preset revision method through the large language model when the consistency verification result of the predicted triplet and the feedback triplet set of the current inference step is inconsistent, so as to obtain the candidate correction inference plan. A multi-step inference plan text update module is used to update the multi-step inference plan text based on the comprehensive reward value of the candidate modified inference plan; The question reasoning result determination module is used to associate the question answer and evidence path obtained based on the updated multi-step reasoning plan text to obtain the reasoning result of the user input question.

[0011] As one preferred embodiment, the multi-step reasoning plan text determination module includes: The initial plan text determination unit is used to call the large language model to process the user input question and obtain the initial plan text; An initial plan text parsing unit is used to parse the initial plan text to obtain a multi-step reasoning plan text; the recorded data for each reasoning step of the multi-step reasoning plan text includes action data and predicted entity relationship data; Action data for each reasoning step includes a retrieval action identifier and a termination action identifier; the retrieval action identifier is associated with the retrieval prompt text, and the termination action identifier is associated with the candidate answer text; The prediction triplet construction unit is used to construct prediction triplets for each inference step based on the prediction head entity, prediction relation, and prediction tail entity in the prediction entity relation data.

[0012] As one preferred embodiment, the system further includes: The retrieval starting point determination module is used to take each entity in the feedback triple set corresponding to the previous inference step as the retrieval starting point when the action data of the current inference step is a retrieval action identifier. The knowledge graph retrieval module is used to perform a knowledge graph retrieval operation based on the retrieval prompt text associated with the retrieval action identifier and the retrieval starting point, so as to obtain the set of feedback triples corresponding to the current reasoning step. The evidence path determination module is used to combine the feedback triplet sets corresponding to each reasoning step in the order of the steps when the action data of the current reasoning step is a termination action identifier, so as to obtain the evidence path. The user input question reasoning module is used to obtain the reasoning result of the user input question based on the candidate answer text associated with the termination action identifier and the evidence path.

[0013] As one preferred embodiment, the system further includes: The next reasoning scheme construction module is used to construct a reasoning scheme for the next reasoning step based on the feedback triple set of the current reasoning step when the consistency verification result of the prediction triple set and the feedback triple set of the current reasoning step is consistent; the reasoning scheme includes a knowledge graph retrieval sub-scheme or an evidence path combination sub-scheme.

[0014] As one preferred embodiment, the candidate correction inference plan determination module includes: The revision method history information acquisition unit is used to acquire the historical selection count and cumulative reward value of each preset revision method when the consistency verification result of the predicted triplet and the feedback triplet set in the current inference step is inconsistent. The target preset revision method determination unit is used to filter out the target preset revision method among the preset revision methods based on the historical selection number and cumulative reward value of each preset revision method; The candidate correction inference plan determination unit is used to process the revision prompt context corresponding to the target preset revision method through the large language model to obtain the candidate correction inference plan.

[0015] This application transforms user questions into multi-step reasoning plans and executes knowledge graph retrieval, prediction verification, and plan revision at the step-by-step granularity. It triggers timely corrections as soon as a reasoning error occurs, preventing the error from propagating along the reasoning chain. Through a step-by-step verification mechanism based on feedback triple sets, each reasoning step receives evidence supporting the facts in the knowledge graph. Multiple preset revision methods and an adaptive selection mechanism allow the revision granularity to be dynamically adjusted according to different error types. A comprehensive reward evaluation mechanism filters high-quality candidate revision plans, ensuring that the updated reasoning plan both conforms to the facts and maintains the question's objective. Finally, the answer is output in association with the evidence path, improving the interpretability and credibility of the reasoning results. The entire solution does not require fine-tuning of the underlying large language model and can be deployed as an independent external reasoning enhancement layer. Attached Figure Description

[0016] Figure 1 This is one of the flowcharts illustrating the reasoning enhancement method for large language models provided by this invention; Figure 2 This is the second flowchart of the reasoning enhancement method for the large language model provided by this invention; Figure 3 This is a schematic diagram of the structure of the reasoning enhancement system for a large language model provided by the present invention.

[0017] Figure label: Among them, 301, Multi-step reasoning plan text determination module; 302, Feedback triple set determination module; 303, Candidate revised reasoning plan determination module; 304, Multi-step reasoning plan text update module; 305, Problem reasoning result determination module. Detailed Implementation

[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0019] In the description of this application, the terms "first," "second," "third," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined with "first," "second," "third," etc., may explicitly or implicitly include one or more of that feature. In the description of this application, unless otherwise stated, "a plurality of" means two or more.

[0020] In the description of this application, it should be noted that, unless otherwise expressly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to fixed connections, detachable connections, or integral connections; they can refer to mechanical connections or electrical connections; they can refer to direct connections or indirect connections through an intermediate medium; and they can refer to the internal communication between two components. The terms "vertical," "horizontal," "left," "right," "upper," "lower," and similar expressions used herein are for illustrative purposes only and do not indicate or imply that the device or component referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as limiting the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.

[0021] In the description of this application, it should be noted that, unless otherwise defined, all technical and scientific terms used in this invention have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in this specification is for the purpose of describing specific embodiments only and is not intended to limit the invention. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.

[0022] See Figure 1 , Figure 1 This is a flowchart illustrating an embodiment of the reasoning enhancement method for large language models provided by the present invention, as shown below. Figure 1 As shown, this embodiment includes steps 100 to 500, and the specific steps are as follows: Step 100: Process the user input question using the large language model to obtain a multi-step inference plan text; each inference step of the multi-step inference plan text includes an action identifier and a prediction triple. In this embodiment, after receiving the text data corresponding to the user's input question, the large language model is invoked to perform structured reasoning plan generation processing on the user's input question, resulting in a multi-step reasoning plan text. A preset prompt template guides the large language model to output the reasoning plan in a specified format. The prompt template includes a task description, output format instructions, and examples, used to constrain the output structure of the large language model.

[0023] The inference plan consists of multiple structured records arranged in a step-by-step sequence. The record data for each inference step includes at least an action identifier and a prediction triple. The action identifier indicates the type of operation to be performed in the current step, including retrieval actions and termination actions. The prediction triple represents the knowledge fact that the current step expects to retrieve from the knowledge graph, and consists of a prediction head entity, a prediction relation, and a prediction tail entity.

[0024] The plan text fed back by the large language model is parsed. Based on the preset step separators (such as newline characters or specific markers) and field identifiers (such as prefixes such as “Thought:”, “Action:”, and “Pred:”), the plan text is split into structured records of each reasoning step, thereby obtaining the multi-step reasoning plan text in this embodiment.

[0025] For example, in an open-domain knowledge question-answering scenario, if a user inputs: "What profession does the spouse of the director of the movie *Inception* have?", the large language model generates a four-step reasoning plan containing a relationship chain of "movie—director—spouse—profession". The first three steps correspond to the three relationship retrievals in the aforementioned relationship chain, and the fourth step is a termination action. Each step includes a corresponding action identifier and a prediction triple. As another example, in a biomedical knowledge question-answering scenario, if a user inputs: "Which genes interact with genes downregulated by dacarbazine?", the large language model generates a multi-step reasoning plan containing a relationship chain of "dacarbazine—downregulated gene—interacting gene".

[0026] In this embodiment, by transforming user questions into structured multi-step reasoning plans, subsequent retrieval, verification, and revision can be executed precisely at the step level, avoiding information redundancy and noise problems caused by one-time retrieval, and improving the controllability and interpretability of the reasoning process.

[0027] Step 200: Based on the action identifier of the current inference step, obtain the set of feedback triples corresponding to the current inference step; In this embodiment, each reasoning step is executed sequentially according to the order of steps in the multi-step reasoning plan text. For the currently executing reasoning step, the action identifier in the structured record of that step is read first. Action identifiers include two types: retrieval action identifiers and termination action identifiers. The retrieval action identifier is associated with the retrieval prompt text, and its function is to trigger the knowledge graph retrieval operation; the termination action identifier is associated with the candidate answer text, and its function is to trigger the termination of reasoning and the output of the answer.

[0028] When a retrieval action identifier is read, the knowledge graph retrieval operation is performed based on the retrieval prompt text associated with the action identifier and the entities in the feedback triple set corresponding to the previous reasoning step.

[0029] Specifically, using the starting entity as the query center, outbound and inbound edge queries are performed within the knowledge graph to obtain a set of candidate relations. The knowledge graph is a structured collection of knowledge consisting of entities, relations, and triplet facts. Subsequently, the candidate relations are semantically filtered based on the search prompt text to determine the target relation for the current reasoning step. The specific method of semantic filtering can be as follows: using the user's input question and search prompt text as input, a large language model is invoked to generate suggested relation texts. Then, the semantic similarity between each candidate relation text and the suggested relation texts is calculated, and the candidate relation with the highest similarity is selected as the target relation.

[0030] Next, a triplet query pattern is constructed using the starting entity and target relation, such as (head entity, relation, ?) or (?, relation, tail entity). The corresponding entity is retrieved from the knowledge graph, and the retrieved (head entity, relation, tail entity) triples are added to the feedback triplet set corresponding to the current reasoning step. The feedback triplet set consists of structured factual evidence in the knowledge graph directly related to the current reasoning step. Each feedback triplet comprises three fields: head entity, relation, and tail entity.

[0031] When the termination action flag is read, the search operation terminates, preparing to enter the answer output stage. For example, in the first step of the movie query example above, using the initial topic entity "Inception" as the search starting point, the retrieved triplet information of the movie director is used as the feedback triplet set. In the first step of the biomedical query example, using "dacarbazine" as the search starting point, the retrieved triplet information of the genes downregulated by the drug is used as the feedback triplet set.

[0032] This embodiment uses an action-identifier-driven retrieval mechanism to ensure that each reasoning step obtains a knowledge graph feedback triple that directly corresponds to the current sub-target, thus avoiding the introduction of irrelevant information. The entity fed back from the previous step serves as the starting point for the next retrieval, ensuring the continuity of the reasoning chain and the coherence of the evidence.

[0033] Step 300: When the consistency check result of the predicted triplet and the feedback triplet set in the current inference step is inconsistent, the revision prompt context corresponding to the target preset revision method is processed by the large language model to obtain a candidate revision inference plan. In this embodiment, the consistency of the predicted triples in the current inference step with the retrieved set of feedback triples is checked. A predicted triple is a complete triple structure consisting of a predicted head entity, a predicted relation, and a predicted tail entity, representing the knowledge facts that the large language model expects to retrieve in this step. The set of feedback triples consists of the triple facts actually retrieved from the knowledge graph.

[0034] Consistency verification is performed by the verifier module. In this embodiment, the verifier module can be performed solely by the large language model verifier, or jointly by the large language model verifier and the lightweight discriminative model verifier. The large language model verifier receives the predicted triples and feedback triples as input and outputs a binary label indicating whether they are consistent, along with the reason for the decision. The lightweight discriminative model verifier outputs an implication label, a contradiction label, or a neutral label. When any verifier determines that the predicted triples and feedback triples are inconsistent, the consistency verification result is determined to be inconsistent, and the plan revision process is triggered.

[0035] When a revision is triggered, the target preset revision method is selected from several preset revision methods. The preset revision methods include at least three types: local error correction, look-ahead adjustment, and global rewrite.

[0036] The local error correction method uses only the set of feedback triples from the current reasoning step as the basis for revision, suitable for situations where current evidence is sufficient to correct entity or relation errors. The look-ahead adjustment method further considers candidate relations for the next step as the basis for revision, starting with entities in the current entity set and querying outgoing and incoming edges in the knowledge graph to obtain candidate relations for the next step, suitable for situations where current evidence is insufficient but future relations can indicate the correct direction for expansion. The global rewrite method uses the complete reasoning plan and historical feedback sequence as the basis for revision, suitable for situations involving accumulated errors or drifting problem intent.

[0037] Based on the historical selection frequency and cumulative reward value of each revision method, a target preset revision method is selected using an upper confidence bound selection mechanism or rule-based strategy. Specifically, a score for each revision method can be calculated, and the ratio of cumulative reward value to historical selection frequency can be used as the historical average return term. This is then overlaid with an exploration term, and the revision method with the highest score is selected as the target preset revision method.

[0038] Subsequently, the revision prompt context corresponding to the target preset revision method is input into the large language model. The revision prompt context contains the knowledge graph feedback information and revision instructions required for that revision method. Different revision methods correspond to different revision prompt contexts: the revision prompt context for the local error correction method contains the set of feedback triples for the current step and the instruction "correct only the current step"; the revision prompt context for the lookahead adjustment method contains the set of feedback triples for the current inference step, the set of candidate relations for the next step, and the instruction "correct the current step and subsequent steps by referring to the next relation"; the revision prompt context for the global rewrite method contains the complete inference plan, the historical feedback sequence, and the instruction "re-plan the entire inference plan".

[0039] The large language model generates candidate correction inference plans based on the revision prompt context. These candidate correction inference plans also adopt a structured inference plan format, allowing for adjustments to the prediction triples of the current step, rewriting subsequent steps, shortening the inference chain, adding necessary retrieval steps, or reorganizing the order of subsequent inferences. For example, if a step predicts "the director of the movie *Inception* is character B," but the knowledge graph feedback shows "the director of the movie *Inception* is Christopher Nolan," a revision is triggered. If a local error correction method is selected, the feedback triples of the current step are input into the large language model as context, generating a candidate correction inference plan that corrects "character B" to "Christopher Nolan."

[0040] This embodiment achieves timely prevention of errors before they propagate by triggering revisions when the predicted triples and the feedback triples are inconsistent. By setting multiple revision methods and an adaptive selection mechanism, the revision granularity can be dynamically adjusted according to the sufficiency of evidence and the scope of errors, thus avoiding the failure of a single revision strategy in different scenarios.

[0041] Step 400: Update the multi-step inference plan text based on the comprehensive reward value of the candidate modified inference plan; In this embodiment, a comprehensive reward evaluation is performed on the candidate revised inference plan, and a decision is made based on the evaluation results regarding whether to adopt the candidate plan to update the multi-step inference plan text. The comprehensive reward value is obtained by fusing two parts: task-specific evaluation and answer stability evaluation. The task-specific evaluation is used to determine the local quality of the candidate revised inference plan at the current step. The answer stability evaluation is used to determine whether the final answer that the candidate revised inference plan may obtain tends to be consistent with other candidate plans.

[0042] Task-specific evaluations include scores across at least five dimensions: fact-verification consistency, problem relevance, problem goal retention, reasoning coherence, and execution efficiency. Fact-verification consistency determines whether the revised predicted triples match the set of feedback triples. Problem relevance determines whether the revised content still revolves around the user's input question. Problem goal retention determines whether the multi-hop reasoning process deviates from the original problem goal. Reasoning coherence determines whether the reasoning content of the current reasoning step matches the knowledge graph feedback. Execution efficiency penalizes repetitive, overlapping, or invalid reasoning steps.

[0043] Scores are calculated for each of the five dimensions, with each score generated by a pre-defined contradiction detection or semantic similarity calculation and normalized to a value range of 0 to 1. Subsequently, the scores of the five dimensions are weighted and summed according to pre-defined weights to obtain a task-specific evaluation score. Contradiction detection compares whether two texts or triples contradict each other, outputting a contradiction probability value. Semantic similarity calculation calculates the similarity between two texts or triples in the semantic space, outputting a similarity value between 0 and 1.

[0044] Answer stability evaluation compares whether the final answers obtained from the current candidate revision plan are consistent with those obtained from other candidate revision plans. Multiple candidate revision plans are simulated and executed separately to obtain the final answer for each plan. Then, the semantic similarity between the final answers is calculated. The answer stability score of the current candidate plan is the proportion of its final answer that is semantically equivalent to the final answers of other candidate plans.

[0045] The two evaluation methods described above are adaptively fused based on the uncertainty of the current answer. Answer uncertainty refers to the degree of certainty about the final answer based on the current reasoning state, which can be measured by the normalized entropy of the current candidate answer distribution; the higher the entropy value, the higher the uncertainty. When the answer uncertainty is high, the weight of the answer stability evaluation in the overall reward is increased; when the answer uncertainty is low, the weight of the answer stability evaluation is decreased.

[0046] Specifically, set The fusion weights for evaluating the stability of the answer. The value ranges from 0 to 1 and increases as the uncertainty of the current answer increases, then the comprehensive reward value As shown in formula (1), where, Assign a specific evaluation score to the task; The score is used to evaluate the stability of the answer.

[0047] (1) If the overall reward value reaches the preset acceptance threshold, the candidate revised inference plan is accepted, and the corresponding step or subsequent step in the original multi-step inference plan text is replaced with the candidate revised inference plan to complete the plan update. If the overall reward value is lower than the preset acceptance threshold, the current candidate plan is rejected, and a new revision method is selected or a new candidate plan is generated until the acceptance conditions are met or the maximum number of revisions is reached. When the maximum number of revisions is reached and no candidate plan is accepted, the original inference plan is retained and the current step is marked as unreliable, and subsequent steps are executed or the inference is terminated.

[0048] For example, in the first step of the movie query example, a candidate correction inference plan is generated to change "Character B" to "Christopher Nolan". In the task-specific evaluation, the scores are: Fact Verification Consistency 0.9, Question Relevance 0.85, Question Goal Preservation 0.8, Reasoning Coherence 0.85, Execution Efficiency 0.9, and Weighted Task-Specific Evaluation Score 0.86. The current answer has low uncertainty, and the weighted scores are adjusted accordingly. If the score is set to 0.2, the stability evaluation score is 0.75, and the comprehensive reward value is 0.8 × 0.86 + 0.2 × 0.75 = 0.838, which meets the preset acceptance threshold of 0.7, so the candidate plan is accepted. In another scenario, the comprehensive reward value of the candidate plan is only 0.55, which does not meet the acceptance threshold, so the plan is rejected and a new candidate plan is generated by selecting a revision method.

[0049] This embodiment uses a multi-dimensional task-specific evaluation and answer stability evaluation fusion mechanism to comprehensively evaluate the quality of candidate revision plans from multiple perspectives, such as factual accuracy, question relevance, reasoning coherence, execution efficiency, and answer consistency, and select high-quality revision plans. By adaptively adjusting the fusion weights based on answer uncertainty, the evaluation mechanism has different focuses at different reasoning stages, which improves the rationality and accuracy of the evaluation.

[0050] Step 500: Associate the question answer and evidence path obtained based on the updated multi-step reasoning plan text to obtain the reasoning result of the user input question.

[0051] In this embodiment, subsequent reasoning steps are continued based on the updated multi-step reasoning plan text until the action identifier of a certain reasoning step is a termination action identifier. Then, the final question answer is read from the candidate answer text associated with the termination action identifier.

[0052] Specifically, after all retrieval steps are completed, the text content within the brackets of the "Finish[answer]" action marker in the last step or the specified termination step is read, and this text is used as the original form of the final answer. Optionally, the original answer can also be post-processed, for example, by removing redundant modifiers, standardizing the format, or performing semantic simplification to obtain a standardized final answer.

[0053] Simultaneously, the feedback triple sets corresponding to each reasoning step are combined according to the step sequence to form a complete evidence path. The evidence path records the knowledge graph triple facts traversed from the initial topic entity to the final answer, serving as the traceable factual basis for the reasoning result. The evidence path is combined as follows: the entity in the feedback triple set of the first step is used as the retrieval starting point of the second step, the entity in the feedback triple set of the second step is used as the retrieval starting point of the third step, and so on, ultimately forming a chain structure from the initial entity to the answer entity.

[0054] If a reasoning step has a revision history, the feedback triples corresponding to the revised step are prioritized in the evidence path. The change information for that step can also be recorded, including the original prediction triples, the revision method type, and the revision time sequence, forming a plan change record. The final question answer is associated with the evidence path, and the reasoning result for the user-input question is output in a structured data format. The reasoning result includes at least an answer field and an evidence path field. The evidence path field is in the form of a triple list, where each triple consists of a head entity, a relation, and a tail entity, arranged in the order of the reasoning steps. Optionally, the reasoning result may also include a plan change record field to record the revision history of each reasoning step.

[0055] The structured data format in this embodiment can be JSON, XML, or key-value pair format, which facilitates parsing and use by downstream systems. For example, in the movie query example above, the final output reasoning result is as follows: the answer field is "film producer"; the evidence path field is [("Inception", "director", "Christopher Nolan"), ("Christopher Nolan", "spouse", "Emma Thomas"), ("Emma Thomas", "occupation", "film producer")]; the planned change record field records the operation of correcting "person B" to "Christopher Nolan" in the first step. As another example, in the biomedical query example, the user inputs "Which genes interact with genes downregulated by dacarbazine?", and the final output is the answer "BRCA1, TP53" and the evidence path [("dacarbazine", "downregulated gene", "BRCA1"), ("dacarbazine", "downregulated gene", "TP53"), ("BRCA1", "interacting gene", "ATM"), ("TP53", "interacting gene", "MDM2")].

[0056] This embodiment outputs the final answer in association with the evidence path accumulated in each step, enabling users to verify the source of the answer and the correctness of the reasoning chain. The chain-like combination of evidence paths clearly demonstrates the complete reasoning process from the initial question to the final answer. The structured output format facilitates downstream system parsing and further processing, improving the practicality and compatibility of the solution.

[0057] This application transforms user questions into multi-step reasoning plans and executes knowledge graph retrieval, prediction verification, and plan revision at the step-by-step granularity. It triggers timely corrections as soon as a reasoning error occurs, preventing the error from propagating along the reasoning chain. Through a step-by-step verification mechanism based on feedback triple sets, each reasoning step receives evidence supporting the facts in the knowledge graph. Multiple preset revision methods and an adaptive selection mechanism allow the revision granularity to be dynamically adjusted according to different error types. A comprehensive reward evaluation mechanism filters high-quality candidate revision plans, ensuring that the updated reasoning plan both conforms to the facts and maintains the question's objective. Finally, the answer is output in association with the evidence path, improving the interpretability and credibility of the reasoning results. The entire solution does not require fine-tuning of the underlying large language model and can be deployed as an independent external reasoning enhancement layer.

[0058] In another embodiment of the reasoning enhancement method for large language models provided by the present invention, the above steps specifically include: Step 110: Call the large language model to process the user input question and obtain the initial plan text; Step 120: Parse the initial plan text to obtain a multi-step reasoning plan text; the recorded data for each reasoning step in the multi-step reasoning plan text includes action data and predicted entity relationship data; Action data for each reasoning step includes a retrieval action identifier and a termination action identifier; the retrieval action identifier is associated with the retrieval prompt text, and the termination action identifier is associated with the candidate answer text; Step 130: Based on the predicted head entity, predicted relation, and predicted tail entity in the predicted entity relation data, construct the predicted triplet for each inference step.

[0059] When invoking a large language model to process user input, the model is first guided by a pre-defined prompt template to output an initial plan text in a specified format. The pre-defined prompt template includes a task description, output format instructions, and an example, which constrain the output structure of the large language model. The task description informs the model that the current task is "generating a structured reasoning plan for multi-hop knowledge graph question answering." The output format instructions specify the field names, field order, and field format for each step. The example demonstrates a sample reasoning plan that conforms to the format requirements.

[0060] Upon receiving the initial plan text, the system parses it according to preset step separators and field identifiers, breaking it down into structured records for each inference step, thus obtaining a multi-step inference plan text. Step separators are used to identify the boundaries between different inference steps. Field identifiers are used to identify the starting positions of different fields within the same inference step.

[0061] The recorded data for each reasoning step in a multi-step reasoning plan text includes action data and predicted entity relationship data. Action data contains action identifiers and their associated parameters. Action identifiers include two types: retrieval action identifiers and termination action identifiers. Retrieval action identifiers (such as "Search[text]") are associated with retrieval prompt text and are used to indicate the execution of a knowledge graph retrieval operation. Termination action identifiers (such as "Finish[answer]") are associated with candidate answer text and are used to indicate the termination of reasoning and the output of the answer.

[0062] The predicted entity relationship data includes three fields: predicted head entity, predicted relationship, and predicted tail entity. Predicted triples are constructed based on these three fields for each inference step. The predicted head entity and predicted tail entity fields are also used for candidate entity filtering in subsequent retrieval processes, and the complete predicted triples are used for consistency comparison with the knowledge graph feedback.

[0063] For example, the original text of an inference step output by the large language model is: "Thought: Need to find the director of the movie Inception; Action: Search [Inception]; Pred: (Inception, director, Christopher Nolan)". The plan parsing module parses this text into a structured record based on the field identifiers.

[0064] Through format constraints and structured parsing, the reasoning plans freely generated by the large language model can be automatically identified and executed step by step by the system, providing a standardized data interface for subsequent step-by-step retrieval and verification.

[0065] This embodiment constrains the output format of the large language model through prompt templates and combines it with the parsing module for structured processing, transforming the free text inference plan into a machine-readable structured record. This provides a standardized data foundation for subsequent step-by-step execution of retrieval, verification, and revision. The separation design of action identifiers and predicted entity relationship data enables the execution of different processing branches based on action type. At the same time, the use of predicted triples for consistency verification improves the automation and operability of the inference process.

[0066] See Figure 2 , Figure 2 This is a flowchart illustrating another embodiment of the reasoning enhancement method for large language models provided by the present invention, as shown below. Figure 2 As shown, this embodiment includes steps 10 to 40, and the specific steps are as follows: Step 10: When the action data of the current reasoning step is a retrieval action identifier, take each entity in the feedback triple set corresponding to the previous reasoning step as the retrieval starting point. Step 20: Based on the search prompt text associated with the search action identifier and the search starting point, perform a knowledge graph search operation to obtain the set of feedback triples corresponding to the current reasoning step; Step 30: When the action data of the current reasoning step is a termination action identifier, combine the feedback triplet sets corresponding to each reasoning step in the order of the steps to obtain the evidence path; Step 40: Based on the candidate answer text associated with the termination action identifier and the evidence path, obtain the reasoning result of the user input question.

[0067] After obtaining the multi-step inference plan text, each inference step is executed sequentially according to the step order. When the action data of the current inference step is a retrieval action identifier, the entities in the feedback triple set corresponding to the previous inference step are first obtained as the retrieval starting point. For the first inference step, if there is no previous inference step, the retrieval starting point is the initial set of topic entities identified from the user input question.

[0068] Read the search hint text associated with the search action identifier from the action data of the current inference step, i.e., the text content within square brackets of the "Search[text]" action. Using the search starting point and the search hint text as input, perform a knowledge graph search operation.

[0069] Specifically, the process begins by performing a relation retrieval using the starting entity as the query center to obtain a set of candidate relations. Then, the candidate relations are semantically filtered using the search hints to determine the target relation. Next, a query pattern is constructed using the starting entity and the target relation to retrieve the corresponding entity from the knowledge graph. The retrieved triples are then used as the set of feedback triples for the current reasoning step.

[0070] If the action data for the current reasoning step is a termination action marker, further retrieval operations are terminated. The feedback triples corresponding to each completed reasoning step are combined in order to obtain the evidence path. Simultaneously, the final answer is read from the candidate answer text associated with the termination action marker, i.e., the text content within square brackets of the "Finish[answer]" action. The candidate answer text is associated with the evidence path and output as the reasoning result for the user's input question.

[0071] For example, for a movie search question, the steps are as follows: First, the action marker `Search[Director of the movie *Inception*]` is used to retrieve the feedback triple ("Inception", "Director", "Christopher Nolan") starting from the initial entity "Inception"; second, the action marker `Search[Christopher Nolan's spouse]` is used to retrieve the feedback triple ("Christopher Nolan", "Spouse", "Emma Thomas") starting from the entity "Christopher Nolan" in the previous step; third, the action marker `Search[Emma Thomas's profession]` is used to retrieve the feedback triple ("Emma Thomas", "Profession", "Film Producer") starting from the entity "Emma Thomas" in the previous step; fourth, the action marker `Finish[Film Producer]` terminates the search, combining the feedback triples from the first three steps into an evidence path, which is then associated with the answer "Film Producer" and output. Alternatively, for a single-step simple question answer, only one search step is performed before the termination step, and the evidence path contains only one triple.

[0072] This embodiment achieves automatic switching between retrieval mode and termination mode through an action identifier-driven branching mechanism, completing the entire reasoning process from question input to answer output without manual intervention. In retrieval mode, the entity fed back from the previous step serves as the starting point for the next retrieval, ensuring the continuity of the reasoning chain. In termination mode, the accumulated evidence path is associated with the answer and output, giving the reasoning result a complete chain of evidence and improving the interpretability of the reasoning result.

[0073] In another embodiment of the reasoning enhancement method for large language models provided by the present invention, the above steps specifically include: Step 50: When the consistency check result of the prediction triple and the feedback triple set of the current reasoning step is consistent, construct the reasoning scheme for the next reasoning step based on the feedback triple set of the current reasoning step; the reasoning scheme includes a knowledge graph retrieval sub-scheme or an evidence path combination sub-scheme.

[0074] If the consistency check result between the predicted triples and the feedback triples set in the current reasoning step is consistent, meaning the predicted observation in the current step is supported by facts from the knowledge graph, then a reasoning scheme for the next reasoning step is constructed based on the feedback triples set of the current reasoning step, or the reasoning is terminated. The reasoning scheme includes a knowledge graph retrieval sub-scheme or an evidence path combination sub-scheme.

[0075] Specifically, determine whether the entity in the feedback triple set of the current reasoning step can be used as the starting point for the next hop retrieval. If the feedback triple set of the current reasoning step is not empty and its entity has the potential to be further expanded (i.e., the entity has at least one outgoing or incoming edge relationship in the knowledge graph), then construct a knowledge graph retrieval sub-scheme, use the entity as the starting point for the retrieval of the next reasoning step, and continue to execute the retrieval operations of subsequent steps.

[0076] If the current reasoning step is the last retrieval step in the plan, or if the current set of feedback triples contains enough information to answer the question (e.g., the tail entity is the target entity type asked in the question), then construct an evidence path combination sub-scheme, merge the current set of feedback triples with the sets of feedback triples from previous steps to form a complete evidence path, and prepare to enter the termination step to output the answer.

[0077] When constructing a knowledge graph retrieval sub-scheme, the retrieval prompt text for the next reasoning step can be optimized based on the entity and relation information in the current feedback triple set. For example, the entity name retrieved in the current step can be incorporated into the retrieval prompt for the next step, and the placeholder in the retrieval prompt text for the next step can be replaced with the tail entity name of the current step, thereby improving the accuracy of subsequent searches.

[0078] For example, in the movie query example, after the first step of verification is successful, the feedback triple is ("Inception", "Director", "Christopher Nolan"). It is determined that "Christopher Nolan" has an outgoing edge relationship of "spouse" in the knowledge graph. Therefore, a knowledge graph retrieval sub-scheme is constructed, using "Christopher Nolan" as the starting point for the second step of retrieval. As another example, if the user's question is "Who is Christopher Nolan's spouse?", after performing the first step of retrieval and obtaining the feedback triple ("Christopher Nolan", "spouse", "Emma Thomas"), it is determined that the tail entity "Emma Thomas" in this feedback triple is the target entity type queried by the user. The retrieval is not continued; instead, an evidence path combination sub-scheme is constructed.

[0079] After the consistency verification is passed, this embodiment automatically constructs the reasoning scheme for the next reasoning step based on the current set of feedback triples, or terminates the reasoning, thus achieving seamless connection of the reasoning process in the scenario where the verification is passed; the classification processing of the knowledge graph retrieval sub-scheme and the evidence path combination sub-scheme can adaptively select to continue retrieval or output the answer according to the current reasoning progress, improving the flexibility and execution efficiency of the reasoning process; the optimization mechanism of the retrieval prompt text further improves the accuracy of subsequent retrieval.

[0080] In another embodiment of the reasoning enhancement method for large language models provided by the present invention, the above steps specifically include: Step 310: When the consistency check result between the predicted triplet and the feedback triplet set in the current inference step is inconsistent, obtain the historical selection count and cumulative reward value of each preset revision method; Step 320: Based on the historical selection count and cumulative reward value of each preset revision method, select the target preset revision method from each preset revision method; Step 330: Process the revision prompt context corresponding to the target preset revision method through the large language model to obtain the candidate revision inference plan.

[0081] When the consistency check result between the predicted triples and the feedback triples set in the current inference step is inconsistent, the revision method selection process is triggered. First, the historical selection count and cumulative reward value of each preset revision method are obtained. The preset revision methods include three types: local error correction, lookahead adjustment, and global rewrite. The historical selection count records the number of times each revision method has been selected since the start of the current inference task. The cumulative reward value records the sum of the combined reward values ​​of the candidate plans generated after each revision method was selected.

[0082] The score for each preset revision method is calculated based on the historical selection count and cumulative reward value, and the preset revision method with the highest score is selected as the target preset revision method.

[0083] Specifically, the upper confidence boundary selection mechanism can be used to calculate the score: Let the number of historical selections for the c-th revision method be . The cumulative reward value is The cumulative number of times all revision methods can be selected is Then the first Step 1 The basic score of the revision method As shown in formula (2), where, Indicates historical average return; This indicates that the upper confidence boundary has not been fully utilized in the exploration of revision methods. The preset exploration coefficient; This represents a reward for answer uncertainty, used to increase the probability of being selected for global rewriting when the answer distribution is unstable; This represents a knowledge graph awareness item, used to constrain the selection of revision methods based on repeated entity visits and inference depth; This indicates a diversity penalty, used to prevent the repeated selection of the same revision method within a short period of time.

[0084] (2) Further auxiliary items can be added to optimize the selection. These include an answer uncertainty reward, a knowledge graph awareness item, and a diversity penalty item. The answer uncertainty reward item increases the probability of global rewriting when the answer distribution is unstable. The knowledge graph awareness item constrains the revision method selection based on repeated entity visits and inference depth. The diversity penalty item avoids repeatedly selecting the same revision method within a short period of time.

[0085] If a certain revision method has not yet been selected (i.e.) If a method is selected as the target preset revision method, it will be given priority for initial exploration and will be directly selected as the target preset revision method to ensure that all revision methods have the opportunity to be tried in the early stage.

[0086] After selecting the target preset revision method, the corresponding revision prompt context is input into the large language model. Different revision methods correspond to different revision prompt contexts: For local error correction, the revision prompt context includes the set of feedback triples for the current step and the instruction to "correct only the current step." The large language model adjusts only the prediction triples for the current step, keeping subsequent steps unchanged. For lookahead adjustment, the revision prompt context includes the set of feedback triples for the current step, the set of candidate relations for the next step, and the instruction to "correct the current and subsequent steps by referring to the next relation." Starting with entities in the current entity set, the outgoing and incoming edges in the knowledge graph are queried to obtain the set of candidate relations for the next step. The large language model adjusts the prediction content for the current step and one or more subsequent steps accordingly. For global rewrite, the revision prompt context includes the complete inference plan, the historical feedback sequence, and the instruction to "re-plan the entire inference plan." The large language model regenerates the complete inference plan accordingly, potentially changing the number of steps, the order of steps, and the prediction content.

[0087] The large language model generates candidate revision inference plans based on revision prompts and context. These candidate revision inference plans also adopt a structured inference plan format, including action data for each step and predicted entity relationship data.

[0088] For example, in the second step of a multi-hop query, the prediction is "Entity X belongs to category Y," but the knowledge graph feedback shows "Entity X belongs to category Z." After obtaining historical data for each revision method, if the historical average benefit of local correction is the highest, then the local correction method is selected. The feedback triple ("Entity X," "belongs to," "category Z") and the instruction "correct only the current step" are input into the large language model to generate a candidate plan that corrects the prediction to "Entity X belongs to category Z." Alternatively, if the evidence for the current step is insufficient, the lookahead adjustment method is selected. The current feedback triple and the next step candidate relations (such as "subclass of category Z" and "instance of category Z") are input into the large language model to generate a candidate plan that simultaneously adjusts the current step and the subsequent expansion direction.

[0089] This embodiment adopts an adaptive selection method for target revision based on historical selection counts and cumulative reward values, enabling the revision strategy to be dynamically optimized according to historical execution results, thus avoiding the problem of unstable results in different scenarios due to a fixed strategy order. The upper confidence boundary selection mechanism takes into account both the utilization of high-yield revision methods and the exploration of revision methods that have not been fully tried, improving the global optimality of revision method selection. Different revision methods correspond to revision prompt contexts of different granularities, enabling the large language model to obtain appropriate revision basis according to the error type, thereby improving the quality of candidate correction inference plans.

[0090] The reasoning enhancement system for a large language model provided by this invention will be described below. The reasoning enhancement system for a large language model described below can be referred to in correspondence with the reasoning enhancement method for a large language model described above.

[0091] Please refer to Figure 3 The present invention also provides a reasoning enhancement system for large language models, comprising: The multi-step reasoning plan text determination module 301 is used to process the user input question through the large language model to obtain the multi-step reasoning plan text; each reasoning step of the multi-step reasoning plan text includes an action identifier and a prediction triple. The feedback triple set determination module 302 is used to obtain the feedback triple set corresponding to the current inference step based on the action identifier of the current inference step. The candidate correction inference plan determination module 303 is used to process the revision prompt context corresponding to the target preset revision method through the large language model when the consistency verification result of the predicted triplet and the feedback triplet set of the current inference step is inconsistent, so as to obtain the candidate correction inference plan. The multi-step reasoning plan text update module 304 is used to update the multi-step reasoning plan text based on the comprehensive reward value of the candidate modified reasoning plan; The question reasoning result determination module 305 is used to associate the question answer and evidence path obtained based on the updated multi-step reasoning plan text to obtain the reasoning result of the user input question.

[0092] Optionally, the multi-step reasoning plan text determination module includes: The initial plan text determination unit is used to call the large language model to process the user input question and obtain the initial plan text; An initial plan text parsing unit is used to parse the initial plan text to obtain a multi-step reasoning plan text; the recorded data for each reasoning step of the multi-step reasoning plan text includes action data and predicted entity relationship data; Action data for each reasoning step includes a retrieval action identifier and a termination action identifier; the retrieval action identifier is associated with the retrieval prompt text, and the termination action identifier is associated with the candidate answer text; The prediction triplet construction unit is used to construct prediction triplets for each inference step based on the prediction head entity, prediction relation, and prediction tail entity in the prediction entity relation data.

[0093] Optionally, the system further includes: The retrieval starting point determination module is used to take each entity in the feedback triple set corresponding to the previous inference step as the retrieval starting point when the action data of the current inference step is a retrieval action identifier. The knowledge graph retrieval module is used to perform a knowledge graph retrieval operation based on the retrieval prompt text associated with the retrieval action identifier and the retrieval starting point, so as to obtain the set of feedback triples corresponding to the current reasoning step. The evidence path determination module is used to combine the feedback triplet sets corresponding to each reasoning step in the order of the steps when the action data of the current reasoning step is a termination action identifier, so as to obtain the evidence path. The user input question reasoning module is used to obtain the reasoning result of the user input question based on the candidate answer text associated with the termination action identifier and the evidence path.

[0094] Optionally, the system further includes: The next reasoning scheme construction module is used to construct a reasoning scheme for the next reasoning step based on the feedback triple set of the current reasoning step when the consistency verification result of the prediction triple set and the feedback triple set of the current reasoning step is consistent; the reasoning scheme includes a knowledge graph retrieval sub-scheme or an evidence path combination sub-scheme.

[0095] Optionally, the candidate correction inference plan determination module includes: The revision method history information acquisition unit is used to acquire the historical selection count and cumulative reward value of each preset revision method when the consistency verification result of the predicted triplet and the feedback triplet set in the current inference step is inconsistent. The target preset revision method determination unit is used to filter out the target preset revision method among the preset revision methods based on the historical selection number and cumulative reward value of each preset revision method; The candidate correction inference plan determination unit is used to process the revision prompt context corresponding to the target preset revision method through the large language model to obtain the candidate correction inference plan.

[0096] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of this patent should be determined by the appended claims.

Claims

1. A reasoning enhancement method for a large language model, characterized in that, include: The user input question is processed using the large language model to obtain a multi-step reasoning plan text; Each reasoning step in the multi-step reasoning plan text includes an action identifier and a prediction triple; Based on the action identifier of the current reasoning step, the set of feedback triples corresponding to the current reasoning step is obtained; When the consistency check result between the predicted triplet and the feedback triplet set in the current inference step is inconsistent, the revision prompt context corresponding to the target preset revision method is processed by the large language model to obtain a candidate revision inference plan. Update the multi-step reasoning plan text based on the comprehensive reward value of the candidate modified reasoning plan; By associating the question answer and evidence path obtained based on the updated multi-step reasoning plan text, the reasoning result of the user input question is obtained.

2. The reasoning enhancement method for a large language model as described in claim 1, characterized in that, The process of processing user input questions using the large language model to obtain multi-step reasoning plan text includes: The large language model is invoked to process the user input question and obtain the initial plan text; The initial plan text is parsed to obtain a multi-step reasoning plan text; the recorded data for each reasoning step in the multi-step reasoning plan text includes action data and predicted entity relationship data; Action data for each reasoning step includes a retrieval action identifier and a termination action identifier; the retrieval action identifier is associated with the retrieval prompt text, and the termination action identifier is associated with the candidate answer text; Based on the predicted head entity, predicted relation, and predicted tail entity in the predicted entity relation data, predictive triples are constructed for each inference step.

3. The reasoning enhancement method for a large language model as described in claim 2, characterized in that, The process of processing the user input question using the large language model to obtain the multi-step reasoning plan text includes: When the action data of the current reasoning step is a retrieval action identifier, each entity in the feedback triple set corresponding to the previous reasoning step is used as the retrieval starting point. Based on the search prompt text associated with the search action identifier and the search starting point, a knowledge graph search operation is performed to obtain the set of feedback triples corresponding to the current reasoning step. When the action data of the current reasoning step is a termination action identifier, the feedback triple set corresponding to each reasoning step is combined in the order of the steps to obtain the evidence path; Based on the candidate answer text associated with the termination action identifier and the evidence path, the reasoning result of the user input question is obtained.

4. The reasoning enhancement method for a large language model as described in claim 3, characterized in that, After obtaining the set of feedback triples corresponding to the current inference step, the following is included: When the consistency check result between the predicted triples and the feedback triples set of the current reasoning step is consistent, a reasoning scheme for the next reasoning step is constructed based on the feedback triples set of the current reasoning step; the reasoning scheme includes a knowledge graph retrieval sub-scheme or an evidence path combination sub-scheme.

5. The reasoning enhancement method for a large language model as described in claim 1, characterized in that, When the consistency check result between the predicted triplet and the feedback triplet set in the current inference step is inconsistent, the large language model processes the revision prompt context corresponding to the target preset revision method to obtain candidate revision inference plans, including: When the consistency check result between the predicted triplet and the feedback triplet set in the current inference step is inconsistent, obtain the historical selection count and cumulative reward value of each preset revision method; Based on the historical selection count and cumulative reward value of each preset revision method, the target preset revision method among the preset revision methods is selected; The large language model is used to process the revision prompt context corresponding to the target preset revision method to obtain a candidate revision inference plan.

6. A reasoning enhancement system for a large language model, characterized in that, include: The multi-step reasoning plan text determination module is used to process the user input question through the large language model to obtain the multi-step reasoning plan text; Each reasoning step in the multi-step reasoning plan text includes an action identifier and a prediction triple; The feedback triple set determination module is used to obtain the feedback triple set corresponding to the current inference step based on the action identifier of the current inference step. The candidate correction inference plan determination module is used to process the revision prompt context corresponding to the target preset revision method through the large language model when the consistency verification result of the predicted triplet and the feedback triplet set of the current inference step is inconsistent, so as to obtain the candidate correction inference plan. A multi-step inference plan text update module is used to update the multi-step inference plan text based on the comprehensive reward value of the candidate modified inference plan; The question reasoning result determination module is used to associate the question answer and evidence path obtained based on the updated multi-step reasoning plan text to obtain the reasoning result of the user input question.

7. The reasoning enhancement system for a large language model as described in claim 6, characterized in that, The multi-step reasoning plan text determination module includes: The initial plan text determination unit is used to call the large language model to process the user input question and obtain the initial plan text; An initial plan text parsing unit is used to parse the initial plan text to obtain a multi-step reasoning plan text; the recorded data for each reasoning step of the multi-step reasoning plan text includes action data and predicted entity relationship data; Action data for each reasoning step includes a retrieval action identifier and a termination action identifier; the retrieval action identifier is associated with the retrieval prompt text, and the termination action identifier is associated with the candidate answer text; The prediction triplet construction unit is used to construct prediction triplets for each inference step based on the prediction head entity, prediction relation, and prediction tail entity in the prediction entity relation data.

8. The reasoning enhancement system for a large language model as described in claim 7, characterized in that, The system also includes: The retrieval starting point determination module is used to take each entity in the feedback triple set corresponding to the previous inference step as the retrieval starting point when the action data of the current inference step is a retrieval action identifier. The knowledge graph retrieval module is used to perform a knowledge graph retrieval operation based on the retrieval prompt text associated with the retrieval action identifier and the retrieval starting point, so as to obtain the set of feedback triples corresponding to the current reasoning step. The evidence path determination module is used to combine the feedback triplet sets corresponding to each reasoning step in the order of the steps when the action data of the current reasoning step is a termination action identifier, so as to obtain the evidence path. The user input question reasoning module is used to obtain the reasoning result of the user input question based on the candidate answer text associated with the termination action identifier and the evidence path.

9. The reasoning enhancement system for a large language model as described in claim 8, characterized in that, The system also includes: The next reasoning scheme construction module is used to construct a reasoning scheme for the next reasoning step based on the feedback triple set of the current reasoning step when the consistency verification result of the prediction triple set and the feedback triple set of the current reasoning step is consistent; the reasoning scheme includes a knowledge graph retrieval sub-scheme or an evidence path combination sub-scheme.

10. The reasoning enhancement system for a large language model as described in claim 6, characterized in that, The candidate correction inference plan determination module includes: The revision method history information acquisition unit is used to acquire the historical selection count and cumulative reward value of each preset revision method when the consistency verification result of the predicted triplet and the feedback triplet set in the current inference step is inconsistent. The target preset revision method determination unit is used to filter out the target preset revision method among the preset revision methods based on the historical selection number and cumulative reward value of each preset revision method; The candidate correction inference plan determination unit is used to process the revision prompt context corresponding to the target preset revision method through the large language model to obtain the candidate correction inference plan.