A multi-path thinking chain reasoning generation method based on fine-grained knowledge retrieval

Through the multi-path thinking chain inference generation method of fine-grained knowledge retrieval, the existing thinking chain technology has solved the shortcomings in semantic understanding and inference structure, achieved high accuracy and logical coherence in reasoning path generation, and improved the inference accuracy and interpretability in complex scenarios.

CN120297425BActive Publication Date: 2025-08-22INST OF INT RELATIONS
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510786179.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-12
Publication Date
2025-08-22
Estimated Expiration
2045-06-12

AI Technical Summary

Technical Problem

The existing thinking chain technology has shortcomings in semantic understanding, inference structure and knowledge integration, and it is difficult to capture implicit information, lack of logical links and a single method of knowledge injection, which affects the efficiency and accuracy of reasoning.

Method used

A multi-path thinking chain inference generation method based on fine-grained knowledge retrieval is adopted to generate inference paths with high semantic correlation and output consistent answers through deep semantic analysis, double-threshold filtering, path construction and optimization, multi-path sampling and consistency decision-making.

Benefits of technology

It significantly improves the accuracy of knowledge extraction and the logical coherence of inference paths, improves the reliability and robustness of the final conclusions, and enhances the accuracy and interpretability of inference in complex scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120297425B_ABST
    Figure CN120297425B_ABST
Patent Text Reader

Abstract

The present invention discloses a multi-path thinking chain reasoning generation method based on fine-grained knowledge retrieval, including: using a large language model to perform deep semantic analysis on user questions, extracting entities contained in the question text and the relationship between entities to generate a triple set; dynamically dividing the triples into different confidence sets by setting high and low double confidence thresholds; constructing a thinking chain framework using pre-defined paths to obtain an initial reasoning path set; optimizing the initial reasoning path, sampling the optimized reasoning path set using Top‑k scoring, and obtaining a reasoning path set with high semantic relevance; dividing the reasoning path set into multiple reasoning path groups with complementary internal path information to obtain multiple candidate answers; using a majority voting mechanism to select multiple candidate answers, and finally obtaining a consistent answer. The present invention can significantly improve the accuracy and interpretability of reasoning, and greatly improve the reliability and robustness of the final conclusion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of artificial intelligence technology, and specifically relates to a multi-path thinking chain reasoning generation method based on fine-grained knowledge retrieval, a computer device, a computer-readable storage medium and a computer program product. Background Art

[0002] In the field of artificial intelligence, Chain-of-Thought (CoT) reasoning technology is a significant breakthrough in improving the interpretability and logical reasoning capabilities of AI models. Traditional large language models (LLMs) typically generate results in an end-to-end manner, lacking a transparent reasoning process. The Chain-of-Thought approach, by explicitly guiding the model through step-by-step reasoning, not only improves the model's performance in complex tasks but also makes the decision-making process more traceable and verifiable. This technology significantly enhances the application value of AI systems in areas such as mathematical reasoning, logical analysis, and complex problem solving, laying the foundation for more reliable and trustworthy AI.

[0003] However, existing thought chaining techniques, particularly the zero-shot thought chaining (CoT) approach, still suffer from several key flaws. First, at the semantic understanding level, models often parse text superficially, failing to capture implicit information and subtle connections. This leads to frequent misinterpretation when dealing with polysemous words, complex references, or scenarios requiring domain knowledge. Second, while they can generate step-by-step reasoning, they lack clear logical connections between the steps. The extracted entities and relationships are discretely distributed, key nodes are missing, creating logical gaps, and the causal relationship between intermediate conclusions and the final answer is unclear. Finally, regarding knowledge integration mechanisms, existing methods rely on simple threshold filtering, which can incorrectly filter out important connections while retaining irrelevant noise. Furthermore, the single knowledge injection approach cannot dynamically adjust weights, severely impacting reasoning efficiency and accuracy. Therefore, to address the shortcomings of existing thought chaining techniques in semantic understanding, reasoning structure, and knowledge integration, an innovative approach is urgently needed that can refine the extraction of semantic relationships and dynamically construct structured reasoning paths to further enhance the reasoning capabilities of large models. Summary of the Invention

