Knowledge query method based on federal context learning and large model agent

By introducing federated context learning and knowledge query methods into federated learning of large-model agents, generating and aggregating knowledge outlines, combined with search enhanced generation technology, the problems of high bandwidth, computing density and data heterogeneity in federated learning of large-model agents are solved, and a federated learning process with high efficiency and excellent performance is achieved.

CN119539078APending Publication Date: 2025-02-28THE CHINESE UNIV OF HONG KONG (SHENZHEN)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411599133.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-11
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

Large model agents face problems of high bandwidth consumption, computing density and data heterogeneity in federated learning, resulting in excessive communication and computing overhead, affecting learning effects.

Method used

A knowledge query method based on federated context learning and large model agents was designed. The tool learning and use modules that enhance the generation through local knowledge outline generation, global knowledge outline aggregation and retrieval are realized to realize the intake of knowledge and the use of tools, reducing communication and computing needs.

Benefits of technology

It effectively reduces the bandwidth and computing requirements of federated learning in large model agents, solves the data heterogeneity problem, improves the communication efficiency and computing efficiency of federated learning, and realizes an efficient and excellent federated learning process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119539078A_ABST
    Figure CN119539078A_ABST
Patent Text Reader

Abstract

The invention discloses a knowledge query method based on federal context learning and a large model agent. The method comprises the following steps: S1, each client generates a local knowledge summary through a knowledge summary generation module based on a large model; s2, each client transmits the generated knowledge outline to a central server; s3, the central server splices and aggregates all the collected local knowledge outline to create a global knowledge outline; s4, the central server issues the global knowledge outline to all clients; and S5, the client converts the received global knowledge outline into a vector database for data storage, and a large model agent of the client is combined with retrieval enhancement generation to realize the global knowledge outline, and corresponding knowledge acquisition is realized according to the requirements of the user. According to the method, model design is used for knowledge learning generated based on retrieval enhancement, the problems of bandwidth, calculation requirements and data isomerism of large model agent federated learning are effectively solved, and an efficient federated learning process with excellent performance can be provided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of federated learning of large model intelligent agents, and in particular to a knowledge query method based on federated context learning and large model intelligent agents. Background Art

[0002] Large models often have more than billions of parameters and are trained on massive amounts of data, which gives them many capabilities that traditional small models do not have, including the ability to use tools as agents. Through the use of tools, large models can provide a lot of help to humans in daily life, including weather queries, travel planning, and so on. However, the performance of large model agents in downstream tasks is often limited by the scarcity of high-quality data. Most data is stored locally and privately, which limits the performance of large language model agents by training with more data. Federated learning has emerged as a promising method that can achieve collaborative improvement of models between multiple clients without directly exchanging private data. In federated learning, knowledge sharing is promoted by aggregating model weights from different clients, which effectively protects data privacy. However, the large number of large model parameters means that the bandwidth required for aggregating large model parameters in federated learning far exceeds the network transmission capacity of mainstream devices. The calculation of the client also poses severe challenges to the computing power equipment, and the heterogeneous data of different users makes the effect of federated learning susceptible to significant negative effects. Therefore, optimizing communication and computing overhead in federated learning and alleviating the impact of data heterogeneity have become urgent tasks.

[0003] Current research has proposed several strategies for optimization, including federated learning algorithms based on efficient parameter fine-tuning methods such as LoRA, and federated learning algorithms based on regularization. However, the current popular algorithms cannot complete training efficiently and effectively in the scenario of federated learning of large model agents. To address these problems, we proposed the first privacy-preserving federated learning algorithm for large model agents based on contextual learning. FICAL includes the following innovations: Designing a local knowledge outline generation module based on large models to generate privacy-preserving knowledge outlines. Proposing the aggregation and distribution of knowledge outlines instead of parameter aggregation in traditional federated learning to significantly reduce communication overhead. Designing a tool learning and use module based on retrieval-enhanced generation to guide large model agents to acquire knowledge and use tools through contextual learning.

[0004] Compared with traditional federated learning, federated learning of large model agents faces several key challenges: 1) The mismatch between high bandwidth consumption and modern communication systems. For example, a popular large model such as LLaMA3.1-405B needs to be transmitted between two distributed nodes for more than ten hours at a typical 100Mbps communication network rate. In federated learning, the amount of data required to share large model parameters between clients and central servers in each round imposes a huge burden on modern communication systems. 2) There is a mismatch between high computational consumption and modern computing hardware. Popular modern large models usually have more than billions of parameters, which are thousands of times larger than traditional models, and the development speed of hardware cannot keep up with this rapid growth. Training these large models is computationally intensive, which not only leads to significantly longer training time, but also incurs significant costs due to the need to obtain GPUs with high processing power and large memory capacity. 3) Heterogeneous data distribution on different clients. Due to differences in user geographic locations or industries, different clients may have non-independent and identically distributed (non-IID) data distributions. This may impair the aggregation of model parameters and further complicate the federated learning process. Summary of the invention

