LLM credible inference method based on kge constraint and path self-iteration

CN122905068APending Publication Date: 2026-10-13NANJING TECH UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611125639.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-28
Publication Date
2026-10-13

AI Technical Summary

Technical Problem

因此,如何让LLM可控地生成路径扩展,仍是长链推理稳定性提升中的一个开放性问题

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122905068A_ABST
    Figure CN122905068A_ABST
Patent Text Reader

Abstract

A kind of LLM credible inference method based on KGE constraint and path self iteration, steps include: (one) constructs knowledge graph embedding KGE enhanced self iteration credible inference framework KRAFT;(two) natural language question is mapped into the triple of knowledge graph KG by semantic analysis;Then inference under KRAFT obtains answer.The collaborative training strategy of the present application realizes the knowledge alignment and optimization of KGE verifier and LLM question and answer unit at parameter level.Experiments on multiple KGQA datasets show that KRAFT is superior to KELIN and multiple baseline methods in accuracy, generates clear structure, semantic coherent and high credibility reasoning path, significantly improves process credibility and explainability.
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, specifically a reliable LLM reasoning method based on KGE constraints and path self-iteration. Background Technology

[0002] With the continuous development of Large Language Models (LLM) in language understanding, question answering, and complex reasoning tasks, their application capabilities in knowledge-intensive scenarios are constantly improving. Leveraging large-scale pre-training, instruction fine-tuning, and alignment optimization mechanisms, LLM can learn rich semantic representations and implicit knowledge from massive corpora, demonstrating strong generalization abilities in open-domain question answering, multi-step analysis, and test-oriented tasks. [1][2] However, for knowledge-intensive tasks such as complex knowledge-based question answering and exam-style question answering, relying solely on the parameterized knowledge within the LLM for free generation still makes it difficult to simultaneously guarantee the correctness of the answer, the stability of the reasoning, and the reliability of the process. [7] Especially when the problem involves long chains of knowledge dependencies, multi-hop evidence integration, relational ambiguity resolution, or complex logical constraints, while LLM can generate a seemingly coherent analytical process, the intermediate steps may not have sufficient factual support, nor may they be consistent with the actual knowledge chain. [3][4] Therefore, knowledge-intensive reasoning is no longer just about "whether an answer can be generated," but rather "whether a credible, verifiable, and correctable reasoning process can be generated with the support of external knowledge."

[0003] Introducing Knowledge Graph Embedding (KGE) into the LLM reasoning process can mitigate path drift and fact bias to some extent. However, path-level confidence assessment primarily serves candidate path selection and result interpretation, and is insufficient to guarantee that each hop in the reasoning process has adequate factual support and logical coherence. Furthermore, improving the credibility of knowledge-enhanced reasoning by focusing solely on "whether the path is reasonable" can only improve the quality of candidate path selection and result interpretability to a limited extent. "Whether the process is faithful and credible" is a prerequisite for constructing a credible knowledge-enhanced reasoning mechanism.

[0004] Researchers have conducted in-depth studies on the utilization of structured knowledge, path planning, and the introduction of external evidence, but achieving credibility in the reasoning process remains a challenging problem. Simultaneously improving both the accuracy and credibility of long-chain reasoning remains extremely difficult.

[0005] (1) The multi-hop path generation process lacks sufficient structural constraints. Introducing a graph structure as a whole fails to continuously constrain multi-hop candidate paths. Existing research focuses on constructing local subgraphs around the problem, retrieving candidate paths, and organizing structured evidence to improve the solution capabilities of complex Knowledge Graph Question Answering (KGQA) tasks. RoG

[12] Generate relational paths supported by a Knowledge Graph (KG) as a plan, and then retrieve valid reasoning paths based on this plan. PoG is then used to build upon the path planning.

[34] GCR combines guidance, memory, and feedback mechanisms to achieve adaptive exploration and self-correcting planning.

[17] With DoG

[35] These methods move graph structure constraints to the path generation and decoding stages, introducing explicit path tracing. However, once the LLM selects a locally relevant but globally mismatched relation branch in an early step, subsequent inference, even if linguistically coherent, will gradually deviate from the target. Regarding the expansion of next-hop triples, existing methods mostly rely on the LLM's own generation probability, failing to fully utilize relation patterns, path connectivity, and confidence signals in the KG. Therefore, how to enable the LLM to controllably generate path expansions remains an open question for improving the stability of long-chain inference.

[0006] (2) The intermediate reasoning steps lack fine-grained credibility verification. A correct final answer does not necessarily mean that the reasoning process is faithful and reliable. Errors in multi-hop reasoning are often not caused by a single failure of the entire path, but rather by a failure in the selection of an intermediate relation or a failure in local semantic alignment, and then gradually propagate and amplify along subsequent steps. If LLM can only make judgments at the level of the final answer, it is difficult to pinpoint the specific step where the error occurred, and it is also impossible to achieve targeted correction of local errors and targeted adjustments to subsequent paths.

[36] KBIGER

[37] FiDeLiS dynamically generates step instructions using the current inference graph to correct intermediate entity prediction errors.

[18] The reasoning process is progressively verified by step-by-step bundle search and LLM prediction scoring mechanism, and is terminated early when the problem can be deduced. In ReaRev

[33] Within this framework, the KG (Knowledge Group) guides the updating of the next-hop instruction, and the inference direction is adaptively adjusted according to the KG structure. The above scheme focuses on optimizing the search process and adjusting the inference direction. Explicit localization and directional correction mechanisms for errors still require further research.

[0007] (3) Reliable reasoning relies on the high-cost, multi-round re-reasoning and iterative search of LLM. While LLM improves reasoning quality through multiple rounds of regeneration, it also forces an increase in reasoning cost. Strategies such as multi-round exploration, iterative planning, self-reflection, or candidate path reordering are used to improve answer accuracy or reasoning reliability.

[13] The LLM is viewed as an intelligent agent that interacts and explores on the KG, continuously discovering more promising paths through iterative beam search. PoG

[34] Combining memory and feedback mechanisms to perform self-correcting planning. This type of method has advantages in enhancing deep reasoning capabilities and path traceability, but at the cost of maintaining more intermediate states and relying on multiple candidate expansions or multiple rounds of LLM calls to achieve a high solution success rate. Another concern is that real-world KGs are often incomplete; in the case of missing critical edges, using explicit graph search may lead to interruptions and premature reasoning. Based on the incomplete KGQA setting, GoG...

[39] LLM is used to generate new triples during graph exploration to compensate for external knowledge gaps. FiDeLiS

[18] Path-RAG and inference early stopping mechanisms are explicitly introduced to reduce inference costs while ensuring reliability. Further exploration is needed to avoid the high costs of repeated searches and full-chain re-pushing. Summary of the Invention

[0008] To address the aforementioned challenges, this invention proposes a self-iterative trusted reasoning framework, KRAFT, which embeds KGE enhancements into knowledge graphs. Within this framework, knowledge graph KG structural constraints and KGE confidence signals are incorporated into the entire reasoning process, and path generation, trustworthiness verification, and local corrections are integrated into a unified architecture.

[0009] The present invention discloses an LLM-based trusted reasoning method based on KGE constraints and path self-iteration, comprising the following steps: (i) constructing a knowledge graph embedded with KGE-enhanced self-iterative trusted reasoning framework KRAFT; (ii) mapping natural language questions to triples of the knowledge graph KG through semantic parsing; and then obtaining the answer through reasoning under KRAFT.

[0010] The constituent modules of the KRAFT include:

[0011] The problem input module is used for KGE-oriented structural constraint construction.

[0012] The step verification module is used to verify feedback-driven inference path iterations.

[0013] The answer decision module is used for answer decisions supported by credible evidence from multiple paths.

[0014] The method for constructing the KRAFT is as follows:

[0015] First, let KG be represented as ,in , and These represent the entity set, the relation set, and the triplet set, respectively.

[0016] set up To unify answer variables and model credible reasoning as a process of marginalizing potential path variables, thus characterizing multi-paradigm question answering within the same framework;

[0017] set up For the relation sequence A candidate reasoning path is formed. For input problem The corresponding candidate path space;

[0018] Therefore, the probability of a uniform answer is

[0019] (1)

[0020] Based on path evidence, candidate reasoning paths are generated under KG constraints, and the answer decision is made by the large language model LLM.

[0021] To introduce credibility constraints, the high-quality inference paths obtained through step-level verification are characterized as the posterior preference distribution of the path variables, specifically:

[0022] The posterior distribution centered on the trusted path is represented as ;

[0023] The path generation distribution for generating candidate inference chains under the constraints of the problem-related local graph is represented as follows: ;

[0024] Then KRAFT satisfies:

[0025] (2)

[0026] in Indicates KL divergence;

[0027] Under the constraints of equation (2), the candidate reasoning paths provide support for the final answer, and the path generation distribution approximates... The posterior distribution of;

[0028] The training of KRAFT consists of three phases:

[0029] Phase 1: Discriminator training for KGE structural constraints: Train the KGE model and introduce a step-level verifier to jointly review the factual support, path coherence, and goal consistency of intermediate reasoning steps.

[0030] Phase Two: LLM Fine-tuning of Path Iteration Strategy: The LLM is fine-tuned to learn constrained multi-hop path expansion strategies under local graph constraints; error type identification results are used to determine the source of failure, and local backtracking and directional correction are performed with the help of a prompt-driven LLM replanning mechanism; the general language modeling capability is transformed into path iteration and relation expansion capability for KG knowledge reasoning.

[0031] Phase 3, Multi-paradigm Question Answering Output Adaptation: Based on a unified answer space and credible evidence representation, the answer output layer is adapted to unify the answer output decision-making methods of different question answering paradigms, so that open-ended and selective question answering can achieve consistent output under the condition of sharing the main reasoning framework;

[0032] The reasoning process in step (two) includes:

[0033] 1) Constrained bundle search: Starting with an empty path as the initial state, it continues to expand around the retained path prefix in each iteration;

[0034] For any path prefix, query its set of legal candidate relations from the prefix constraint index, generate a corresponding new path for each candidate relation, and calculate the joint score of the current expansion by combining the prior entity relation pattern.

[0035] 2) Step-level verification and local repair: The new path is verified step-level from three dimensions: factual support, path coherence and goal consistency; the generated score and the verification score are added together to the total score of the path, and the path is retained in the candidate set of the current step;

[0036] After expanding all candidate paths in the current step, normalize the scores of the candidate set and retain the highest-scoring paths. The path serves as the input for the next round of beam search;

[0037] 3) Credible evidence aggregation and answer decision: Merge the paths retained from each step to form a final set of credible paths;

[0038] In the unified answer space, for each candidate answer, the weights of all reliable paths that support that answer are accumulated, and the answer with the highest probability is selected as the final output;

[0039] During the inference process, the reliability of the current step is determined by KGE and the lightweight discriminator, and subsequent actions are generated by LLM.

[0040] The main contributions of this invention include:

[0041] 1) KGE Constraint Generation for Unified Trustworthy Reasoning. KGE is introduced as a dynamic constraint signal into the reasoning generation stage. At each step of relation expansion, LLM simultaneously refers to linguistic probability, structural consistency, semantic relevance of the problem, and prior relation patterns, thereby transforming open-ended free generation into a controllable generation process supported by KG.

[0042] 2) Step-level credibility verification and partial rollback correction. Explicit review covers three dimensions: factual support, path coherence, and goal relevance. Error type identification and partial rollback mechanisms are integrated into the KGQA system. When a step mismatch is detected, the system replaces the entire chain with re-reasoning with partial correction.

[0043] 3) Unified Modeling and Credible Output for Multi-Paradigm Question Answering. Based on a unified credible evidence representation, open-ended answer generation and selective candidate selection are introduced into the shared knowledge reasoning backbone. KRAFT is integrated into an end-to-end KGQA system, and experimental results on multiple datasets demonstrate that the proposed framework outperforms baseline methods in terms of accuracy, path credibility, and adaptability in multi-paradigm question answering scenarios. Attached Figure Description

[0044] Figure 1 This diagram shows an overview of the KRAFT framework applicable to multi-paradigm KGQA.

[0045] Figure 2 This represents a KRAFT collaborative workflow;

[0046] Figure 3 The diagram shows the prompt word templates and their relationships in path iteration control; in the figure, (a) is the constrained next-hop expansion prompt word, (b) is the step-level verification prompt word, and (c) is the local backtracking and regeneration prompt word.

[0047] Figure 4 This represents the SFT and DPO training framework for control policy optimization.

[0048] Figure 5(a) shows the results of KGE-constrained ablation: a performance comparison of different constraint strategies;

[0049] Figure 5(b) shows the results of KGE-constrained ablation: the relative performance degradation of different constraint strategies;

[0050] Figure 6(a) shows the gain analysis of path generation and step-level control: performance comparison of different control versions;

[0051] Figure 6(b) shows the gain analysis of path generation and step-level control: asymptotic performance recovery for different control versions;

[0052] Figure 7(a) shows the step-level credibility analysis: step pass rate and error correction success rate at different inference depths;

[0053] Figure 7(b) shows the step-level credibility analysis: step pass rate analysis for different versions;

[0054] Figure 7(c) shows the step-level credibility analysis: semantic clustering diagram of the process path;

[0055] Figure 8(a) shows the efficiency comparison of different methods on WebQSP: inference time and accuracy;

[0056] Figure 8(b) shows a comparison of the efficiency of different methods on WebQSP: lexical consumption and accuracy. Detailed Implementation

[0057] The invention will be further described below with reference to the accompanying drawings.

[0058] 1 Overview

[0059] This invention addresses the issues of reasoning credibility and unified modeling in KGQA question answering, proposing a reliable LLM reasoning method based on KGE constraints and path self-iteration. To address the shortcomings of existing methods, such as insufficient structural constraints in multi-hop reasoning, lack of fine-grained verification of intermediate steps, and difficulty in sharing a unified reasoning mechanism across multiple question answering paradigms, a reliable and interpretable reasoning framework is constructed. This invention designs a collaborative training strategy to achieve knowledge alignment and optimization between the KGE validator (discriminator) and the LLM question answering unit at the parameter level.

[0060] Experiments on multiple KGQA datasets show that KRAFT outperforms KELIN and various baseline methods in terms of accuracy, generates reasoning paths that are structurally clear, semantically coherent, and highly credible, and significantly improves the credibility and interpretability of the process.

[0061] 2. Inference Architecture Design

[0062] like Figure 1 As shown, the KRAFT self-iterative trusted reasoning framework with KGE enhancement embedded in the knowledge graph proposed in this invention is decomposed into three cooperative functional modules, covering the complete reasoning process from question input, step verification to answer decision:

[0063] (1) KGE-guided structural constraint construction: Based on the problem identification anchor entity and the cropping of the problem-related local graph, construct the candidate relation set and the constrained search space (see steps 1 and 2 corresponding to the purple arrows).

[0064] (2) Verification feedback-driven path iteration: Local graph constraints and structural scoring signals are used to expand the inference path hop by hop. The factuality, coherence and goal consistency of intermediate inference steps are verified, and local rollback and regeneration are performed on failed branches (see steps 3 and 4 corresponding to the red arrows).

[0065] (3) Answer decision supported by credible evidence from multiple paths: aggregate the reasoning paths that have passed verification and complete the final answer decision on a unified answer space (see steps 5 and 6 corresponding to the green arrows).

[0066] Figure 1In the reasoning process: Step 1: Constraint space construction; Step 2: Dynamic constraint path guided by KGE; Step 3: Step-level credibility verification; Step 4: Local backtracking and regeneration; Step 5: Faithful path set and evidence aggregation; Step 6: Unified answer decision.

[0067] Unlike RoG

[39] And KELIN (an interpretable multi-hop reasoning method based on KGE-enhanced LLM), in the KRAFT framework, structural constraints in KG and confidence signals provided by KGE are incorporated into the path generation, step verification, error correction, and final decision-making processes. KG is represented as... ,in , and Let represent the set of entities, the set of relations, and the set of triples, respectively. To unify the answer variable and model credible reasoning as a process of marginalizing potential path variables, thus characterizing multi-paradigm question answering within the same framework, let... This is a candidate reasoning path composed of a sequence of relations. For input problem The corresponding candidate path space. The uniform answer probability can be written as:

[0068] (1)

[0069] Based on path evidence, candidate reasoning paths are generated under KG constraints, and the answer decision is made by LLM.

[0070] To introduce credibility constraints, the high-quality paths obtained through step-level verification are characterized as a posterior preference distribution of the path variable. The posterior distribution centered on credible paths is represented as follows: The path generation distribution for generating candidate inference chains under local graph constraints is represented as follows: The unified trustworthy reasoning framework satisfies:

[0071] (2)

[0072] in Let KL divergence be denoted. Under the constraints of equation (2), the candidate paths can provide support for the final answer, and the path generation distribution approximates... The posterior distribution. The optimization objective is not simply to increase the probability of answer prediction, but to balance the factual reliability, structural coherence, and goal consistency of the reasoning path.

[0073] 2.1 KGE-guided structural constraint construction

[0074] Multi-hop search across a large-scale KG graph suffers from interference such as entity redundancy and branch bloat. To address this, this invention constructs a problem-related local graph and builds a controllable constraint space on the local graph, compressing the search range for subsequent path generation and reducing unnecessary searches.

[0075] make Given a set of problem entities, extract them from the KG. Centered Skip neighborhood subgraph, denoted as In order to suppress and Irrelevant extensions, filtering candidate triples in the local graph The consistency between candidate triples and the question semantics is determined by... Measurement; the structural consistency score given by the KGE model is... Calculate. The retention fraction of the candidate triplet is ,in This is the balance coefficient. If... The cropped problem-related local graph is constructed as follows: The original open search, which was open to the entire graph, has been transformed into a controlled search. A constrained and controllable search process.

[0076] In obtaining Subsequently, the KGQA system needs to generate candidate inference paths consistent with the problem objective within a constrained search space. Unlike methods that rely solely on LLM to generate relation sequences, irrelevant relations that do not need to enter the LLM's judgment scope are pre-filtered. This stage explicitly introduces structural constraints and semantic filtering; each relation expansion step must not only satisfy the rationality of linguistic expression but also meet the KG structural consistency requirements. This mechanism helps to suppress the cumulative errors caused by invalid expansions and local misjudgments.

[0077] The structural consistency score, semantic relevance score, and relation schema prior score of the candidate relation in the current state are respectively denoted as: , and LLM for candidate relationships The generation probability is The joint extended fraction at step i can be written as

[0078] (3)