[0004] The purpose of the present invention is to address the problems existing in the prior art and provide a multi-path thinking chain reasoning generation method based on fine-grained knowledge retrieval, a computer device, a computer-readable storage medium and a computer program product, which can significantly improve the accuracy of knowledge extraction, refine the reasoning path while ensuring logical coherence, and greatly improve the reliability and robustness of the final conclusion.

[0005] One aspect of the present invention provides a multi-path thought chain reasoning generation method based on fine-grained knowledge retrieval, comprising:

[0006] Step S1: Use a large language model to perform deep semantic analysis on the user's question and extract entity information contained in the question text;

[0007] Step S2: The extracted entities are input into the large language model again to extract all the relationships between the entities and generate a set of triples;

[0008] Step S3: Assign a relevance score to each triple based on the contextual relevance, set a high confidence threshold and a low confidence threshold, and divide the triple set into three categories based on the relevance score: high relevance, low relevance, and medium relevance. The high relevance and low relevance triplets are provided as positive and negative samples to the large language model to further distinguish the medium relevance triplets, thereby obtaining fine-grained triplets that are highly relevant to the user's question.

[0009] Step S4: Input the triples that are highly relevant to the user's question into the large language model, and use the pre-defined paths to build a thinking chain framework to obtain an initial reasoning path set;

[0010] Step S5: Input the initial reasoning path set into the large language model, so that the initial reasoning path is optimized according to the optimization strategy of eliminating redundancy, reordering entities, and merging sub-paths to obtain an optimized reasoning path set;

[0011] Step S6: Input the optimized inference path set into the large language model, and sample the optimized inference path set using Top-k scoring to obtain a set of inference paths with high semantic relevance;

[0012] Step S7: Input the user question and the set of reasoning paths with high semantic relevance into the large language model, divide the set of reasoning paths into multiple reasoning path groups with complementary internal path information, and obtain multiple candidate answers corresponding to the multiple reasoning path groups;

[0013] In step S8, a majority voting mechanism is used to select multiple candidate answers and ultimately obtain a consistent answer.

[0014] Another aspect of the present invention provides a computer device, comprising a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the above method.

[0015] Another aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above method when executed by a processor.

[0016] Yet another aspect of the present invention provides a computer program product, comprising a computer program, which implements the steps of the above method when executed by a processor.

[0017] The multi-path thinking chain reasoning generation method based on fine-grained knowledge retrieval, computer equipment, computer-readable storage medium and computer program product according to the above aspects of the present invention can significantly improve the accuracy of knowledge extraction, achieve the refinement of the reasoning path while ensuring logical coherence, and can greatly improve the reliability and robustness of the final conclusion, thereby significantly improving the reasoning accuracy and explainability in complex scenarios, and can provide more reliable technical support for the cognitive decision-making of artificial intelligence systems. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions of the present invention, the following briefly introduces the drawings used in the description of the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention. Those skilled in the art can also derive other drawings based on these drawings without inventive efforts.

[0019] Figure 1 This is a flowchart of a multi-path thinking chain reasoning generation method based on fine-grained knowledge retrieval according to an embodiment of the present invention;

[0020] Figure 2 It is a structural diagram of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0021] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.

[0022] An embodiment of the present invention provides a multi-path thinking chain reasoning generation method based on fine-grained knowledge retrieval, Figure 1 FIG. 1 is a flowchart of a multi-path thinking chain reasoning generation method based on fine-grained knowledge retrieval according to an embodiment of the present invention. Figure 1 As shown, the method of the embodiment of the present invention includes the following steps:

[0023] In the entity extraction step S1, an open-source large language model is used to perform deep semantic analysis on the user's question. Through its pre-trained knowledge representation and entity recognition capabilities, key entity information contained in the question text is extracted.

[0024] In the relation extraction step S2, the extracted entities are fed back into the open-source large language model, which performs entity disambiguation and relation linking based on the context, extracts all relations between entities, generates a set of relation triples, and constructs a complete structured knowledge representation.

[0025] In the dual-threshold filtering step S3, a relevance score is assigned to each triple based on its contextual relevance. High and low confidence thresholds are set, and the triple set is divided into three categories based on the relevance score: high relevance, low relevance, and medium relevance. High-relevance and low-relevance triplets are provided as positive and negative samples to the large language model to further distinguish medium-relevance triplets, thereby obtaining fine-grained knowledge triplets that are highly relevant to the user's question.

[0026] In the path construction step S4, the triples highly relevant to the user's question are input into the large language model, and the thought chain framework is constructed using the pre-defined paths to obtain the initial reasoning path set;

[0027] In the path optimization step S5, the initial reasoning path set is input into the large language model, which optimizes the initial reasoning path according to the optimization strategy of eliminating redundancy, reordering entities, and merging sub-paths, thereby obtaining an optimized reasoning path set with high reliability content and a streamlined path structure.

[0028] In the path sampling step S6, the optimized inference path set is input into the large language model and the optimized inference path set is sampled using the Top-k scoring to obtain a highly semantically relevant inference path set that is both diverse and representative.

[0029] In step S7, the user question is fed into a set of inference paths with high semantic relevance into the large language model, the inference path set is divided into multiple inference path groups with complementary internal path information, and multiple candidate answers corresponding to the multiple inference path groups are obtained.

[0030] In the consistency decision step S8, a majority voting mechanism is used to select multiple candidate answers and finally obtain a consistent answer.

[0031] In an embodiment of the present invention, the large language model uses, for example, the leading open-source large language model LLaMA-3. In each of the aforementioned steps, a prompt template is constructed to convert the user's natural language question into an instruction format understandable by the model, thereby interacting with the large language model and obtaining relevant inference information. A prompt template is essentially a string with parameters, which simplifies the process of constructing and processing prompt words. In an embodiment of the present invention, prompt templates include entity relationship prompt templates, path construction and optimization prompt templates, and consistent answer prompt templates. Taking the entity relationship prompt template as an example, the content of the template may be: "The context information is: {context}. Based on the given context, please extract the important entity relationships in the context:." The content enclosed by "{}" is the parameter to be received. After obtaining the content corresponding to the parameter, it is input into the large language model to obtain the corresponding result. The path construction and optimization prompt template, the consistent answer prompt template, and the entity relationship prompt template have similar structures.

[0032] In step S1, the information extraction capability of the large language model is used to extract and context Identify and extract relevant entities to form A collection of entities During the extraction process, context analysis is first performed to identify candidate entities. Entities are then screened and normalized through deep semantic analysis to improve extraction accuracy and consistency. This process not only identifies explicit entities but also infers some implicit entities through contextual associations, thereby improving entity coverage and laying a more solid foundation for subsequent relationship extraction. The specific implementation process is as follows:

[0033] Fill the entity relationship prompt template with context information (including materials, questions, etc.) to construct the first prompt text. The template text content is: "The context information is: {C}. Based on the given context, please extract the important entity relationships in the context: ". The first prompt text is input into the large language model to obtain the entity set. The formula is as follows:

[0034]

[0035] in For context, Refers to Large Language Model. The entity set obtained for large language model reasoning, . n is the number of entities.

[0036] In step S2, based on the entity set , identify explicit and implicit relationships between entities. For each pair of entities , detect explicit relationships or infer potential implicit relationships, and generate standardized relationship triples All extracted relations form a set , and finally form a triple set During the extraction process, different types of relationships can be distinguished and inference relationships with low confidence levels can be screened to improve the reliability of the final knowledge structure. The specific implementation process is as follows:

[0037] contextual information With entity collection Fill in the entity relationship prompt template and construct the second prompt text. The content of the template text is: "Give a context { }, and the collection of all entities in the context { Extract all relationships between entities directly stated in the context. Each relationship is represented as a triple: (entity A, entity B, relationship between entity A and B). Input the second prompt text into the large language model to obtain a complete structured knowledge representation. The formula is as follows:

[0038]