[0005] The purpose of the present invention is to overcome the shortcomings of the prior art and provide a knowledge query method based on federated context learning and large model intelligent agents. The knowledge learning method based on retrieval enhanced generation uses a model design, which effectively reduces the bandwidth and computing requirements of federated learning of large model intelligent agents, and takes into account the heterogeneous data distribution problems of different clients, and can provide an efficient and high-performance federated learning process.

[0006] The object of the present invention is achieved through the following technical solution: a knowledge query method based on federated context learning and large model agent, comprising the following steps:

[0007] S1. Each client generates a local knowledge summary through a knowledge summary generation module based on a large model;

[0008] S2. Each client transmits the generated knowledge outline to the central server;

[0009] S3. The central server will aggregate all the collected local knowledge outlines to create a global knowledge outline;

[0010] S4. The central server sends the global knowledge outline to all clients;

[0011] S5. The client converts the received global knowledge outline into a vector database for data storage. The client's large model agent combines retrieval enhancement generation to realize the global knowledge outline and obtain corresponding knowledge according to user needs.

[0012] The beneficial effects of the present invention are: the present invention is based on the knowledge learning usage model design of retrieval-enhanced generation, which effectively reduces the bandwidth and computing requirements of large-model intelligent agent federated learning, and solves the problem of data heterogeneity (here it means that the data distribution of different clients is different. For example, some users have more data for a certain tool, and some users have more data for another tool. The difference in data distribution often causes a decline in the effect of federated learning). It can provide an efficient and high-performance federated learning process: through the transmission of knowledge outlines, users can learn how to use different tools while protecting each other's privacy, thereby acquiring knowledge, and in the scenario of large models, the communication overhead is greatly reduced, thereby improving the communication efficiency and computing efficiency of the large-model intelligent agent federated learning and the effectiveness of the algorithm. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 is a flow chart of the method of the present invention;

[0014] Figure 2 Generate instruction architecture diagrams for tool knowledge outlines. DETAILED DESCRIPTION

[0015] The technical solution of the present invention is further described in detail below in conjunction with the accompanying drawings, but the protection scope of the present invention is not limited to the following.

[0016] The purpose of the present invention is to effectively deal with the challenges of high bandwidth, high computing volume, data heterogeneity, etc. of federated learning of large-model intelligent agents, so as to improve the algorithm effect of federated learning and reduce resource consumption. From the perspective of architecture, the present invention includes a local knowledge outline generation module, a global knowledge outline generation module, and a tool learning and utilization module. On the technical level, the present invention adopts federated learning technology, contextual learning technology, retrieval enhancement generation technology and large model technology, and makes full use of the contextual learning ability of large models. Through the combination of federated learning and contextual learning, the performance of user request response is improved, and the communication consumption in federated learning is greatly reduced. Federated learning utilizes but does not leak the data of different users. In this application, it is reflected in the use of knowledge outlines issued by different users, but the user's own data (that is, each user's private "question-answer" data) will not be leaked. Specifically:

[0017] like Figure 1 As shown, a knowledge query method based on federated context learning and large model agent includes the following steps:

[0018] S1. Each client generates a local knowledge summary through a knowledge summary generation module based on a large model;

[0019] S101: Generate local tool knowledge outline instructions. Contains system instructions, examples of user questions and corresponding answers (including the name of the tool to be used and the correct input parameters for using the tool), tool name generation instructions, tool detailed description generation instructions, tool usage scenario generation instructions, tool precautions generation instructions, and tool interaction and collaboration generation instructions. Among them, the tool detailed description generation instructions are used to help users clearly understand the main functions and uses of the tool. The tool usage scenario is used to help the large model agent understand the effectiveness of the tool in specific situations and ensure that the appropriate tool is selected to solve specific problems. Tool precautions guide the large model agent on how to use the tool effectively and avoid erroneous requests, thereby improving the performance of the application. Tool interaction and collaboration information guides the large model agent to chain calls to the tool to solve the problem. The tool knowledge outline generation instruction architecture is as follows Figure 2 shown.