[0079] in , and The balancing parameter. Based on equation (3), Can be written as

[0080] (4)

[0081] in Let i represent the set of candidate relations under reasoning step i;

[0082] Thus, the constraints on legitimate candidates, path generation probability, and KGE-guided semantic priors are unified into the same decoding process. Each extension step is simultaneously constrained by the KG structure, semantic information, and relational pattern priors.

[0083] The process of constructing the local graph and constraint space described above is formalized as Algorithm 1.

[0084]

[0085] Unlike full-graph open retrieval, the framework proposed in this invention extracts a local graph based on the problem to construct a prefix constraint space, and uses joint scoring to prune candidate facts. Algorithm 1 mainly consists of two stages:

[0086] (1) Partial image cropping: Extracting from KG corresponding At the same time, initialize the candidate fact retention set. (Lines 1-3). Calculate the joint retention score of semantic relevance and structural consistency (line 5), based on the threshold. Retain high-quality candidate facts (lines 6-8). The output of this stage is a pruned set of candidate triples. .

[0087] (2) Construction of constraint space: Reassembled (Line 10) Construct a prefix-constrained index (Line 11). At this stage, the clipped local graph is organized into a structured constraint space that can be invoked hop-by-hop inference, thus ensuring that the path generation process is always confined to the set of legitimate candidate relations.

[0088] 2.2 Verification Feedback-Driven Path Iteration

[0089] After completing the structural constraints and joint scoring of candidate relationships, the inference process transitions to the path dynamic control stage. This stage focuses on how to continuously expand high-quality paths within a limited candidate set and promptly correct deviations in intermediate steps.

[0090] Due to the sparsity of KG, knowledge gaps, and the local semantic judgment bias of LLM, errors in complex multi-hop question answering are difficult to completely avoid. Some paths satisfy the current local constraints, but are insufficient to constitute a reasoning chain that is factually reliable and goal-consistent.

[0091] make The corresponding local reasoning unit in step i is , Indicates execution relationship The new entity arrives later. The validator jointly evaluates it from three dimensions: factual support, path coherence, and goal consistency. Let the three-dimensional validation outputs be respectively... , and The overall credibility score for step i is ,in , and These represent the weights for each validation dimension. If... The partial rollback and regeneration are triggered, indicating that the current expansion has a credibility risk. The cumulative generated score is , for The set of supported answers is then defined as the posterior distribution of the reliable path.

[0092] (5)

[0093] in, and The contributions of the generation score and the validation score to the posterior path are controlled separately. It is evident that the determination of a high-quality path depends on both the cumulative score during the generation phase and the validation results from intermediate steps. The corresponding answer supports the idea that the actual system does not necessarily rely entirely on the explicit graph path endpoint. If there is a knowledge gap in the local graph, the parameterized knowledge of LLM retains its necessary compensatory ability when KG evidence is insufficient.

[0094] The identified low-reliability paths are not discarded directly, but instead fall back to the nearest reliable prefix and replan subsequent expansions. Let the first failed step be... The corresponding set of failure source relationships is denoted as The corrected extended fraction after rollback is ,in This is the penalty coefficient. The local backoff mechanism preserves existing reliable prefixes and performs targeted corrections on subsequent failed branches. Compared to the whole-chain re-push strategy, local backoff only performs replanning on failed steps and their subsequent local sub-paths; verified reliable prefixes are not recalculated.

[0095] Jump-by-jump path expansion, step-level verification, and local backoff are incorporated into the self-iterative control. The inference trajectory is dynamically adjusted based on feedback from intermediate information, continuously refining the trajectory. Based on a cluster search strategy, high-scoring prefixes are retained and expanded until the answer entity satisfying the problem objective or the maximum number of jumps is reached. Open-ended free generation is transformed into a controllable path search constrained by the KG structure. This constraint does not imply a complete abandonment of the implicit knowledge of LLMs.

[0096] 2.3 Answer Modeling Supported by Multi-Path Reliable Evidence

[0097] Let the set of trusted paths be . Different paths within the framework can either collectively support the same answer or provide complementary evidence from different perspectives. To unify and integrate multi-path information, answer decisions are confined to a unified answer space, eliminating the need for separate decision logics for open-ended and multiple-choice questions. Any path that passes the filtering process... The weights are normalized to

[0098] (6)

[0099] The generation score and step verification performance of the path are characterized. After aggregating credible evidence from multiple paths based on path weights, the final answer decision can be expressed as follows:

[0100] (7)

[0101] With the support of multi-path evidence, for selection-based question-answering tasks, The corresponding candidate options are directly output; for open-ended question-answering tasks, the optimal answer variable is transformed into natural language form. Open-ended answer generation and selective candidate discrimination share a reliable path, evidence induction process, and answer decision-making thread, which is consistent with the design goals of the proposed reasoning framework.

[0102] 3. Collaborative Training Strategy

[0103] KRAFT manifests as a unified, end-to-end process during the inference phase. This means the system sequentially completes constraint space construction, dynamic path generation, step-level verification and local error correction, and unified answer decision-making around the same problem, ultimately outputting the answer. This section proposes a collaborative training strategy that integrates these capabilities into a single main process during the inference phase and executes it end-to-end.

[0104] like Figure 2 As shown, collaborative training consists of three stages:

[0105] (1) Lightweight discriminator training for KGE structural constraints: Train the KGE model and introduce a step-level verifier to jointly review the factual support, path coherence and goal consistency of intermediate reasoning steps (see steps corresponding to purple arrows).

[0106] (2) LLM fine-tuning of path iteration strategy: The LLM is fine-tuned to learn a constrained multi-hop path expansion strategy under local graph constraints. Error type identification results are used to determine the source of failure, and local backtracking and directional correction are performed with the help of a prompt-driven LLM replanning mechanism. General language modeling capability is transformed into path iteration and relation expansion capability for KG knowledge reasoning (see steps corresponding to red arrows).

[0107] (3) Multi-paradigm question answering output adaptation: Based on a unified answer space and credible evidence representation, the answer output layer is adapted to unify the answer output decision-making methods of different question answering paradigms. Open-ended and selective question answering can achieve consistent output under the condition of sharing the main reasoning framework (see the steps corresponding to the green arrows).

[0108] 3.1 Lightweight Discriminator Training for KGE Structural Constraints

[0109] To provide stable structural constraints, this section trains a KGE model on the target KG.

[0110] For a positive sample triplet Replace the head or tail entity to construct the corresponding negative sample set. The embedding model is trained using a marginal ranking loss. This indicates that the KGE model applies to triples. The scoring function. The loss during KGE model training is calculated as...

[0111] (8)

[0112] in, This represents the marginal parameter in the loss function. After training, the KGE output displays the structural features of entities and relations, providing scoring signals for local graph pruning, candidate relation ranking, and step discrimination. This score serves two purposes: firstly, it measures the structural rationality of candidate triples, and secondly, it supports the pruning of problem-related local graphs and the prioritization of candidate relations.

[0113] KGE structural constraint signals guide the construction of a lightweight constraint discriminator. This discriminator, prior to LLM review, explicitly discriminates candidate paths, thus achieving end-to-end judgment of local extension credibility. Let the local inference unit at step i in a candidate path be... This includes the current candidate step, the corresponding KGE structure score, the existing path prefix state, and the problem semantics. The discriminator outputs a prediction vector. These correspond to the three dimensions of factual support, path coherence, and goal consistency, respectively. Let the error type label for this step be... Error type classifier The predicted probability is Step i is in the first step. The supervision labels on each verification dimension are represented as follows: The weights of the error type classification loss are expressed as follows: The validator loss function is then written as:

[0114] (9)

[0115] The loss function constrains the discriminator to complete step-level credibility judgment and error source location. Therefore, the discriminator can be regarded as an end-to-end explicit verification model with KGE as the structural foundation.

[0116] 3.2 LLM Fine-tuning of Path Iteration Strategy

[0117] This section employs the LoRA (Low-Rank Adaptation) method for SFT (Supervised Fine-Tuning) and DPO (Direct Preference Optimization) fine-tuning, enabling LLM to generate next-hop paths under KG constraints. The inference path iteration of LLM must possess the ability to perform local backtracking and replanning based on path iteration.

[0118] Figure 3 In the middle, (a) is the constrained next-hop expansion prompt, (b) is the step-level verification prompt, and (c) is the local rollback and regeneration prompt;

[0119] exist Figure 3 In the constrained next-hop expansion cue shown in (a), the problem, current path prefix, reachable entity state, and candidate relation set are organized as LLM inputs, and the LLM is explicitly constrained to select the next-hop relation only from the candidate relation set. This cue constitutes the main training object in the SFT stage, and its role is to initialize the general language modeling capability of the basic LLM into a constrained relation expansion capability under local graph constraints. With the help of this cue, the LLM learns to complete the goal-oriented next-hop selection within the candidate relation space, instead of relying on unconstrained free generation.

[0120] Figure 3The step-level verification prompt shown in (b) is used to review the factual support, path coherence, and goal consistency of the current extension step, and outputs error type and explanation information. In this prompt, Fact, Coherence, and Goal correspond to the three credibility dimensions of the verifier mentioned above, Error Type is used to mark the main sources of failure in the current step, and Explanation is used to provide a qualitative explanation. It should be noted that this prompt mainly follows the structured feedback output by the constraint discriminator in the previous section. Its core function is to transform the step-level discrimination results into control signals that can be consumed by the LLM, rather than being the main optimization target of DPO.

[0121] Figure 3 The local backoff and regeneration prompt shown in (c) is triggered when the aforementioned path is determined to be of low confidence. This prompt retains verified reliable prefixes and explicitly incorporates the failed step, error type, disabled relation, and new candidate relation set into the input, thereby guiding the LLM to correct failed branches while preserving valid evidence. Compared to the constrained next-hop extension prompt shown in (a), this prompt interface no longer focuses on next-hop generation in a general sense, but rather on local backoff, replanning, and error avoidance in failure states, which is the optimization objective of the control strategy in the DPO phase.

[0122] SFT is used to initialize LLM, enabling it to perform basic path expansion and control behavior under local graph constraints. Let the path supervision dataset be... ,in represent The corresponding supervised path. Based on the path prior distribution, the loss function for the path generation stage is:

[0123] (10)

[0124] The first term guides LLM to learn the true path distribution under local graph constraints; the second term utilizes ordering constraints to improve LLM's ability to distinguish between correct and distracting relationships. and These represent the weights and marginal parameters of the ranking loss, respectively. The original language modeling capability of LLM is calibrated to a constrained selection capability oriented towards a set of candidate relations.

[0125] like Figure 4 As shown, after completing the SFT initialization, DPO (Device Optimization Point) is introduced (it is necessary to introduce) to optimize the preferences of the control strategy. Under the same verification state, one action may help recover the reliable path, reduce invalid loops, and improve the accuracy of the final answer, while another action may lead to the repetition of error patterns, additional backoff overhead, or deviation from the problem objective. To characterize this relative preference relationship, This represents the current control context, consisting of the problem, validated path prefixes, the current failed step, the error type, and a new set of candidate relationships. Let... The preferred action within the context is one that leads to successful subsequent expansions or reduces the number of invalid rollbacks. This involves identifying inferior actions that lead to a continued deviation from the problem objective or an unnecessary increase in search depth. A preference dataset is then constructed. .

[0126] set up The reference model obtained from the SFT stage and kept frozen. This represents the current policy model that needs to be optimized. Let represent the preference intensity control parameter, then the loss function in the DPO stage is:

[0127] (11)

[0128] in, Let represent the Sigmoid function. LLM, while maintaining the basic stability of the initial policy distribution in the SFT, increases the relative probability of the preferred control action compared to the inferior control action, thereby enhancing the performance of LLM. and The ability to choose strategies between different approaches. Compared to relying solely on supervised imitation, DPO more directly encodes preference information for better control actions, making it suitable for... Figure 3 The failure state control scenario is shown in (c) above.

[0129] From a training responsibility perspective, SFT is used... Figure 3 The constrained expansion prompts (a) and (b) are used to initialize the basic path expansion capability under local graph constraints. DPO is used for... Figure 3 (c) The corresponding local rollback and regeneration hint interface is used to optimize rollback, correction, and replanning strategies in failure states. Since the above capabilities are ultimately carried by the same LLM parameter, the control preferences optimized by the DPO are also indirectly affected through parameter sharing. Figure 3 The extended behaviors corresponding to (a) and (b) are shown in the diagram. It should be noted that DPO is used for path expansion and optimization of the control strategy itself, and is not directly used for the final answer output. The reliability of the current step is determined by KGE and the lightweight discriminator, while subsequent actions are generated by LLM. These two mechanisms respectively assume different responsibilities in the inference chain: constraint judgment and generation control.

[0130] Training with SFT and DPO enables LLM to progressively complete constrained path expansion, local backtracking, and directional replanning under the combined influence of graph constraints, validation feedback, and error type information. After this training phase, LLM no longer merely performs relation prediction but serves as the backbone of policy generation, continuously outputting reasoning action sequences that better meet structural constraints and credibility requirements, providing high-quality path evidence for subsequent answer decisions.

[0131] 3.3 Multi-paradigm Question-Answer Output Adaptation

[0132] As described in Section 2.3, multi-paradigm question answering is unified into a conditional probability learning problem on the same answer space. Therefore, different question answering paradigms not only share the same inference backbone but also share a consistent answer modeling objective. Based on Equation (8), the training process for multi-paradigm question answering involves conditional probability modeling of the correct answer variable on the answer space. Let the answer supervision dataset be... The loss for output adaptation fine-tuning is formalized as

[0133] (12)

[0134] For multiple-choice questions, the correct answer variable directly corresponds to the correct option in the candidate set. For open-ended questions, the correct answer variable corresponds to the target answer representation consisting of the endpoint of a credible path or its normalized representation. Unlike a direct mapping that treats only the answer as the endpoint entity, the semantic inductive power of LLM is preserved in the output adaptation stage. Credible path evidence is used to support LLM in organizing the structured reasoning results into answer representations suitable for analysis.

[0135] Answer modeling relies on the results of trusted path iterations and a unified answer space. When the Knowledge Group (KG) lacks some explicit knowledge, the LLM can provide necessary semantic supplementation and induction for question-and-answer processing, thereby avoiding the output being limited to a mechanical mapping of the path's endpoint entity. After training, the KGE constraint discriminator and the LLM output module group are assembled into the same inference chain, thus forming a trusted end-to-end inference execution process during the inference phase.

[0136] The constrained reasoning process of search, verification and error correction, and unified decision-making is summarized as Algorithm 2:

[0137] (1) Constrained bundle search: Starting with an empty path as the initial state, continue to expand around the retained path prefix in each iteration (see lines 1-4). For any path prefix, query its set of legal candidate relations from the prefix constraint index (see line 5), and generate a corresponding new path for each candidate relation (see lines 6-8). Combine the entity relation pattern prior to calculate the joint score of the current expansion (see line 8).

[0138] (2) Step-level verification and local repair: The new path is verified step-level by three dimensions: factual support, path coherence, and goal consistency (see lines 9-10). The generated score and the verification score are added together to the total path score, and the path is retained in the candidate set for the current step (see lines 12-13). After expanding all candidate paths for the current step, the algorithm normalizes the scores of the candidate set (see line 17) and retains the highest-scoring path. The path is used as input for the next round of beam search (see line 18).

[0139] (3) Collection of credible evidence and decision-making: The paths retained in each step are merged to form the final set of credible paths (see line 20). In the unified answer space, the weights of all credible paths that support the answer are accumulated for each candidate answer, and the answer with the highest probability is selected as the final output (see lines 21-23).

[0140]

[0141] 4. Experimental Preparation

[0142] 4.1 Experimental Dataset

[0143] This experiment uses WebQSP

[22] CWQ

[23] and PQL

[24] As an open-source KGQA dataset, MedQA containing 12,723 medical question-answering samples was used to test the adaptability of the proposed inference framework to selection-based question-answering tasks.

[11] A dataset was additionally introduced. This dataset is derived from questions on the U.S. Medical Licensing Examination, and the questions mainly involve case analysis, disease diagnosis, drug use, and clinical decision-making, exhibiting strong professional knowledge intensity and complex reasoning characteristics. Each question contains four candidate options, making it naturally suitable as a benchmark for multiple-choice question answering. To test the adaptability of the proposed reasoning framework to multi-paradigm question answering tasks, MedQA was used to construct experimental settings with and without options. The setting with options retains the original candidate options to evaluate the LLM's ability to discriminate choices; the setting without options removes the candidate options, retaining only the question text, to evaluate the ability to generate open-ended answers under the same reasoning framework.

[0144] To train the discriminator for KGE constraints, a step-by-step iterative validation sample set was constructed based on real knowledge paths from the four datasets mentioned above. Valid steps were extracted from the real reasoning paths in the datasets as positive samples. Entity substitution, relation substitution, and path shuffling were used to construct negative samples, thereby covering typical error types such as factual errors, path mismatches, and target deviations. This sample set was used to train a step-level validator to perform fine-grained judgments on intermediate reasoning steps and to provide supervision signals for subsequent local backtracking and regeneration mechanisms.

[0145] 4.2 Experimental Setup

[0146] KGE uses the PyKEEN toolset.

[25] RotatE model training is implemented. LLM uses the LLaMA-Factory toolset.

[26] Complete SFT.

[0147] After fine-tuning the SFT phase, DPO is used for preference optimization in path expansion and control policies. DPO is implemented based on the LLaMA-Factory toolset and maintains the same base model, vocabulary settings, and template configuration as the SFT phase. Preference data is constructed using standard triplet forms, where each training sample consists of prompt, chosen, and rejected within the same context. The prompt comprises the question, validated path prefix, current failed step, error type, and a new set of candidate relations. The chosen action is the preferred control action that leads to higher step-level validation pass rates, fewer invalid backoffs, and higher final answer accuracy. The rejected action is the inferior action that causes repeated error patterns, question target shift, or additional search overhead. During training, the LoRA adapter obtained in the SFT phase is used as the initialization parameters for the policy model, and the corresponding frozen reference model is retained to calculate the relative preference signal; no additional independent reward model is trained. The DPO loss function uses a sigmoid form, with preference intensity parameters... Set it to 0.1.

[0148] For the open-ended question-answering datasets WebQSP, CWQ, and PQL, credible path evidence was used to generate open-ended answers. For the MedQA with options setting, the model was required to perform candidate option discrimination on the same inference backbone; for the MedQA without options setting, the original candidate options were removed, and only the question text was retained. The model was required to directly generate the answer text to examine the adaptability of the unified inference framework under different output formats.

[0149] All experiments were performed on a workstation equipped with dual NVIDIA RTX 4090 GPUs. Except for necessary adjustments to the maximum number of hops, candidate pruning size, and local graph extent due to differences in the dataset itself, all other key training and inference settings were kept consistent with KELIN to ensure fairness in the experimental comparisons.

[0150] 4.3 Ablation Study and Selection of Benchmark Methods

[0151] This section compares the method proposed in this invention with three benchmarks.

[0152] (1) LLM-based methods:

[0153] Qwen3

[28] Llama

[29]

[30] DeepSeek-V3

[38] ChatGPT

[27]

[0154] (2) Graph-based methods:

[0155] GraftNet [8] PullNet

[10] NSM

[31] SR+NSM [9] SQALER

[32] 、ReaRev

[33]

[0156] KBIGER

[37] An iterative reasoning method for multi-hop KBQA, which completes knowledge base reasoning through intermediate steps of generation and gradual expansion.

[0157] QA-GNN

[11] This approach combines KG message passing mechanisms to achieve joint reasoning of semantic and KG structural information. It is used for evaluation on the MedQA dataset.

[0158] (3) KG-enhanced LLM inference method:

[0159] KD-CoT

[16] EWEK-QA

[20] StructGPT

[14] KB-BINDER

[19] ToG

[13] ,RoG

[12]

[0160] PoG

[34] A planning-based reasoning framework for KGQA, employing adaptive path planning and search strategies, and reporting results such as answer performance, LLM call count, and lexical consumption on WebQSP and CWQ.

[0161] GoG

[39] This study examines the compensatory role of parameterized knowledge in LLM by considering LLM as both a reasoning agent and a source of implicit knowledge supplementation, under conditions of complete and incomplete KG settings.

[0162] GCR

[17] : To constrain KG to the KGQA inference framework in the inference process.

[0163] FiDeLiS

[18] A KG-enhanced LLM inference framework employing step-by-step search and verifiable reasoning mechanisms.

[0164] KG-SFT

[21] : Utilize KG to generate structured interpretation samples and perform SFT. Used for evaluation on the MedQA dataset.

[0165] For evaluation metrics, Hit@1 and F1 were used as the main evaluation metrics for open-ended question-answering datasets, while Accuracy was used as the main evaluation metric for selective question-answering datasets. Hit@1 is used to check whether the generated response contains any correct answer, F1 is used to comprehensively measure the accuracy and recall of the prediction results, and Accuracy is used to evaluate the model's ability to discriminate within the candidate set.

[0166] From a functional architecture perspective, KRAFT is decomposed into several variants for ablation studies, as shown in Table 1. This ablation experiment focuses on variants with consistent architecture, which, while maintaining the integrity of the end-to-end inference main flow, isolate the specific contributions of each major functional module as much as possible. The ablation variants are as follows:

[0167] Overall performance verification (Proposed-1 to -6): Several Qwen and Llama series LLMs with different parameter values ​​were selected as base LLMs and fully integrated into the KRAFT framework.

[0168] Ablation of the graph constraint module (Proposed-7, -8, -9): The LLM step verification and unified answer decision module remain unchanged, and the proposed KGE-guided graph constraint construction and candidate relation ranking mechanism is replaced by random selection, frequency ranking or First-k control strategy.

[0169] Ablation of step-level verification and local backoff modules (Proposed-10, -11): Preserving the graph constraint space and dynamic path generation module. Proposed-10 removes the step-level verifier and degenerates process control into a simple backoff strategy that does not rely on explicit verifiers. Proposed-11 further removes the local backoff mechanism, completing inference solely based on a single constrained path generation.

[0170] Ablation of the unified answer decision module (Proposed-12, -13): The aforementioned graph constraint, path generation and process verification modules are retained, but the multi-path reasoning chain aggregation is replaced with native LLM direct answer.

[0171] 5 Results Analysis

[0172] This section systematically analyzes the experimental results from multiple dimensions. Ablation experiments verify the specific roles of KGE constraints, step-level verification, and local backoff mechanisms, and evaluate the performance trends of the method under different inference depths. Furthermore, two process-level statistical indicators, step pass rate and error correction success rate, are introduced to analyze the process reliability of the proposed framework.

[0173] Table 1 Classification of the proposed methods

[0174]

[0175] 5.1 Benchmarking

[0176] Table 2 Benchmark tests under different base LLMs

[0177]

[0178] This experiment first analyzes the performance of the proposed framework and the native LLM. As shown in Table 2, KRAFT demonstrates performance improvement on all four datasets compared to the corresponding native LLM. Proposed-6 achieves 90.4% and 74.6% Hit@1 and F1 scores on WebQSP, respectively, representing improvements of 27.2% and 45% compared to the native Llama3.1-8B. KRAFT shows a more significant enhancement effect on small-to-medium-scale base LLMs. Taking Qwen3 as an example, Proposed-1 to Proposed-3 all significantly outperform the corresponding native LLMs, with particularly noticeable improvements on PQL. These results indicate that the KG-guided constraint and path iteration mechanism can compensate for the lack of knowledge in small-scale parameter LLMs during complex inference.

[0179] The results from MedQA (Open) demonstrate the adaptability of the proposed framework in medical question answering scenarios with insufficient knowledge base (KG). The accuracy of the native LLM in this scenario is significantly lower than that of the general KGQA dataset, indicating that medical question answering places higher demands on long-contextual expertise and the standardization of answer representations. KRAFT's performance is significantly higher than its corresponding native base LLM. These results demonstrate that even when medical-related KGs are missing or explicit paths are incomplete, the proposed framework can still utilize KG constraints to narrow the search space and combine the parameterized knowledge of LLM to complete supplementary inferences, thereby improving the problem-solving capability of medical question answering.

[0180] Table 3 Performance comparison with different baseline models

[0181]

[0182] Next, the accuracy performance of the proposed framework is compared with advanced graph methods and baseline methods that enhance LLM inference with KG. As shown in Table 3, compared with most excellent baseline methods, KRAFT achieves a 5-10% Hit@1 performance gain on WebQSP. Proposed-6 achieves 90.4% Hit@1 and 74.6% F1 on WebQSP, both outperforming methods such as RoG. Moving the KGE signal forward to the path iteration stage and introducing explicit verification and local correction in intermediate inference steps is more effective in suppressing error propagation than simply relying on retrieval enhancement or hint-driven inference.

[0183] Methods that partially rely on stronger closed-source LLMs or high-cost inference processes still maintain an advantage in certain metrics. For example, PoG and GCR outperform KRAFT in Hit@1 on WebQSP and CWQ. This indicates that directly applying an external inference process of a ChatGPT-level closed-source LLM for deep error correction can still improve the final accuracy. However, compared to these high-cost methods, KRAFT has achieved highly competitive results using only a 7B / 8B-level open-source base LLM, achieving an F1 score of 74.6% on WebQSP, higher than GCR. Overall, KRAFT achieves a good balance between performance and implementation cost, validating the effectiveness of the proposed framework in complex knowledge question answering.

[0184] 5.2 Analysis of Multi-paradigm Question Answering Adaptability

[0185] To verify the adaptability of the unified trustworthy reasoning framework to different question-answering paradigms, this section compares the performance of MedQA under two settings: open-ended question answering and option-based question answering.

[0186] Table 4 shows the performance of the proposed framework on the MedQA dataset.

[0187]

[0188] As shown in Table 4, under the option setting, Proposed-6 achieved an accuracy of 65.3% on MedQA (Options), which is 27.3 and 16.1 percentage points higher than QA-GNN and KG-SFT, respectively. This result indicates that the proposed method does not rely solely on LLM for surface semantic matching of candidate options, but can achieve more evidence-based candidate option discrimination within a graph-constrained inference space by combining answer decision mechanisms. In contrast, QA-GNN mainly relies on graph structure propagation and representation aggregation, KG-SFT focuses on improving the model's knowledge utilization ability through knowledge-driven fine-tuning, while KRAFT collaboratively models structural constraints, step control, and final decision-making, thus demonstrating a stronger discriminative advantage in choice-based medical question answering.

[0189] Meanwhile, in open-ended settings, medical question answering no longer provides explicit candidate options, making the task significantly more difficult than in options-based settings. Therefore, the overall accuracy is generally lower in open-ended scenarios. Table 2 shows that KRAFT maintains good answering capabilities in open-ended settings, with accuracy consistently higher than the native LLM. This indicates that the proposed framework can improve answer discrimination accuracy under candidate constraint. Even in the absence of explicit option assistance, the proposed framework can still stably generate relatively reasonable answers using KG constraints.

[0190] 5.3 Ablation Experiment

[0191] To analyze the contribution of different modules to the overall performance, this section conducts ablation experiments focusing on the KGE constraint mechanism, the step-level control module, and the answer decision module.

[0192] 5.3.1 Analysis of the effect of KGE constraints

[0193] KGE structural constraint consistency signals were used to filter and rank candidate relations. To evaluate the effectiveness of this module, the discriminator, step-level verification, and answer decision modules were retained, and Proposed-6 was compared with three KGE constraint degenerate variants. Proposed-7 replaced them in a random manner, Proposed-8 adopted a frequency-based heuristic relation prioritization strategy, and Proposed-9 adopted a simple First-k candidate retention strategy.

[0194] As shown in Table 5, removing the KGE-guided graph constraints significantly reduced the performance of all variants across multiple datasets, indicating that the graph constraint module plays a fundamental role in the overall performance of KRAFT. Using Proposed-6 as a reference, Proposed-8 performed best overall among the three degradation strategies, demonstrating that while heuristic priors based on relation frequency provide coarse-grained candidate ranking information, they cannot replace the structural consistency constraints provided by KGE. Compared to other datasets, CWQ exhibits more complex multi-hop dependencies and a higher candidate branch density. This suggests that without the pruning of the candidate relation space by graph constraints, erroneous branches are more likely to enter subsequent search processes early in the inference process and gradually accumulate and amplify in intermediate steps. In contrast, WebQSP primarily deals with two-hop problems with shallower inference depth, thus maintaining relatively acceptable performance even after degradation. Figure 5 shows the performance degradation of different constraint strategies relative to Proposed-6, indicating that the role of KGE constraints is not merely simple candidate re-ranking, but rather substantially alters the search space structure in complex inference scenarios, suppressing invalid expansion and error propagation at the source.

[0195] Table 5. Results of KGE confinement ablation experiments

[0196]

[0197] Table 6. Experimental Results of Path Generation Initialization and Step-Level Controlled Ablation

[0198]

[0199] 5.3.2 Effectiveness Analysis of Path Initialization and Step-Level Control

[0200] Given a graph-constrained space, KRAFT relies on path generation initialization, step-level verification, and local backoff mechanisms to continuously control the intermediate inference trajectory. To evaluate the effectiveness of the path iteration mechanism, this section compares Proposed-6 with its degenerate versions, Proposed-10 and Proposed-11. Proposed-10 removes the explicit step-level verifier, retaining only a simple local backoff strategy. Proposed-11 further removes local backoff, degenerating the inference process into a single constrained path generation.

[0201] As shown in Table 6, Proposed-6 consistently outperforms the ablation variant in accuracy and exhibits a clear trend of gradual recovery. Proposed-11 achieves relatively high performance while preserving graph constraints, demonstrating that constrained path initialization itself is significantly superior to the unstructured native inference approach. The performance improvement from Proposed-11 to Proposed-10 indicates that even without an explicit verifier, the fallback mechanism alone can mitigate the error accumulation caused by a single failed path expansion. The improvement from Proposed-10 to Proposed-6 shows that what truly makes KRAFT more stable in complex inference tasks is not simply increased retrying, but the explicit inclusion of step verification signals, which gives local corrections target-oriented and error-avoidance capabilities.

[0202] Figure 6 visually illustrates the recovery trend of model performance as the control strategy increases from weak to strong. It can be seen that with the gradual introduction of single-constrained generation, backoff mechanisms, and explicit verification-driven control, KRAFT's overall performance on the three datasets steadily improves. This indicates that the proposed framework's control mechanism has good modular interpretability; the different components are not loosely stacked, but rather gradually strengthen along the direction of credibility.

[0203] 5.3.3 Analysis of the Role of the Unified Answer Decision Module

[0204] After iterative path generation, KRAFT needs to aggregate evidence from multiple credible paths and make a final decision on a unified answer space. Proposed-12 and -13 correspond to the answer decision degradation versions of Proposed-4 and -6, respectively. Both degradation versions use the native LLM answer strategy.

[0205] As shown in Table 7, both the full-featured versions of Proposed-4 and -6 achieved better Hit@1 and F1 scores on WebQSP and CWQ, regardless of whether they were on Qwen or Llama. This indicates that the answer decision module not only improves single-point hit capability but also enhances the overall answer stability after multi-path evidence fusion. Particularly on CWQ, the F1 score of Proposed-13 decreased more significantly. This suggests that without a credible evidence aggregation mechanism, while LLM can sometimes hit some answers, it is prone to shortcomings in multi-answer coverage and multi-evidence integration. Nevertheless, the other modules in this ablation experiment remained consistent with Proposed-6, and the degraded version still achieved certain results, indicating that the aforementioned modules provided relatively reliable reasoning support for the final answer.

[0206] Table 7 Ablation Experiment Results of the Answer Decision Module

[0207]

[0208] 5.4 Step-by-step credibility analysis

[0209] To evaluate KRAFT's path iteration capability during intermediate inference, process-level statistical metrics are introduced: step pass rate and error correction success rate. Step pass rate represents the proportion of candidate extensions deemed credible after verification, while error correction success rate represents the proportion of paths that can be regenerated after triggering a local backtrack. These two metrics are used to analyze KRAFT's process reliability from both error identification and error correction perspectives.

[0210] Figure 7(a) examines the discriminative performance of the step-level validator. Proposed-6 divides the problem reasoning depth in PQL into two-hop, three-hop, and more than three-hop scenarios. PQL contains a relatively clear division of reasoning depth, which is suitable for observing the changes in process credibility as the path length increases. As the reasoning depth gradually increases, both the step pass rate and the error correction success rate gradually decrease. This indicates that in longer path scenarios, the number of candidate triples and the cumulative error of intermediate states increase simultaneously. This decrease is gradual; in scenarios with more than three hops, the step pass rate and error correction success rate remain at a high level, and the proposed iterative error correction mechanism still has good usability in long-chain scenarios. KRAFT's advantage in complex reasoning scenarios is not only reflected in the higher accuracy at the final answer level, but also in its ability to maintain stable intermediate step quality throughout the path expansion process.

[0211] Analyzing only the complete model is insufficient to fully explain the relationship between these process-level metrics and final performance. Therefore, Figure 7(b) supplements the analysis with the results of ablation experiments to examine process reliability under different control capability variants. It should be noted that Proposed-11 does not include a local rollback mechanism; therefore, the error correction success rate of this model is denoted as "N / A". As control capabilities gradually increase, different ablation versions show a recovery trend in both step pass rate and error correction success rate. The rollback mechanism in Proposed-10 alleviates some error propagation issues. Proposed-6, with verifier feedback support, improves the step pass rate and makes it easier to regenerate verified extensions after triggering rollback. This indicates that the key role in KRAFT is not merely the multiple retries of the LLM, but rather the targeted error identification and local correction based on step verification signals.

[0212] Figure 7(c) shows the clustering visualization of the real path, KELIN path, and KRAFT path in the two-dimensional semantic projection space. Each point in the figure represents the projection position of a path in the semantic space. The real path forms a relatively concentrated reference cluster in the central region, while the KRAFT path is mainly distributed around this center, with a more compact overall cluster, indicating that its generation process has higher semantic consistency with the target path. In contrast, the KELIN path is more dispersed overall, with more points far from the center of the real path, indicating that it is more prone to local offsets, redundant expansions, or semantic drift during path generation. KRAFT's advantage is not just in getting more answers correct, but also in deviating less from the correct path in the intermediate process, demonstrating the process verification capability of the trustworthy reasoning framework.

[0213] 5.5 Reasoning Efficiency Analysis

[0214] Improving the reliability of intermediate steps in complex reasoning often comes at the cost of additional computation. This section evaluates the cost and reasoning efficiency of the proposed method in complex scenarios from the perspectives of reasoning latency and lexical consumption.

[0215] As shown in Figure 8(a), KRAFT achieved the highest accuracy on WebQSP, while its average inference time was at a moderate level. Compared to KELIN, KRAFT's inference time increased due to the introduction of the path iteration strategy, but this increase in overhead did not double with the increase in answer accuracy. Although KRAFT's time was not the lowest, it achieved an optimal trade-off between accuracy and time.

[0216] Figure 8(b) illustrates the relationship between lexical cost and accuracy for different methods. KRAFT's average lexical cost is higher than KELIN's, but significantly lower than agent-based methods such as ToG and StructGPT. Although KRAFT requires additional encoding of verification feedback, local backoff states, and new candidate relation sets, its context overhead remains within a relatively reasonable range, and it does not rely on high-cost solutions such as text stacking or increasing the number of inference rounds to achieve performance improvement. In contrast, although KELIN has lower lexical cost, its process control capability is relatively weaker, resulting in a lower final accuracy than KRAFT. These results demonstrate the lightweight and effective credibility enhancement strategy in KRAFT.

[0217] References

[0218] [1]Vaswani A, Shazeer N, Parmar N, et al. Attention is all you need[J]. Advances in Neural Information Processing Systems, 2017, 30: 5998–6008.

[0219] [2] Shu Wentao, Li Ruixiao, Sun Tianxiang, Huang Xuanjing, Qiu Xipeng. Large-scale language models: principles, implementation and development [J]. Computer Research and Development, 2024, 61(2): 351-361.

[0220] [3]Huang L, Yu W, Ma W, et al. A survey on hallucination in large language models: Principles, taxonomy, challenges, and open questions[J]. ACMTransactions on Information Systems, 2025, 43(2): 1-55.

[0221] [4] Liu Zeyuan, Wang Pengjiang, Song Xiaobin, et al. A review of research on the illusion problem of large language models [J]. Journal of Software, 2025, 36(03): 1152-1185.

[0222] [5]Wei J, Wang X, Schuurmans D, et al. Chain-of-thought promptingelicits reasoning in large language models[J]. Advances in neural informationprocessing systems, 2022, 35: 248224837.

[0223] [6]Wang X, Wei J, Schuurmans D, et al. Self-Consistency ImprovesChain of Thought Reasoning in Language Models[C] / / The Eleventh InternationalConference on Learning Representations. 2023.

[0224] [7]Ji Z, Lee N, Frieske R, et al. Survey of hallucination in naturallanguage generation[J]. ACM computing surveys, 2023, 55(12): 1-38.

[0225] [8]Sun H, Dhingra B, Zaheer M, et al. Open domain question answeringusing early fusion of knowledge bases and text[C] / / Proceedings of the 2018conference on empirical methods in natural language processing. 2018: 4231-4242.

[0226] [9]Zhang J, Zhang X, Yu J, et al. Subgraph retrieval enhanced modelfor multi-hop knowledge base question answering[C] / / Proceedings of the 60thannual meeting of the association for computational linguistics (volume 1:Long papers). 2022: 5773-5784.

[0227]

[10] Sun H, Bedrax-Weiss T, Cohen W. Pullnet: Open domain questionanswering with iterative retrieval on knowledge bases and text[C] / / Proceedings of the 2019 conference on empirical methods in natural languageprocessing and the 9th international joint conference on natural languageprocessing (EMNLP-IJCNLP). 2019: 2380-2390.

[0228]

[11] Yasunaga M, Ren H, Bosselut A, et al. QA-GNN: Reasoning withlanguage models and knowledge graphs for question answering[C] / / Proceedingsof the 2021 conference of the North American chapter of the association forcomputational linguistics: human language technologies. 2021: 535-546.

[0229]

[12] LUO L, Li Y F, Haffari G, et al. Reasoning on Graphs: Faithfuland Interpretable Large Language Model Reasoning[C] / / The TwelfthInternational Conference on Learning Representations. 2024.

[0230]

[13] Sun J, Xu C, Tang L, et al. Think-on-Graph: Deep and ResponsibleReasoning of Large Language Model on Knowledge Graph[C] / / The TwelfthInternational Conference on Learning Representations. 2024.

[0231]

[14] Jiang J, Zhou K, Dong Z, et al. Structgpt: A general frameworkfor large language model to reason over structured data[C] / / Proceedings ofthe 2023 Conference on Empirical Methods in Natural Language Processing.2023: 9237-9251.

[0232]

[15] Brown T, Mann B, Ryder N, et al. Language models are few-shotlearners[J]. Advances in neural information processing systems, 2020, 33:1877-1901.

[0233]

[16] Wang K, Duan F, Wang S, et al. Knowledge-driven cot: Exploringfaithful reasoning in llms for knowledge-intensive question answering[J].arXiv preprint arXiv:2308.13259, 2023.

[0234]

[17] Luo L, Zhao Z, Haffari G, et al. Graph-constrained Reasoning:Faithful Reasoning on Knowledge Graphs with Large Language Models[C] / / International Conference on Machine Learning 2025. Proceedings of MachineLearning Research (PMLR), 2025: 41540-41565.

[0235]

[18] Sui Y, He Y, Liu N, et al. Fidelis: Faithful reasoning in largelanguage models for knowledge graph question answering[C] / / Findings of theAssociation for Computational Linguistics: ACL 2025. 2025: 8315-8330.

[0236]

[19] Li T, Ma X, Zhuang A, et al. Few-shot in-context learning onknowledge base question answering[C] / / Proceedings of the 61st Annual Meetingof the Association for Computational Linguistics (Volume 1: Long Papers).2023: 6966-6980.

[0237]

[20] Dehghan M, Alomrani M, Bagga S, et al. EWEK-QA: Enhanced web andefficient knowledge graph retrieval for citation-based question answeringsystems[C] / / Proceedings of the 62nd Annual Meeting of the Association forComputational Linguistics (Volume 1: Long Papers). 2024: 14169-14187.

[0238]

[21] Chen H, Shen X, Wang J, et al. Knowledge graph finetuningenhances knowledge manipulation in large language models[C] / / The ThirteenthInternational Conference on Learning Representations. 2025.

[0239]

[22] Yih W, Richardson M, Meek C, et al. The value of semantic parselabeling for knowledge base question answering[C] / / Proceedings of the 54thAnnual Meeting of the Association for Computational Linguistics (Volume 2:Short Papers). 2016: 201-206.

[0240]

[23] Talmor A, Berant J. The web as a knowledge-base for answeringcomplex questions[C] / / Proceedings of the 2018 Conference of the NorthAmerican Chapter of the Association for Computational Linguistics: HumanLanguage Technologies, Volume 1 (Long Papers). 2018: 641-651.

[0241]

[24] Zhou M, Huang M, Zhu X. An interpretable reasoning network formulti-relation question answering[C] / / Proceedings of the 27th internationalconference on computational linguistics. 2018: 2010-2022.

[0242]

[25] Ali M, Berrendorf M, Hoyt C T, et al. PyKEEN 1.0: a pythonlibrary for training and evaluating knowledge graph embeddings[J]. Journal ofMachine Learning Research, 2021, 22(82): 1-6.

[0243]

[26] Zheng Y, Zhang R, Zhang J, et al. Llamafactory: Unified efficientfine-tuning of 100+ language models[C] / / Proceedings of the 62nd annualmeeting of the association for computational linguistics (volume 3: systemdemonstrations). 2024: 400-410.

[0244]

[27] Achiam J, Adler S, Agarwal S, et al. Gpt-4 technical report[J].arXiv preprint arXiv:2303.08774, 2023.

[0245]

[28] Yang A, Li A, Yang B, et al. Qwen3 technical report[J]. arXivpreprint arXiv:2505.09388, 2025.

[0246]

[29] Touvron H, Martin L, Stone K, et al. Llama 2: Open foundation andfine-tuned chat models[J]. arXiv preprint arXiv:2307.09288, 2023.

[0247]

[30] Grattafiori A, Dubey A, Jauhri A, et al. The Llama 3 herd ofmodels[C] / / Neural Information Processing Systems. Curran Associates, 2024.

[0248]

[31] He G, Lan Y, Jiang J, et al. Improving multi-hop knowledge basequestion answering by learning intermediate supervision signals[C] / / Proceedings of the 14th ACM international conference on web search and datamining. 2021: 553-561.

[0249]

[32] Atzeni M, Bogojeska J, Loukas A. Sqaler: Scaling questionanswering by decoupling multi-hop and logical reasoning[J]. Advances inNeural Information Processing Systems, 2021, 34: 12587-12599.

[0250]

[33] Mavromatis C, Karypis G. ReaRev: Adaptive reasoning for questionanswering over knowledge graphs[C] / / Findings of the Association forComputational Linguistics: EMNLP 2022. 2022: 2447-2458.

[0251]

[34] Tan X, Wang X, Liu Q, et al. Paths-over-graph: Knowledge graphempowered large language model reasoning[C] / / Proceedings of the ACM on WebConference 2025. 2025: 3505-3522.

[0252]

[35] Li K, Zhang T, Wu X, et al. Decoding on graphs: Faithful andsound reasoning on knowledge graphs through generation of well-formed chains[C] / / Proceedings of the 63rd Annual Meeting of the Association forComputational Linguistics (Volume 1: Long Papers). 2025: 24349-24364.

[0253]

[36] Salnikov M, Le H, Rajput P, et al. Large language models meetknowledge graphs to answer factoid questions[C] / / Proceedings of the 37thPacific Asia Conference on Language, Information and Computation. 2023: 635-644.

[0254]

[37] Du H, Huang Q, Zhang C, et al. Knowledge-enhanced iterativeinstruction generation and reasoning for knowledge base question answering[C] / / CCF International Conference on Natural Language Processing and ChineseComputing. Cham: Springer International Publishing, 2022: 431-444.

[0255]

[38] Guo D, Yang D, Zhang H, et al. DeepSeek-R1 incentivizes reasoningin LLMs through reinforcement learning[J]. Nature, 2025, 645(8081): 633-638.

[0256]

[39] Xu Y, He S, Chen J, et al. Generate-on-graph: Treat LLM as bothagent and KG for incomplete knowledge graph question answering[C] / / Proceedings of the 2024 conference on empirical methods in natural languageprocessing. 2024: 18410-18430.

Claims