[0039] in , is a relation triple, , is the number of relation triples, Representing an entity With entity relationship.

[0040] In step S3, high and low confidence thresholds are used to dynamically divide knowledge triples to achieve intelligent classification of high / low / medium confidence, and the positive and negative sample comparison method is combined to optimize the knowledge sample screening effect.

[0041] During the entity relationship extraction process, triples often contain irrelevant information, which increases the difficulty of constructing the reasoning path. Traditional single-threshold filtering strategies have difficulty distinguishing between high and medium correlation triplets, and are prone to losing valuable information or retaining irrelevant content. To this end, the embodiment of the present invention designs dual-threshold filtering, which achieves accurate classification by setting two high and low semantic relevance confidence thresholds: the high confidence threshold is used to preliminarily filter out noise knowledge fragments that are irrelevant to the problem; the low confidence threshold is used to further refine the filtering results, retaining only knowledge fragments that are highly relevant to the reasoning task. Through dual-threshold filtering, highly correlated triplets are retained, low-correlation items are filtered, and medium-correlation triplets are refined. By comparing high- and low-scoring triples, the classification accuracy is further improved.

[0042] Specifically, for the context The set of triples extracted from , the model assigns a relevance score to each triple according to the context relevance , set a high confidence threshold and a low confidence threshold , the triples are divided into three subsets according to the relevance score: It is a highly correlated triplet and is retained as a positive sample; if the score is less than It is a low-correlation triplet and is filtered as a negative sample; the score is between and The correlation triples between , further evaluation is required. For moderately relevant triplets, the model compares them with positive and negative samples. By comparing semantic context, it autonomously adjusts the classification, moving triplets that closely match the positive sample into the positive set and triplets that are similar to the negative sample into the negative set. This dual-threshold extraction mechanism ensures the complete preservation of highly relevant triplets while intelligently incorporating moderately relevant triplets with contextual value, building a high-quality knowledge base and providing reliable support for subsequent reasoning path building.

[0043] In step S3, the specific implementation process of obtaining fine-grained knowledge that is highly relevant to the user's question is as follows:

[0044] contextual information and structured knowledge triple sets Fill in the entity relationship prompt template and construct the third prompt text. The content of the template text is: "Given a context { }, structured knowledge { }, please score it based on the contextual semantics. Score the confidence of each relationship. The confidence score ranges from 0 to 10, and the higher the score, the more likely the relationship is correct. Each relationship is represented as a triple: (entity A, entity B, relationship between entity A and B)". The third prompt text is input into the large language model, and each triple is assigned a relevance score based on the contextual relevance. The model's scoring reference standards are as follows:

[0045] Table 1 Reference standards for triple correlation scores

[0046]

[0047] Passing a high confidence threshold and a low confidence threshold The triple set is divided into three subsets, and the formula is as follows:

[0048]

[0049] in Rating Greater than the high confidence threshold A set of highly correlated triples. Rating Between high confidence threshold and a low confidence threshold The set of related triples in . Rating Less than the low confidence threshold A set of low-correlation triplets.

[0050] Set the rating between and The correlation triples between , through and To refer to and compare with contextual information, adjust the classification independently, and Highly consistent with the positive sample set, Similar ones are classified into negative sample sets. Specifically, the context information Highly correlated triple sets , low correlation triple set , the set of related triples in Fill in the entity relationship prompt template and construct the fourth prompt text. The content of the template text is: "Now there are high-scoring triples and low-scoring triples. Please analyze the high-scoring triples and low-scoring triples in combination with the context and determine whether to extract some medium-scoring triples and put them into the high-scoring triples, and some medium-scoring triples and put them into the low-scoring triples. This is the context information { }, this is the high score triple { }, this is a low-scoring triple { }, which is the middle score triple { Extract the important mid-score triples according to the previous requirements. Each relationship is returned as a triple: (entity A, entity B, relationship between entity A and B). Input the fourth prompt text into the large language model. The formula is as follows:

[0051]

[0052]

[0053] in Indicates from The extracted triples have contextual value. Indicates from The extracted part does not contain triples of contextual value.