[0020] S102: The local tool knowledge outline instruction is input into the big model, and the big model generates the knowledge outline according to the input instruction. The present invention utilizes the big model architecture in advanced artificial intelligence technology to achieve efficient and accurate knowledge outline generation. The big model refers to a deep learning model with a large number of parameters, which is usually pre-trained with a large-scale data set to capture complex data patterns. The big model DeepSeek-v2 used in the present invention is a hybrid expert model based on the Transformer architecture, which performs well in the field of natural language processing and has the ability to capture long-distance dependencies (supporting a context length of 128K tokens) while having economical training costs and efficient reasoning capabilities. When receiving a user request, the hybrid expert model intelligently and sparsely activates different experts to answer according to the different fields to which the user request belongs, thereby accelerating reasoning and reducing costs. The big model is pre-trained on massive text data to learn language rules, contextual relationships and other complex semantic features. When the local knowledge outline is received, the text will first be sent to the input processing system of the model, where the text will be segmented and converted into token IDs, and then converted into embedded vectors. Then the model uses Rotary Position Embedding (ROPE) for position encoding. The model effectively captures the dependencies between words at different positions in the sequence through the Multi-head Latent Attention (MLA) module, and flexibly handles local tool knowledge outline instructions of non-fixed length in the sequence. After receiving the local tool knowledge outline instruction, the large model can quickly understand the instruction intent and generate the knowledge outline of the corresponding field based on its rich knowledge obtained by pre-training, significantly improving the quality and accuracy of the generated content. The content of the knowledge outline includes the following parts: tool name; tool description, which contains a detailed description of the tool, such as the platform supported by the tool, what problems the tool is designed to solve, on which operating systems or hardware the tool can run, how the tool implements data encryption, privacy protection and other security measures, the tool usage process, etc.; tool usage scenario, which contains the possible situations in which the tool should be used to improve the quality of the large model agent's response; precautions, which contains details that need to be paid attention to when using the tool, such as the frequency limit of tool requests, the data format of tool input data, the version information of tool calls, the permissions required to call the tool, etc.

[0021] S2. Each client transmits the generated knowledge outline to the central server;

[0022] S3. The central server will aggregate all the collected local knowledge outlines to create a global knowledge outline;

[0023] The central server collects the local knowledge compendiums ζ1,ζ2,…,ζ1 from all users of the federated learning system (the system can be considered as the central server and the client). n Then the collected local knowledge outlines are spliced ​​to obtain the global knowledge outline ζ global :

[0024] ζ global ={ζ1,ζ2,…,ζ n}

[0025] S4. The central server sends the global knowledge outline to all clients;

[0026] S5. The client converts the received global knowledge outline into a vector database for data storage. The client's large model agent combines retrieval enhancement generation to realize the global knowledge outline and obtain corresponding knowledge according to user needs.

[0027] S501: Using the deep neural network-based embedding model bge-large-en-v1_5, the global knowledge outline is stored as a vector database, and the processed knowledge outline is converted into a multi-dimensional vector representation. This embedding model learns semantic and structural information based on a neural network architecture (such as Transformer), embedding semantic similarity and contextual relationships into the vector representation. The generated vector data is stored in the vector database for subsequent storage and retrieval operations. The vector database also supports real-time updates, batch insertions, and complex query optimization mechanisms to ensure that the storage and retrieval of large-scale knowledge entries are efficient, scalable, and accurate. Through this process, the vectorized management of global knowledge entries is achieved, so that the matching, retrieval, and reasoning operations of related knowledge can be completed quickly and efficiently in the vector space, greatly improving the availability and intelligence of the knowledge base.

[0028] S502: When receiving a user request, first use the embedding model bge-large-en-v1_5 to convert the user request into a multidimensional vector. Then use the converted multidimensional vector and the knowledge outline vector stored in the vector database in the previous step to calculate the similarity. Here, metrics such as cosine similarity or Jaccard similarity are used to evaluate the similarity between the request vector and the stored vector to determine the most relevant knowledge items. The most matching knowledge items are selected as context information based on a preset threshold or sorting mechanism. This information contains the relevant knowledge of the specific tools and technologies required to complete a specific request, and contains the knowledge outline information of the specific required tools, such as tool name, tool description, tool usage scenario, tool usage precautions, etc. Then combine the selected context information with the original user request to generate an input sequence containing relevant knowledge outline information and specific requirements. After receiving the relevant input sequence, the large model agent can obtain the knowledge required for the relevant use of the tool through context learning, thereby achieving the purpose of tool learning. The large model outputs the tool name and input parameters required for the tool call, and calls the corresponding tool to complete the user's request.

