Method for enhancing complex questions and answers of large language model based on thinking map guide reasoning
By constructing a thinking graph-guided reasoning method, using pre-trained encoder and hybrid search methods, the professional knowledge and interpretability problems of large language models in complex question-and-answer tasks are solved, and efficient and flexible inference and accurate answer generation are achieved.
Patent Information
- Application Number
- CN202510460112.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-14
- Publication Date
- 2025-07-29
AI Technical Summary
Existing large language models lack domain-specific expertise, interpretability and real-time update capabilities of the latest knowledge in complex question-and-answer tasks. The iterative reasoning method has high time complexity and is prone to errors, while the dependency path of one-time reasoning method limits the ability to handle complex problems.
By constructing a thinking graph-guided reasoning method, using a pre-trained encoder to identify the correlation relationships of atomic problems, combining the knowledge graph and the inherent knowledge of the large language model, and using mixed relationship perception and non-perception retrieval methods, reducing the number of calls to the large language model and improving the accuracy and flexibility of the inference plan.
It realizes efficient and flexible inference in different knowledge graphs, reduces dependence on high-quality annotation data sets, and improves the accuracy and interpretability of large language models in complex question-and-answer tasks.
Smart Images

Figure CN120386843A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of natural language processing and large language models, and specifically relates to a method for enhancing complex question answering of large language models based on mind map-guided reasoning. Background Art
[0002] Due to its emerging capabilities and strong generalization ability, the Large Language Model (LLM) has brought about profound changes in the field of Natural Language Processing (NLP). However, due to the lack of domain-specific expertise, interpretability, and the ability to update the latest knowledge in the large language model, it still faces many limitations in complex question answering tasks that require advanced reasoning and domain knowledge.
[0003] As a structured and updatable knowledge base, the Knowledge Graph (KG) has the characteristics of being able to reduce knowledge redundancy, provide clear relationships, and high reliability, and is considered an effective tool to alleviate the above limitations of large language models. The retrieval enhancement method based on the knowledge graph enriches the knowledge of the large language model by extracting triples from the knowledge graph and enhances its reasoning ability. However, such methods usually ignore the structural characteristics of the knowledge graph and may introduce information redundancy, thus being limited in complex question answering tasks. It is crucial to enable the large language model to reason about the knowledge graph to obtain comprehensive and accurate knowledge.
[0004] In existing research, knowledge graph enhanced reasoning technology is considered a promising method for simulating human thinking and solving complex question answering challenges. The current knowledge graph enhanced reasoning methods are mainly divided into two categories: iterative reasoning and one-shot reasoning. Iterative reasoning methods achieve complex reasoning through dynamic interaction between the large language model and the knowledge graph. Although this method performs excellently in knowledge retrieval and reasoning accuracy, due to frequent interactions, the time complexity is too high, and it is difficult to determine the termination condition. In addition, errors in the initial stage of iterative reasoning may gradually amplify, resulting in the invalidity of subsequent reasoning and waste of resources. In contrast, one-shot reasoning methods plan the reasoning path in advance or directly retrieve the required structured knowledge through a single query, thus significantly reducing the interaction cost.
[0005] Representative methods in iterative reasoning, such as the ToG method proposed in (Jiashuo Sun, Chengjin Xu, Lumingyuan Tang, Saizhuo Wang, Chen Lin, Yeyun Gong, Lionel M.Ni, Heung-Yeung Shum, Jian Guo: Think-on-Graph: Deep and Responsible Reasoning of Large Language Model on KnowledgeGraph.ICLR 2024), use a large language model to select relations and entities from the knowledge graph and use the inherent knowledge of the large language model to collaboratively enhance reasoning. One-shot reasoning methods, such as the RoG method proposed in (Linhao Luo, Yuan-Fang Li, Gholamreza Haffari, Shirui Pan: Reasoning on Graphs: Faithful and Interpretable Large Language Model Reasoning.ICLR 2024), plan relation paths by fine-tuning a large language model, thereby achieving faithful and interpretable reasoning. These methods emphasize the importance of relations in knowledge graphs in the reasoning process and the prospects of utilizing the inherent knowledge of large language models. However, due to training data bias, large language models in ToG may favor certain relations while ignoring more relevant ones. RoG relies entirely on relation paths for reasoning, limiting its ability to handle complex questions with implicit relations. Furthermore, it relies on labeled QA datasets for fine-tuning, which reduces its adaptability to real-world scenarios with limited annotations.
[0006] In summary, how to efficiently and flexibly construct reasoning plans based on knowledge graph relationships and fully tap their reasoning potential remains an important challenge that needs to be urgently addressed by current large language models in the field of complex question answering. Summary of the invention
[0007] In order to solve the above problems, the present invention designs and invents a large language model complex question answering enhancement method based on mind map guided reasoning. Figure 1Construct a mind map by finding consistent candidate atomic relationships. Then, under the guidance of the mind map, the method uses the structured knowledge of the knowledge graph and the inherent knowledge of the large language model to achieve complex question-answering reasoning. The method follows a one-shot reasoning paradigm, reducing the number of calls to the large language model, improving the accuracy and flexibility of reasoning plan construction, and making full use of the heuristic knowledge in the mind map to enhance the reasoning effect. In addition, the method can get rid of the dependence on high-quality labeled datasets and improve the generality of the large language model in different knowledge graphs.
[0008] To achieve the above object, the technical solution adopted by the present invention is as follows:
[0009] A method for enhancing complex question answering of a large language model guided by a mind map, comprising the following steps:
[0010] Step 1: Construct an atomic question-relationship training set based on the large language model and train a specially designed encoder to identify the relevant relationships of each atomic question.
[0011] In the above step 1, we first designed a method for constructing an atomic question-relationship dataset based on the large language model. For each atomic relationship r in the knowledge graph i randomly sample k1 knowledge triples, and based on these triples, generate k2 diverse atomic questions Q a . Subsequently, replace the subject entity of the atomic question with "topic entity" to generate abstract atomic questions so as to better capture the semantic information of the relationship.
[0012] Then, use the prototype contrast learning method to train the encoder so that it can identify the relevant relationships of each atomic question derived from question decomposition. To improve the discrimination ability of the encoder, the present invention adopts a label-aware hard negative sample sampling strategy.
[0013] For a given abstract atomic question and the positive sample atomic relationship r + perform encoding to obtain the embedding representations of q and r + as h q and Cluster h q into K categories C1, C2,..., C K , and their centroids are denoted as c1, c2,..., c K . The prototype is defined as the average value in each cluster , denoted as For a given cluster C iFor each anchor point \(q\) in \((1\leq i\leq K)\), select an atomic relation from the top \(N\) nearest clusters as a hard negative sample, thus providing \(N\) negative samples for each input problem \(q\). Similarly, for each anchor prototype \(c\) i (1\leq i\leq K), these top \(N\) nearest clusters are considered as its hard negative sample prototypes. The contrastive loss function is defined as follows:
[0014]
[0015] where, is an anchor sample in the batch, and each anchor sample has a positive sample h r represents the positive and negative samples, \(\tau\) is a temperature parameter, and \(sim\) is the cosine similarity function. Similarly, each anchor sample has a positive sample prototype c r represents the positive and negative sample prototypes. \(\varphi\) represents the concentration estimation, and a smaller \(\varphi\) indicates a larger concentration. For a cluster \(C, C\in C_1, C_2,..., C\) K , its concentration is defined as:
[0016]
[0017] Here, \(D\) represents the number of samples in cluster \(C\), \(c\) is the centroid of cluster \(C\), represents the momentum feature of an atomic problem. The parameter \(\alpha\) is a smoothing parameter. In addition, in order to make the concentration of each group of clusters have the same mean \(\tau\), \(\varphi\) is normalized.
[0018] Finally, use the large language model to decompose the input natural language problem \(Q\) into abstract atomic problems \(Q'=\{q_1, q_2,..., q\) z}). Using the trained encoder \(E\), select \(k\) i ∈Q' (where \(1\leq i\leq z\)) of the most relevant atomic relations according to the cosine similarity. q
[0019] Step 2: According to the given problem and the selected atomic relations, construct a mind map that combines the relations in the knowledge graph and the inherent knowledge of the large language model.
[0020] In the said Step 2, we designed a method for constructing a mind map based on the large language model. The mind map \(GoT\) Q is constructed according to the input problem \(Q\) and all the selected atomic relations \(r\) Q′ , represented by the Cypher language and then parsed into triples. Formally, it can be expressed as:
[0021]
[0022] where || represents concatenation using a hint template, and ε got represents a set of entities, represents a set of relationships, represents a set of triples constructed from the question Q and the selected atomic relationship r Q′ Q′
[0023] The hint template for constructing a mind map is as follows:
[0024] You should answer the question according to the following steps:
[0025] Step 1. Identify the knowledge plan you need to solve the problem.
[0026] Step 2. Use the atomic relationships in the possible atomic relationships to strictly fill in the knowledge plan, construct a knowledge graph in Cypher language as completely as possible, and combine your knowledge.
[0027] Step 3. Strictly complete the knowledge graph to construct a complete knowledge graph to include more detailed reasoning paths to solve the problem.
[0028] Step 4. Based on the complete knowledge graph, generate an effective relationship path that helps answer the question.
[0029] Step 3: Through the mind map, guide the hybrid relationship-aware and relationship-unaware retrieval methods to retrieve relevant and comprehensive evidence from the knowledge graph to guide the large language model to reason and generate the question answer.
[0030] In step 3, we designed a hybrid relationship-aware and relationship-unaware retrieval method for reasoning.
[0031] First, perform relationship-aware retrieval and pruning. For each relationship path path Q in GoT r =[e s ,r1,r2,...,r L , retrieve the head entity ε s that matches e s . For each matching entity in ε s , retrieve the corresponding relationship σ1:
[0032] ε s =argtopm 1≤i≤n sim(f(e s ),f(e i ))
[0033] σ i =argtopm 1≤j≤z sim(f(r i ),f(r j))), 1 ≤ i ≤ L
[0034] Among them, f(·) represents the encoding function based on the pre-trained language model, and z represents the number of relationships related to the matching entity. Next, through the triple (e s , r1,?) to obtain the tail entity ε o . Set ε o as the new ε s and repeat the above steps to generate a set of inference paths. Each inference path is represented as
[0035] To prune the inference paths, define the score of each path as follows:
[0036]
[0037] The pruning strategy sorts the inference paths by score p and retains the top K1 inference paths with the highest scores
[0038] In addition, consider all the triples in GoT Q to ensure that relevant relationships are not missed. This process defines the relationship path as Perform the same retrieval and pruning as the above process. Then, retain the top K2 triples with the highest scores as the final result
[0039] Then, perform relationship-agnostic retrieval and pruning. Extract the path-based evidence graph and neighbor-based evidence graph based on the entities in GoT Q . We align the entities in GoT Q with the entities in the knowledge graph ε to construct the candidate entity set ε cand = {e1, e2,..., e M | e i ∈ ε, 1 ≤ i ≤ M}. The candidate entities are constructed in pairs, and the l-hop shortest paths between them are recorded to obtain the path-based evidence graph:
[0040]
[0041] By incorporating the 1-hop neighbors of each node e i ∈ ε cand , the triple (e i , r, e o ) is added to the neighbor-based evidence graph . To handle potential noise in the knowledge, we use the re-ranking model Reranker(x, y, topk) for pruning:
[0042]
[0043] Among them ⊕ represents the union operation.
[0044] Finally, combine and deduplicate these three groups of structured knowledge to form reasoning evidence
[0045]
[0046] Take the question Q and input them into the large language model for reasoning to obtain the answer A to the question Q. It is formally represented as:
[0047]
[0048] The beneficial effects brought by the method for enhancing complex question answering of large language models based on mind map-guided reasoning provided by the present invention are:
[0049] (1) The present invention proposes an atomic relation selection module, which utilizes the language generation ability of the large language model and the representation learning ability of prototype contrast learning, enabling the method of the present invention to flexibly construct more accurate mind maps and integrate with different knowledge graphs.
[0050] (2) The present invention conducts relation-aware and relation-unaware retrieval through mind map guidance. The retrieved reasoning evidence conforms to the question intention and contains structured and comprehensive knowledge, thus achieving more accurate reasoning.
[0051] (3) The present invention proposes a method for enhancing complex question answering of large language models, which reduces the factual hallucination of the large language model and improves the interpretability through mind map-guided reasoning. Description of the Drawings
[0052] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments recorded in the present invention, and those of ordinary skill in the art can also obtain other drawings based on these drawings.
[0053] Figure 1 is the overall flowchart of the method for enhancing complex question answering of large language models based on mind map-guided reasoning in the present invention;
[0054] Figure 2 is the schematic diagram of step 1 of the method for enhancing complex question answering of large language models based on mind map-guided reasoning in the present invention;
[0055] Figure 3Schematic diagram of step 2 of the method for enhancing complex question answering of large language models based on mind map-guided reasoning in the present invention;
[0056] Figure 4 Schematic diagram of step 3 of the method for enhancing complex question answering of large language models based on mind map-guided reasoning in the present invention. Detailed implementation manners
[0057] To better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings of the specification and specific implementation manners.
[0058] Figure 1 Flow schematic diagram of the method for enhancing complex question answering of large language models based on mind map-guided reasoning in the present invention. As Figure 1 shown, the method of the present invention includes the following steps:
[0059] Step 1: Construct an atomic question-relation training set based on a large language model and train a specially designed encoder to identify the relevant relationships of each atomic question. As Figure 2 shown, step 1 includes the following steps:
[0060] (1) Training data construction
[0061] Given a knowledge graph where ε and represent the entity set and the relation set respectively, and |ε| = n, represents the knowledge triple set, and each triple contains a head entity e s 、tail entity e o and a relation r. Usually, the atomic relation set of the knowledge graph is where
[0062] is to randomly sample k1 triples for each atomic relation r i (1 ≤ i ≤ m). Then, use the generation ability of the large language model to generate k2 atomic questions Q a for each triple to ensure the diversity of expression. In addition, replace the subject (i.e., the head entity) of each atomic question with "topic entity" to generate abstract atomic questions, denoted as Abstract atomic questions can better represent the semantics of the relationship because they do not contain specific subject entities. For each abstract atomic question q (q ∈ Q abs a), the relation in the triple generated by q is the positive sample atomic relation r + . The prompt template for generating Q a is:
[0063] Given a triple in the form of head entity, relation, tail entity, rewrite it as a question where the head entity serves as the subject of the question and the tail entity serves as the answer. Note that the tail entity cannot appear in the question. Provide different formulations of k2 questions in a list form.
[0064] (2) Encoder training
[0065] During the process of training the sentence encoder E, for the input abstract atomic question and the positive sample atomic relation r + encode them respectively to obtain q and r + and the embedding representation of h q and
[0066]
[0067] Cluster h q into K categories C1, C2,..., C K , and denote their centroids as c1, c2,..., c K . To better capture the relevance of each atomic relation, calculate the average value in each cluster as the prototype, denoted as
[0068] Adopt a label-aware hard negative sample sampling strategy, which combines label information with hard negative sample mining in supervised contrastive learning. Specifically, for each anchor q in the given cluster C i (1 ≤ i ≤ K), select an atomic relation from the top N nearest clusters as the hard negative sample, thus providing N negative samples for each input question q. Similarly, for each anchor prototype c i (1 ≤ i ≤ K), these top N nearest clusters are regarded as its hard negative sample prototypes. By randomly selecting negative samples from the N nearest clusters, the cost of calculating distances is reduced, while ensuring the diversity of hard negative samples. This method promotes the learning of global representations without biasing the model towards a specific direction. The contrast loss function is defined as follows:
[0069]
[0070] where, is an anchor sample in the batch, and each anchor sample has a positive sample h r represents the positive sample and negative samples, τ is a temperature parameter, and sim is the cosine similarity function. Similarly, each anchor sample has a positive sample prototype c rDenote positive and negative sample prototypes. φ represents concentration estimation, and a smaller φ indicates a larger concentration. For a cluster C, C ∈ C1, C2,..., C K , its concentration is defined as:
[0071]
[0072] Here, D represents the number of samples in cluster C, c is the centroid of cluster C, represents the momentum feature of an atomic problem. The parameter α is a smoothing parameter used to ensure that small clusters do not result in overly large φ values. Additionally, φ is normalized so that the concentration of each set of clusters has the same mean τ.
[0073] (3) Relationship selection
[0074] Use a large language model to decompose the input natural language question Q into abstract atomic questions Q′ = {q1, q2,..., q z}}. For different question - answering scenarios, different prompt templates can be designed for question decomposition. The following is an example of a prompt template for question decomposition:
[0075] Decompose the question into a list of atomic questions according to the subject - predicate - object structure. If the question is already an atomic question, it is not decomposed further. Finally, replace the subject of each atomic question with the topic entity to generate abstract atomic questions.
[0076] Then, use the trained encoder E to select k i most relevant atomic relationships for each q q ∈ Q′ (where 1 ≤ i ≤ z).
[0077] Step 2: According to the given question and the selected atomic relationships, construct a mind map that combines the relationships in the knowledge graph and the inherent knowledge of the large language model. As Figure 3 shown, the implementation of Step 2 is as follows:
[0078] Prompt the large language model to construct a mind map GoT Q′ based on the input question Q and all selected atomic relationships r Q , where |r Q′ | = z · k q . GoT Q is constructed using Cypher language because the large language model is more inclined to answer using continuous language and has strong code capabilities. Additionally, we adopt a few - shot prompting strategy, which utilizes the context - learning ability of the large language model to enable it to better adapt to the mind - map construction task. The generated Cypher queries are then parsed into triples. Formally, it can be expressed as:
[0079]
[0080] where || represents concatenation using the prompt template, and ε got represents the entity set, represents the relationship set, represents the set of triples constructed from the question Q and the selected atomic relationship r Q′ Constructed triple set.
[0081] By constructing a mind map to solve the problem as a whole, errors in the problem decomposition process are reduced. By combining the relationships aligned with the knowledge graph and the inherent knowledge of the large language model, a more accurate reasoning plan and auxiliary knowledge are provided for problem solving. To avoid high time complexity, the present invention uses the large language model to identify the key relationship paths instead of directly extracting all paths from the mind map. The prompt template is as follows:
[0082] You should answer the question according to the following steps:
[0083] Step 1. Identify the knowledge plan you need to solve the problem.
[0084] Step 2. Use the atomic relationships in the possible atomic relationships, strictly fill in the knowledge plan, construct the knowledge graph in Cypher language as completely as possible, and combine your knowledge.
[0085] Step 3. Strictly complete the knowledge graph to construct a complete knowledge graph to include more detailed reasoning paths to solve the problem.
[0086] Step 4. Based on the complete knowledge graph, generate effective relationship paths that help answer the question.
[0087] Step 3: Through the mind map, guide the hybrid relationship-aware and relationship-unaware retrieval methods to retrieve relevant and comprehensive evidence from the knowledge graph to guide the large language model to reason and generate the question answer.
[0088] To fully exploit the potential of GoT, a hybrid retrieval method based on relationship awareness and relationship unawareness is designed for reasoning. Relationship-aware retrieval considers the structured connections and the semantics of relationships in the mind map, ensuring accurate and contextually relevant information. Relationship-unaware retrieval directly constructs reasoning paths based on entities without considering the semantics of relationships, providing auxiliary knowledge for reasoning. Combining these two methods can provide more comprehensive knowledge for the large language model in complex question-answering tasks and enhance the accuracy and interpretability of reasoning. As Figure 4 shown, Step 3 includes the following steps:
[0089] (1) Relationship-aware retrieval and pruning
[0090] GoTQ The relationship paths in it represent the logical reasoning plan based on the alignment relationships of the knowledge graph. Relationship-aware retrieval traverses these paths through beam search to retrieve relevant knowledge from the knowledge graph. Specifically, for GoT Q For each relationship path path r = [e s , r1, r2,..., r L in, first retrieve the head entity ε s matching e s . Then, for each matching entity in ε s , retrieve the corresponding relationship σ1:
[0091] ε s = argtopm 1≤i≤n sim(f(e s ), f(e i ))
[0092] σ i = argtopm 1≤j≤z sim(f(r i ), f(r j ))), 1 ≤ i ≤ L
[0093] where f(·) represents the encoding function based on the pre-trained language model, and z represents the number of relationships related to the matching entity. Next, obtain the tail entity ε s through the triple (e o , r1,?). Set ε o as the new ε s and repeat the above steps to generate a set of inference paths. Each inference path is represented as
[0094] To prune the inference paths, we define the score of each path as follows:
[0095]
[0096] The pruning strategy sorts the inference paths by score p and retains the top K1 paths with the highest scores
[0097] In addition, consider all triples in GoT Q to ensure that no relevant relationships are missed. This process defines the relationship path as Perform the same retrieval and pruning as the above process. Then, retain the top K2 triples with the highest scores as the final result
[0098] (2) Relationship-unaware retrieval and pruning
[0099] Relationship-agnostic retrieval is based on the entities in GoT Q to extract path-based evidence graphs and neighbor-based evidence graphs. Align the entities in GoT Q with the entities in the knowledge graph ε to construct a candidate entity set ε cand ={e1, e2,..., e M |e i ∈ε, 1 ≤ i ≤ M}. Candidate entities are constructed in pairs, and the l-hop shortest paths between them are recorded to obtain path-based evidence graphs:
[0100]
[0101] The neighbor-based evidence graph provides additional evidence related to the question. In this step, by incorporating the 1-hop neighbors of each node e ∈ε i ∈ε cand into it, the triples (e i , r, e o ) are added to the set . To handle potential noise in the knowledge, a re-ranking model Reranker(x, y, topk) is used, which evaluates a segment set x and selects the top k elements from y. The pruning process can be formalized as:
[0102]
[0103] where ⊕ represents the union operation. Relationship-agnostic retrieval makes the implicit knowledge of the large language model interpretable and extends the scope of knowledge considered in the subsequent reasoning process.
[0104] (3) Evidence combination and reasoning
[0105] Finally, these three sets of structured knowledge are combined and de-duplicated to form reasoning evidence for reasoning:
[0106]
[0107] Input the question Q and into the large language model for reasoning to obtain the answer A to the question Q. It is formally represented as:
[0108]
[0109] The above is only the preferred embodiment of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present invention.
Claims
1. A complex question-answering enhancement method for a large language model based on mind map-guided reasoning, characterized by: The following steps are involved: S1, builds an atomic question-relation training set based on a large language model and trains a specially designed encoder to identify the relevant relations of each atomic question; S2, based on the given question and the selected atomic relationship, constructs a mind map that combines the relationships in the knowledge graph and the inherent knowledge of the large language model; S3, through the mind map to guide the hybrid relationship-aware and relationship-unaware retrieval methods, retrieves relevant and comprehensive evidence from the knowledge graph for the large language model to reason and generate answers to questions.
2. The method for enhancing complex question and answering using a large language model based on mind map guided reasoning according to claim 1 is characterized in that: The step S1 includes the following sub-steps: (1) Training data construction Given knowledge graph For each atomic relation r in it i Randomly sample k1 knowledge triples, and generate k2 diverse atomic questions Q based on these triples by leveraging the generation ability of the large language model a , and replace the subject entity of the atomic question with "topic entity" to generate abstract atomic questions Take the relation in the triple as the positive sample relation r of the abstract atomic question + ; (2) Encoder training Train the encoder using the prototype contrastive learning method with the set hard negative sample sampling strategy for the given abstract atomic problem and the positive sample atomic relation r + are encoded to obtain q and r + whose embedding representations are h q and Cluster h q into K categories C1, C2,..., C K , and their centroids are denoted as c1, c2,..., c K . The prototype is defined as the average value in each cluster , denoted as For each anchor q in the given cluster C i (1 ≤ i ≤ K), select an atomic relation from the first N nearest clusters as the hard negative sample, so as to provide N negative samples for each input problem q. For each anchor prototype c i (1 ≤ i ≤ K), these first N nearest clusters are regarded as its hard negative sample prototypes, and the contrastive loss function is defined as follows: Among them, is an anchor sample in a batch, and each anchor sample has a positive sample h r represents positive and negative samples, τ is a temperature parameter, sim is a cosine similarity function. Similarly, each anchor sample has a positive sample prototype c r represents positive and negative sample prototypes, φ represents concentration estimation, and a smaller φ represents a larger concentration. For a cluster C, C ∈ C1, C2,..., C K , its concentration is defined as: Here, D represents the number of samples in cluster C, and c is the centroid of cluster C. represents the momentum feature of an atomic problem. The parameter α is a smoothing parameter. To make the concentration of each group of clusters have the same mean τ, φ is normalized. (3) Relationship selection Decompose the input natural language problem Q into abstract atomic problems Q′ = {q1, q2,..., q z}, and use the trained encoder to select k i relevant atomic relations for each q q ∈ Q′ according to the cosine similarity.
3. The method for enhancing complex question answering of a large language model guided by mind map-based reasoning according to claim 1, wherein In the step S2: According to the input question Q and the selected atomic relation r Q′ , construct the thought graph GoT using the few-shot prompting strategy Q , denoted as where || represents concatenation using the prompting template, and ε got represents the set of entities, represents the set of relations, represents the set of triples constructed from the question Q and the selected atomic relation r Q′ . The prompting template for thought graph construction is as follows: You should follow these steps to answer the questions: The first step is to find out what knowledge you need to solve the problem. The second step is to use the atomic relationships in the possible atomic relationships to strictly fill in the knowledge plan, build a knowledge graph in Cypher language as completely as possible, and combine your knowledge. The third step is to strictly complete the knowledge graph and build a complete knowledge graph to include more detailed reasoning paths to solve the problem. The fourth step is to generate effective relationship paths that help answer questions based on the complete knowledge graph.
4. The method for enhancing complex question and answering using a large language model based on mind map guided reasoning according to claim 1 is characterized in that: The step S3 includes the following sub-steps: (1) Relation-aware retrieval and pruning For GoT Q For each relationship path path r = [e s , r1, r2,..., r L , beam search is used to retrieve the head entity ε s that matches e s For each matching entity in ε s the corresponding relationship σ1 is retrieved: ε s =argtopm 1≤i≤n sim(f(e s ),f(e i )) σ i = argtopm 1≤j≤z sim(f(r i ), f(r j ), 1 ≤ i ≤ L Where f(·) represents the encoding function based on the pre-trained language model, z represents the number of relations related to the matching entity, and the triple (e s ,r1,? )Get the tail entity ε o , change ε o Set to the new ε s Repeat the above steps to generate a set of reasoning paths, each of which is represented by The score of each path is defined as follows: Sort by score p Sort the inference paths and retain the top K1 paths with the highest scores In addition, consider all triples in GoT Q to ensure that relevant relationships are not missed. This process defines the relationship path as Perform the same retrieval and pruning as the above process. Then, retain the top K2 triples with the highest scores as the final result (2) Relation-aware retrieval and pruning Relationships don't feel crunch according to GoT Q Entity extraction in path-based evidence graph and neighbor-based evidence graph, GoT Q Align the entities in the knowledge graph ε and construct the candidate entity set ε cand ={e1,e2,...,e M |e i ∈ε,1≤i≤M}, candidate entities are constructed in pairs, and the l-hop shortest paths between them are recorded to obtain a path-based evidence graph: The neighbor-based evidence graph is Provides additional evidence relevant to the problem, in this step by adding each node e i ∈ε cand The 1-hop neighbors of i ,r,e o ) added to the collection In the example, the reranking model Reranker(x,y,topk) is used for filtering. The filtering process is as follows: Among them represents the union operation; (3) Evidence combination and reasoning Combine and deduplicate the results of the hybrid retrieval to form an inference evidence set Take the question Q and the inference evidence Input into the large language model to generate the question answer A, defined as follows: