Movatterモバイル変換


[0]ホーム

URL:


CN119336921A - Industrial knowledge graph completion and adaptive retrieval method based on large language model - Google Patents

Industrial knowledge graph completion and adaptive retrieval method based on large language model
Download PDF

Info

Publication number
CN119336921A
CN119336921ACN202411884224.3ACN202411884224ACN119336921ACN 119336921 ACN119336921 ACN 119336921ACN 202411884224 ACN202411884224 ACN 202411884224ACN 119336921 ACN119336921 ACN 119336921A
Authority
CN
China
Prior art keywords
knowledge graph
entity
sub
information
language model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202411884224.3A
Other languages
Chinese (zh)
Other versions
CN119336921B (en
Inventor
章东平
刘萱
马道滨
卜玉真
余家斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Jiliang University
Original Assignee
China Jiliang University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Jiliang UniversityfiledCriticalChina Jiliang University
Priority to CN202411884224.3ApriorityCriticalpatent/CN119336921B/en
Publication of CN119336921ApublicationCriticalpatent/CN119336921A/en
Application grantedgrantedCritical
Publication of CN119336921BpublicationCriticalpatent/CN119336921B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

Translated fromChinese

本发明公开了基于大语言模型的工业知识图谱补全与自适应检索方法,属于计算机技术领域,将残缺知识图谱划分多个子图,通过负样本过滤、邻域信息剪枝、信息合并、问答模板映射以及构建知识图谱补全大模型并进行LoRA微调,补全知识图谱,通过自适应检索查询模块接收用户问题、任务分解、实体探索、关系探索、更新记忆子模块中的子图、推理路径和子目标状态,并评估性能输出查询结果,在反思与自我矫正中,当信息不足时,LLM会基于当前信息评估是否需要调整探索方向或修正推理路径,最终,根据检索到的信息输出满足用户需求的答案。本发明有效地结合了大语言模型的能力,通过自适应检索和反思机制,提高了知识图谱补全的效率和准确性。

The present invention discloses an industrial knowledge graph completion and adaptive retrieval method based on a large language model, which belongs to the field of computer technology. The incomplete knowledge graph is divided into multiple subgraphs, and the knowledge graph is completed by filtering negative samples, pruning neighborhood information, merging information, mapping question and answer templates, and constructing a large knowledge graph completion model and performing LoRA fine-tuning. The knowledge graph is completed, and the user questions, task decomposition, entity exploration, relationship exploration, subgraphs in the updated memory submodule, reasoning paths and sub-goal states are received through an adaptive retrieval query module, and the performance is evaluated to output query results. In reflection and self-correction, when the information is insufficient, LLM will evaluate whether it is necessary to adjust the exploration direction or correct the reasoning path based on the current information, and finally, output answers that meet the user's needs according to the retrieved information. The present invention effectively combines the capabilities of a large language model, and improves the efficiency and accuracy of knowledge graph completion through adaptive retrieval and reflection mechanisms.

Description

Industrial knowledge graph completion and self-adaptive retrieval method based on large language model
Technical Field
The invention belongs to the technical field of computers, and particularly relates to an industrial knowledge graph completion and self-adaptive retrieval method based on a large language model.
Background
In an industrial scene, the knowledge graph is used as a structured knowledge representation mode and is widely applied to the fields of recommendation systems, semantic search, intelligent question and answer and the like. However, knowledge maps often have incomplete problems, and missing entities and relationships need to be predicted and added by knowledge map completion techniques. Traditional knowledge graph completion methods mainly depend on graph structure information, such as knowledge graph embedding technology, but the methods have limitations in treating sparsity and expandability problems. In recent years, with the development of large language models (LLM, large Language Model), researchers have begun to explore the way in which knowledge patterns can be enhanced with the powerful understanding and generating capabilities of these models. LLM can learn semantic information of entities and relationships through context, thereby improving completion accuracy. However, the existing research still has a disadvantage in how to effectively integrate the inference capability of LLM and the structured information of the knowledge graph, and particularly when processing complex queries and dynamically updating the knowledge graph in industrial scenes, a more flexible and adaptive planning method is required.
In addition, existing knowledge graph completion methods face computational efficiency and real-time challenges when dealing with large-scale and dynamically changing industrial data. Meanwhile, the LLM may generate an incorrect path or inaccurate prediction in the inference process on the knowledge graph, which requires an adaptive planning and self-correction mechanism to dynamically adjust the inference strategy. Although some studies have attempted to improve this problem through interactive exploration and iterative reasoning, these approaches often lack the ability to effectively identify and correct false reasoning paths. Therefore, how to design a system capable of combining semantic understanding and knowledge graph structuring information of LLM and having self-adaptive planning and self-correction capabilities becomes a hot spot and a challenge of current research. These systems need to be able to dynamically adjust the exploration path, record and utilize historical reasoning information, and self-correct if necessary, according to the problem semantics, to improve the efficiency and accuracy of knowledge graph completion and query.
Disclosure of Invention
In order to solve the defects in the prior art and achieve the purposes of improving the integrity of the knowledge graph and the query efficiency, and particularly improving the processing capacity of complex query in industrial scenes, the invention adopts the following technical scheme:
The industrial knowledge graph completion and self-adaptive retrieval method based on the large language model comprises the following steps:
step 1, obtaining a incomplete knowledge graph;
Dividing the incomplete knowledge graph into a plurality of subgraphs, selecting a negative sample set based on the subgraphs, determining a final information set according to the size of the negative sample set, integrating information into a problem by adopting question-answer template mapping, inputting a constructed large language model, training the large language model, fine-tuning the large language model through LoRA technology, and changing a small amount of parameters to adapt to a completion task to obtain a completed knowledge graph;
Step 3, receiving the inquiry problem of the user, carrying out task decomposition in the self-adaptive searching inquiry module, searching an inference path in the knowledge graph to extract related information, carrying out entity searching and relation searching through the self-adaptive planning strategy sub-module, and updating the sub-graph, the inference path and the sub-target state in the memory sub-module in real time;
and 4, evaluating the retrieved information, judging whether the requirement of the user query is met, and outputting a final query result.
Further, the knowledge graph complement in the step 2 includes the following steps:
Step 2.1, constructing a neighborhood subgraph through neighborhood sampling, screening a knowledge graph triplet set related to a specific relation, and removing a correct triplet to obtain a negative sample set;
2.2, entity trimming and compression are carried out on the subgraph formed by extracting relevant information from the neighborhood sampling, and entities exceeding 5 steps are removed to obtain a context neighborhood information set;
step 2.3, information merging, namely forming a final information set by the adjusted negative sample set and the context neighborhood information set;
Step 2.4, completing a knowledge graph completion task by adopting question-answer template mapping, integrating information into a problem, inputting the problem into a large language model for training to obtain a knowledge graph completion large model, generating a completed triplet by using the knowledge graph completion large model, and merging the completed triplet into the knowledge graph to obtain a completed knowledge graph;
and 2.5, fine tuning the large language model by adopting LoRA technology, adapting to tasks by changing a small amount of parameters, reducing resource consumption and maintaining the generalization capability of the model.
Further, in the step 2.1, an entity is first constructedKnowledge graph neighborhood subgraph with center,Including all andDirectly related entities and relationships, then, fromMiddle screening outAnd a specific relationshipRelated triplet setsNext, fromRemoving the correct triplesObtaining a negative sample set;
In the step 2.2, the missing triples are represented by (e, r), e represents the entity, r represents the relation, for each triplet in the knowledge graph G, related information is extracted from the entity e by a neighborhood sampling method to form a sub-graph Ge, the sub-graph Ge is trimmed and compressed, the size of the sub-graph is limited, the entity exceeding 5 steps from e is removed, and the sub-graph is defined:
Ge = {(h, r, t) ∈ G : d(e, h) ≤ 5 ∨ d(e, t) ≤ 5}
then, remove the negative sample from Ge, generateTo distinguish positive and negative samples, p parameters are introduced to limit the path depth of a subgraph for a large-scale graph G, a context neighborhood information set with e as a center and p depth is represented by C (e, p), when p=0, C (e, p) is empty, when p=1, only direct neighbors are considered, when p >1, a deeper path is considered, and the aim is to accurately acquire and utilize C (e, p) according to the value of p.
Further, in step 2.3, a negative set of samples is extracted from the triplesAnd a neighborhood information set C (e, p), wherein C (e, p) represents a context neighborhood information set with e as a center and depth p, the number M of the context information sets is set, and for each triplet, a final information set is determined according to the size of the negative sample set, wherein M samples are randomly selected from the negative sample set if the size of the negative sample set is more than or equal to M, if the negative sample set is less than M, the samples are supplemented from the neighborhood information set until the total number reaches M, the final information set D (e, M) comprises the adjusted negative sample set and the supplemented neighborhood information set, and if the size of the negative sample set reaches M, the neighborhood information set is not included.
Further, in the step 2.4, for the missing triples (h, r,:
For each triplet in G, sub-graph set is obtained through sub-graph divisionFor any pair (e, r), a corresponding sub-graph is obtained,Comprising a negative sample setOr neighborhood information set C (e, p), ifNot empty, using templatesThe prompt model gives out answers outside the list and helps the model to make reasoning, wherein:
If C (e, p) is not null, thenProviding e neighborhood information to assist the model in reasoning, wherein:
Finally, integrating this information into questionsInputting the training data into a large language model LLM for LoRA fine tuning training:
thus obtaining the knowledge graph complement large model.
Further, in LoRA fine tuning, the pre-training weight matrix W passes through two small rank matrices in step 2.4AndIs updated by the product of (a), the updated weight is expressed as:
AndIs updated in the fine-tuning process,The update rules of (a) are:
Wherein,Representing a learning rate, L representing a loss function;
the similarity between the predicted entity and the actual entity is measured by using a cross entropy loss function, and the formula is as follows:
Wherein,Representing a predicted entity, A representing an actual entity;
for a pre-trained large language model M with parameters θ, the training set containsFor the questions and answers to the questions,Training set representing knowledge graph, fine tuning target is to find parametersMinimizing the loss function:
where M (θ') represents the trimmed model output and Q represents the problem.
Further, the adaptive planning strategy in the step 3 includes the following steps:
analyzing semantics through a large language model LLM, subdividing the answer task into a plurality of subtasks containing specific conditions, including acquiring basic information, analyzing noise characteristics, checking maintenance records and the like, wherein the large language model LLM decomposes the problem q into a series of subtasks for retrieving and reasoning a knowledge graph;
the series of subtasks is denoted o= { O1, o2, oi, where O represents a sub-target set,Indicating an ith sub-target, wherein sub-tasks in O can mutually refer to results to reflect the dependency relationship in the reasoning process;
Extracting relevant information by searching an inference path in a knowledge graph, focusing on the inference path related to the problem, determining starting points corresponding to topic entities mentioned in the question when path exploration is started, and taking the topic entities as starting points of the inference path in the face of the problem q;
Step 3.3, dynamically updating the sub-graph, the reasoning path and the sub-target state in the memory sub-module to reflect the current reasoning progress, wherein the data stored in the memory sub-module provides background information of history retrieval and reasoning for review;
Because LLM possibly forgets certain conditions in reasoning, sub-targets are obtained by decomposing the problem, a plurality of conditions in LLM memory problem are helped, sub-target states record the latest information related to each sub-target, assist LLM in memorizing the known condition of each condition and adjust the exploration direction when thinking back, and then the LLM is used for updating the information related to the sub-targets to the sub-target states according to semantic information of the problem q, sub-target O, historical sub-target states, reasoning path P and knowledge base of LLMWherein the length of S is the same as O.
Further, in the step 3.2, the initial entity set is as follows:
Wherein,Representing an initial set of entities at the beginning of a path exploration,Representing a set of topic entities associated with question q,Representing a particular entity in the knowledge-graph,Representing a total number of topic entities;
In subsequent iterations of round D, each inference pathComprisesThe three triples, namely:
representation ofComprising a slaveStart toIs used to determine the number of triplets of a group,AndRepresenting a subject entity and a guest entity respectively,Representation ofAndSince only those paths most relevant to the problem in the D-1 round are continuously explored in the D-1 round iteration, the lengths of each path are different, and the tail entity and the relation set to be explored are respectively recorded asAnd,Are their lengths, and use a large language model LLM from the current set of entitiesIs to identify the most relevant entity based on question qAnd extends the inference path P accordingly.
Further, to address the complexity of using a large language model LLM to handle a large number of neighboring entities, an adaptive planning strategy is employed that is not limited to a fixed number of relationships and entities, including two-step processes, relationship exploration and entity exploration;
the relationship exploration, i.e. findingRelationships among all tail entities in the tree are selected, and those relationships most relevant to the problem q and the sub-target O are selectedAll tail entity relations in the tree form a candidate relation setAnd expanding the inference paths with the relationships to form a set of candidate inference pathsThen, based on the semantics of the problem q, the tail entityCandidate relationshipAnd sub-target O, using LLM slaveMiddle screening out relationship with tail entityA matched related reasoning path P;
The entity exploration is performed byAndA process of searching the surrounding entities and finding out the entities closely related to the problem q, an expanded reasoning path P and a new tail relation are obtained in the relation exploration stageFor each path in PBy queryingOr (b)To obtain candidate entity setsHere, whereAndIs thatThe similarity between the entity and the problem is calculated by adopting a pre-trained small model to improve the recall rate in the face of a plurality of candidate entities, and then all candidate entity sets are combined into a wholeAnd extend P to using these entitiesIn the candidate reasoning pathOn the basis of (1) using a large language model LLM based on semantic information of problem q and the result of the semantic informationAndFormed knowledge triples fromMiddle screening and tail entityThe matched relevant inference path P.
Further, in step 3.3, after two rounds of exploration, dynamically updating the subgraph in the memoryThe sub-graph aggregates all relationships and entities retrieved from the knowledge graph, the updates of which facilitate subsequent self-correction, determines the correct entity for rollback, and in iteration D, adds a set of candidate relationshipsAnd a candidate entity setTo refresh subgraphIn order to make LLM better understand relationships between entities and make path corrections, the inference path P is updated to maintain semantic links within the knowledge graph.
The invention has the advantages that:
The invention can obviously improve the completion efficiency and retrieval accuracy of the knowledge graph in the industrial scene. By utilizing the powerful semantic understanding and generating capability of a Large Language Model (LLM), missing information in the knowledge graph can be effectively predicted and complemented, and the integrity of the knowledge graph is enhanced. In addition, the self-adaptive path retrieval and memory updating mechanism further enhances the flexibility and accuracy of the system, so that the retrieval path can be quickly adjusted when complex query is faced, invalid retrieval is reduced, and the retrieval efficiency is improved.
Drawings
FIG. 1 is a flow chart of a method in an embodiment of the invention.
Fig. 2 is a schematic structural diagram of a knowledge graph completion module based on a large model in an embodiment of the invention.
Fig. 3 is a schematic structural diagram of an adaptive search query module according to an embodiment of the present invention.
Detailed Description
The following describes specific embodiments of the present invention in detail with reference to the drawings. It should be understood that the detailed description and specific examples, while indicating and illustrating the invention, are not intended to limit the invention.
As shown in FIG. 1, the industrial knowledge graph completion and self-adaptive retrieval method based on the large language model comprises the following steps:
step 1, inputting a incomplete knowledge graph G= (E, T), wherein E is an entity set, and T is a triplet set.
The Knowledge Graph (KG) consists of three main parts, g= { E, R, T }. Wherein E represents an entity set which covers different individuals such as people, places, equipment and the like, R represents a relationship set which comprises various relations among the entities, such as 'failure reasons' and 'solving measures', T is a triplet set and has the following form:
{(h, r, t) | h∈E,r∈R,t∈E},
wherein h, r, t refer to the subject, relationship, and guest, respectively, in the triplet. In a given knowledge graph G, the training set consists ofThe triplets, validation set consists of Tvalida triplets, and test set consists of Ttest triplets. In particular, the sub-graph information in Tvalida and Ttest is based onAnd (3) generating. In the link prediction task, bi-prediction is required for each triplet, i.e., predicting missing subjects (h, r,. These two types of missing triples are abbreviated as (e, r), e being the known host or guest and r being the relationship between them.Is the set of all of these parts,Wherein
Input incomplete knowledge graph g= (E, T), where E is the set of entities and T is the set of triples.
And 2, constructing a knowledge graph completion module based on the large model, and dividing the incomplete knowledge graph into a plurality of subgraphs through a subgraph division module. And determining a final information set D (e, M) according to the size of the negative sample set, designing question-answer template mapping, and using LoRA technology to fine-tune a model to complete the knowledge graph completion. As shown in fig. 2, the knowledge graph completion includes the following steps:
step 2.1, negative sample filtering, namely constructing a neighborhood subgraph through a neighborhood sampling technology, screening a triplet set related to a specific relation, and removing a correct triplet to obtain a negative sample set;
generating a negative sample setIn order to ensure that information is not revealed between the training set and the test set, the generalization capability of the model is more accurately evaluated. First constructNeighborhood subgraph being centerIncluding all andDirectly related entities and relationships. Then, fromMiddle screening outAnd a specific relationshipRelated triplet sets. Then, fromRemoving the correct triplesObtaining a negative sample set
Pruning the neighborhood information, namely extracting relevant information to form a subgraph through a neighborhood sampling method, pruning and compressing, and removing entities exceeding 5 steps to obtain a context neighborhood information set;
The missing triples are denoted by (e, r). For each triplet in G, starting from entity e, relevant information is extracted through a neighborhood sampling method to form a sub-graph Ge, and the sub-graph Ge is trimmed and compressed. Limiting the size of the subgraph, removing entities exceeding 5 steps from e. Subgraph definition:
Ge = {(h, r, t) ∈ G : d(e, h) ≤ 5 ∨ d(e, t) ≤ 5}
then, remove the negative sample from Ge, generateTo distinguish between positive and negative samples. For large graph G, a p-parameter is introduced to limit the path depth of the subgraph. C (e, p) denotes a context neighborhood information set centered on e and having a depth of p. When p=0, C (e, p) is null, when p=1, only the direct neighbors are considered, and when p >1, the deeper paths are considered. The goal is to accurately acquire and utilize C (e, p) based on the value of p.
Step 2.3, information merging, namely forming a final information set by the adjusted negative sample set and the context neighborhood information set;
Synthesizing the final information set, extracting the negative sample set from the triplesAnd a neighborhood information set C (e, p), C (e, p) representing a context neighborhood information set centered on e and having a depth of p, and setting the number M of context information sets. For each triplet, determining a final information set according to the size of the negative sample set, randomly selecting M samples from the negative sample set if the size of the negative sample set is greater than or equal to M, and supplementing samples from the neighborhood information set if the size of the negative sample set is less than M until the total number reaches M. The final information set D (e, M) includes the adjusted negative sample set and the supplemental neighborhood information set. If the size of the negative sample set has reached M, then the neighborhood information set will not be included. The method ensures that the quantity of the information sets meets the requirement, and simultaneously maintains the diversity and the information balance of the data sets.
And 2.4, completing a knowledge graph completion task by adopting question-answer template mapping, integrating information into questions, and inputting the questions into a large language model for training to obtain the knowledge graph completion large model. And generating a completed triplet by using the knowledge graph completion large model and merging the completed triplet into the knowledge graph to obtain the completed knowledge graph. The training of the large language model adopts LoRA fine tuning technology, and the resource consumption is reduced by changing a small amount of parameters to adapt to tasks, so that the generalization capability of the model is maintained.
For the missing triples (h, r,:
For each triplet in G, sub-graph set is obtained through sub-graph division. For any pair (e, r), a corresponding sub-graph is obtainedIt contains a negative sample setOr a neighborhood information set C (e, p). If it isIs not empty, useThe prompt model gives out answers outside the list, helping the model to make reasoning. Wherein:
If C (e, p) is not null, usingAnd providing e neighborhood information to help the model to make reasoning. Wherein:
Finally, these information are integrated into questions, input to LLM for LoRA fine-tuning training:
thus obtaining the knowledge graph complement large model.
Step 2.5, fine tuning the large language model by adopting LoRA technology, adapting to tasks by changing a small amount of parameters, reducing resource consumption and keeping the generalization capability of the model;
LoRA fine-tuning the large model, instruction-based fine-tuning is a training method that optimizes the performance of the large language model on a particular task. LoRA as an efficient fine tuning technique, adapts to tasks by changing a small number of parameters, reduces resource consumption, while maintaining model generalization capability. In LoRA fine tuning, the pre-training weight matrix W is passed through two small rank matricesAndIs updated by the product of (a), the updated weight is expressed as:
AndIs updated in the fine-tuning process,The update rules of (a) are:
Wherein,Is the learning rate and L is the loss function.
The similarity between the predicted entity and the actual entity is measured by using a cross entropy loss function, and the formula is as follows:
Wherein,Representing the predicted entity and a represents the actual entity.
For a pre-trained large language model M with parameters θ, the training set containsAnd (5) questions and answers. The goal of the fine tuning is to find parametersMinimizing the loss function:
where M (θ') is the trimmed model output and Q represents the problem.
And 3, receiving the problems of the user, performing task decomposition in the self-adaptive search query module, and updating the sub-graph, the inference path and the sub-target state in the memory sub-module after performing entity exploration and relationship exploration through the self-adaptive planning strategy sub-module. Evaluate performance and output query results. Entities and relationships associated with the problem are adaptively retrieved based on the results of the task decomposition. And updating the memory sub-module, and recording the current retrieval progress and sub-target state. As shown in fig. 3, the specific implementation of the adaptive search query module includes the following steps:
And 3.1, receiving a query question proposed by a user, and decomposing the answer task into a plurality of subtasks. The answer task is subdivided by LLM analysis semantics into a number of subtasks containing specific conditions, including obtaining basic information, analyzing noise characteristics, checking maintenance records, etc. LLM breaks the problem q down into a series of subtasks for retrieving and reasoning knowledge maps. The subtask series is denoted o= { O1, o2, o3. Wherein O represents a sub-target set,Representing the ith sub-target. Subtasks in O will reference results to each other, reflecting the dependency in the reasoning process.
And 3.2, extracting relevant information by searching an inference path in the knowledge graph, and focusing on the inference path related to the problem. At the beginning of the path exploration, a starting point corresponding to the subject entity mentioned in the question is determined. Facing problem q, these topic entities are taken as the starting points of the inference path, noted as:
Wherein,Representing an initial set of entities at the beginning of a path exploration,Representing a set of topic entities associated with question q,Representing a specific entity in the knowledge-graph,Is the total number of subject entities.
In subsequent iterations, focus is on the reasoning path that is more relevant to the problem, and rest on the other paths. For example, in round D iteration, each inference pathComprisesThe three triples, namely:
Wherein,AndRepresenting a host and a guest entity respectively,Is a specific relationship between them. Since only those paths most relevant to the problem in round D-1 continue to be explored in round D iteration, the length of each path is different. The tail entity and the relation set to be explored are respectively recorded asAnd,Is their length. Using LLM from a current set of entitiesIs to identify the most relevant entity based on question qAnd extends the inference path P accordingly. To address the complexity of handling a large number of neighboring entities using LLM, an adaptive planning strategy is proposed that is not limited to a fixed number of relationships and entities. The strategy comprises a two-step process of relationship exploration and entity exploration.
The relation is explored, i.e. foundRelationships of all tail entities in the tree are selected, and those relationships most relevant to the problem q and the sub-objective O are selected. First, search collectionAll tail entity relations in the tree form a candidate relation setAnd expanding the inference paths with the relationships to form a set of candidate inference paths. Then, semantics and tail entity based on problem qCandidate relationshipAnd sub-target O, using LLM slaveMiddle screening out relationship with tail entityThe matched relevant inference path P.
The entity exploration is utilizedAndTo retrieve the surrounding entities and to find the entities closely related to the problem q. An extended reasoning path P and a new tail relation are obtained in the relation exploration stage. For each path in PBy queryingOr (b)To obtain candidate entity setsHere, whereAndIs thatTail entities and relationships in (a). In the face of numerous candidate entities, a pre-trained small model is adopted to calculate the similarity between the entity and the problem so as to improve the recall rate. Thereafter, all candidate entity sets are combined intoAnd extend P to using these entities. In the candidate reasoning pathOn the basis of (1) using LLM according to semantic information of problem q and byAndFormed knowledge triples fromMiddle screening and tail entityThe matched relevant inference path P.
And 3.3, dynamically updating the subgraphs, the inference paths and the sub-target states in the memory to reflect the current inference progress. The data stored in the memory provides background information for historical retrieval and reasoning for review. Dynamic updating of subgraphs in memory after two rounds of explorationAn inference path P and a sub-objective state S to reflect the current inference progress.
The subgraph aggregates all relationships and entities retrieved from the knowledge graph, and updates thereof facilitate subsequent self-correction, determining the correct entity for rollback. In iteration D, by adding a candidate relationship setAnd a candidate entity setTo refresh subgraph. In order to make LLM better understand relationships between entities and make path corrections, the inference path P is updated to maintain semantic links within the knowledge-graph.
Since LLM may forget certain conditions in reasoning, sub-goals are obtained by decomposing the problem, helping multiple conditions in LLM memory problems. The sub-object state records the latest information related to each sub-object, assists the LLM in memorizing the known condition of each condition, and adjusts the exploration direction at the time of the jeopardy. Then updating the information related to the sub-objective state by using the LLM according to the semantic information of the problem q, the sub-objective O, the historical sub-objective state, the reasoning path P and the knowledge base of the LLMWherein the length of S is the same as O.
And 4, evaluating the retrieved information and judging whether the requirement of the user query is met. And outputting the final query result and providing the final query result for the user.
Step 4.1, evaluating whether the information collected at present is enough to deduce an answer, if so, giving the answer by combining an inference path, a sub-target state and a knowledge base thereof;
After the path exploration and memory updating are completed, the LLM evaluates the information currently collected, including the stored sub-objective states and inferred paths, whether the answer is sufficiently derived, as shown in fig. 3, and the specific implementation of the thinking-back and self-correction module includes the following steps:
if the LLM considers the information to be sufficient, it will give an answer in combination with the inference path, sub-objective state and its knowledge base.
If the information is insufficient, the existing path needs to be further expanded or the current path may be wrong.
Because the reasoning ability of LLM can not always ensure the correctness of path exploration, an anti-thinking mechanism is designed to judge whether and how to correct the reasoning path, when the LLM feels that the information is insufficient, the anti-thinking stage is entered, and the LLM is utilized to search the entity based on the problem q, the sub-target state S, the reasoning path P and the next round of planTo consider whether to adjust the direction of exploration, LLM also needs to provide reasons for disbelief. If LLM thinks that exploration is neededThe other entities need to correct the reasoning path, otherwise, continue toThe tail entity in (c) explores along the current path. In the self-correction process, LLM decides to be in the S according to the sub-target state and the additional retrieval reason obtained by the dislikeBacktrack to which entities andAdding new exploration entityTo make self-correction, expressed as
And 4.2, outputting a query result according to the retrieved information. If the information is insufficient, the method enters an thinking-back stage, considers whether the exploration direction is adjusted, and if the exploration direction is needed, carries out self-correction, and continues to explore or correct the reasoning path.
Although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those skilled in the art that the foregoing embodiments may be modified or equivalents may be substituted for some or all of the features thereof, and that the modifications or substitutions do not depart from the scope of the embodiments of the present invention.

Claims (10)

4. The industrial knowledge graph completion and self-adaptive retrieval method based on a large language model as set forth in claim 2, wherein in said step 2.3, a negative sample set is extracted from triplesAnd a neighborhood information set C (e, p), wherein C (e, p) represents a context neighborhood information set with the e as a center and the depth of p, the number M of the context information sets is set, and for each triplet, a final information set is determined according to the size of the negative sample set, wherein M samples are randomly selected from the negative sample set if the size of the negative sample set is more than or equal to M, and if the negative sample set is less than M, the samples are supplemented from the neighborhood information set until the total number reaches M, and the final information set D (e, M) comprises the adjusted negative sample set and the supplemented neighborhood information set, and if the size of the negative sample set reaches M, the neighborhood information set is not included.
CN202411884224.3A2024-12-202024-12-20 Industrial knowledge graph completion and adaptive retrieval method based on large language modelActiveCN119336921B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202411884224.3ACN119336921B (en)2024-12-202024-12-20 Industrial knowledge graph completion and adaptive retrieval method based on large language model

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202411884224.3ACN119336921B (en)2024-12-202024-12-20 Industrial knowledge graph completion and adaptive retrieval method based on large language model

Publications (2)

Publication NumberPublication Date
CN119336921Atrue CN119336921A (en)2025-01-21
CN119336921B CN119336921B (en)2025-06-03

Family

ID=94265443

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202411884224.3AActiveCN119336921B (en)2024-12-202024-12-20 Industrial knowledge graph completion and adaptive retrieval method based on large language model

Country Status (1)

CountryLink
CN (1)CN119336921B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN119832914A (en)*2025-03-172025-04-15青岛海尔电冰箱有限公司Personalized voice question-answering method and device based on large model and refrigeration equipment
CN120086338A (en)*2025-02-142025-06-03南京新一代人工智能研究院有限公司 An intelligent dialogue system for temporal memory management and task distribution
CN120180060A (en)*2025-05-232025-06-20浪潮电子信息产业股份有限公司 Methods, products, equipment and media for assessing the ability to answer factual knowledge questions

Citations (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
WO2023065211A1 (en)*2021-10-212023-04-27华为技术有限公司Information acquisition method and apparatus
CN116955650A (en)*2023-07-282023-10-27杭州电子科技大学 Information retrieval optimization method and system based on small sample knowledge graph completion
CN117033608A (en)*2023-09-282023-11-10中国电子科技集团公司第十研究所Knowledge graph generation type question-answering method and system based on large language model
CN118036742A (en)*2024-02-012024-05-14西安交通大学Military question-answering method and system for driving knowledge graph multi-hop reasoning by large language model
US20240386015A1 (en)*2015-10-282024-11-21Qomplx LlcComposite symbolic and non-symbolic artificial intelligence system for advanced reasoning and semantic search
CN119150975A (en)*2024-11-192024-12-17南京信息工程大学Knowledge graph completion method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20240386015A1 (en)*2015-10-282024-11-21Qomplx LlcComposite symbolic and non-symbolic artificial intelligence system for advanced reasoning and semantic search
WO2023065211A1 (en)*2021-10-212023-04-27华为技术有限公司Information acquisition method and apparatus
CN116955650A (en)*2023-07-282023-10-27杭州电子科技大学 Information retrieval optimization method and system based on small sample knowledge graph completion
CN117033608A (en)*2023-09-282023-11-10中国电子科技集团公司第十研究所Knowledge graph generation type question-answering method and system based on large language model
CN118036742A (en)*2024-02-012024-05-14西安交通大学Military question-answering method and system for driving knowledge graph multi-hop reasoning by large language model
CN119150975A (en)*2024-11-192024-12-17南京信息工程大学Knowledge graph completion method

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
JIAPU WANG: "MADE: Multicurvature Adaptive Embedding for Temporal Knowledge Graph Completion", IEEE TRANSACTIONS ON CYBERNETICS, 21 May 2024 (2024-05-21), pages 5818*
张仲伟;曹雷;陈希亮;寇大磊;宋天挺;: "基于神经网络的知识推理研究综述", 计算机工程与应用, no. 12, 25 March 2019 (2019-03-25)*
阮光册;樊宇航;夏磊;: "知识图谱在实体检索中的应用研究综述", 图书情报工作, no. 14, 20 July 2020 (2020-07-20)*

Cited By (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN120086338A (en)*2025-02-142025-06-03南京新一代人工智能研究院有限公司 An intelligent dialogue system for temporal memory management and task distribution
CN119832914A (en)*2025-03-172025-04-15青岛海尔电冰箱有限公司Personalized voice question-answering method and device based on large model and refrigeration equipment
CN120180060A (en)*2025-05-232025-06-20浪潮电子信息产业股份有限公司 Methods, products, equipment and media for assessing the ability to answer factual knowledge questions

Also Published As

Publication numberPublication date
CN119336921B (en)2025-06-03

Similar Documents

PublicationPublication DateTitle
CN119336921B (en) Industrial knowledge graph completion and adaptive retrieval method based on large language model
CN110674279B (en) Question and answer processing method, device, equipment and storage medium based on artificial intelligence
CN112487168B (en)Semantic question-answering method and device of knowledge graph, computer equipment and storage medium
CN111543988B (en)Adaptive cognitive activity recognition method and device and storage medium
CN118036756B (en)Method, device, computer equipment and storage medium for large model multi-round dialogue
CN116843970B (en) Fine-grained small-shot classification method based on task-specific channel reconstruction network
CN114065003A (en)Network structure searching method, system and medium oriented to super large searching space
CN111105442B (en)Switching type target tracking method
CN119443267A (en) A method and system for solving mathematical problems by thinking chain reasoning based on feature classifier
CN115730248B (en) A machine account detection method, system, device and storage medium
CN119377359B (en)Method for training knowledge base selection model, and method and device for processing user problems
CN119361020B (en) Method, device and computer equipment for generating antimicrobial peptides based on generative model
Bidaki et al.Online continual learning: A systematic literature review of approaches, challenges, and benchmarks
CN119848190A (en)Knowledge graph question-answering method combining large model with graph neural network
CN117952198B (en)Time sequence knowledge graph representation learning method based on time characteristics and complex evolution
CN117972044B (en) Visual question answering method and platform based on knowledge enhancement
CN119106729A (en) Temporal knowledge graph completion method and system based on relational graph convolutional neural network
Martinez et al.Towards personalized preprocessing pipeline search
CN115100694B (en) A fast fingerprint retrieval method based on self-supervised neural network
Ali et al.Recent trends in neural architecture search systems
Jahed et al.Enhancing classification performance via reinforcement learning for feature selection
CN113298233A (en)Agent model-based progressive depth integration architecture searching method
Rao et al.Medical Big Data Analysis using Binary Moth-Flame with Whale Optimization Approach
CN116561350B (en)Resource generation method and related device
CN119988236B (en) Intelligent equipment software testing method based on convolutional neural network combined with genetic algorithm

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp