Zero-sample multi-agent knowledge graph problem generation method
Through the RoleAgentQG framework and multi-agent cooperation, the problem of degradation of KGQG model accuracy in zero-sample scenarios is solved, high-quality problem generation and low deployment costs are achieved, and the dependence on labeled data is reduced.
Patent Information
- Application Number
- CN202411388948.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-08
- Publication Date
- 2025-02-28
AI Technical Summary
In the zero-sample scenario, the accuracy of the Knowledge Graph Problem Generation (KGQG) model has decreased, and it relies on a large amount of manual annotation data, which has high deployment costs.
A method of generating knowledge graph problems with zero-sample multi-agents is proposed. Through the RoleAgentQG framework, a large language model (LLM) is used to generate problems and improve the quality of problems through multi-agent cooperation, thereby training a smaller model.
It realizes the generation of high-quality problems in zero-sample scenarios, reduces dependence on labeled data, reduces deployment costs, and improves the robustness of the system.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of medical information technology, and in particular relates to a method for generating knowledge graph problems with zero-sample multi-agents. Background Art
[0002] Knowledge graph question generation (KGQG) is a task to generate natural language questions based on a given knowledge graph (KG). This task improves the performance of question answering (QA) models and helps dialogue systems create coherent queries. For the healthcare and medical fields, by building a medical knowledge graph containing information such as diseases, symptoms, treatment plans, and drug interactions, the system can generate diagnostic recommendations for doctors or health consultation responses to patients based on the specific conditions of the patients, assisting doctors to make more accurate diagnosis and treatment decisions, or help analyze information such as drug ingredients, mechanisms of action, and side effects to accelerate the development process of new drugs. At the same time, by monitoring large-scale medical data, adverse drug reactions and potential risks can be discovered in a timely manner to improve drug safety. In recent years, this field has received significant research attention. Most of the most advanced KGQG solutions are based on small parameter model methods, such as template methods and neural network methods, which are referred to as "small models" in this article. Template methods use predefined templates and rules, but are generally lacking in scalability. In contrast, neural network methods are on the rise due to advances in deep learning. These methods utilize models like G2S and DSM to generate complex and diverse questions using a large amount of labeled data (i.e., question and answer pairs corresponding to the KG).
[0003] It is worth noting that the performance of KGQG models heavily relies on the availability of labeled data. Empirical results show that the accuracy of KGQG drops dramatically when the amount of labeled data decreases, especially in zero-shot scenarios. Despite this problem, current literature often ignores it and usually relies on existing KGQA databases to obtain labeled data. However, in the absence of QA data, generating labeled data requires a lot of manual annotation. Therefore, exploring unsupervised methods for KGQG, also known as zero-shot KGQG, is crucial to reduce the manual annotation effort.
[0004] In recent years, LLMs such as ChatGPT have made significant progress in KGQG due to their high-level reasoning and few-shot generalization capabilities. For example, a state-of-the-art LLM-based method can effectively generate relevant questions from few-shot, pre-labeled logical data. Although LLMs have provided significant support in KGQG tasks, their practical applications are subject to several limitations. First, Figure 1As shown in , LLMs also perform relatively poorly in zero-shot scenarios. Second, the large number of parameters of LLMs significantly increases the deployment cost. Although these issues are critical, existing research often ignores them and assumes that time and resources are not limited. In actual deployment, LLMs require a lot of computing resources and considerable financial investment, and also pose potential data security risks. Therefore, many organizations are turning to smaller and more manageable models.
[0005] To cope with the manual annotation cost and deployment cost, it is necessary to study a new cost-effective zero-shot KGQG paradigm. Summary of the invention
[0006] In view of this, this application proposes to train small models by using LLMs to generate valuable questions, and then deploy small models in practice, integrating the capabilities of LLMs and small models. Specifically, considering that LLMs often perform poorly in zero-shot generation tasks, with low relevance and redundant content, this application introduces a new cooperation paradigm inspired by the latest progress in multi-agent systems. This paradigm, named RoleAgentQG, improves the quality of questions generated by LLMs through multi-agent cooperation, thereby effectively training smaller models. Specifically, RoleAgentQG simulates an editorial team consisting of roles such as editor-in-chief, executive editor, contributor, content editor, and proofreading editor, each of which is represented by a LLM. The workflow begins with the editor-in-chief defining the overall goal based on subgraphs and answer information. The executive editor then refines the overall goal into specific requirements to guide contributors, content editors, and proofreading editors. These guidelines guide contributors to draft questions, which are checked by content editors for logic, content quality, and difficulty. Questions that pass the inspection are polished by proofreading editors in terms of grammar and format. Finally, the editor-in-chief evaluates the questions and accepts high-quality questions.
[0007] It is worth noting that in order to improve the efficiency of communication between roles, this application also designs two workflow optimization tools (i.e., communication protocol and growing database), which can reduce the risk of hallucinations caused by overly complex tasks. Ultimately, the generated questions are used to train smaller models to improve their ability to generate high-quality questions.
[0008] To achieve the above purpose, the zero-sample multi-agent knowledge graph problem generation method disclosed in this application includes the following steps:
[0009] Obtain medical knowledge graph;
[0010] The editor-in-chief agent sets the generation of questions to ensure that the tone of the content matches the true meaning of the questioner. Figure 1 and monitor the quality of the final questions;
[0011] The executive editor agent manages iteration deadlines and ensures the problem generation process proceeds;
[0012] Contributor agents simulate typical inquirers and create questions based on requirements;
[0013] Content Editing Agent: Provides feedback and ensures that the final output questions are consistent with the answers and sub-questions in terms of content, logic, and difficulty. Figure 1 To;
[0014] Proofreading editing agents review and edit generated issues for grammar, punctuation, style, and consistency;
[0015] Each agent executes the Agent-ODA execution mechanism; the Agent-ODA execution mechanism includes an observation module, an action module, and a feedback module; the observation module observes and processes the relevant knowledge in the knowledge graph environment; each iteration i, it constructs an observation subgraph O i , and the subgraph is incorporated into the inference large language model; the action module also uses the observation subgraph O i and ODA memory, select the action that best suits the knowledge graph, and ensure that the answer to the prompt requirement of the corresponding agent is generated based on the answer entity; the feedback module uses the observation subgraph O i , feedback the knowledge gained from the action steps;
[0016] The editor-in-chief agent scores and evaluates the proofread and edited questions; if the score is less than the preset threshold, it is returned to the executive editor agent to regenerate the question; if the score is greater than the preset threshold, it is accepted and saved in the growing database;
[0017] Output the final medical knowledge graph problem.
[0018] Preferably, the observation module uses the entity E related to the task at each iteration i. i , the agent's input prompt p i , the information c passed in by the previous agent i and the answer entity e i Generate observation subgraph O i This process is described as:
[0019] O i =Observation([E i ,p i ,c i ,e i ]).
[0020] Preferably, a D-round observation strategy is used to solve the scalability problem in the observation subgraph update process, where D represents the maximum jump depth; each round has two steps: update and refinement; the update step is used to expand the subgraph, and the refinement step changes the subgraph size without losing important information.
[0021] Preferably, the updating steps are as follows:
[0022] For the starting observation entity For each entity e in , its adjacent triples are extracted from the knowledge graph; each triple is in the form of [e, r, t], where r represents the relationship and t represents the tail entity;
[0023] Calculate the cosine similarity score:
[0024]
[0025] is based on the agent's input prompt p i , the information c passed in by the previous agent i The two combined vectors, v r+t is the vector of the combination of relation r and tail entity t, based on the agent's input promptp i , the information c passed in by the previous agent i , relation r, and tail entity t are all in text form;
[0026] All triples associated with entities in E are collectively sorted in descending order according to their similarity scores; the top N triples are added to the observation subgraph O. i .
[0027] Preferably, the refinement step retains only the top P% with the highest similarity scores, further refines the top N triples; and determines the tail entity from the top P% triples after refinement as the starting observation entity for the next iteration.
[0028] Preferably, the action module uses a large language model to design strategic prompts to generate the best action based on its agent's input promptp i , memory M <i , observe subgraph O i and historical actions <i Choose the most accurate action i :
[0029] a i =Action([p i ,O i ,a <i ,M <i ])
[0030] Memory M <i Includes all historical records of the previous i agents;
[0031] The actions include neighborhood exploration, path discovery, and answering; the neighborhood exploration task explores the knowledge graph neighborhood of related entities and retrieves all adjacent triples;
[0032] Given two entities E in task-related entities i , the path discovery operation searches for all possible paths connecting them; each path consists of interconnected triplets to explore various connections and discover potential hidden relationships;
[0033] The answer operation generates the answer required by the question or prompt only if the required information is present in memory. <i ;
[0034] Once the answer action is selected, the Agent-ODA execution mechanism stops the iterative cycle of observation, action, and reflection; the Agent-ODA execution mechanism uses the knowledge in memory M <i , directly generates the answer required by the question or prompt; or if the neighborhood exploration or path discovery operation is selected, the Agent-ODA execution mechanism extracts relevant knowledge from the knowledge graph and treats it as a set of triples; these extracted triples are input into the subsequent feedback step for further processing.
[0035] Preferably, M i The memory adopts a subgraph format, which is composed of a path network that conforms to the knowledge graph structure; the feedback module integrates the observation subgraph O i , existing memory M <i , the agent's input promptp i , the information c passed by the previous agent i ,This process can be formalized as:
[0036] M i =Reflection([O i ,a i ,M <i ,p i ,c i ])
[0037] The feedback module browses the path network and finds the first path suitable for integrating the feedback triplet; the path suitable for integrating the feedback triplet is the one in which the tail t of the last triplet in the selected path is aligned with the entity e of the last triplet in the selected path; if a matching path is found, it is added to the feedback triplet, otherwise, a new path is created based on the feedback triplet; the maximum size of the feedback triplet is denoted as K; subsequently, the tail entity in the feedback triplet is designated as the task-related entity for the next iteration;
[0038] The observation, action, and feedback modules collaborate iteratively until the answer operation of the action module is triggered or the maximum iteration limit is reached.
[0039] Preferably, structured face-to-face communication is used to enhance communication between agents; scenarios are constructed for each agent role, and individuals are required to provide modular outputs based on their specific roles and contexts; the constructed scenarios include informing the agent of the roles and responsibilities of its opponents in the interaction, so that it dynamically adjusts its content generation; the modular outputs establish key data points handled by each role and simplify the flow of information.
[0040] Preferably, in order to provide reference example questions for contributors who generate questions, the historical data passed by the editor-in-chief agent is stored in a growing database, and the top k samples in its own historical samples are selected as references for each agent's work;
[0041] To prevent information overload, the database adopts a role-specific data sharing strategy to ensure that agents only receive historical data related to their current tasks, reducing interference caused by irrelevant information.
[0042] The technical effects of this application are as follows:
[0043] (1) This application is the first to attempt to integrate multi-agent LLMs and small models for zero-shot KGQG, which can get rid of the dependence on labeled training data and has low deployment cost;
[0044] (2) This application proposes RoleAgentQG, a multi-agent collaborative KGQG framework for generating high-quality questions to train small models; it proposes a workflow using a professional editing agent team architecture to reduce ineffective collaboration between agents based on LLM and significantly enhance the robustness of the system. In addition, this application designs two workflow optimization tools to improve the communication efficiency of roles at runtime and further improve the quality of question generation; BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 The framework diagram of the present invention;
[0046] Figure 2 Example diagram of the present invention. DETAILED DESCRIPTION
[0047] The present invention is further described below in conjunction with the accompanying drawings, but the present invention is not limited in any way. Any changes or substitutions made based on the teachings of the present invention belong to the protection scope of the present invention.
[0048] Artificial intelligence is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.
[0049] Natural language processing (NLP) is an important direction in the fields of computer science and artificial intelligence. It studies various theories and methods that can achieve effective communication between people and computers using natural language. Natural language processing is a science that integrates linguistics, computer science, and mathematics. Therefore, research in this field will involve natural language, that is, the language people use in daily life, so it is closely related to the study of linguistics. Natural language processing technology usually includes text processing, semantic understanding, machine translation, robot question answering, knowledge graph and other technologies.
[0050] The technical solutions provided in the embodiments of the present application involve technologies such as machine learning and natural language processing of artificial intelligence, which are specifically introduced and explained through the following embodiments.
[0051] Before introducing the embodiments of the present application, some terms involved in the present application are first explained.
[0052] 1. Knowledge Graph Question Generation
[0053] Knowledge graph question generation (KGQG) models can be divided into small parameter model methods (such as template-based and neural network-based methods) and LLM-based methods. Early approaches to the KGQG task were template-based methods, which generated natural language questions using handcrafted templates and rules. However, template-based methods rely heavily on manual annotations and have difficulty generating complex questions and scaling. With the development of deep neural networks, neural network-based methods have received widespread attention. These methods use distant supervision to match the context of the text, are able to generate questions without supervision, and address the problem of semantic drift. Subsequent research has further advanced the development of KGQG models and enhanced the consistency between generated questions and subgraphs. LLM-based methods have also received attention due to their generalization ability in few-shot learning.
[0054] For zero-shot KGQG, the work most similar to ours explores the effectiveness of chain-thinking methods in enhancing KGQG performance, using few-shot logical forms as input. Our work differs in that we design a multi-agent collaboration framework using role-playing of LLMs. Within this framework, we innovatively implement an editorial team architecture workflow and workflow optimization tools, aiming to adaptively improve the quality of KGQG results in zero-shot settings. We focus on minimizing the cost of generation and deployment by using smaller models in both training and inference stages. We also experimentally confirm the superiority of our scheme.
[0055] 2. Multi-agent framework based on large models
[0056] Recent advances in autonomous agents based on LLMs have attracted widespread attention in industry and academia. Many works have improved the performance of LLMs for specific tasks by promoting interactions between multiple agents. Some have proposed a multi-agent framework that uses agents with different capabilities to solve complex tasks through multiple rounds of "brainstorming". Other frameworks combine large and small models and use tools to reduce costs to solve complex tasks. Some studies have proposed a "town" of 25 agents to study specific phenomena such as language interaction.
[0057] In this application, we observed several challenges facing multi-agent collaboration, such as maintaining consistency, performing tasks in a less professional way, and avoiding invalid cycles. This motivated this application to focus on applying advanced concepts such as professional editor team architecture and role empowerment to the multi-agent KGQG framework. In addition, while it is a common strategy to integrate large and small models using knowledge distillation techniques, this approach is not directly applicable to KGQG. Studies have shown that LLMs often perform poorly in zero-shot generation tasks, and the generated results are usually low in correlation and high in redundancy.
[0058] A knowledge graph (KG) consists of a set of triples, represented as<s,r,o> , where s, r, and o represent the head entity, relation, and tail entity, respectively. The focus of this study is to generate a natural language question q related to the answer given a set of triples extracted from KG (knowledge graph) and a specific answer a (a∈{s,r,o}) as input. Task-related entities E={e0,e1,…,e k}, and one is denoted as G.
[0059] refer to Figure 1The model provided in this application is RoleAgentQG. RoleAgentQG is a zero-shot KGQG framework for multi-agent systems that combines the advantages of multi-agent LLMs and small models. Next, the role specialization and workflow in the framework are explained, and it is illustrated how to organize a zero-shot multi-agent system to generate LLMs-based questions in the context of the editorial team structure workflow. In addition, this application uses workflow optimization tools, communication protocols, and a growing database to improve the efficiency of role communication. These methods enable agents to generate semantically clear and syntactically correct questions. Finally, we introduce a low-cost training module for training small models using generated questions to learn the capabilities of LLMs and improve the relevance of generated questions.
[0060] This application solves the role agent generation problem in the workflow through the editorial team structure. Clear role specialization helps to decompose complex tasks into more manageable and specific activities. In the complex process of problem generation, the collaboration of agents with different skills and expertise is essential. Each participant contributes specialized output to optimize the overall content quality.
[0061] In the complex task of question generation, structured collaboration among a team of experts and professional editors is essential to produce high-quality questions. Figure 1 As shown, the editorial team consists of five key roles: Chief Editor Agent, Executive Editor Agent, Contributor Agent, Content Editor Agent, and Proofreading Editor Agent:
[0062] Editor-in-Chief: Holds the highest position on the editorial team and is responsible for setting the overall vision and direction of question generation. This role involves making key decisions on question topics, ensuring the tone of content is consistent with the true meaning of the questioner, and ensuring that the content is consistent with the true meaning of the questioner. Figure 1 It is worth noting that for each agent, the Agent-ODA execution mechanism is executed to alleviate hallucinations and improve work efficiency.
[0063] Executive editor agent: responsible for the daily operation of the editorial team. This role includes coordinating with experts, leveraging their strengths and completing tasks within their professional fields, managing iteration deadlines, and ensuring the smooth progress of the question generation process. It is worth noting that for each agent, the Agent-ODA execution mechanism is executed to alleviate hallucinations and improve work efficiency.
[0064] Contributor Agent: simulates a typical inquirer and creates questions based on requirements. From question generation to final confirmation, it works closely with the content editing agent to reliably optimize question quality from multiple perspectives. It is worth noting that for each agent, the Agent-ODA execution mechanism is executed to alleviate hallucinations and improve work efficiency.
[0065] Content Editing Agent: Works closely with contributors to develop and refine generated questions. It provides draft feedback, suggests revisions, and ensures that the final output questions are consistent with the answers and sub-questions in terms of content, logic, and difficulty. Figure 1 It is worth noting that for each agent, the Agent-ODA execution mechanism will be executed to alleviate hallucinations and improve work efficiency.
[0066] Proofreading Editor Agent: reviews and edits the generated issues for grammar, punctuation, style, and consistency. It ensures that the content is error-free and complies with the style guide set by the Editor-in-Chief Agent. It is worth noting that for each agent, the Agent-ODA execution mechanism is executed to alleviate hallucinations and improve work efficiency.
[0067] Each agent operates strictly within its scope of responsibility to maximize the use of its professional skills. The Agent-ODA execution mechanism is as follows:
[0068] Using an iterative approach, Agent-ODA addresses the challenges inherent in KG-centric question generation tasks. Compared to existing methods that combine LLM and KG together and rely solely on analyzing LLM queries, ODA can autonomously integrate knowledge observed from KG into the entire reasoning process to make more informed decisions. To achieve this goal, the Agent-ODA execution mechanism mainly includes three key modules for solving tasks:
[0069] 1. Observation: This module effectively observes and processes relevant knowledge in the KG environment. In each iteration, it constructs an observation subgraph (denoted as O i ). This subgraph is autonomously incorporated into the reasoning LLM by leveraging insights and patterns captured from the KG. This synergistic integration provides ODA with enhanced capabilities from both LLM and KG, enabling it to handle tasks more effectively.
[0070] 2. Action: Simultaneously use the observation subgraph O i and ODA memory (denoted as M <i The action module consists of a i The action module represented by it will strategically select the action that best suits the KG, ensuring that accurate questions are generated based on the answer entity or the answers required by the corresponding agent prompt.
[0071] 3. Feedback: Using the Observation Subgraph O i The feedback module is implemented by feeding back the knowledge gained from the action step. The feedback knowledge will be stored in the memory M i for use in the next iteration, thus facilitating continuous reasoning.
[0072] Through this iterative process, ODA dynamically updates its observation subgraph and memory. i and memory M i Memory i. Each module is discussed in detail below.
[0073] Observation Module: The observation module aims to inspect the global KG knowledge and utilize the KG environment to navigate the autonomous reasoning process. At each iteration i, it utilizes the task-related entities E i , the agent's input prompt (p i ), the information c passed by the previous agent i and the answer entity e i Generate observation subgraph P i This process can be described as: i =Observation([E i ,p i ,c i ,e i ])
[0074] Initially, the task-related entities are represented by the answer entity e i For KG-centric tasks, observation brings about the problem of explosive growth in the number of nodes. To address the scalability challenge in the observation subgraph update process, we propose a D-round observation strategy, where D represents the maximum jump depth. Each round has two steps: update and refinement. The update step focuses on expanding the subgraph, while the refinement step ensures the appropriate size of the subgraph without losing important information.
[0075] For every entity e∈E i , the observation module initializes the observed entity as a set Initialization of . Where d represents the current search depth in KG. The update and refinement steps are iterated for each entity until D. The details are described as follows:
[0076] Algorithm 1 Observation
[0077] Input: answer entity e i , the agent’s input prompt(p i ), the information c passed by the previous agent i ,Task related entity E i , limit D, N and P;
[0078] Use the answer entity e i To initialize the task related entity E i
[0079] fore∈E i do
[0080]
[0081]
[0082] renew:
[0083] for For each entity e in , adjacent triples are extracted from the KG. Each triple is in the form of [e, r, t], where r represents the relation and t represents the tail entity.
[0084] The answer is based on the agent's input prompt (p i ) and the information c passed in by the previous agent i , will be the similarity score between r and t, calculated by measuring the cosine similarity of their embeddings:
[0085]
[0086] All triples related to entities in E are collectively sorted in descending order according to their similarity scores.
[0087] The first N triplets are added to the observation subgraph O i .
[0088] Refinement:
[0089] - The top M triplets were further refined by retaining only the top P% with the highest similarity scores.
[0090] - The tail entities from the top P% triples of refinement are determined as the starting observed entities for the next iteration
[0091] Action Module
[0092] The action module leverages the power of LLM to craft strategic prompts to generate optimal actions. i ), memory M <i , observe subgraph O i and historical actions <i Choose the most accurate action i .
[0093] a i =Action([p i ,O i,a <i ,M <i ])
[0094] This application proposes three core actions, including:
[0095] Neighborhood exploration: This operation explores the KG neighborhood of task-related entities and retrieves all neighboring triples. i And retrieve all adjacent triples. This helps build context for ODA and understand the interconnectedness within the KG.
[0096] Path discovery: Given two entities E among the task-related entities i , which searches for all possible paths connecting them. Each path consists of interconnected triplets, allowing ODA to explore various connections and discover potential hidden relationships.
[0097] Answer: This operation generates the answer to the question or prompt only if the required information is present in memory. <i .
[0098] Once the answer action is chosen, ODA stops the iterative cycle of observation, action, and reflection. <i , it can then directly generate the answer required by the question or prompt. Alternatively, if the "Neighborhood Exploration" or "Path Discovery" operation is selected, ODA strategically extracts relevant knowledge from the KG as a set of triples. These extracted triples are then fed into the subsequent reflection step for further processing.
[0099] Feedback module:
[0100] The feedback module plays a crucial role in evaluating the triplets generated by the action steps and subsequently updating the ODA memory. i .Memory is designed for KG tasks. i The memory is in subgraph format, which consists of a path network that conforms to the inherent structure of KG, aiming to optimize efficiency and relevance. i , existing memory M <i , the agent's input prompt (p i ), the information c passed by the previous agent i ,The feedback module can autonomously integrate them and provide valuable feedback information to guide future decisions.,This process can be formalized as
[0101] M i =Reflection([O i ,a i ,M <i ,pi ,c i ])
[0102] Given that memory M i The structure of is a network of paths, and the feedback module browses these paths to find the first path that is suitable for integrating the feedback triplet. This suitability comes from aligning the tail t of the last triplet in the selected path with the entity of the last triplet in the selected path. If a matching path is found, the feedback triplet is added. Otherwise, a new path is created based on the feedback triplet. The maximum size of the feedback triplet is denoted as K.
[0103] Subsequently, the tail entity in the feedback triplet is designated as the task-related entity for the next iteration.
[0104] The observation, action, and feedback modules collaborate iteratively until the action module’s “answer” operation is triggered or the maximum iteration limit is reached.
[0105] Workflow between agents:
[0106] Specifically, if Figure 2 As shown in the figure, after obtaining the knowledge graph, the editor-in-chief conducts a comprehensive analysis and formulates a detailed overall goal, which is used as a preliminary information breakdown. The overall goal is then passed to the executive editor, who converts the overall goal into specific detailed information (overall goal, grammar and format requirements, logic, content, and difficulty requirements). Next, the executive editor assigns the specific information to the appropriate professionals. For example, the executive editor assigns the overall goal, grammar and format requirements, logic, content, and difficulty requirements to the contributor. In the next stage, the contributor generates a draft question and hands it over to the content editor, who checks the logic, content, and difficulty of the question and makes suggestions for the questions that have not passed to ensure strict question quality. For the questions that have passed, they are handed over to the proofreading editor to correct the grammar and format. In the last step, the editor-in-chief scores and evaluates the questions that have been polished by the proofreading editor; those with a score less than or equal to 3 (range: 1-5) are returned to the executive editor for regeneration, and those with a score greater than or equal to 4 are accepted, and the acceptance of all role outputs will be saved in the growing database. Each role (agent) executes the Agent-ODA execution mechanism.
[0107] In typical multi-agent collaborations, outputs are usually converged through iterative discussion and consensus. However, in practice, LLMs are prone to changing opinions, leading to the generation of redundant and irrelevant answers (e.g., the answer is already in the question). In contrast, RoleAgentQG requires LLM-based agents to generate structured outputs, such as high-quality instructions, tasks, suggestions, and interface specifications. Using intermediate structured outputs significantly improves the success rate of target question generation. More details will be shown in the experiments.
[0108] In one embodiment, the present application designs two main workflow optimization tools: communication protocol and growing database. These tools are intended to improve the efficiency of role-specific communication in our framework.
[0109] Communication Protocol
[0110] Modern LLM-based multi-agent frameworks typically adopt unconstrained natural language as their primary communication interface. Despite the versatility of natural language, there are significant challenges in maintaining information integrity, especially in complex task environments. This is demonstrated in the game of telephone (or Chinese whispers), where information tends to be severely distorted after a few rounds. Inspired by the structure of human society, we propose to use structured face-to-face communication to enhance communication between agents. This application performs role empowerment, scenario construction for each role, and requires individuals to provide necessary modular outputs based on their specific role and context:
[0111] Role empowerment: Assigning agents specific roles and clear responsibilities enhances their ability to emulate behaviors and responses typical of these roles. For example, an agent designated as “Editor-in-Chief” interprets and processes information from this professional perspective, using appropriate terminology and analytical frameworks. This structured role assignment ensures in-depth and accurate communication related to knowledge graph development and task-specific question generation.
[0112] Scenario construction: This involves informing agents of the roles and responsibilities of their counterparts in the interaction, allowing them to dynamically adjust their content generation. By understanding these roles, agents can ensure that their communications are both relevant and precise, improving the effectiveness of collaborative tasks and specialized information exchanges.
[0113] Modular outputs: Establish key data points that each role must handle, simplify information flow, and prevent the dissemination of irrelevant or incomplete content. For example, an agent who serves as an "executive editor" generates three different outputs: overall goals, grammar and format requirements, and logic, content, and difficulty requirements. They are an important basis for the work of contributors, content editors, and proof editors.
[0114] Growing database
[0115] Examples are crucial in agent collaboration. For example, contributors who generate questions usually need to refer to example questions. However, obtaining high-quality examples in zero-shot settings is often challenging.
[0116] To address this challenge, a feasible approach is to store the historical data passed by the editor-in-chief in a growing database and select the $top-k$ of its own historical samples as a reference for each agent's work. This application introduces a growing database that stores each agent's own historical data and final score. The $top-k$ historical data with the highest score in the work is selected as part of the input as an example reference.
[0117] To prevent information overload, the database adopts a role-specific data sharing strategy. This approach ensures that agents only receive historical data relevant to their current tasks, thereby minimizing interference caused by irrelevant information. This selective data sharing approach greatly improves communication efficiency and keeps agents focused.
[0118] Train a small model using the generated questions
[0119] Modern LLMs require a lot of computing resources for training and fine-tuning, and may produce hallucinations (e.g., low relevance, redundancy, etc.) and are expensive. In contrast, small models have advantages due to their reduced training costs and faster processing speeds. Therefore, this application uses a small model (i.e., G2S-AE-RL) for training. This model is one of the latest KGQG models and uses the BiGraph2Seq model to generate questions and answers from subgraphs.
[0120] Specifically, the accepted questions are input into G2S-AE-RL as training data. The datasets include TCGA and MIMIC-III datasets. TCGA (The Cancer Genome Atlas) provides genomic, epigenetic, transcriptomic, and clinical data of various cancer types and is an important resource for tumor research. MIMIC-III (Medical InformationMart for Intensive Care) contains de-identified data of patients in intensive care units, including vital signs, laboratory test results, drug use records, etc., which are widely used in the research of medical predictive modeling and clinical decision support systems. Through this training, it quickly learns the fluency and logic of collaborative generation of questions based on RoleGPT agents, thereby generating high-quality final questions. More details about G2S-AE-RL are as follows.
[0121] Specifically, the accepted questions are input into G2S-AE-RL as training data. Through this training, it quickly learns the fluency and logic of generating questions based on the collaborative generation of RoleGPT agents, thereby generating high-quality final questions. More details about G2S-AE-RL are as follows:
[0122] A. Problem Raising
[0123] Assume that the KG subgraph O obtained by the multi-agents above is a triple (i.e., subject-predicate-object,<s,r,o> ), which can also be represented as a subgraph o = (E0, R) = multiple groups generated by the above multi-agent<s,r,o> , where E0 represents a set of entities (i.e., subject s or object o). It is also assumed that all answers e in the target answer set come from the entity set V, which is the normal setting for the KBQA task. The task of KBQA is that the task of KG-QG is to generate the best natural language question consisting of a sequence of word tokens. WORD = {word1, word2, …, word q―Lengths} is the most likely condition. Where q―Lengths is the length of the question. We focus on a set of KG subgraphs O obtained by the multi-agents above, answers, target question pairs, and input prompts (p i ) and information c transmitted / generated by multiple agents i In the problem setting of learning mapping; existing QG methods make similar assumptions. Although the three main challenges discussed above are based on KG-based QG, QG tasks from other data sources will also encounter some or most of the problems when dealing with these tasks. Therefore, the model of this application can also be generalized to these tasks.
[0124] B. Coding Layer
[0125] Let E0 be a set of nodes (i.e. entities) {e1,e2,…,e n In the KG subgraph O obtained by the multi-agent above, each node is associated with an attribute such as text, character or ID number. Similarly, let R be a set of edges (i.e. predicates) {r1,r,…,r m A set of edges (i.e., predicates) in a subgraph O in}, where each edge has some attributes, such as text, character, or ID number.
[0126] 1. Encoding nodes and edges: Before using the GNN encoder to process the KG subgraph O obtained by the multi-agent above, the nodes and edges need to be mapped to the initial embedding space to encode their attributes. There are two common methods for encoding nodes and edges in KG. One method is based on the global KG embedding that is pre-trained on the entire KG through some KG representation learning algorithm (such as TransE, TransR, TransR, TransD), and the other method is based on the structure of the text (such as the input prompt (p i ) and information c transmitted / generated by multiple agents i), characters, ID number attributes of the words pre-trained embedding (such as Word2Vec, FastText, See, GloVe, NNLM). This application chooses to encode nodes and edges according to the word embeddings of text attributes in the main model. We believe that it is relatively easier for a model to learn the mapping from the input KG subgraph O obtained by the multi-agent above to the output natural language question (both sides are based on word embeddings). We empirically compared and analyzed these two encoding strategies in the experiment. In order to encode the nodes and edges in the KG subgraph O obtained by the multi-agent above, we applied two bidirectional LSTMs to the nodes (i.e., one for the nodes and one for the edges) to their related texts (such as the input prompt (p i ) and information c transmitted / generated by multiple agents i ). The concatenation of the last forward and backward hidden states of the BiLSTM is used as the initial embeddings for nodes and edges.
[0127] Specific introduction:
[0128] The basic idea of the TransE model is to regard the relation as a translation from head to tail. It believes that a correct knowledge triple should satisfy h+r=(approximately equal to) t, while an incorrect one does not. In layman's terms, the head entity embedding plus the relation embedding is approximately equal to the tail entity embedding. TransE defines a distance function d(h+r,t) to measure the distance between h+r and t. We can also use the L1 or L2 norm. TransE uses the maximum margin method
[0129] The core idea of TransH is that for each relation r, there is a hyperplane Wr and a relation vector dr to represent it, rather than in the same embedding space as the entity. Specifically, in each triple, the head entity h and the tail entity t are mapped to this hyperplane to obtain vectors h⊥ and t⊥, and training is performed so that h⊥+dr≈t⊥. The purpose is to make the same entity have different meanings in different relations, because different relations have different normal planes.
[0130] The TransR method is proposed on the basis of TransE and TransH. Although TransE and TransR have made great progress, their entities and relations are mapped in the same semantic space. However, entities contain multiple attributes, and different relations correspond to different entity attributes. Therefore, in the entity space, some entities are similar and therefore close to each other, but some specific entity attributes are quite different, so they are far apart from each other in the relevant relational space. The proposal of TransR originated from this. The so-called TransR refers to mapping entities and relations to different semantic spaces, and the relationship is no longer a single one, but multiple relational spaces. The translation of the head and tail entities is also completed in the corresponding relational space. The R stands for Relation Space.
[0131] The TransD method is proposed on the basis of TransR. Although TransR has significant effects compared with the first two methods, it also has obvious shortcomings. Let's take a look at the model idea of TransD. Given a triple (h, r, t), TransD projects the head and tail entities into the relational space to obtain projection matrices Mrh and Mrt, respectively. The projection matrices obtained in this way are related to both entities and relations. After obtaining the projection matrix, the projection vectors of the head and tail entities are calculated as in TransR.
[0132] Word2Vec: Main idea: Train a model on the context of each word so that similar words have similar numerical representations. Just like a normal feed-forward network where you have a set of independent variables and a target dependent variable that you are trying to predict, you first break your sentence into words (tokenize) and create a number of word pairs based on the window size. One of these pairs could be a pair of words like (cat, purr) where cat is the independent variable (X) and purr is the target dependent variable we want to predict (Y) We feed ‘cat’ into the NN through an embedding layer initialized with random weights and pass it through a softmax layer with the ultimate goal of predicting ‘purr’. Optimization methods like SGD minimize the loss function “(target word|contextwords)” which aims to minimize the loss of predicting the target word given the context words. If we do this enough times, the weights in the embedding layer will eventually represent the vocabulary of word vectors, that is, the “coordinates” of the word in this geometric vector space.
[0133] GLOVE: GLOVE works similarly to Word2Vec. As you can see above, Word2Vec is a "prediction" model that predicts the context of a given word, and GLOVE learns by constructing a co-occurrence matrix (words X context), which basically counts how often words appear in context. Because it is a huge matrix, we decompose this matrix to get a low-dimensional representation.
[0134] FastText: FastText is very different from the two embeddings above. Word2Vec and GLOVE treat each word as the smallest training unit, while FastText uses n-gram characters as the smallest unit. For example, the word vector, "apple", can be decomposed into different units of word vectors, such as "ap", "app", "ple". The biggest benefit of using FastText is that it can generate better embeddings for rare words, even words that were not seen during training, because the n-gram character vectors are shared with other words. This is something that Word2Vec and GLOVE cannot do.
[0135] 2. Leveraging the target answer: In the KBQA setting, it is usually assumed that the answer to the question is the entity in the KG subgraph O obtained by the multi-agent above. As an upstream task of KBQA, in our method, we assume that leveraging the target answer and the KG subgraph O obtained by the multi-agent above can help generate more relevant questions. To this end, we adopt a simple but effective strategy of introducing an additional learnable label vector on each node / edge to indicate whether it is an answer. Therefore, the initial vector representation of the node / edge will be the concatenation of the BiLSTM output and the answer label vector.
[0136] Will Represent the embedding of entity nodes and predicate edges respectively. e and EMBED p have the same embedding dimension d.
[0137] C. Bidirectional Graph2Seq Generator with Multi-Agent Information and Replication
[0138] Although RNNs are good at modeling sequential data, they cannot naturally handle graph-structured data. To apply an RNN-based encoder, it may be necessary to linearize the graph into a sequence, which will lose the rich structural information in the graph. Many previous studies have shown that GNNs are more advantageous than RNNs in modeling graph-structured data. Kumar et al. proposed to encode a set of triplets through a transformer, removing the positional encoding in the original architecture. Although the Transformer-based encoder can learn the semantic relationship between triplets through all-to-all attention, the explicit graph structure is completely discarded. This application introduces a GNN-based bidirectional encoder to encode the KG subgraph O obtained by the multi-agent above, and uses an RNN-based decoder to encode the output question, the input prompt (p i ) and information c transmitted / generated by multiple agents i For decoding, the decoder is equipped with a node-level replication mechanism.
[0139] Bidirectional Graph Encoder: Many existing GNNs are not designed to process directed graphs like KGs. Even though some GNN variants (such as GGSNN and MPNN) are able to process directed graphs via cross-graph message passing, they do not model bidirectional information when aggregating information from neighboring nodes for each node. Therefore, information can only be passed across the graph in a unidirectional manner.
[0140] This application introduces a bidirectional gated GNN (BiGGNN), which extends GGSNN by learning node embeddings from both the input and output directions in an interleaved manner when processing directed graphs. Similar bidirectional methods have been used in the existing literature to extend other GNN variants. These methods simply learn node embeddings in each direction independently and concatenate them in the last step, while BiGGNN fuses the intermediate node embeddings of both directions at each iteration.
[0141] Node Embedding The embedding value of node e is initialized to Embed e That is, the concatenation of the BiLSTM output and the answer tag vector. The BiGGNN then performs a fixed number of hops of information transfer in the graph, with each hop sharing the same set of network parameters. At each hop of the computation, for each node in the graph, the application applies an aggregation function that takes as input a set of incoming (or outgoing) neighboring node vectors and outputs a backward (or forward) aggregate vector. In principle, many order-invariant operators (such as max or attention) can be used to aggregate neighborhood information. Here, the application uses a weighted aggregator
[0142]
[0143] in and represents the in-and-out neighbors of the node e. Then, the node embedding information aggregated from two directions is fused.
[0144]
[0145] The fusion function is calculated as the gated sum of the two information sources
[0146] Fuse(a,b)=z⊙a+(1―z)⊙b
[0147] z=σ(W z [a; b; a⊙b; a―b]+b z ) (3)
[0148] Where ⊙ is the component-wise multiplication, σ is a sigmoid function, and z is the gating vector. The gating helps the model determine how much information to retain from the embeddings of the two aggregated nodes.
[0149] Finally, a gated recurrent unit (GRU) is used to update the node embeddings by combining the aggregated information.
[0150]
[0151] In the n-hop GNN calculation, where n is a hyperparameter, the final state embedding is obtained To calculate the graph-level embedding, we first perform linear projection on the node embeddings, and then perform maximum pooling on all node embeddings to obtain a d-vector Ep O .
[0152] 3. Handling multi-relational graphs: KGs are typically heterogeneous networks containing a large number of edge types. However, many existing GNNs are not directly applicable to multi-relational graphs. In order to model node and edge information with GNNs, researchers have extended GNNs by either setting separate learnable weights for different edge types or setting explicit edge embeddings when performing information transfer. The former solution may have serious scalability issues when handling graphs with a large number of edge types, while the latter solution requires major modifications to existing GNNs. This application adopts two solutions to adapt GNNs to multi-relational graphs.
[0153] a) Levi Transformation: We can directly apply regular GNN to the multi-relational KG subgraph O obtained by the multi-agent above to convert it into a Levi graph. Specifically, we treat all edges in the original graph as new nodes and add new edges connecting the original nodes and the new nodes to obtain a two-party graph. For example, in a KG subgraph O obtained by the multi-agent above, a triple (Mario_Siciliano, place_of_birth, Rome) will be transformed into "Mario_Siciliano, place_of_birth, Rome". →Birthplace→Rome", where "birthplace" becomes a new node and → represents a new edge connecting the entity and the predicate. It should be noted that since most KG subgraphs O are sparse, the number of newly added nodes (and edges) is at most linear with the number of original nodes.
[0154] b) Gated Information Passing with Side Information: We also extend BiGGNN to explicitly include side embedding information when performing information passing, and call the resulting variant Specifically, we rewrite the node aggregation function (1) as follows:
[0155]
[0156] Where f is a nonlinear function (i.e. linear projection + ReLU) applied to and e ue is the embedding of the edges connecting the nodes.
[0157] 4. Node-level replicated RNN decoder: This application uses an attention-based LSTM decoder to generate an output sequence of one word at a time. The decoder uses graph-level embedding Ep O The next two independent fully connected layers serve as the initial hidden states (i.e., c0 and state0 node embeddings as an attention memory. The specific attention mechanism used by our decoder is very similar to the literature. Basically, at each decoding step t, the attention mechanism learns to focus on the most relevant nodes in the input graph and computes a context vector based on the current decoding state And according to the current decoding state t and attention memory to compute a context vector.
[0158] Assume that when generating natural language questions based on the KG subgraph O obtained by the multi-agent above, it is very likely to directly mention (i.e., copy) the entity name in the KG subgraph O obtained by the multi-agent above, even if it is not rephrased. If a copy mechanism is added, most RNN decoders can usually copy words from the input sequence. The conventional word-level copy mechanism is extended to a node-level copy mechanism, allowing node attributes (i.e., node text) to be copied from the input graph. This application uses a masked copy mechanism that only copies the entity nodes in the converted Levi graph, but not the predicate nodes. This is because we assume that in the KG-QG task, humans are very likely to directly mention the entity name, but not necessarily the predicate name.
[0159] At each decoding step, the probability p is generated gen ∈[0,1] is the probability of generation. Decoder state t and decoder input word t―1 .Next step gen It is a soft switch that selects whether to generate a word from the vocabulary or copy a node attribute from the input graph. This application dynamically maintains an extended vocabulary, which is a combination of all node names that appear in the common vocabulary and a batch of source examples (i.e., the KG subgraph O obtained by the multi-agent above).
[0160] D. Training and Testing
[0161] As is customary for training sequence models, the following cross entropy loss is minimized:
[0162]
[0163] in is the word at position t of the golden output sequence. To alleviate the exposure bias problem, we use a timed teacher forcing method. During the test phase, beam search is used to generate outputs.
[0164] In addition, you can also choose relative entropy, which is also called KL divergence (Kullback–Leibler divergence), which is used to describe the difference between two probability distributions. Assuming there are two probability distributions q(x)q(x) and p(x) for the same variable x, the relative entropy between the two can be defined as follows:
[0165]
[0166] For practical applications, p(x) is the target distribution and q(x) is the predicted matching distribution.
[0167] Two-stage training strategy: Most early studies on QG adopted a cross-entropy based training objective, which is also the de facto choice for training sequence models in many other NLP tasks. However, the cross-entropy based training strategy has some known limitations, including exposure bias and evaluation differences between training and testing. That is, during training, the model has access to the previous token of the ground truth when decoding and optimizes towards the cross-entropy loss; while during testing, the previous token of the ground truth is not provided and the cross-entropy loss is not used for evaluation.
[0168] To address these issues, in addition to training the model of this application with the conventional cross-entropy loss, a two-stage training strategy is explored, that is, first training the model with the cross-entropy loss, and then fine-tuning the model with a hybrid loss that combines the cross-entropy loss and the RL loss. The RL loss is defined based on the evaluation metric, so we can directly optimize the model based on the evaluation metric.
[0169] The reason for the need for the first stage of training is that it is often challenging to train a model from scratch using RL. Conventional cross entropy training can obtain a model with fairly good performance, while RL-based fine-tuning can further improve the performance of the model.
[0170] In the first stage, the conventional cross entropy loss is used
[0171]
[0172] As shown in (6), in the second stage, the model is further fine-tuned by optimizing a hybrid objective function that combines the cross entropy loss and the RL loss.
[0173]
[0174] where γ is a scaling factor that controls the trade-off between the two losses.
[0175] The architecture of the present application is not limited by a specific RL algorithm. In one embodiment, an efficient and effective RL method, Self-Critical Sequence Training (SCST), is used to directly optimize discrete evaluation metrics. SCST is an efficient REINFORCE algorithm that uses the output of its own test-time reasoning algorithm to normalize the rewards it experiences. In each training iteration, the RL loss is defined by comparing the reward of the sampled output with the reward of the baseline output. WORD s Rewards and benchmark outputs
[0176]
[0177] Among them WORD s is generated by multinomial sampling, that is, each word Sample according to the probability predicted by the generator. P(word t ∣X,word <t ) predicts the likelihood of sampling, and is obtained by greedy search, i.e. maximizing the output probability distribution at each decoding step. We can see that minimizing the above loss is equivalent to maximizing the likelihood of some sampled outputs, which have higher rewards than the corresponding baselines.
[0178] One of the key factors in RL is to choose a suitable reward function. We denote r(WORD) as the reward for the output sequence WORD, calculated by comparing it with the corresponding ground-truth sequence WORD * We compare it with the corresponding ground truth sequence and calculate the reward for the output sequence, which is a combination of our evaluation metrics (using BLEU-4, ROUGE-L, METOR, CIDEr scores). This way, we can optimize the model directly based on the evaluation metrics.
[0179] Ultimately, higher quality questions are generated.
[0180] As used herein, the word "preferred" is intended to be used as an example, instance, or illustration. Any aspect or design described herein as "preferred" is not necessarily to be construed as being more advantageous than other aspects or designs. On the contrary, the use of the word "preferred" is intended to present concepts in a specific way. The term "or" as used in this application is intended to mean an inclusive "or" rather than an exclusive "or". That is, unless otherwise specified or clear from the context, "X uses A or B" means any one of the naturally included permutations. That is, if X uses A; X uses B; or X uses both A and B, then "X uses A or B" is satisfied in any of the foregoing examples.
[0181] Moreover, although the present disclosure has been shown and described with respect to one or implementations, those skilled in the art will think of equivalent variations and modifications based on the reading and understanding of this specification and the accompanying drawings. The present disclosure includes all such modifications and variations, and is limited only by the scope of the appended claims. In particular, with respect to the various functions performed by the above-mentioned components (such as elements, etc.), the terms used to describe such components are intended to correspond to any component (unless otherwise indicated) that performs the specified function of the component (such as it is functionally equivalent), even if the structure is not equivalent to the disclosed structure of the function in the exemplary implementation of the present disclosure shown herein. In addition, although the specific features of the present disclosure have been disclosed with respect to only one of several implementations, such features can be combined with one or other features of other implementations that may be desired and advantageous for a given or specific application. Moreover, insofar as the terms "including", "having", "containing" or their variations are used in specific embodiments or claims, such terms are intended to be included in a manner similar to the term "comprising".
[0182] The functional units in the embodiments of the present invention may be integrated into a processing module, or each unit may exist physically separately, or multiple or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium. The above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc. The above-mentioned devices or systems may execute the storage method in the corresponding method embodiment.
[0183] To sum up, the above embodiment is an implementation mode of the present invention, but the implementation mode of the present invention is not limited by the embodiment. Any other changes, modifications, substitutions, combinations, and simplifications that deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.
Claims
1. A zero-shot multi-agent knowledge graph problem generation method, characterized in that: The following steps are involved: Obtain medical knowledge graph; The editor-in-chief agent sets the generation of questions, ensures that the tone of the content is consistent with the true intention of the questioner, and supervises the quality of the final questions; The executive editor agent manages iteration deadlines and ensures the problem generation process proceeds; Contributor agents simulate typical inquirers and create questions based on requirements; Content editing agent: provides feedback and ensures that the final output questions are consistent with the answers and subgraphs in terms of content, logic, and difficulty; Proofreading editing agents review and edit generated issues for grammar, punctuation, style, and consistency; Each agent executes the Agent-ODA execution mechanism; the Agent-ODA execution mechanism includes an observation module, an action module and a feedback module; the observation module observes and processes relevant knowledge in the knowledge graph environment; At each iteration i, it constructs an observation subgraph O i , and the subgraph is incorporated into the inference large language model; the action module also uses the observation subgraph O i and ODA memory, select the action that best suits the knowledge graph, and ensure that the answer to the prompt requirement of the corresponding agent is generated based on the answer entity; the feedback module uses the observation subgraph O i , feedback the knowledge gained from the action steps; The editor-in-chief agent scores and evaluates the proofread and edited questions; Those with scores less than the preset threshold are returned to the executive editing agent to regenerate the question, and those with scores greater than the preset threshold are accepted and saved in the growing database; Output the final medical knowledge graph problem.
2. The zero-shot multi-agent knowledge graph problem generation method according to claim 1, characterized in that: The observation module uses the task-related entity E at each iteration i. i , the agent’s input prompt p i , the information c passed in by the previous agent i and the answer entity e i Generate observation subgraph O i This process is described as: Hi=Observation([E i ,p i ,w i ,and i ])。 3. The zero-shot multi-agent knowledge graph problem generation method according to claim 2, characterized in that: A D-round observation strategy is used to solve the scalability problem in the process of observing subgraph updates, where D represents the maximum jump depth; each round has two steps: update and refinement; the update step is used to expand the subgraph, while the refinement step changes the subgraph size without losing important information.
4. The method for generating knowledge graph problems for zero-shot multi-agents according to claim 3, characterized in that: The update steps are as follows: For the starting observation entity For each entity e in , its adjacent triples are extracted from the knowledge graph; each triple is in the form of [e, r, t], where r represents the relationship and t represents the tail entity; Calculate the cosine similarity score: is based on the agent's input prompt p i , the information c passed in by the previous agent i The two combined vectors, v r+t is the vector of the relation r and the tail entity t, based on the agent's input prompt p i , the information c passed in by the previous agent i , relation r, and tail entity t are all in text form; All triples associated with entities in E are collectively sorted in descending order according to their similarity scores; the top N triples are added to the observation subgraph O. i .
5. The method for generating knowledge graph problems for zero-shot multi-agents according to claim 4, characterized in that: The refinement step retains only the top P% with the highest similarity scores, further refines the top N triples; and determines the tail entity from the top P% triples after refinement as the starting observation entity for the next iteration.
6. The zero-shot multi-agent knowledge graph problem generation method according to claim 3, characterized in that: The action module uses a large language model to design strategic prompts to generate the best action based on its agent's input promptp i , memory M <i , observe subgraph O i and historical actions <i Choose the most accurate action i : a i =Action([p i ,O i ,a <i ,M <i ]) Memory M <i Includes all historical records of the previous i agents; The actions include neighborhood exploration, path discovery, and answering; the neighborhood exploration task explores the knowledge graph neighborhood of related entities and retrieves all adjacent triples; Given two entities E in task-related entities i , the path discovery operation searches for all possible paths connecting them; each path consists of interconnected triplets to explore various connections and discover potential hidden relationships; The answer operation generates the answer required by the question or prompt only if the required information is present in memory. <i ; Once the answer action is selected, the Agent-ODA execution mechanism stops the iterative cycle of observation, action, and reflection; the Agent-ODA execution mechanism uses the knowledge in memory M <i , directly generate the answer required by the question or prompt; Or if the neighborhood exploration or path discovery operation is selected, the Agent-ODA execution mechanism extracts relevant knowledge from the knowledge graph and treats it as a set of triples. These extracted triples are input into the subsequent feedback step for further processing.
7. The method for generating knowledge graph questions for zero-shot multi-agents according to claim 3, characterized in that: M i The memory adopts subgraph format, which is composed of a path network that conforms to the knowledge graph structure. The feedback module integrates the observation subgraph O i , existing memory M <i , the agent’s input prompt p i , the information c passed in by the previous agent i , this process can be formalized as: M i =Reflection([O i ,a i ,M <i ,p i ,c i ]) The feedback module browses the path network and finds the first path suitable for integrating the feedback triplet; the path suitable for integrating the feedback triplet is the one in which the tail t of the last triplet in the selected path is aligned with the entity e of the last triplet in the selected path; if a matching path is found, it is added to the feedback triplet, otherwise, a new path is created based on the feedback triplet; the maximum size of the feedback triplet is denoted as K; subsequently, the tail entity in the feedback triplet is designated as the task-related entity for the next iteration; The observation, action, and feedback modules collaborate iteratively until the answer operation of the action module is triggered or the maximum iteration limit is reached.
8. The method for generating knowledge graph questions for zero-shot multi-agents according to claim 7, characterized in that: Use structured face-to-face communication to enhance communication between agents; construct scenarios for each agent role and require individuals to provide modular outputs based on their specific roles and contexts; the scenario construction includes informing the agent of the role and responsibilities of the opponent in the interaction so that it dynamically adjusts its content generation; the modular output establishes key data points handled by each role and simplifies the flow of information.
9. The method for generating knowledge graph questions for zero-shot multi-agents according to claim 8, characterized in that: In order to provide reference example problems for contributors of generated problems, the historical data passed by the editor-in-chief agent is stored in the growing database, and the top k samples in its own historical samples are selected as references for each agent's work; To prevent information overload, the database adopts a role-specific data sharing strategy to ensure that agents only receive historical data related to their current tasks and reduce interference caused by irrelevant information.