[0054] In step S4, high-quality triples are obtained based on the fine-grained knowledge extraction mechanism. , build an initial set of reasoning paths , ensuring comprehensive coverage of relevant entity relationships. During path construction, triples are first screened to ensure that the selected knowledge units have high confidence and logical consistency. Then, combining the semantic relevance of the entities and contextual information, an inference path is constructed using an autoregressive generation method based on a large language model and expressed as: . Each path Represents the initial entity To the target entity The logical reasoning link, 、 They all represent the relationship between entities, such as For Entity With entity To enhance logical coherence, the inherent knowledge of the large language model is further utilized to expand the path and supplement the possible missing intermediate reasoning links to ensure the integrity of the path and improve the reasoning ability.

[0055] The specific implementation process is as follows:

[0056] contextual information , high correlation triples Fill in the path construction and optimization prompt template to build the fifth prompt text. The content of the template text is: "Given context information and high-scoring relationships in the context. One or more reasoning paths need to be generated based on these relationships. The format of the reasoning path is: entity → relationship → entity → relationship... This is context information { }, which is a high context value triple { }, the last number of the high-scoring relationship represents the score of each relationship. Input the fifth prompt text into the large language model to obtain the initial reasoning path set The formula is as follows:

[0057]

[0058] in = For all paths (from =1 to =z), represents the reasoning path, Represents an entity, Indicates relationship, is the number of paths.

[0059] In step S5, a parallel reasoning path is generated based on high-quality knowledge triples, and is dynamically optimized through three stages of deletion-correction-reconstruction, using node reorganization technology to maintain the logical consistency of the path.

[0060] During the path construction process, due to the autoregressive generation characteristics of the large language model, semantically similar entities may be redundantly connected, resulting in excessively long paths and repeated information. To this end, the present invention adopts an optimization method based on model introspection and error correction mechanism to refine paths that exceed the length threshold to improve the compactness and semantic integrity of the path. The optimization strategy includes the following three aspects: redundancy elimination, analyzing the path structure, deleting duplicate or semantically similar nodes, avoiding information redundancy, and improving reasoning efficiency; structural adjustment, rearranging the order of entities in the path to make the reasoning chain clearer, reduce ambiguity, and improve the logical interpretability of the path; path reconstruction, merging sub-paths while ensuring that core information is not lost, making the reasoning process more compact, while ensuring the coherence and rationality of the reasoning. The optimization results in a reasoning path with high-reliability content and a streamlined path structure.

[0061] The specific implementation process of optimizing the inference path is as follows:

[0062] contextual information , initial reasoning path set Fill in the path construction and optimization prompt template to construct the sixth prompt text. The content of the template text is: "Please optimize the path length of the path with a length greater than 10 according to the given path and meet the following requirements

[0063] 1. Eliminate redundancy: Eliminate duplicate or semantically similar nodes to simplify the path.

[0064] How to do it: Delete duplicate nodes, relationships, or words with similar meanings.

[0065] • For example: “A→B→B→C” → simplifies to “A→B→C”

[0066] • For example: merging synonyms (“happy→happy→happy” is unified into “happy”)

[0067] 2. Structural Adjustment: Reorder entities to improve reasoning clarity.

[0068] How: Reorder nodes to follow a logical sequence (e.g., chronological, cause-and-effect).

[0069] • For example: "Rain → Wet Ground → Carry Umbrella" can be reordered to "Rain → Carry Umbrella → Wet Ground"

[0070] 3. Path reconstruction: merge sub-paths to preserve key information while ensuring consistency.

[0071] How to do it: Merge subpaths and keep only basic nodes.

[0072] • For example: "Study → Review → Exam → Pass → Celebrate" is simplified to "Study → Exam → Celebrate"

[0073] Please optimize the inference paths whose length exceeds 10 according to the above requirements and display the optimization results. }, relationship path { }:". Input the sixth prompt text into the large language model to obtain the optimized reasoning path set. The formula is as follows:

[0074]

[0075] in .