[0029] In the embodiments of the present patent application, compared with the traditional solutions, the performance of the present invention significantly exceeds the existing solutions. In a large number of experiments, the present invention has achieved significant improvements in multiple key indicators, and the method of the present invention is recorded as FICAL. Specifically, FICAL has achieved a 26.09% to 43.48% improvement in tool call accuracy compared with the existing popular federated learning algorithms FedACG, FedDecorr, FedLoRA, FedAdam, FedYogi, and FedProx under the default settings. At the same time, compared with the O(N) communication overhead in the baseline algorithm that increases linearly with the number of model parameters, FICAL reduces the linear overhead to O(1), and achieves a 3.33×10^5 times reduction in communication overhead under the use setting of the LLaMA-3 8b model.

[0030] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the above embodiments, it is still possible for a person skilled in the art to modify the methods described in the above embodiments, such as changing the names of the methods, etc. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A knowledge query method based on federated context learning and large model agent, characterized by: The following steps are involved: S1. Each client generates a local knowledge summary through a knowledge summary generation module based on a large model; S2. Each client transmits the generated knowledge outline to the central server; S3. The central server will aggregate all the collected local knowledge outlines to create a global knowledge outline; S4. The central server sends the global knowledge outline to all clients; S5. The client converts the received global knowledge outline into a vector database for data storage. The client's large model agent combines retrieval enhancement generation to realize the global knowledge outline and obtain corresponding knowledge according to user needs.

2. A knowledge query method based on federated context learning and large model agent according to claim 1, characterized in that: The step S1 comprises: S101. Generate local tool knowledge outline instructions, including: System instructions, containing user questions and corresponding answer tool name generation instructions; Tool description generation instructions are used to help users clearly understand the main functions and uses of the tool; Tool usage scenarios generate instructions to help large model agents understand the effectiveness of tools and ensure that the appropriate tool is selected to solve the problem; Tool considerations generate instructions for large model agents on how to use tools effectively and avoid erroneous requests, thereby improving application performance; Tools interact and collaborate to generate instructions to guide large-scale intelligent agents to solve problems by chaining calls to tools; S102. Input the local tool knowledge outline instruction into the big model, and the big model generates the knowledge outline according to the input instruction: The big model used is DeepSeek-v2. After receiving the local tool knowledge outline instruction, the big model generates a knowledge outline of the corresponding field based on the rich knowledge obtained through pre-training.

3. A knowledge query method based on federated context learning and large model agent according to claim 2, characterized in that: The content of the knowledge outline includes: tool name, tool description, precautions for tool usage scenarios, data format of tool input data, version information of tool call, and permissions required to call the tool.

4. The knowledge query method based on federated context learning and large model agent according to claim 1, characterized in that: The step S3 comprises: The central server collects all users’ local knowledge compendiums ζ1,ζ2,…,ζ from each client n , then the collected local knowledge outlines are spliced ​​to obtain the global knowledge outline ζ global : g global ={ζ1,ζ2,...,ζ n }。 5. The knowledge query method based on federated context learning and large model agent according to claim 1, characterized in that: The step S5 comprises: S501: using the deep neural network-based embedding model bge-large-en-v1_5, the global knowledge outline is stored as a vector database, and the processed knowledge outline is converted into a multi-dimensional vector representation; This embedding model is based on a neural network architecture to learn semantic and structural information, embedding semantic similarity and contextual relationships into vector representations; Store the generated vector data into a vector database to facilitate subsequent storage and retrieval operations; The vector database supports real-time updates, batch insertions, and complex query optimization mechanisms. S502: When receiving a user request, first use the embedding model bge-large-en-v1_5 to convert the user request into a multi-dimensional vector; then use the converted multi-dimensional vector and the knowledge outline vector stored in the vector database in the previous step to perform similarity calculation: The best matching knowledge item is selected as context information according to a preset threshold or sorting mechanism. The context information contains the relevant knowledge of the specific tools and technologies required to complete the request, and includes the knowledge outline information of the required tools; Then, the selected context information is combined with the original user request to generate an input sequence containing relevant knowledge outline information and specific requirements; After receiving the relevant input sequence, the large model agent can acquire the knowledge needed to use the relevant tools through context learning, thereby achieving the purpose of tool learning; The large model outputs the tool name and input parameters required for calling the tool, and calls the corresponding tool to complete the user's request.

6. The knowledge query method based on federated context learning and large model agent according to claim 5, characterized in that: The similarity calculation uses a cosine similarity or Jaccard similarity metric to evaluate the similarity between the request vector and the stored vector.