1. A reliable inference method for LLM based on KGE constraints and path self-iteration, characterized by the following steps: include: (a) Constructing KRAFT, a self-iterative trustworthy reasoning framework that embeds knowledge graphs and enhances KGE; (ii) Natural language problems are mapped to triples in a knowledge graph (KG) through semantic parsing; Then, the answer is obtained through reasoning using Kraft; The constituent modules of the KRAFT include: The problem input module is used for KGE-oriented structural constraint construction. The step verification module is used to verify feedback-driven inference path iterations. The answer decision module is used for answer decisions supported by credible evidence from multiple paths. The method for constructing the KRAFT is as follows: First, let KG be represented as ,in , and These represent the entity set, the relation set, and the triplet set, respectively. set up To unify answer variables and model credible reasoning as a process of marginalizing potential path variables, thus characterizing multi-paradigm question answering within the same framework; set up For the relation sequence A candidate reasoning path is formed. For input problem The corresponding candidate path space; Therefore, the probability of a uniform answer is (1) Based on path evidence, candidate reasoning paths are generated under KG constraints, and the answer decision is made by the large language model LLM. To introduce credibility constraints, the high-quality inference paths obtained through step-level verification are characterized as the posterior preference distribution of the path variables, specifically: The posterior distribution centered on the trusted path is represented as follows: ; The path generation distribution for generating candidate inference chains under the constraints of the problem-related local graph is represented as follows: ; Then KRAFT satisfies: (2) in Indicates KL divergence; Under the constraints of equation (2), the candidate reasoning paths provide support for the final answer, and the path generation distribution approximates... The posterior distribution of; The training of KRAFT consists of three phases: Phase 1: Discriminator training for KGE structural constraints: Train the KGE model and introduce a step-level verifier to jointly review the factual support, path coherence, and goal consistency of intermediate reasoning steps. Phase Two: LLM Fine-tuning of Path Iteration Strategy: The LLM is fine-tuned to learn constrained multi-hop path expansion strategies under local graph constraints; error type identification results are used to determine the source of failure, and local backtracking and directional correction are performed with the help of a prompt-driven LLM replanning mechanism; the general language modeling capability is transformed into path iteration and relation expansion capability for KG knowledge reasoning. Phase 3, Multi-paradigm Question Answering Output Adaptation: Based on a unified answer space and credible evidence representation, the answer output layer is adapted to unify the answer output decision-making methods of different question answering paradigms, so that open-ended and selective question answering can achieve consistent output under the condition of sharing the main reasoning framework; The reasoning process in step (two) includes: 1) Constrained bundle search: Starting with an empty path as the initial state, it continues to expand around the retained path prefix in each iteration; For any path prefix, query its set of legal candidate relations from the prefix constraint index, generate a corresponding new path for each candidate relation, and calculate the joint score of the current expansion by combining the prior entity relation pattern. 2) Step-level verification and local repair: The new path is verified step-level from three dimensions: factual support, path coherence and goal consistency; the generated score and the verification score are added together to the total score of the path, and the path is retained in the candidate set of the current step; After expanding all candidate paths in the current step, normalize the scores of the candidate set and retain the highest-scoring paths. The path serves as the input for the next round of beam search; 3) Credible evidence aggregation and answer decision: Merge the paths retained from each step to form a final set of credible paths; In the unified answer space, for each candidate answer, the weights of all reliable paths that support that answer are accumulated, and the answer with the highest probability is selected as the final output; During the inference process, the reliability of the current step is determined by KGE and the lightweight discriminator, and subsequent actions are generated by LLM.

2. The LLM trusted reasoning method based on KGE constraints and path self-iteration as described in claim 1, Its characteristic is that the method for constructing KGE-oriented structural constraints is as follows: First, construct a local graph related to the problem, and then construct a controllable constraint space on the local graph, as follows: make For the question The entity set is first extracted from the KG. Centered A skip neighborhood subgraph is considered as a local graph, denoted as... ; These represent the set of entity nodes in the local subgraph, the set of entity nodes in the local subgraph, and the set of knowledge triples in the local subgraph, respectively. Then, candidate triples in the local graph are filtered. ; The consistency between candidate triples and question semantics is determined by The metric represents the degree of relevance of the triple to the semantics of the current problem; the structural consistency score given by the KGE model is determined by... The calculation represents the structural rationality of the triplet in the knowledge graph embedding space; the triplet h, r, and t represent the head entity, relation, and tail entity, respectively. The retention score of the candidate triplet is ,in This is the balance coefficient; if The relevant local diagram of the problem after clipping is constructed as follows: , For threshold; Next, the candidate relationship In the current state, the structural consistency score, semantic relevance score, and relation schema prior score are respectively represented as follows: , and LLM for candidate relations The generation probability is Then the joint expansion score of step i is (3) in , and The balancing parameter; i represents the number of inference steps; Based on equation (3), Represented as (4) in Let i represent the set of candidate relations under reasoning step i; Thus, the legal candidate constraints, path generation probability, and KGE-guided semantic priors are unified into the same decoding process.

3. The LLM trusted reasoning method based on KGE constraints and path self-iteration as described in claim 2, characterized in that: The method for verifying feedback-driven path iteration is as follows: A validator is used to verify intermediate inference steps, and local rollback and regeneration are performed on failed branches, as detailed below: make The corresponding local reasoning unit in step i is In the formula, Indicates execution relationship New entities that arrive later; the validator evaluates them from three dimensions: factual support, path coherence, and goal consistency. Conduct a joint assessment; Let the 3D verification outputs be respectively , and Then the overall credibility score for step i is ,in , and The weights for each validation dimension; if , If the threshold is set, then local rollback and regeneration are triggered, indicating that there is a credibility risk in the current expansion; set up The cumulative generated score is ; for The set of supported answers is then defined as the posterior distribution of the reliable path. (5) in, and The contributions of the generated score and the validation score to the path posterior are controlled separately; represents the other candidate path variables in the normalization term and the cumulative credibility score of all inference steps in path z, respectively; Let the first step that fails validation be: The corresponding set of failure source relationships is denoted as The corrected extended fraction after rollback is ,in This is the penalty coefficient.

4. The LLM-based trusted reasoning method based on KGE constraints and path self-iteration as described in claim 3, Its characteristic is that the answer decision is supported by multi-path credible evidence, as follows: Let the set of trusted paths be ; Any path that passes the filter The weights are normalized to The performance is represented by the generation score of the path and its step verification, as follows: (6) After aggregating credible evidence from multiple paths based on path weights, the final answer decision is represented as follows: (7) With the support of multi-path evidence, for selection-based question-answering tasks, The corresponding candidate options are output directly; for open-ended question-and-answer tasks, the optimal answer variable is converted into natural language form.

5. The LLM trusted reasoning method based on KGE constraints and path self-iteration as described in claim 1, characterized in that: The lightweight discriminator training for KGE structural constraints in training phase one is as follows: First, train the KGE model on the target KG. For a positive sample triplet Replace the head or tail entity to construct the corresponding negative sample set. The KGE model is trained using a marginal ranking loss. This indicates that the KGE model applies to triples. The scoring function; the loss during KGE model training is calculated as (8) in, This represents the marginal parameter in the loss function; After training, the KGE output displays the structural features of entities and relations, providing scoring signals for local graph pruning, candidate relation ranking, and step discrimination. This score is used to measure the structural rationality of candidate triples and to support the pruning of problem-related local graphs and the priority ranking of candidate relations. Then, a KGE structural constraint signal-guided lightweight constraint discriminator is constructed. The discriminator, preceding the LLM review, explicitly discriminates candidate paths, thereby achieving end-to-end judgment of the credibility of local extensions; the discriminator is constructed as follows: Let the local reasoning unit at step i in a candidate path be . It includes the current candidate step, the corresponding KGE structure score, the existing path prefix status, and the problem semantics; Discriminator outputs predicted vector These correspond to the three dimensions of factual support, path coherence, and goal consistency, respectively; let the error type label for step i be... Error type classifier The predicted probability is Step i in the first step The supervision labels on each verification dimension are represented as follows: The corresponding predicted value is The weights of the error type classification loss are expressed as follows: The validator loss function is then... (9) loss function Once the constraint discriminator completes step-level reliability judgment and error source location, the discriminator is considered an end-to-end explicit verification model based on KGE.

6. The LLM-based trusted reasoning method based on KGE constraints and path self-iteration as described in claim 5, characterized in that: The LLM fine-tuning of the path iteration strategy in training phase two uses LoRA for supervised fine-tuning of SFT and Direct Preference Optimization (DPO), enabling the LLM to generate next-hop paths under KG constraints. The method is as follows: First, SFT is used to initialize LLM, enabling LLM to have the ability to extend basic paths and control behavior under local graph constraints, specifically: Let the path supervision dataset be ,in represent The corresponding supervised path; then, based on the path prior distribution, the loss function for the path generation stage is: (10) The first term in Equation (10) is used to guide LLM to learn the true path distribution under local graph constraints; the second term is used to improve LLM's ability to distinguish between correct and interfering relationships by utilizing ranking constraints. and These represent the weights and marginal parameters of the ranking loss, respectively. In this way, the original language modeling capability of LLM is calibrated into a constrained selection capability oriented towards a set of candidate relations; Then, the preferences of the control policy are optimized using DPO, specifically: First construct the preference dataset ,in: Under the same verification conditions, the potential positive effects of one action are to facilitate the recovery of reliable paths, reduce invalid loops, and improve the accuracy of the final answer; the potential negative effects of another action are to lead to repeated error patterns, additional backoff overhead, or deviation from the problem objective. To characterize this relative preference relationship, we use... It represents the current control context, which consists of the problem, the validated path prefix, the current failed step, the error type, and a new set of candidate relationships; The preferred action within the context is one that leads to successful subsequent expansions or reduces the number of invalid rollbacks. This refers to the inferior actions that lead to a continued deviation from the problem objective or an unnecessary increase in search depth; Next set The reference model obtained from the SFT stage and kept frozen. This represents the current control strategy model that needs to be optimized. Let represent the preference intensity control parameter, then the loss function in the DPO stage is: (11) in, This represents the Sigmoid function.

7. The LLM trusted reasoning method based on KGE constraints and path self-iteration as described in claim 5, characterized in that: The multi-paradigm question-answering output adaptation method in training phase three is as follows: Based on equation (8), the training process for multi-paradigm question answering involves conditional probability modeling of the correct answer variable in the answer space. Let the supervised dataset for answer be... The loss for output adaptation fine-tuning is then formalized as (12) For multiple-choice questions, the correct answer variable directly corresponds to the correct option in the candidate set; for open-ended questions, the correct answer variable corresponds to the target answer representation composed of the endpoint of the credible path or its normalized representation.