[0076] In step S6, in order to improve the diversity and representativeness of the reasoning paths, the top k reasoning paths are selected by fusion Top-k scoring as the final reasoning paths that are both diverse and representative.

[0077] The specific implementation process of strategy fusion Top-k scoring sampling is as follows:

[0078] contextual information , optimized reasoning path set Fill in the path construction and optimization prompt template to construct the seventh prompt text. The content of the template text is: "Please give a comprehensive score to these reasoning path sets based on their semantic relevance, logical rationality, contextual consistency, information completeness, and reasoning coherence according to the given context, and select the top k paths with the highest scores ( ). The context information is { }, the reasoning path set is { }". The seventh prompt text is input into the large language model, and 40 reasoning paths with high semantic relevance are obtained. The formula is as follows:

[0079]

[0080] in .

[0081] In an embodiment of the present invention, a fusion Top-k (k=40) strategy is used to allow a large language model to perform semantic relevance scoring and select the top 40 reasoning paths as the final reasoning paths, thereby providing a richer logical perspective and stronger reasoning robustness.

[0082] In step S7, the large language model is used to measure the semantic information richness of multiple reasoning paths. Multiple paths representing different semantics are combined. Using a chain-of-thought approach and incorporating contextual information, the reasoning process is independently executed on each path to generate multiple possible candidate answers. To improve the completeness and coherence of the answers, information between paths is linked during the reasoning process, enabling information from different paths to complement each other, thereby reducing the potential for information loss associated with single-path reasoning. Furthermore, contextual information is incorporated into the generation of candidate answers to enhance the stability and consistency of the answers.

[0083] Specifically, in step S7, the specific implementation process of generating multiple candidate answers by path combination is as follows:

[0084] First, the context information , a set of reasoning paths with high semantic relevance Fill in the consistent answer prompt template and construct the eighth prompt text. The content of the template text is: "Provide a piece of context information, and a set of reasoning paths with high scores in semantic relevance, logical rationality, context consistency, information completeness and reasoning coherence. Based on this information, please combine these reasoning paths into several groups of reasoning path groups while ensuring consistency with the context. Each group should contain several reasoning paths that complement each other in content or perspective, forming a group of reasoning paths with diverse internal information but consistent semantics. The whole should cover multiple reasonable reasoning directions. There is information complementarity between the internal paths of each group, that is, the same core reasoning goal is supplemented or expanded from different angles; all paths must maintain semantic consistency and logical coherence with the context; the generated multiple groups of paths should also reflect diversity as much as possible. The following is the context information { }, the following is the set of inference paths { }". Input the eighth prompt text into the large language model to obtain a group of inference paths with complementary information from different paths. The formula is as follows:

[0085]

[0086] in , any of which , represents the number of final combined reasoning path groups, .

[0087] Then the context information , a set of reasoning paths that complement the information of different paths , fill in the consistent answer prompt template to construct the ninth prompt text. The content of the template text is: "Provide a piece of context information and several sets of complementary and logically consistent reasoning paths. Each set of paths starts from a different perspective, reasoning around the same question, and has information complementarity. Please carefully reason and generate the final answer based on the context information and each set of reasoning paths. The following is the context information { }, the following is the set of inference paths { }". Input the ninth prompt text into the large language model to obtain multiple candidate answer sets. The formula is as follows:

[0088]

[0089] in , Indicates the The answer generated by the path group.

[0090] In step S8, a consistency aggregation mechanism is used to calculate the consistency scores of the answers output by multiple reasoning paths. A voting mechanism is then used to comprehensively evaluate all candidate answers, determining the target answer that best matches the overall reasoning process in terms of logical consistency and semantics. This consistency aggregation-based answer decision mechanism integrates the analysis of multi-path reasoning results, implements error correction based on majority voting, and ultimately outputs a robust and robust solution.

[0091] To ensure the reliability of the final answer, a consistency aggregation mechanism is introduced in this step. First, the answers output by multiple reasoning paths are statistically calculated. Then, a majority voting mechanism is used to count all candidate answers, with the most frequently occurring candidate selected as the final answer. This allows the final answer to be selected as the one that best aligns with the overall reasoning logic. The complementary effects of different reasoning paths enable the final answer to demonstrate greater information richness and reasoning depth.

[0092] The multi-path thinking chain reasoning generation method based on fine-grained knowledge retrieval in the embodiment of the present invention has the following beneficial effects:

[0093] 1. The present invention realizes fine-grained knowledge extraction and optimization through dual-threshold fine-grained knowledge extraction: by setting high and low dual confidence thresholds, the extracted knowledge triples are dynamically divided into different confidence sets. Combined with contextual relevance evaluation, the accuracy of knowledge extraction is significantly improved, noise interference is effectively reduced, and a reliable knowledge foundation is provided for subsequent reasoning processes. It solves the problem of inaccurate semantic understanding caused by coarse-grained knowledge extraction in the existing technology.

[0094] 2. The present invention adopts a multi-path explicit construction and optimization strategy to generate multiple independent reasoning paths based on high-quality knowledge triples, and dynamically optimizes the path nodes through systematic deletion, correction and reconstruction operations, thereby achieving the refinement of the reasoning path while ensuring logical coherence. The diversified reasoning paths generated by this method have been strictly optimized, which not only retains the necessary reasoning nodes but also eliminates redundant information, making the reasoning process of complex problems more efficient and reliable, and overcoming the defects of the existing reasoning path structure being loose and lacking logical coherence. Verified by the standard test set, the accuracy of this method in common sense reasoning, logical reasoning and mathematical reasoning tasks is at least 5.5 percentage points higher than that of the baseline model.

[0095] 3. The present invention makes decisions based on consistent answers and utilizes the intelligent fusion of multi-path results and a majority voting mechanism to effectively identify and correct possible reasoning deviations that may arise from a single path. It can output stable and reliable final conclusions in all kinds of complex reasoning scenarios, greatly improving the reliability and robustness of the final conclusions while maintaining the transparency and traceability of the decision-making process.

[0096] The embodiment of the present invention further provides a computer device, which may be a server, and its internal structure diagram may be as shown in FIG. Figure 2 As shown. The computer device includes a processor, a memory and a network interface connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store operating parameter data of each framework. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, the steps of the method of the embodiment of the present invention are implemented.

[0097] Those skilled in the art will understand that Figure 2 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0098] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method of the embodiment of the present invention are implemented.

[0099] An embodiment of the present invention further provides a computer program product, including a computer program, which implements the steps of the method of the embodiment of the present invention when executed by a processor.

[0100] The above description is merely illustrative of certain exemplary embodiments of the present invention. It goes without saying that those skilled in the art will be able to modify the described embodiments in various ways without departing from the spirit and scope of the present invention. Therefore, the above drawings and description are illustrative in nature and should not be construed as limiting the scope of protection of the claims.

Claims

1. A multi-path thinking chain reasoning generation method based on fine-grained knowledge retrieval, characterized by: include: Step S1: Use a large language model to perform deep semantic analysis on the user's question and extract entity information contained in the question text; Step S2: The extracted entities are input into the large language model again to extract all the relationships between the entities and generate a set of triples; Step S3: Assign a relevance score to each triple based on the contextual relevance, set a high confidence threshold and a low confidence threshold, and divide the triple set into three categories based on the relevance score: high relevance, low relevance, and medium relevance. The high relevance and low relevance triplets are provided as positive and negative samples to the large language model to further distinguish the medium relevance triplets, thereby obtaining fine-grained triplets that are highly relevant to the user's question. Step S4: Input the triples that are highly relevant to the user's question into the large language model, and use the pre-defined paths to build a thinking chain framework to obtain an initial reasoning path set; Step S5: Input the initial reasoning path set into the large language model, so that the initial reasoning path is optimized according to the optimization strategy of eliminating redundancy, reordering entities, and merging sub-paths to obtain an optimized reasoning path set; Step S6: Input the optimized inference path set into the large language model, and sample the optimized inference path set using Top-k scoring to obtain a set of inference paths with high semantic relevance; Step S7: Input the user question and the set of reasoning paths with high semantic relevance into the large language model, divide the set of reasoning paths into multiple reasoning path groups with complementary internal path information, and obtain multiple candidate answers corresponding to the multiple reasoning path groups; In step S8, a majority voting mechanism is used to select multiple candidate answers and ultimately obtain a consistent answer.

2. The method according to claim 1, wherein In step S1, the context information of the user's question text is filled into the entity relationship prompt template to construct the first prompt text. The first prompt text is input into the large language model to obtain the entity set: in For context, To use a large language model The set of entities obtained by reasoning, , is the entity, n is the number of entities; In step S2, the context information and entity set are filled into the entity relationship prompt template to construct a second prompt text. The second prompt text is input into the large language model to generate a triple set: in is a set of triples, , is a relation triple, is the number of relation triples, , Representing an entity With entity relationship.

3. The method according to claim 2, wherein In step S3, the context information and the triple set are filled into the entity relationship prompt template, a third prompt text is constructed, and the third prompt text is input into the large language model so that for the generated triple set, a relevance score is assigned to each triple according to the context relevance, a high confidence threshold and a low confidence threshold are set, and triples with a score greater than the high confidence threshold are regarded as high-relevance triples, triples with a score less than the low confidence threshold are regarded as low-relevance triples, and triples with a score between the high confidence threshold and the low confidence threshold are regarded as medium-relevance triples, resulting in: in is a set of highly correlated triples, is the set of related triples in , is a set of low-correlation triplets.

4. The method according to claim 3, wherein In step S3, the context information and the highly correlated triplet set are combined , low correlation triple set , the set of related triples in Fill in the entity relationship prompt template, construct the fourth prompt text, input the fourth prompt text into the large language model, and make it compare with the high-correlation triple set and the low-correlation triple set in combination with context information. The medium-correlation triples that are highly consistent with the high-correlation triple set are promoted to the high-correlation triple set, and the medium-correlation triples that are similar to the low-correlation triple set are classified into the low-correlation triple set, resulting in: in, Indicates from The extracted triples have contextual value. Indicates from The extracted part does not contain triples of contextual value.

5. The method according to claim 4, wherein In step S4, the context information and the high-correlation triple set are filled into the path construction and optimization prompt template to construct the fifth prompt text, and the fifth prompt text is input into the large language model to obtain the initial reasoning path set. : in , each path Indicates that from the initial entity To the target entity The logical reasoning link, 、 They all represent the relationship between entities. is the number of paths; In step S5, the context information, initial reasoning path set and optimization strategy are filled into the path construction and optimization prompt template to construct the sixth prompt text, and the sixth prompt text is input into the large language model to obtain the optimized reasoning path set. : in ; In step S6, the context information and the optimized reasoning path set are filled into the path construction and optimization prompt template to construct the seventh prompt text. The seventh prompt text is input into the large language model to obtain a set of k reasoning paths with high semantic relevance. : in , .

6. The method according to claim 5, wherein In step S7, the context information, the reasoning path set with high semantic relevance, and the path combination strategy are filled into the consistent answer prompt template to construct the eighth prompt text, and the eighth prompt text is input into the large language model to obtain multiple reasoning path groups. : in , , represents the number of reasoning path groups, ; Among them, the path combination strategy is: combining reasoning paths into several reasoning path groups, each group contains several reasoning paths that complement each other in content or perspective, the internal paths of each group have information complementarity, and the paths of multiple groups reflect diversity.

7. The method according to claim 6, wherein In step S8, the context information and multiple reasoning path groups are filled into the consistent answer prompt template to construct the ninth prompt text. The ninth prompt text is input into the large language model to obtain multiple candidate answers corresponding to the multiple reasoning path groups: in , Indicates the The answer generated by the group of reasoning paths.

8. A computer device comprising a memory, a processor, and a computer program stored in the memory, wherein: The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 7.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Domain knowledge session method, system and device based on large model and multistage reasoning

    CN118964538A

  • Knowledge graph open domain construction and RAG question and answer method and device and storage medium

    CN119416882A