Hierarchical exploration and thinking-driven large model complex graph question processing method and device
By exploring a layered, thought-driven approach to large-scale complex graph question-answering, and utilizing induced tags and contextual hints for multi-level dynamic reasoning, this approach addresses the shortcomings of existing technologies in terms of reasoning depth and cross-layer information fusion capabilities. It enables global search and optimization of deep, multi-hop reasoning paths, thereby improving the accuracy and consistency of question answering.
Patent Information
- Application Number
- CN202511012962.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-23
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2045-07-23
AI Technical Summary
Existing complex graph question answering methods are insufficient in terms of reasoning depth, path search strategy, and cross-layer information fusion capability. They are unable to effectively cope with multi-hop reasoning requirements, and the path search strategy is prone to getting trapped in local optima, failing to make full use of hierarchical information.
We adopt a large-scale complex graph question answering method driven by hierarchical exploration thinking. Through a multi-level dynamic reasoning mechanism, we decompose the complex graph question answering task into multiple semantic levels. We use induced labeling, contextual hints and multi-head graph attention mechanism for global search and optimization. Combined with consistency verification and feedback iteration mechanism, we generate high-quality question answering results.
It significantly improves the hierarchical exploration thinking and comprehensive answering ability of large models in complex graph question-answering scenarios, realizes global search and optimization of deep-level, multi-hop reasoning paths, and improves the accuracy and consistency of answers.
Smart Images

