Graph structure-based reasoning path generation and self-correction method and device for large model and computer equipment
By combining the characteristics of graph structure and the semantic understanding ability of large language models, a large model based on graph structure inference path generation and self-correction method is proposed, which solves the problems of low inference efficiency and unreliable output of large language models in the graph structure in the prior art, and achieves more efficient and accurate inference path generation.
Patent Information
- Application Number
- CN202510024319.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-07
- Publication Date
- 2025-04-25
AI Technical Summary
The multi-hop inference of existing large language models in graph structures is inefficient and the output information is unreliable, especially when processing large-scale and complex graph structure data.
By combining the characteristics of graph structure and the semantic understanding ability of large language models, a large model based on graph structure is proposed, including extracting element instances and abstracts in chunks, constructing graph structures, calculating k-hop subgraphs, generating inference paths, and instantiating and correcting paths on graph structures.
It improves the inference efficiency and accuracy of large-scale graph structures of large-scale language models, reduces the number of model calls, enhances the accurate understanding of user query problems, and improves the intelligence level of the inference process.
Smart Images

Figure CN119886355A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of large language models, and in particular to a method, device and computer equipment for generating and self-correcting reasoning paths based on graph structures of large models. Background Art
[0002] Reasoning tasks of large language models (LLMs) in graph structures usually involve multi-hop reasoning, which requires the model to first accurately understand the questions asked by users in natural language and extract key information such as entities and attributes from them. The model then matches this information with the corresponding entities and relationships in the graph structure data. The reasoning process requires the model to be able to extract relevant parts from a large amount of information, build a reasoning path, and finally get an answer that meets the question. This process places high demands on the model's semantic understanding and logical reasoning capabilities, especially when dealing with large-scale and complex graph structure data.
[0003] Existing methods usually use LLM to gradually build the reasoning path, starting from a specific element (such as an entity or relationship in a knowledge graph), and using the structure of the graph to expand the reasoning path. These methods frequently interact with the graph structure through LLM, and use the knowledge provided by the graph structure (such as the graph) to reduce errors when the model performs complex reasoning, but the reasoning process requires multiple calls to the model, which is inefficient. In addition, some methods inject graph structure knowledge by fine-tuning model parameters. Although there is no need to interact with the graph structure during the reasoning process, which improves the reasoning efficiency, it cannot ensure the reliability of the model output information, and relies on a large amount of labeled data, and the performance will also degrade on unseen data.
[0004] To address the above problems, this paper proposes a new and efficient reasoning path generation and optimization mechanism by combining the graph structure characteristics and the semantic understanding ability of LLM, aiming to improve the reasoning efficiency and accuracy of LLM on large-scale graph structures. Summary of the invention
[0005] In view of the deficiencies in the prior art, the present invention provides a method, device and computer equipment for generating and self-correcting reasoning paths based on a graph structure for a large model.
[0006] To achieve the above purpose, the technical solution adopted by the present invention is as follows: On the one hand, this method provides a method for generating and self-correcting reasoning paths based on graph structures of large models, including the following steps: S1, divide the source document to be processed into blocks, extract element instances and element summaries and construct them into a graph structure; S2. According to the given question and the graph structure, calculate the k-hop subgraph most relevant to the given question and convert it into a relation triple; S3, inputting the given question and the k-hop subgraph as context into a large language model to generate one or more reasoning paths; S4, instantiate the currently generated reasoning path on the graph structure, and determine whether the instantiation is successful. If the reasoning path instantiation fails, go to S4; if the instantiation is successful, go to S8; S5. Collect the error cause after instantiation fails; S6, using the collected error reasons and the reasoning path currently being instantiated, correct the candidate relationship being instantiated; S7, based on the given question and the corrected candidate relationship, calling the large language model to edit the reasoning path that failed to be instantiated, generating a corrected reasoning path and going to S4; S8. Send the reasoning path with the maximum number of instantiations or edits and the given question to the large language model. The large language model processes the triples used to answer the question in a CoT manner to generate the final answer.
[0007] Further, the S1 includes: S11, extracting input text of the source document to be processed, and dividing the input text into text blocks of a set granularity; S12, using the large language model prompt to identify all entities in each text block and the relationships between all explicitly related entities, and extracting descriptions of entities, relationships, and statements in each text block, i.e., element instances; S13, performing a large language model summary on the descriptions of entities, relations, and declarations in each text block, so that the descriptions of entities, relations, and declarations are converted into a single description text block of corresponding entity nodes, relationship edges, and declaration covariates, i.e., an element summary; S14. Model the entity nodes and relationship edges in each text block as a homogeneous undirected weighted graph, i.e., a graph structure.
[0008] Furthermore, all entities in each text block include name, type and description; The relationships between all explicitly related entities include source entities and target entities and descriptions of their relationships.
[0009] Furthermore, the k-hop subgraph in S2 that is most relevant to the given question is calculated according to the following steps: According to the given question, the entities are identified, and the nodes most similar to the entities in the graph structure are calculated using the BM25 and Contriever algorithms. The k-hop subgraph of these nodes is taken as the k-hop subgraph most relevant to the given question.
[0010] Furthermore, the instantiation of the reasoning path in S4 and the determination of whether the instantiation is successful include relationship binding and path connection; wherein, relationship binding includes for each relationship expressed in natural language in the reasoning path, the system searches for relationships with similar semantic information in the graph structure as candidate relationships through BM25 and Contriever algorithms; path connection includes, on the basis of relationship binding, checking whether there is a reasoning path instance triggered from the starting entity, matching the relationships connected to the starting entity on the reasoning path with candidate relationships in sequence, if the candidate relationship can be connected to the currently processed entity, indicating that the part of the reasoning path is successfully instantiated, and repeating the above steps for the remaining relationships on the reasoning path until the entire reasoning path is successfully instantiated; if no candidate relationship can be connected to the currently processed entity, indicating that the instantiation of the part of the reasoning path has failed.
[0011] Furthermore, the error causes include: irrelevant natural language relations, none of the candidate graph structure relations is connected to the current entity, an empty reasoning path, and a reasoning path ends with a composite node.
[0012] Furthermore, the maximum number of edits is set according to experimental requirements and resource limitations.
[0013] On the other hand, the present invention provides a large model based on the graph structure of the reasoning path generation and self-correction device, comprising: The first module is used to divide the source document to be processed into blocks, extract element instances and element summaries, and construct them into a graph structure; The second module is used to calculate the k-hop subgraph most relevant to the given question and the graph structure and convert it into a relation triple; A third module is used to input the given question and the k-hop subgraph as context into a large language model to generate one or more reasoning paths; The fourth module is used to instantiate the currently generated reasoning path on the graph structure and determine whether the instantiation is successful; The fifth module is used to collect error causes after instantiation fails; The sixth module is used to correct the candidate relationship being instantiated by utilizing the collected error reasons and the reasoning path currently being instantiated; A seventh module is used to call the large language model to edit the reasoning path that failed to be instantiated based on the given question and the corrected candidate relationship, and generate a corrected reasoning path; The eighth module is used to send the reasoning path with the maximum number of instantiation successes or edit times and the given question to the large language model. The large language model processes the triples used to answer the question in a CoT manner to generate a final answer.
[0014] On the other hand, the present invention provides a computer device including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of generating a reasoning path based on a graph structure for a large model and a method for self-correction are implemented.
[0015] On the other hand, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of a method for generating a reasoning path based on a graph structure and self-correction of a large model.
[0016] Compared with the prior art, the beneficial technical effects that the present invention can produce are: The method, device and computer equipment for generating and self-correcting reasoning paths based on graph structures for large models provided by the present invention utilize graph structures to store text information, and effectively organize and characterize key elements and relationships of long texts in the form of nodes and edges, so as to capture multi-hop relationships. The present invention utilizes the structural characteristics of graphs to enhance the model's ability to understand and process long context information, thereby helping to generate more accurate answers.
[0017] The present invention combines the question to be queried and the graph structure to find the k-hop subgraph (k is a hyperparameter) that is most relevant to the question and converts it into a relation triple. The large language model then combines the k-hop subgraph information and the question to be queried to generate a complete reasoning path that is strongly associated with the graph, greatly improving the efficiency of reasoning path instantiation. The path is edited only when necessary, and error information and environmental feedback are used to guide the editing process instead of repeatedly calling the large language model for path generation, thereby reducing the number of calls to the large language model (i.e., the number of interactions with the graph structure) and improving the efficiency and accuracy of reasoning.
[0018] The present invention uses the structured information in the image and the embedded representation of entities and relationships to improve the accurate understanding of user query questions during the reasoning process, thereby improving the accuracy of the reasoning results. In addition, through the automated reasoning path generation and editing mechanism, it reduces manual intervention, improves the intelligence level of the reasoning process, and enables the large language model to complete complex reasoning tasks more independently.
[0019] The present invention adopts a graph structure information storage method and innovatively combines a large language model with graph structure information, which can generate a complete reasoning path at the beginning of a task, optimize the reasoning process, and only use error information and environmental feedback to guide the editing path when necessary, thereby reducing the call to the large language model. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the structures shown in these drawings without paying creative work.
[0021] Figure 1 A schematic flow chart of a method for generating a reasoning path based on a graph structure and self-correction of a large model provided by an embodiment; Figure 2 A schematic diagram of a graph structure construction process provided by an embodiment; Figure 3 A schematic diagram of a flow chart of generating a reasoning path provided by an embodiment; Figure 4 A schematic diagram of a reasoning path instantiation process provided by an embodiment; Figure 5 A schematic diagram of a flow chart of editing reasoning paths provided by an embodiment; Figure 6 A schematic diagram of a flow chart of generating answers provided by an embodiment. DETAILED DESCRIPTION
[0022] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0023] Reference Figure 1 In one embodiment, a method for generating and self-correcting a reasoning path based on a graph structure of a large model is provided, comprising the following steps: S1, divide the source document to be processed into blocks, extract element instances and element summaries and construct them into a graph structure; S2. According to the given question and the graph structure, calculate the k-hop subgraph most relevant to the given question and convert it into a relation triple; S3, inputting the given question and the k-hop subgraph as context into a large language model to generate one or more reasoning paths; S4, instantiate the currently generated reasoning path on the graph structure, and determine whether the instantiation is successful. If the reasoning path instantiation fails, go to S4; if the instantiation is successful, go to S8; S5. Collect the error cause after instantiation fails; S6, using the collected error reasons and the reasoning path currently being instantiated, correct the candidate relationship being instantiated; S7, based on the given question and the corrected candidate relationship, calling the large language model to edit the reasoning path that failed to be instantiated, generating a corrected reasoning path and going to S4; S8. Send the reasoning path with the maximum number of instantiations or edits and the given question to the large language model. The large language model processes the triples used to answer the question in a CoT manner to generate the final answer.
[0024] Reference Figure 2 In one embodiment, S1 specifically includes: S11, extracting input text of the source document to be processed, and dividing the input text into text blocks of a set granularity; S12, using the large language model prompt to identify all entities in each text block and the relationships between all explicitly related entities, and extracting descriptions of entities, relationships, and statements in each text block, i.e., element instances; S13, performing a large language model summary on the descriptions of entities, relations, and declarations in each text block, so that the descriptions of entities, relations, and declarations are converted into a single description text block of corresponding entity nodes, relationship edges, and declaration covariates, i.e., an element summary; S14. Model the entity nodes and relationship edges in each text block as a homogeneous undirected weighted graph, i.e., a graph structure.
[0025] Longer text blocks in S12 can be extracted using fewer large language model calls, but are affected by the recall degradation of the large language model context window; the larger the text block, the lower the recall rate, that is, the proportion of entities and relations correctly identified by the large language model decreases, resulting in the omission of entities and relations that should have been identified.
[0026] All entities in each text block include name, type and description; the relationships between all explicitly related entities include source entities and target entities and descriptions of their relationships.
[0027] Reference Figure 3 According to the given question and the graph structure, the k-hop subgraph most relevant to the given question is calculated and converted into a relation triple; the given question and the k-hop subgraph are input into the large language model as context to generate one or more reasoning paths. This reasoning path is a path that starts from each subject entity and leads to the answer through a series of edges and nodes. The k-hop subgraph most relevant to the given question is calculated according to the following steps: According to the given question, the entities are identified, and the nodes most similar to the entities in the graph structure are calculated using the BM25 and Contriever algorithms. The k-hop subgraph of these nodes is taken as the k-hop subgraph most relevant to the given question.
[0028] Reference Figure 4 , the instantiation of the reasoning path in S4, and judging whether the instantiation is successful, including relationship binding and path connection; wherein, relationship binding includes for each relationship expressed in natural language in the reasoning path, the system searches for relationships with similar semantic information in the graph structure as candidate relationships through BM25 and Contriever algorithms; for example, for "border", the system searches for relationships with similar semantics in the graph structure as candidate relationships through BM25 and Contriever algorithms, such as "adjoin", "near_by", "location" and other relationships; path connection includes, based on relationship binding, checking whether there is a reasoning path instance triggered from the starting entity, Match the relationships connected to the starting entity on the reasoning path with the candidate relationships in sequence. If the candidate relationship can be connected to the entity currently being processed, it means that this part of the reasoning path is successfully instantiated, and repeat the above steps for the remaining relationships on the reasoning path until the entire reasoning path is successfully instantiated. If no candidate relationship can be connected to the entity currently being processed, it means that the instantiation of this part of the reasoning path has failed. For example, for the entity "France", if the candidate relationship "adjoin" can be connected to the currently being processed entity "France", then an entity that satisfies the constraint "[France]border" is found, which means that "border" is successfully instantiated as "adjoin" on the graph structure.
[0029] The whole process ends when the system can start from the starting entity, connect through the path, match and instantiate all the natural language relations in the reasoning path to the corresponding relations in the graph structure, and finally complete the instantiation of the entire reasoning path. This means that starting from a given starting point, one or more reasoning paths that meet all constraints can be found.
[0030] Reference Figure 5 ,The error causes include: irrelevant natural language relations, none of the candidate graph structure relations are connected to the current entity, an empty reasoning path, and the reasoning path ends with a composite node.
[0031] Using the collected error reasons and the reasoning path currently being instantiated, the candidate relationship being instantiated is corrected; based on the given problem and the corrected candidate relationship, the large language model is called to edit the reasoning path that failed to be instantiated, a corrected reasoning path is generated, and it is continued to be determined whether the corrected reasoning path is successfully instantiated; this is performed iteratively until the reasoning path is successfully instantiated or the number of edits reaches a maximum.
[0032] The maximum number of edits is set according to experimental requirements and resource limitations. In one embodiment, for the CWQ dataset, the maximum number of edits is set to 4 times; for the WebQSP dataset, the maximum number of edits is set to 2 times; the maximum number of edits for different datasets in this embodiment is set according to the need to balance the accuracy and efficiency of the system. The maximum number of edits can be adjusted according to the needs of actual applications to save resources or improve performance; in the case of limited resources, the maximum number of edits can be set to a smaller value; in the case of pursuing higher accuracy, the value of the maximum number of edits can be appropriately increased.
[0033] Reference Figure 6 ,The reasoning path with the maximum instantiation or number of edits and the given question are sent to LLM.,Based on the received reasoning path and the given question, LLM processes the triples used to answer the question in a CoT manner and generates the final answer.
[0034] One embodiment provides a large model based graph structure reasoning path generation and self-correction device, including: The first module is used to divide the source document to be processed into blocks, extract element instances and element summaries, and construct them into a graph structure; The second module is used to calculate the k-hop subgraph most relevant to the given question and the graph structure and convert it into a relation triple; A third module is used to input the given question and the k-hop subgraph as context into a large language model to generate one or more reasoning paths; The fourth module is used to instantiate the currently generated reasoning path on the graph structure and determine whether the instantiation is successful; The fifth module is used to collect error causes after instantiation fails; The sixth module is used to correct the candidate relationship being instantiated by utilizing the collected error reasons and the reasoning path currently being instantiated; A seventh module is used to call the large language model to edit the reasoning path that failed to be instantiated based on the given question and the corrected candidate relationship, and generate a corrected reasoning path; The eighth module is used to send the reasoning path with the maximum number of instantiation successes or edit times and the given question to the large language model. The large language model processes the triples used to answer the question in a CoT manner to generate a final answer.
[0035] The implementation methods of the above modules and the construction of the model can adopt the methods described in any of the above embodiments, which will not be repeated here.
[0036] On the other hand, the present invention provides a computer device, including a memory and a processor, the memory storing a computer program, and the processor implementing the steps of the method for generating a reasoning path based on a graph structure and self-correction of a large model provided in any of the above embodiments when executing the computer program. The computer device may be a server. The computer device includes a processor, a memory, a network interface, and a database 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 the computer program in the non-volatile storage medium. The database of the computer device is used to store sample data. The network interface of the computer device is used to communicate with an external terminal via a network connection.
[0037] On the other hand, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for generating and self-correcting a reasoning path based on a graph structure for a large model provided in any of the above-mentioned embodiments.
[0038] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0039] Matters not covered by the present invention are known technologies.
[0040] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0041] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
[0042] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for generating and self-correcting reasoning paths based on graph structures for large models, characterized in that: The following steps are involved: S1, divide the source document to be processed into blocks, extract element instances and element summaries and construct them into a graph structure; S2. According to the given question and the graph structure, calculate the k-hop subgraph most relevant to the given question and convert it into a relation triple; S3, inputting the given question and the k-hop subgraph as context into a large language model to generate one or more reasoning paths; S4, instantiate the currently generated reasoning path on the graph structure, and determine whether the instantiation is successful. If the reasoning path instantiation fails, go to S4; if the instantiation is successful, go to S8; S5. Collect the error cause after instantiation fails; S6, using the collected error reasons and the reasoning path currently being instantiated, correct the candidate relationship being instantiated; S7, based on the given question and the corrected candidate relationship, calling the large language model to edit the reasoning path that failed to be instantiated, generating a corrected reasoning path and going to S4; S8. Send the reasoning path with the maximum number of instantiations or edits and the given question to the large language model. The large language model processes the triples used to answer the question in a CoT manner to generate the final answer.
2. The method for generating and self-correcting a reasoning path based on a graph structure of a large model as claimed in claim 1, characterized in that: The S1 includes: S11, extracting input text of the source document to be processed, and dividing the input text into text blocks of a set granularity; S12, using the large language model prompt to identify all entities in each text block and the relationships between all explicitly related entities, and extracting descriptions of entities, relationships, and statements in each text block, i.e., element instances; S13, performing a large language model summary on the descriptions of entities, relations, and declarations in each text block, so that the descriptions of entities, relations, and declarations are converted into a single description text block of corresponding entity nodes, relationship edges, and declaration covariates, i.e., an element summary; S14. Model the entity nodes and relationship edges in each text block as a homogeneous undirected weighted graph, i.e., a graph structure.
3. The method for generating and self-correcting a reasoning path based on a graph structure of a large model as claimed in claim 2, characterized in that: All entities in each text block include name, type and description; The relationships between all explicitly related entities include source entities and target entities and descriptions of their relationships.
4. The method for generating and self-correcting a reasoning path based on a graph structure of a large model as claimed in claim 1, characterized in that: The k-hop subgraph in S2 that is most relevant to the given question is calculated according to the following steps: According to the given question, the entities are identified, and the nodes most similar to the entities in the graph structure are calculated using the BM25 and Contriever algorithms. The k-hop subgraph of these nodes is taken as the k-hop subgraph most relevant to the given question.
5. The method for generating and self-correcting a reasoning path based on a graph structure of a large model as claimed in claim 1, characterized in that: The instantiation of the reasoning path in S4 and the judgment of whether the instantiation is successful include relationship binding and path connection; wherein, relationship binding includes for each relationship expressed in natural language in the reasoning path, the system searches for relationships with similar semantic information in the graph structure as candidate relationships through BM25 and Contriever algorithms; path connection includes, on the basis of relationship binding, checking whether there is a reasoning path instance triggered from the starting entity, matching the relationships connected to the starting entity on the reasoning path with candidate relationships in sequence, if the candidate relationship can be connected to the currently processed entity, indicating that the part of the reasoning path is successfully instantiated, and repeating the above steps for the remaining relationships on the reasoning path until the entire reasoning path is successfully instantiated; if no candidate relationship can be connected to the currently processed entity, indicating that the instantiation of this part of the reasoning path has failed.
6. The method for generating and self-correcting a reasoning path based on a graph structure of a large model as claimed in claim 1, characterized in that: The error causes include: irrelevant natural language relations, none of the candidate graph structure relations is connected to the current entity, an empty reasoning path, and the reasoning path ends with a composite node.
7. The method for generating and self-correcting a reasoning path based on a graph structure of a large model as claimed in claim 1, characterized in that: The maximum number of edits is set according to experimental requirements and resource limitations.
8. A large model graph-based reasoning path generation and self-correction device, characterized in that: include: The first module is used to divide the source document to be processed into blocks, extract element instances and element summaries, and construct them into a graph structure; The second module is used to calculate the k-hop subgraph most relevant to the given question and the graph structure and convert it into a relation triple; A third module is used to input the given question and the k-hop subgraph as context into a large language model to generate one or more reasoning paths; The fourth module is used to instantiate the currently generated reasoning path on the graph structure and determine whether the instantiation is successful; The fifth module is used to collect error causes after instantiation fails; The sixth module is used to correct the candidate relationship being instantiated by utilizing the collected error reasons and the reasoning path currently being instantiated; A seventh module is used to call the large language model to edit the reasoning path that failed to be instantiated based on the given question and the corrected candidate relationship, and generate a corrected reasoning path; The eighth module is used to send the reasoning path with the maximum number of instantiation successes or edit times and the given question to the large language model. The large language model processes the triples used to answer the question in a CoT manner to generate a final answer.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method for generating and self-correcting a reasoning path based on a graph structure for a large model as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for generating and self-correcting a reasoning path based on a graph structure for a large model as described in any one of claims 1 to 7.