Figure CN120523917B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, and more particularly, to a hierarchical exploration thought-driven large model complex graph question and answer processing method and device. BACKGROUND
[0002] At present, the related technologies of large models in complex graph question and answer tasks mainly focus on the following aspects:
[0003] First, pre-training language model and graph information fusion; second, inference method based on graph neural networks (GNN); third, dynamic path search based on reinforcement learning. However, the above methods can only handle shallow reasoning tasks and are difficult to effectively cope with multi-hop reasoning requirements; at the same time, the path search strategy relies on heuristic methods and is prone to local optimization, lacking global optimization ability; in addition, the above methods often fail to fully utilize hierarchical structure information, resulting in insufficient cross-layer reasoning ability.
[0004] In summary, the existing complex graph question and answer methods have deficiencies in reasoning depth, path search strategy and cross-layer information fusion ability. SUMMARY
[0005] Therefore, the present application provides a hierarchical exploration thought-driven large model complex graph question and answer processing method and device, aiming to solve the technical problems of the deficiencies of the existing complex graph question and answer methods in reasoning depth, path search strategy and cross-layer information fusion ability.
[0006] One aspect of the present application provides a hierarchical exploration thought-driven large model complex graph question and answer processing method, comprising: obtaining a complex graph question and answer task to be processed, wherein the complex graph question and answer task includes graph data and question description, and the graph data includes a node set and an edge set; inputting the complex graph question and answer task into a pre-constructed large model, wherein the large model is configured with a multi-layer structure and performs the following operations: according to the graph data, adding an induced label to the node set using the first layer structure, and generating an induced graph, wherein the induced label is used to prompt the connection relationship between nodes; according to the question description, extracting core entity features and main logic structure features in the question description using the second layer structure, and generating a context prompt, wherein the context prompt is used to provide background information for the question description; according to the induced graph and the context prompt, using the third layer structure to perform reasoning exploration, generating a preliminary question and answer result, and checking the semantic relationship and logical relationship of the preliminary question and answer result; in response to the checking failing, iteratively updating the induced graph and regenerating the question and answer result until the checking passes, and outputting the target question and answer result.
[0007] According to an embodiment of the present application, the adding of the induced mark to the node set by using the first layer structure and the generating of the induced graph according to the graph data comprises: extracting the relationship path between each node in the graph data by using the first layer structure according to the graph data; generating the induced mark for the node according to the relationship path; and fusing the graph data and the induced mark to generate the induced graph, wherein the induced graph comprises the graph data, the induced mark inserted into the graph data, and the connection relationship between the induced marks.
[0008] According to an embodiment of the present application, the connection relationship between the induced marks p i and p j is dynamically adjusted by learning the adjustable parameter, or the connection relationship between the induced marks p i and p j is pruned by the dot product value, wherein when the dot product value between the induced marks p i and p j is greater than or equal to the dot product threshold, the connection relationship between the induced marks p i and p j is pruned; or all the induced marks are independent of each other, wherein the independence of each other represents that there is no connection relationship between all the induced marks.
[0009] According to an embodiment of the present application, the extracting of the core entity feature and the main logic structure feature in the problem description by using the second layer structure and the generating of the context prompt according to the problem description comprise: extracting the core entity feature in the problem description by using the second layer structure according to the problem description; constructing a syntax dependency tree according to the core entity feature, identifying the center predicate and the modification relationship in the core entity feature, and obtaining the main logic structure feature; generating a problem vector according to the core entity feature and the main logic structure feature; retrieving a knowledge fragment matched with the problem vector by using a pre-constructed knowledge base according to the problem vector; and fusing the knowledge fragment to generate the context prompt.
[0010] According to an embodiment of the present application, the retrieving of the knowledge fragment matched with the problem vector by using the pre-constructed knowledge base according to the problem vector comprises: performing expansion processing on the core entity feature in the problem vector; performing matching retrieval by using the knowledge base according to the expanded core entity feature to obtain a candidate knowledge fragment; constructing a vector matrix corresponding to the candidate knowledge fragment according to the candidate knowledge fragment; calculating the cosine similarity of the vector matrix and the problem vector; and based on the cosine similarity, screening the knowledge fragment higher than the cosine similarity threshold from the candidate knowledge fragment to obtain a target knowledge fragment.
[0011] According to an embodiment of the present application, the fusing the knowledge fragments to generate the context prompt comprises: calculating a weight feature of the knowledge fragments by using a graph attention network according to the knowledge fragments; generating a context prompt with weights according to the knowledge fragments and the weight feature; and introducing a time decay factor according to the context prompt with weights to generate a context prompt with timeliness.
[0012] According to an embodiment of the present application, the generating a preliminary question and answer result by using the third layer structure to perform reasoning exploration according to the induced graph and the context prompt, and checking semantic relations and logical relations of the preliminary question and answer result comprises: generating a multi-layer exploration path by using a multi-head graph attention mechanism according to the induced graph and the context prompt; filtering out exploration paths lower than a path depth penalty coefficient threshold in the multi-layer exploration path by using a preset path depth penalty coefficient to obtain the preliminary question and answer result; checking semantic relations of the preliminary question and answer result by using a knowledge graph according to the preliminary question and answer result; and checking logical relations of the preliminary question and answer result by using a logical reasoning network in response to the semantic relation checking of the preliminary question and answer result passing.
[0013] Another aspect of the present application provides a hierarchical exploration thinking-driven large model complex graph question and answer processing device, the device comprising: an acquisition module for acquiring a complex graph question and answer task to be processed, wherein the complex graph question and answer task comprises graph data and a question description, the graph data comprising a node set and an edge set; inputting the complex graph question and answer task into a pre-constructed large model, wherein the large model is configured with a three-layer structure and performs the following modules: an induction module for adding an induction mark to the node set by using a first layer structure according to the graph data and generating an induced graph, wherein the induction mark is used to prompt the connection relationship between nodes; a context construction module for extracting core entity features and main logical structure features in the question description by using a second layer structure according to the question description and generating a context prompt, wherein the context prompt is used to provide background information for the question description; an exploration module for generating a preliminary question and answer result by using a third layer structure to perform reasoning exploration according to the induced graph and the context prompt, and checking semantic relations and logical relations of the preliminary question and answer result; and an iteration module for iteratively updating the induced graph and regenerating a question and answer result in response to the checking not passing, until the checking passes, and outputting a target question and answer result.
[0014] Another aspect of the present application provides an electronic device comprising: one or more processors; a memory for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method as above.
[0015] Another aspect of the present application provides a computer-readable storage medium storing computer-executable instructions, the instructions being used to implement the method as above when executed.
[0016] Another aspect of the present application provides a computer program product comprising computer executable instructions for implementing the above method when executed.
[0017] Compared with the prior art, the layered exploration thinking driven large model complex graph question and answer processing method and device provided by the embodiments of the present application has at least the following beneficial effects:
[0018] (1) The layered exploration thinking driven large model complex graph question and answer processing method and device provided by the embodiments of the present application decomposes the complex graph question and answer task into multiple semantic levels through a multi-level dynamic reasoning mechanism, realizes global search and optimization of deep-level and multi-hop reasoning paths. Specifically, the multi-level dynamic reasoning mechanism is designed as a three-layer structure. The first layer (also known as the induction layer) fuses the prompt information with the node features in the graph data by designing an induction mark to obtain an induced graph with prompt information. The second layer (also known as the context construction layer) retrieves relevant knowledge bases and constructs context prompts based on the information in the question text, and then inputs the induced graph and the context prompts into the third layer (also known as the exploration layer) to realize directional induction generation of global summarization and local detail reasoning, and dynamically updates the induced graph and the generated content in combination with a consistency check and a feedback iteration mechanism to form a closed-loop optimization, thereby significantly improving the layered exploration thinking and comprehensive answering ability of the large model in the complex graph question and answer scenario, and solving the technical problems of the existing complex graph question and answer methods in terms of reasoning depth, path search strategy and cross-layer information fusion capability.
[0019] (2) The layered exploration thinking driven large model complex graph question and answer processing method and device provided by the embodiments of the present application innovatively designs the induction mark, the induction mark structure (also known as the connection relationship between the induction marks) and the insertion mode (also known as the fusion mode of the induction mark and the graph data), so that the prompt information and the graph data features are efficiently fused in the same vector space, thereby providing fine-grained guidance signals for the large model and promoting seamless interaction and collaborative reasoning of cross-modal information between the graph and the text.
[0020] (3) The layered exploration thinking driven large model complex graph question and answer processing method and device provided by the embodiments of the present application innovatively designs the context prompts for question description. By adopting a two-stage retrieval strategy, the problem core terms are quickly anchored by preliminary retrieval guided by entities to build a candidate document pool, ensuring that key information is not missed; and semantic fine screening is used to understand semantic association in depth, and high-value content is screened to provide accurate knowledge background support for subsequent exploration. The two-stage cooperative implementation of the "wide net + precise fishing" retrieval strategy is a key technical path for handling complex problems, which greatly improves the accuracy of exploring answers.
[0021] (4) The hierarchical exploration thought-driven large model complex graph question and answer processing method and device provided by the embodiment of the present application integrates internal consistency detection and feedback-driven iterative optimization strategy, realizes the co-evolution of the induced graph and the generated content through the construction of a double-checking mechanism of fact (semantic relationship) and logical relationship, and ensures the high consistency and reliability of the generated result in terms of semantic expression and logical coherence. BRIEF DESCRIPTION OF DRAWINGS
[0022] The above and other objects, features and advantages of the present application will become more apparent from the following description of embodiments of the present application taken in conjunction with the accompanying drawings, in which:
[0023] Figure 1 A flowchart schematically showing a hierarchical exploration thought-driven large model complex graph question and answer processing method according to an embodiment of the present application is shown;
[0024] Figure 2 A certain example display graph of a hierarchical exploration thought-driven large model complex graph question and answer task according to an embodiment of the present application is schematically shown;
[0025] Figure 3 A structural block diagram of a hierarchical exploration thought-driven large model complex graph question and answer processing device according to an embodiment of the present application is schematically shown;
[0026] Figure 4 A structural block diagram of an electronic device suitable for implementing a hierarchical exploration thought-driven large model complex graph question and answer processing method according to an embodiment of the present application is schematically shown. DETAILED DESCRIPTION
[0027] Hereinafter, embodiments of the present application will be described with reference to the accompanying drawings. It is to be understood, however, that the description is merely exemplary of the present application, and is not intended to limit the scope of the present application. In the following detailed description of the embodiments of the present application, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art, that the embodiments of the present application can be practiced without these specific details. In other instances, well-known structures and functions have been omitted to avoid obscuring the present application.
[0028] The terms used herein are merely used to describe specific embodiments and are not intended to limit the present application. The terms "include", "comprise" and the like as used herein indicate the presence of the described features, steps, operations and / or components, but do not exclude the presence or addition of one or more other features, steps, operations or components.
[0029] All terms used herein, including technical and scientific terms, have the meanings commonly understood by one of ordinary skill in the art unless otherwise defined. It should be noted that the use of any terms herein should be interpreted as consistent with the context of the specification, and should not be interpreted in an idealized or overly formal manner.
[0030] In the case of using expressions similar to "at least one of A, B, and C, etc.", it should be generally interpreted that the meaning of the expression is consistent with the meaning that the expression is commonly understood by one of ordinary skill in the art (for example, "a system having at least one of A, B, and C" should include but not be limited to a system having A alone, a system having B alone, a system having C alone, a system having both A and B, a system having both A and C, a system having both B and C, and / or a system having A, B, and C, etc.).
[0031] In embodiments of the present application, the collection, updating, analysis, processing, use, transmission, provision, disclosure, storage, etc. of the data involved (for example, including but not limited to user personal information) are in accordance with the relevant legal regulations, are used for legal purposes, and do not violate public order and good customs. In particular, necessary measures are taken for user personal information to prevent illegal access to user personal information data and to maintain user personal information security and network security.
[0032] At present, the related technologies of large models in complex graph question answering tasks mainly focus on the following directions:
[0033] First, the pre-training language model is integrated with graph information. Large-scale pre-training language models perform well in understanding natural language, and through the self-attention mechanism, they model the text. Existing technical solutions usually combine these language models with knowledge graph embeddings to align the relationship between text and graph information in the model, realizing cross-modal fusion. This method enables the model to utilize the structural information of entities and relationships in the knowledge graph during multi-hop reasoning, thereby enhancing the problem understanding capability.
[0034] Second, the reasoning method based on graph neural networks (GNN). Graph neural networks have an advantage in capturing local and global structural information in graphs. Some solutions combine GNN with large models by encoding each node and its neighborhood relationships in the graph to form a multi-level representation, and then combine the generation capability of large models to realize multi-step reasoning for complex problems. This method can more effectively handle the relationship and path selection problems between nodes in the graph.
[0035] Third, dynamic path search based on reinforcement learning. To solve the problem of redundant paths and local optimization in knowledge graph, some solutions introduce reinforcement learning methods (such as reinforcement learning-based graph walkers based on random walk). These methods train agents to search for dynamic paths in the graph, automatically explore the optimal reasoning chain, although there may be instability and large search space during training, but to some extent, it improves the flexibility of model path selection.
[0036] However, the above three types of existing technologies for complex graph question and answer tasks have the following defects:
[0037] (1) Limited reasoning depth: Most existing methods can only handle 2-3 step reasoning paths and cannot effectively handle deeper complex question and answer tasks.
[0038] (2) Lack of global optimization in path search strategy: Existing methods often rely on heuristic strategies when searching for paths, which can easily fall into local optimization.
[0039] (3) Insufficient cross-layer information fusion: Existing methods do not fully utilize hierarchical structure information, resulting in poor performance in multi-level reasoning tasks.
[0040] The above analysis shows that existing technologies for complex graph question and answer tasks can only handle shallow reasoning tasks and are difficult to effectively handle multi-hop reasoning requirements; at the same time, the path search strategy relies on heuristic methods and is prone to fall into local optimization, lacking global optimization ability; in addition, the above methods often fail to fully utilize hierarchical structure information, resulting in insufficient cross-layer reasoning ability.
[0041] In summary, existing complex graph question and answer methods have deficiencies in reasoning depth, path search strategy, and cross-layer information fusion ability.
[0042] Based on this, the embodiment of the present application provides a hierarchical exploration thought-driven large model complex graph question and answer processing method, aiming to solve the technical problems of existing complex graph question and answer methods in reasoning depth, path search strategy, and cross-layer information fusion ability.
[0043] To make the purpose, technical scheme and advantages of the present application clearer and more apparent, the following will further explain the present application in detail combined with specific embodiments and referring to the drawings.
[0044] Figure 1 The flowchart of the hierarchical exploration thought-driven large model complex graph question and answer processing method according to the embodiment of the present application is schematically shown.
[0045] As Figure 1As shown, the layered exploration thinking-driven large model complex graph question and answer processing method of the embodiment can include operations S1-S5, for example.
[0046] In operation S1, a complex graph question and answer task to be processed is acquired, where the complex graph question and answer task includes graph data and a question description, and the graph data includes a node set and an edge set.
[0047] The complex graph question and answer task is input into a pre-constructed large model, and the following operations S2-S5 are performed. The large model is configured with a multi-layer structure.
[0048] In operation S2, according to the graph data, the first layer structure is used to add an induction mark to the node set, and an induced graph is generated, where the induction mark is used to prompt the connection relationship between nodes.
[0049] In operation S3, according to the question description, the second layer structure is used to extract core entity features and main logic structure features in the question description, and a context prompt is generated, where the context prompt is used to provide background information for the question description.
[0050] In operation S4, according to the induced graph and the context prompt, the third layer structure is used for reasoning exploration to generate a preliminary question and answer result, and the semantic relationship and logical relationship of the preliminary question and answer result are checked.
[0051] In operation S5, in response to the check failing, the induced graph is iteratively updated and the question and answer result is regenerated until the check passes, and the target question and answer result is output.
[0052] In the embodiment, first, a complex graph question and answer task to be processed is acquired, which generally includes graph data and a question description, and the graph data is generally composed of a node set and an edge set.
[0053] After acquiring the complex graph question and answer task, the complex graph question and answer task is input into a pre-constructed large model for a series of processing.
[0054] In the embodiment, the large model is set to a three-layer structure, specifically including a first layer (also known as an induction layer), a second layer (also known as a context construction layer), and a third layer (also known as an exploration layer).
[0055] The induction layer mainly processes the graph data. After inputting the complex graph question and answer task into the large model, the induction layer is first used to generate an induction mark for the nodes in the node set of the graph data, obtaining an induced graph.
[0056] The induction mark is also known as a prompt mark, which is mainly used to assign vectorized prompt information to each input word or node in the graph, and the dimension is consistent with the original input (whether it is a word vector or a node feature vector).
[0057] The context construction layer mainly processes the problem description. After the complex graph question and answer task input large model, the core entity features and the main logical structure features in the problem description are extracted by using the context construction layer, and a context prompt is generated, wherein the context prompt is used to provide background information for the problem description.
[0058] Next, the induced graph obtained by the first two layers and the context prompt are input into the exploration layer for reasoning exploration, and the large model obtains a preliminary answer, that is, a question and answer result.
[0059] In this embodiment, the large model does not directly output the preliminary answer, but continues to verify the preliminary answer in the exploration layer. Specifically, the consistency of facts and the logical relationship are verified. If the verification fails, the induced graph is updated and the question and answer result is regenerated. This iteration optimization is repeated until the verification passes, and finally the target question and answer result is output.
[0060] The complex graph question and answer processing method of the layered exploration thinking driven large model provided in the embodiment of the application decomposes the complex graph question and answer task into multiple semantic levels through a multi-level dynamic reasoning mechanism, realizes global search and optimization of a deep and multi-hop reasoning path, and is specifically designed as a three-layer structure. The first layer (that is, the induction layer) fuses the prompt information with the node features in the graph data by designing an induction mark to obtain an induced graph with prompt information. The second layer (that is, the context construction layer) retrieves related knowledge bases and constructs a context prompt based on the information in the problem text, and then inputs the induced graph and the context prompt into the third layer (that is, the exploration layer) to realize directional induction generation of global summarization and local detail reasoning, and dynamically updates the induced graph and the generated content in combination with the consistency verification and feedback iteration mechanism to form a closed loop optimization. Therefore, the layered exploration thinking and comprehensive answering ability of the large model in the complex graph question and answer scene are significantly improved, and the technical problems of the existing complex graph question and answer method in the reasoning depth, path search strategy and cross-layer information fusion capability are solved.
[0061] According to the embodiment of the application, operation S2 adds an induction mark to the node set according to the graph data by using the first layer structure, and generates an induced graph, which can specifically include:
[0062] According to the graph data, the relationship paths between the nodes in the graph data are extracted by using the first layer structure;
[0063] According to the relationship paths, the induction marks are generated for the nodes;
[0064] The graph data and the induction marks are fused to generate an induced graph, wherein the induced graph includes the graph data, the induction marks inserted into the graph data, and the connection relationship between the induction marks.
[0065] In this embodiment, in order to seamlessly migrate the effective prompting mechanism in natural language processing (NLP) to the processing of graph data, an induction mechanism is specially proposed to integrate the ideas of NLP prompting and graph prompting. In this induction mechanism, the prompting design of the induction graph should at least include three basic components (induction token, induction token structure, and insertion mode), which work together to adapt to the complexity of data structure and information transmission in the graph field.
[0066] Regarding the induction token (Induction Token):
[0067] The key to the design of the induction token is to ensure that the prompting information has good compatibility and consistency with the original graph data in the subsequent fusion and calculation process. By introducing the prompting vector in the same dimension, the seamless superposition of the prompting information and the original input features in the model can be realized, so as to better guide the model to capture the key information of the target task.
[0068] Specifically, let a graph instance be G=(V,E), where, V={v i 1,v i 2,…,v (1×d) N} represents a node set containing N nodes, and each node v i i has a feature vector, denoted as x j i i ∈R j ; E={(v i i,v i j)|v (1×d) i,v h j∈V} represents an edge set, and each edge connects a pair of nodes in the node set.
[0069] In this embodiment, the induction graph can be represented as Gp=(P,S), where, P={p i 1,p (1×d) 2,…,p i |P| represents the number of induction tokens; and S represents a set of connection relationships between the induction tokens.
[0070] Each induction token p j i i ∈P can be represented by a prompting vector p j i i ∈R i with the same dimension as the node feature in the input graph (graph data). It should be noted that in actual applications, usually and , where d (1×d) is the dimension of the hidden layer in the pre-trained graph model.
[0071] Using these prompting vectors, the input graph can be reconstructed by adding the jth prompting to the graph node.
[0072] For example:
[0073]
[0074] wherein e.g. is an abbreviation for "for example" and is used to exemplify; is denoted as a node v i Add the feature vector after the induced mark.
[0075] Then, the original input features are replaced with the prompted features, and they are sent to the pre-trained large model for subsequent processing.
[0076] Regarding the induced token structure:
[0077] The induced token structure, i.e. the connection relationship between induced tokens, is used to define the mutual connection and interaction between different induced tokens.
[0078] In traditional NLP applications, induced tokens (usually represented as prompt words) generally follow linear arrangement, such as forming a clause or phrase in a sentence, forming an obvious sequential relationship. However, graph data is inherently non-linear and has complex topological structure, so the relationship between each prompt token in the graph prompt must also reflect this non-linear characteristic. Designing a reasonable token structure can help the model more accurately capture the complex dependency relationship and information flow between nodes, thereby improving overall performance.
[0079] In this embodiment, S={(p i, p j )|p i ,p j ∈P} is used to represent the token structure formed by the pairwise relationship between tokens. Unlike NLP prompts, the token structure in the prompt graph is usually implicit.
[0080] To solve this problem, three methods for designing induced token structures are proposed in this embodiment, as follows:
[0081] According to an embodiment of the present application, the connection relationship between induced tokens is configured in the following three ways:
[0082] The first way is to learn adjustable parameters.
[0083] For example, the connection relationship between induced tokens p i and p j can be dynamically adjusted by learning adjustable parameters:
[0084]
[0085] wherein A represents a matrix composed of adjustable parameters a ij , and aij represents an adjustable parameter to indicate the possibility of connection between the induced markers p i and the induced markers p j .
[0086] The second way is to use the dot product of each pair of induced markers, and prune them according to the dot product value.
[0087] For example, the connection relationship between the induced markers p i and the induced markers p j can be pruned by the dot product value, wherein when the dot product value between the induced markers p i and the induced markers p j is greater than or equal to the dot product threshold, the connection relationship between the induced markers p i and the induced markers p j is pruned.
[0088] In the embodiment, (p i , p j ) ∈ S only when , wherein represents a sigmoid activation function, and δ represents a predefined dot product threshold. It can be understood that the connection relationship between the induced markers p i and the induced markers p j is retained only when the dot product value between the induced markers p i and the induced markers p j is less than the dot product threshold.
[0089] The third way is to regard the induced markers as independent of each other.
[0090] For example, all the induced markers are independent of each other, wherein the independence of each other represents that there is no connection relationship between all the induced markers, and at this time S = φ, wherein φ represents an empty set.
[0091] Regarding the inserting pattern:
[0092] The inserting pattern describes the specific method of how to integrate the prompt information into the input data. In NLP, since the text has clear sequence characteristics, the prompt information is often directly added to the front or end of the sentence to form a fixed prompt position. However, graph data lacks a clear starting or ending position similar to text, and its structure is more scattered and diverse, so there is no natural “first position” to accommodate prompt information in the graph field. Therefore, it is necessary to design a flexible and efficient prompt insertion strategy that does not destroy the original graph structure and fully plays the role of prompt information in enhancing feature expression. The design of the inserting pattern often needs to combine the topological characteristics of the graph and the task requirements to explore an optimal prompt embedding method.
[0093] Let ψ be an insertion function indicating how to add the induced graph Gp to the input graph G, then the added graph Gm can be represented as:
[0094]
[0095] In this embodiment, the insertion mode can be defined as the dot product between the induced mark and the input graph node, and then the following customized connection mode is adopted:
[0096]
[0097] where w ik represents the weight value for pruning unnecessary connections, which is defined as:
[0098]
[0099] As an alternative and special case, a more simplified method can also be used:
[0100]
[0101] The hierarchical exploration thinking driven large model complex graph question processing method provided by the embodiment of the application innovatively designs the induced mark, the induced mark structure and the mark insertion mode, so that the prompt information and the graph data features are efficiently fused in the same vector space, thereby providing fine-grained guidance signals for the large model, and promoting seamless interaction and collaborative reasoning of cross-modal information of graph and text.
[0102] According to the embodiment of the application, operation S3 extracts core entity features and main logical structure features in the question description according to the question description using the second layer structure, and generates a context prompt, which can specifically include:
[0103] According to the question description, the core entity features in the question description are extracted using the second layer structure;
[0104] According to the core entity features, a syntax dependency tree is constructed, the center predicate and the modification relationship in the core entity features are identified, and the main logical structure features are obtained;
[0105] According to the core entity features and the main logical structure features, a question vector is generated;
[0106] According to the question vector, a knowledge fragment matching the question vector is retrieved using a pre-constructed knowledge base; the knowledge fragments are fused to generate a context prompt.
[0107] In the embodiment, first, the second layer structure is used for semantic analysis and feature extraction of the problem description, core entities in the problem are extracted, and the knowledge base retrieval range is reduced. Then, the main logic of the problem (such as “who / what → do what → how to do”) is determined, guiding the subsequent semantic understanding. Finally, the text is mapped to the semantic space, providing a basis for vector retrieval.
[0108] Specifically, in the core entity recognition process, for example, a deep learning natural language processing model, a conditional random field model BERT-CRF (pytorch-pretrained-BERT, conditional random field, CRF) can be used to extract core entities, and the process can be represented as:
[0109]
[0110] Wherein, E represents the model output, and e represents the core entity.
[0111] Further dependency analysis is performed to construct a syntax dependency tree, identify the center verb (root verb) and the modification relationship, and obtain the main logic structure, and the process can be represented as:
[0112]
[0113] Further semantic encoding is performed, and a model (such as Sentence-BERT) for generating sentence embedding is used to generate a question vector, and the process can be represented as:
[0114]
[0115] Wherein, q represents the question vector, represents a 768-dimensional real number vector space.
[0116] According to the question vector, the knowledge base is pre-constructed to retrieve the knowledge fragment matched with the question vector, and finally the context prompt is generated by fusing the knowledge fragment.
[0117] According to the embodiment of the application, according to the question vector, the knowledge base is pre-constructed to retrieve the knowledge fragment matched with the question vector, which can specifically include:
[0118] The core entity features in the question vector are expanded;
[0119] According to the expanded core entity features, the knowledge base is used for matching retrieval to obtain candidate knowledge fragments;
[0120] According to the candidate knowledge fragments, a vector matrix corresponding to the candidate knowledge fragments is constructed;
[0121] Calculate the cosine similarity of the vector matrix and the problem vector;
[0122] Based on the cosine similarity, filter out the knowledge fragments higher than the cosine similarity threshold in the candidate knowledge fragments to obtain the target knowledge fragments.
[0123] In this embodiment, a two-stage retrieval strategy is adopted. First, the core terms of the problem are quickly anchored through entity-guided preliminary retrieval to construct a candidate document pool, ensuring that no key information is missed. Then, semantic fine screening is used to filter high-value content to provide accurate knowledge support for the generation module. Specifically:
[0124] In the first stage, entity-guided preliminary retrieval is performed.
[0125] In this stage, first, entity expansion query processing is performed:
[0126]
[0127] Among them, represents the expansion query statement; represents synonym expansion; represents morphological restoration.
[0128] Then, a text retrieval algorithm (such as Best Matching 25) is used to retrieve in the three-level index:
[0129]
[0130] Among them, represents the document relevance score, k1 represents the term frequency adjustment factor to control the influence of term frequency on the score, the larger the value, the higher the term frequency weight; b represents the document length normalization factor to adjust the influence of document length on the score; 0 represents no normalization, and 1 represents complete normalization. "TF(t, d)" represents the term frequency of term t in document d, reflecting the local importance of the term in the document; IDF(t) represents the inverse document frequency, used to measure the global discriminability of the term.
[0131] The parameters of this stage can be set as follows, for example: k1=1.2, b=0.75, and Top 200 candidate documents (candidate knowledge fragments) are returned.
[0132] In the second stage, semantic fine screening is performed.
[0133] In this stage, first, the candidate knowledge fragments construct a candidate document vector matrix D:
[0134]
[0135] Among them, SBERT represents a sentence encoding model; T represents the matrix transpose operation; Dimension specification of a real number matrix.
[0136] Then the cosine similarity is calculated :
[0137]
[0138] Finally, dynamic threshold filtering is performed:
[0139]
[0140] wherein, indicates the final candidate document set screened out; μ indicates the similarity mean value, used as the benchmark screening line; σ indicates the similarity standard deviation, used to measure the data dispersion degree; and α indicates the dynamic coefficient, controlling the screening strictness, and the greater the value, the more relaxed the screening.
[0141] According to the embodiment of the application, the knowledge fragments are fused to generate the context prompt, which can specifically include the following steps:
[0142] According to the knowledge fragments, the weight features of the knowledge fragments are calculated by using a graph attention network;
[0143] According to the knowledge fragments and the weight features, the context prompt with weights is generated;
[0144] According to the context prompt with weights, a time decay factor is introduced to generate the context prompt with timeliness.
[0145] In the embodiment, through semantic association analysis and weight fusion, fragmented knowledge is converted into logically complete context, solving the problem of “information scattering”; and then a time decay mechanism is introduced to construct a timeliness-sensitive weight system, solving the problem of “outdated knowledge”. Both of them ensure that the context input into the large model has logical rigor and timeliness, laying a foundation for high-quality generation. The specific process includes knowledge fragment reorganization and time sequence enhancement.
[0146] Knowledge fragment reorganization:
[0147] For example, first, the fragment relevance weight is calculated by using a graph attention network:
[0148]
[0149] wherein, a ij indicates an attention mechanism parameter vector; W indicates a linear transformation matrix; and LeakyReLU indicates an activation function.
[0150] Then, the context prompt with weights is constructed:
[0151]
[0152] wherein c represents the constructed context vector (or text sequence) with weights; a i represents the weight coefficient of the i-th knowledge fragment (document / paragraph); d i represents the vector representation (or original text) of the i-th knowledge fragment; m represents the total number of knowledge fragments participating in fusion.
[0153] Temporal enhancement:
[0154] For example, a time decay factor is added to construct a time-sensitive weight system, and the process can be represented as:
[0155]
[0156] wherein w t represents the time decay weight; e represents the natural constant; λ represents the knowledge freshness index, λ = 0.1; t current represents the current time; t doc represents the time of the knowledge fragment (document, etc.).
[0157] The hierarchical exploration thinking-driven large model complex graph question and answer processing method provided by the embodiment of the application innovatively designs a context prompt for question description, adopts a two-stage retrieval strategy, first anchors the problem core terms quickly through entity-guided preliminary retrieval to construct a candidate document pool, and ensures that no key information is missed; and then uses semantic fine screening to understand semantic association in depth, and screens high-value content to provide accurate knowledge background support for subsequent exploration. The two-stage cooperation realizes the "broad net + precise fishing" retrieval strategy, which is a key technical path for processing complex problems, and greatly improves the accuracy of exploring answers.
[0158] According to the embodiment of the application, operation S4 generates a preliminary question and answer result by reasoning exploration using the third layer structure according to the induction graph and the context prompt, and checks the semantic relationship and logical relationship of the preliminary question and answer result, which can specifically include:
[0159] Generating a multi-layer exploration path using a multi-head graph attention mechanism according to the induction graph and the context prompt;
[0160] Using a preset path depth penalty coefficient, filtering out exploration paths in the multi-layer exploration path that are lower than the path depth penalty coefficient threshold, to obtain a preliminary question and answer result;
[0161] According to the preliminary question and answer result, performing semantic relationship checking on the preliminary question and answer result using a knowledge graph;
[0162] In response to the semantic relationship checking of the preliminary question and answer result passing, performing logical relationship checking on the preliminary question and answer result using a logical reasoning network.
[0163] In this embodiment, the induced graph obtained from the first two layers and the context prompt are input into the exploration layer for reasoning exploration. The core of this layer is to realize the co-evolution of the prompt graph and the generated content through hierarchical knowledge exploration and self-correction mechanism during the reasoning process. The specific process includes: knowledge deconstruction phase and verification phase.
[0164] Knowledge deconstruction phase:
[0165] This phase decomposes complex problems into multiple levels of semantic units, locates key reasoning paths through attention mechanisms based on graph structure, and solves the problem of information dispersion and complex correlation in graph data.
[0166] For example, first, based on the current problem description Q and the induced graph, a multi-head graph attention mechanism is used to generate k layers of exploration paths. This process can be represented as:
[0167]
[0168] where l∈{1,...,k} represents different abstraction levels; d k is the dimension scaling factor; Softmax represents the normalization function; W represents the linear transformation matrix.
[0169] Then perform probabilistic path sampling. This process can be represented as:
[0170]
[0171] where P(P m ) represents the sampling probability of path P m ; α represents the attention weight of the path edge; u represents the starting / intermediate node of the path; v represents the subsequent node; λ represents the path depth penalty coefficient, which is used to prevent excessive depth of irrelevant subgraphs.
[0172] Verification phase:
[0173] This phase performs double verification on the intermediate conclusions in the reasoning process to ensure that the generated content meets the requirements of factual correctness and logical self-consistency, solving the "hallucination accumulation" problem of traditional large models in complex reasoning. The following two aspects are mainly detected:
[0174] Fact consistency verification (also known as semantic relationship verification): Calculate the confidence of the triplets in the knowledge graph embedding vector space:
[0175]
[0176] where Conf(h,r,t) represents the confidence of the triplet (h,r,t); is the entity projection function, h represents the head entity, and Mr represents the matrix transformation of the relationship r.
[0177] Logical coherence verification: logical relationship verification is performed by constructing a differentiable logic reasoning network:
[0178]
[0179] wherein, represents a logical coherence loss function; c represents a conclusion; represents the gradient of the function fθ(x) with respect to the input x, and θ represents the parameters of the function. When the adjacent conclusions c i and c (i+1) are contradictory, a gradient penalty term is activated.
[0180] According to an embodiment of the present application, operation S5 iteratively updates the induced graph and regenerates the question and answer result in response to the verification failing, until the verification passes, and outputs the target question and answer result.
[0181] This stage realizes the co-evolution of the induced graph and the generated content based on counterfactual analysis and topologically sensitive updates, and solves the problem of mismatch between the static prompt mechanism and the dynamic reasoning demand. The technical process is as follows:
[0182] Counterfactual perturbation generation, the minimum perturbation set is constructed by an adversarial generation network:
[0183]
[0184] wherein, represents the optimal perturbation; KL represents the Kullback-Leibler (KL) divergence, which is used to measure the difference between two probability distributions; p0 represents the original prediction distribution, and γ represents the distribution retention coefficient.
[0185] The hierarchical exploration thought-driven large model complex graph question and answer processing method provided by the embodiment of the present application integrates internal consistency detection and feedback-driven iterative optimization strategy, realizes the co-evolution of the induced graph and the generated content by constructing a dual verification mechanism of fact (semantic relationship) and logical relationship, and ensures the high consistency and reliability of the generated result in terms of semantic expression and logical coherence.
[0186] Figure 2 An example display diagram of a hierarchical exploration thought-driven large model complex graph question and answer task according to an embodiment of the present application is schematically shown.
[0187] As Figure 2 shown, in the present embodiment, the complex graph question and answer task includes: graph data and question description.
[0188] The question description Q is, for example, "Which node is closest to node 5".
[0189] After inputting the complex graph question and answer task into the large model, first, the induced graph generated by the induction layer according to the graph data is used. From the induced graph, it can be seen that by adding the induced mark, the connection relationship between each node can be prompted.
[0190] Then the context construction layer is used to generate a context prompt according to the problem description, for example:
[0191] “Node 4 is connected to nodes 2, 3, 5, and 6.” “Node 5 is connected to nodes 4 and 9.”
[0192] Then the induced graph and the context prompt are input into the exploration layer for reasoning and exploration. The exploration layer can perform the following reasoning and exploration according to the induced graph and the context prompt, for example:
[0193] “Hmm, okay, I need to solve this problem now. The problem states that node 4 is connected to nodes 2, 3, 5, and 6, and node 5 is connected to nodes 4 and 9. Then the question is which node is closest to node 5. I need to carefully analyze the connection relationship between each node and then calculate the distance. First, I need to clearly organize the information given in the question. Maybe drawing a graph will be more intuitive. I first draw the connection of each node: node 4 is directly connected to nodes 2, 3, 5, and 6. That is, from node 4, you can directly reach these four nodes, and the distance of each node is 1 hop. Node 5 is directly connected to node 4 and node 9. Therefore, the single-hop neighbors of node 5 are node 4 and node 9, and the distance between them is 1. The current question is which node is closest to node 5. Here, “distance” refers to the length of the shortest path, i.e. the number of hops. Therefore, I need to find the shortest path from node 5 to all other reachable nodes, and then compare the lengths of these paths to find the node with the shortest path.”
[0194] After checking the preliminary answer and iteratively updating the induced graph, the final output of the question and answer result is: “Node 4 and 9 are closest to node 5”.
[0195] Figure 3 The structure block diagram of the layered exploration thinking-driven large model complex graph question and answer processing device according to the embodiment of the present application is schematically shown.
[0196] As shown in Figure 3 , the layered exploration thinking-driven large model complex graph question and answer processing device 300 of the embodiment of the present application includes an acquisition module 310, an induction module 320, a context construction module 330, an exploration module 340, and an iteration module 350.
[0197] Among them, the acquisition module 310 is used to acquire the complex graph question and answer task to be processed, wherein the complex graph question and answer task includes graph data and problem description, and the graph data includes a node set and an edge set.
[0198] The complex graph question answering task is input into a pre-constructed large model, wherein the large model is configured with a three-layer structure and performs the following modules.
[0199] The induction module 320 is configured to add an induction mark to the node set according to the graph data by using the first layer structure, and generate an induced graph, wherein the induction mark is used to prompt the connection relationship between nodes.
[0200] The context construction module 330 is configured to extract core entity features and main logic structure features in the question description according to the question description by using the second layer structure, and generate a context prompt, wherein the context prompt is used to provide background information for the question description.
[0201] The exploration module 340 is configured to perform reasoning exploration by using the third layer structure according to the induced graph and the context prompt, generate a preliminary question answering result, and check the semantic relationship and logical relationship of the preliminary question answering result.
[0202] The iteration module 350 is configured to update the induced graph and regenerate the question answering result iteratively until the check passes, and output a target question answering result.
[0203] Any one or more of the modules, sub-modules, units, sub-units according to the embodiments of the present application, or at least part of the functions of any one or more of them, can be implemented in one module. Any one or more of the modules, sub-modules, units, sub-units according to the embodiments of the present application can be split into multiple modules for implementation. Any one or more of the modules, sub-modules, units, sub-units according to the embodiments of the present application can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on chip, a system on board, a system on package, an application specific integrated circuit (ASIC), or any other reasonable way of hardware or firmware by integrating or packaging the circuit, or in any one of software, hardware and firmware or in any appropriate combination of any of them. Alternatively, one or more of the modules, sub-modules, units, sub-units according to the embodiments of the present application can be at least partially implemented as computer program modules that can perform corresponding functions when executed.
[0204] For example, any of the plurality of the acquisition module 310, the induction module 320, the context construction module 330, the exploration module 340 and the iteration module 350 can be combined in one module / unit / subunit for implementation, or any of the modules / units / subunits can be split into multiple modules / units / subunits. Alternatively, at least part of the functions of one or more of the modules / units / subunits can be combined with at least part of the functions of other modules / units / subunits and implemented in one module / unit / subunit. According to an embodiment of the present application, at least one of the acquisition module 310, the induction module 320, the context construction module 330, the exploration module 340 and the iteration module 350 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on chip, a system on substrate, a system on package, an application specific integrated circuit (ASIC), or any other reasonable manner of integrating or packaging a circuit, etc. hardware or firmware, or in any one of software, hardware and firmware implementation or in a suitable combination of any of them. Alternatively, at least one of the acquisition module 310, the induction module 320, the context construction module 330, the exploration module 340 and the iteration module 350 can be at least partially implemented as a computer program module that can perform corresponding functions when executed.
[0205] It should be noted that the layered exploration thought-driven large model complex graph question answering device part in the embodiments of the present application corresponds to the layered exploration thought-driven large model complex graph question answering processing method part in the embodiments of the present application, and the description of the layered exploration thought-driven large model complex graph question answering device part is specifically referred to the layered exploration thought-driven large model complex graph question answering processing method part, which will not be repeated here.
[0206] Figure 4 The structure block diagram of an electronic device suitable for implementing the layered exploration thought-driven large model complex graph question answering processing method according to an embodiment of the present application is schematically shown. Figure 4 The electronic device shown is only an example and should not bring any limitation to the functions and use range of the embodiments of the present application.
[0207] As Figure 4As shown, the electronic device 400 according to an embodiment of the present application includes a processor 401 which can perform various appropriate actions and processes in accordance with a program stored in a read only memory (ROM) 402 or a program loaded into a random access memory (RAM) 403 from a storage section 408. The processor 401 can include, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor, and / or a related chipset, and / or a special purpose microprocessor (e.g., an application specific integrated circuit (ASIC)), and so on. The processor 401 can also include an on-board memory for cache use. The processor 401 can include a single processing unit or multiple processing units to perform the various actions of the method processes according to embodiments of the present application.
[0208] In the storage section 408, various programs and data required for the operation of the electronic device 400 are stored. The processor 401, the ROM 402, and the storage section 408 are connected to each other by a bus 404. The processor 401 performs various operations of the method processes according to embodiments of the present application by executing the programs in the ROM 402 and / or the storage section 408. Note that the programs can also be stored in one or more memories other than the ROM 402 and the storage section 408. The processor 401 can also perform various operations of the method processes according to embodiments of the present application by executing the programs stored in the one or more memories.
[0209] According to an embodiment of the present application, the electronic device 400 can also include an input / output (I / O) interface 405 which is also connected to the bus 404. The electronic device 400 can also include one or more of the following components connected to the input / output (I / O) interface 405: an input section 406 including a keyboard, a mouse, etc.; an output section 407 including a display such as a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 408 including a hard disk, etc.; and a communication section 409 including a network interface card such as a LAN card, a modem, etc. The communication section 409 performs communication processing via a network such as the Internet. A drive 410 is also connected to the input / output (I / O) interface 405 as necessary. A removable medium 411 such as a magnetic disk, a magneto-optical disk, a semiconductor memory, etc. is attached to the drive 410 as necessary, so that a computer program read out therefrom is installed into the storage section 408 as necessary.
[0210] According to an embodiment of the present application, the method flow according to the embodiments of the present application can be implemented as a computer software program. For example, the embodiments of the present application include a computer program product comprising a computer program carrying computer program code for performing the methods illustrated in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network through the communication section 409, and / or installed from the detachable medium 411. When the computer program is executed by the processor 401, the above-described functions defined in the system / apparatus according to the embodiments of the present application are performed. According to an embodiment of the present application, the system, apparatus, module, unit, etc. described above can be implemented by computer program modules.
[0211] The present application also provides a computer readable storage medium, which can be included in the apparatus / system / device described in the above embodiments, or exist separately without being assembled into the apparatus / system / device. The above computer readable storage medium carries one or more programs, which when executed, implement the method according to the embodiments of the present application.
[0212] According to an embodiment of the present application, the computer readable storage medium can be a non-volatile computer readable storage medium. For example, it can include but not limited to portable computer diskette, hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any appropriate combination thereof. In the present application, the computer readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus or device.
[0213] For example, according to an embodiment of the present application, the computer readable storage medium can include the ROM 402 and / or the storage section 408 described above, and / or one or more memories other than the ROM 402 and the storage section 408.
[0214] The embodiments of the present application also include a computer program product comprising a computer program containing program code for performing the method provided by the embodiments of the present application, which program code, when the computer program product is run on an electronic device, causes the electronic device to perform the method provided by the embodiments of the present application.
[0215] When the computer program is executed by the processor 401, the above-described functions defined in the system / apparatus according to the embodiments of the present application are performed. According to an embodiment of the present application, the system, apparatus, module, unit, etc. described above can be implemented by computer program modules.
[0216] In one embodiment, the computer program can be tangibly embodied in a non-transitory computer readable medium, such as the optical storage device, the magnetic storage device, etc. In another embodiment, the computer program can be tangibly embodied in a signal, such as a download singal, and be distributed over the networks, such as the Internet, and be downloaded into the computer system 400 through the communication interface 409, and / or the removable storage device 411. The computer program embodied in the computer program can be transmitted in any suitable form including, but not limited to, radio frequency, electrical, optical, acoustic, or any suitable combination of these forms.
[0217] According to an embodiment of the present application, program code embodied on one or more computer readable media can be used by the computer system 400 to perform the computer-implemented processes of the present application. In this regard, various embodiments of the present application can be implemented as a computer program or programs that are executable on the computer system 400 and / or can be implemented in software and / or firmware. Program code 405 generally comprises computer readable instructions that, when executed by the computer system 400, perform a method, e.g., a method of the present application. Program code 405 can be stored in a computer readable medium, such as memory 403, memory 404, and / or memory 405, or a computer program product, such as the removable storage device 411, the communication interface 409, and / or the input / output interface 410. Program code 405 can also be received via the input / output interface 410, the communication interface 409, and / or the removable storage device 411.
[0218] The computer program can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++, or the like, and / or a procedural programming language, such as the "C" programming language or the like, and / or assembly or machine language. Program code 405 can execute entirely on the user's computing device, partly on the user's computing device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device or entirely on the remote computing device or server. In the latter scenario, the remote computing device can be connected to the user's computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computing device, such as through the Internet using an Internet Service Provider. The computer program can be embodied in a computer program product on a non-transitory computer readable medium, which includes program code 405. The flow diagrams and block diagrams in the drawings are representative of the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flow diagrams or block diagrams can represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical functions ("instructions"). It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently or the blocks may be executed in the reverse order, depending on the functionality involved. It will also be noted that each block of the block diagrams and / or flow diagrams, and combinations thereof, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
[0219] The above described embodiments of the application have been described. However, these embodiments are merely meant to be illustrative and not limiting of the scope of the application. Although each of the embodiments has been described separately, this does not mean that measures from the individual embodiments cannot be used advantageously in combination. Numerous alternatives and modifications will be apparent to those skilled in the art without departing from the scope of the present application, which is defined in the following claims.
Claims
1. A layered exploration thinking-driven large model complex graph question answering processing method, characterized in that, The method comprises: acquiring a complex graph question answering task to be processed, wherein the complex graph question answering task comprises graph data and a question description, and the graph data comprises a node set and an edge set; inputting the complex graph question answering task into a pre-constructed large model, wherein the large model is configured with a multi-layer structure and performs the following operations: adding an induced mark to the node set according to the graph data by using a first layer structure, and generating an induced graph, wherein the induced mark is used to prompt the connection relationship between nodes; extracting core entity features and main logical structure features in the question description according to the question description by using a second layer structure, and generating a context prompt, wherein the context prompt is used to provide background information for the question description; performing reasoning exploration by using a third layer structure according to the induced graph and the context prompt, generating a preliminary question answering result, and checking the semantic relationship and logical relationship of the preliminary question answering result; in response to the checking failing, iteratively updating the induced graph and regenerating a question answering result until the checking passes, and outputting a target question answering result; the operation of adding an induced mark to the node set according to the graph data by using a first layer structure and generating an induced graph comprises: extracting a relationship path between nodes in the graph data according to the graph data by using a first layer structure; generating an induced mark for a node according to the relationship path; fusing the graph data and the induced mark to generate an induced graph, wherein the induced graph comprises the graph data, the induced mark inserted into the graph data, and the connection relationship between induced marks; the connection relationship between induced marks is configured as: Induced marker p i With the induced marker p j The connections between them can be dynamically adjusted by learning adjustable parameters, or Induction marker p i The connection relationship between the induction marker p j The connection relationship between the induction marker p i The connection relationship between the induction marker p j The connection relationship between the induction marker p i The connection relationship between the induction marker p j The connection relationship between the induction marker p all induced marks are independent of each other, wherein the independence represents that there is no connection relationship between all induced marks.
2. The method of claim 1, wherein, the operation of extracting core entity features and main logical structure features in the question description according to the question description by using a second layer structure, and generating a context prompt comprises: extracting core entity features in the question description according to the question description by using a second layer structure; constructing a syntax dependency tree according to the core entity features, identifying a center predicate and a modification relationship in the core entity features, and obtaining main logical structure features; generating a question vector according to the core entity features and the main logical structure features; retrieving a knowledge fragment matching the question vector from a pre-constructed knowledge base according to the question vector; fusing the knowledge fragment to generate a context prompt.
3. The method of claim 2, wherein, the operation of retrieving a knowledge fragment matching the question vector from a pre-constructed knowledge base according to the question vector comprises: performing extension processing on the core entity features in the question vector; performing matching retrieval on the extended core entity features by using the knowledge base to obtain a candidate knowledge fragment; constructing a vector matrix corresponding to the candidate knowledge fragment according to the candidate knowledge fragment; calculating the cosine similarity of the vector matrix and the question vector; based on the cosine similarity, filtering out a knowledge fragment higher than a cosine similarity threshold from the candidate knowledge fragment to obtain a target knowledge fragment.
4. The method of claim 2, wherein, The fusing the knowledge segments generates a context prompt, which includes: According to the knowledge segments, the weight features of the knowledge segments are calculated by using a graph attention network; According to the knowledge segments and the weight features, a context prompt with weights is generated; According to the context prompt with weights, a time decay factor is introduced to generate a context prompt with timeliness.
5. The method of claim 1, wherein, The according to the induced graph and the context prompt, the inference exploration is performed by using a third layer structure to generate a preliminary question and answer result, and the semantic relationship and logical relationship of the preliminary question and answer result are verified, which includes: According to the induced graph and the context prompt, a multi-layer exploration path is generated by using a multi-head graph attention mechanism; By using a preset path depth penalty coefficient, exploration paths lower than a path depth penalty coefficient threshold in the multi-layer exploration path are filtered out to obtain a preliminary question and answer result; According to the preliminary question and answer result, the semantic relationship of the preliminary question and answer result is verified by using a knowledge graph; In response to the semantic relationship verification of the preliminary question and answer result passing, the logical relationship of the preliminary question and answer result is verified by using a logical reasoning network.
6. A layered exploration thinking-driven large model complex graph question answering processing apparatus, characterized in that, The device includes: An acquisition module is configured to acquire a complex graph question and answer task to be processed, wherein the complex graph question and answer task includes graph data and a question description, and the graph data includes a node set and an edge set; The complex graph question and answer task is input into a pre-constructed large model, wherein the large model is configured with a three-layer structure and performs the following modules: An induction module is configured to add an induced mark to the node set by using a first layer structure according to the graph data, and generate an induced graph, wherein the induced mark is used to prompt the connection relationship between nodes; A context construction module is configured to extract core entity features and main logical structure features in the question description by using a second layer structure according to the question description, and generate a context prompt, wherein the context prompt is used to provide background information for the question description; An exploration module is configured to perform inference exploration by using a third layer structure according to the induced graph and the context prompt to generate a preliminary question and answer result, and verify the semantic relationship and logical relationship of the preliminary question and answer result; An iteration module is configured to iteratively update the induced graph and regenerate a question and answer result in response to the verification failing, until the verification passes, and output a target question and answer result; The according to the graph data, the induced mark is added to the node set by using a first layer structure, and the induced graph is generated, which includes: According to the graph data, the relationship path between nodes in the graph data is extracted by using a first layer structure; According to the relationship path, an induced mark is generated for a node; The graph data and the induced mark are fused to generate an induced graph, wherein the induced graph includes the graph data, the induced mark inserted into the graph data, and the connection relationship between induced marks; The connection relationship between induced marks is configured as: Induced marker p i With the induced marker p j The connections between them can be dynamically adjusted by learning adjustable parameters, or induction marker p i The connection relationship between the induction marker p j The connection relationship between the induction marker p i The connection relationship between the induction marker p j The connection relationship between the induction marker p i The connection relationship between the induction marker p j The connection relationship between the induction marker p All induced marks are independent of each other, wherein the independence represents that there is no connection relationship between all induced marks.
7. An electronic device, comprising: It includes: One or more processors; A storage device for storing one or more programs; wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method according to any one of claims 1-5.
8. A computer-readable storage medium having stored thereon executable instructions that cause a computer to: The instructions, when executed by a processor, cause the processor to perform the method according to any one of claims 1-5.
Citation Information
Patent Citations
Intelligent virtual customer service system
CN108280095A
Relation prediction method combining logic rules and fragmented knowledge
CN111191460A