A data generation method and system based on multi-agent large language model

By building a multi-agent large language model, including decision makers, commentators, executors and summaries, the problems of inefficient and unstable quality of industry research report writing are solved, and efficient, diverse and accurate report generation is achieved. .

CN118709680BActive Publication Date: 2024-12-06HAOSHEN TECH (BEIJING) CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202410893052.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-04
Publication Date
2024-12-06
Estimated Expiration
2044-07-04

AI Technical Summary

Technical Problem

Existing industry research reports mainly rely on manual writing, which has problems such as long writing cycles, high costs and uneven quality. Most report generation methods are based on a single language model, and the illusion and single perspective problems of the model cannot be avoided.

Method used

Using a data generation method based on the multi-agent large language model, decision makers, commentators, executors and summaries are built, and by fine-tuning the models of decision makers and commentators, they generate industry research reports that meet the requirements.

Benefits of technology

Improve the efficiency and quality of the report writing, avoid the limitations of a single agent, and generate more diverse and accurate reports.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118709680B_ABST
    Figure CN118709680B_ABST
Patent Text Reader

Abstract

The present invention discloses a data generation method and system based on a multi-agent large language model, and relates to the field of data processing technology. The method comprises: building a multi-agent architecture; collecting existing industry research reports, constructing decision maker agent training data and commentator agent training data; fine-tuning the decision maker agent large language model; fine-tuning the commentator agent large language model; deploying a multi-agent system; receiving a report generation instruction, and calling the multi-agent system to generate the final industry research report. The present invention uses industry research report data to perform large language model fine-tuning training, and builds an industry research report generation system that is collaboratively operated by multiple agents, avoiding the limitations of a single agent and improving the efficiency and quality of report writing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a data generation method and system based on a multi-agent large language model. Background Art

[0002] Industry research reports are documents that analyze the current status, development trends, and competitors of an industry. They are an important way for investors, corporate decision makers, and other positions to obtain industry information. However, currently, industry research reports are mainly written manually, which has problems such as long writing cycles, high writing costs, and uneven writing quality.

[0003] With the development of large language models, it is possible to generate industry research reports using large language models, but most current report generation methods are still based on a single language model, which cannot avoid the model's hallucination and single perspective problems. To address this, the present invention proposes a data generation method and system based on a multi-agent large language model. Summary of the invention

[0004] The present invention provides a data generation method and system based on a multi-agent large language model, comprising:

[0005] S10. Build a multi-agent architecture, including building a decision maker agent, a commentator agent, an executor agent, and a summarizer agent;

[0006] S20. Collect existing industry research reports, and construct decision maker agent training data and commentator agent training data based on the existing industry research reports;

[0007] S30, inputting the decision maker agent training data into the decision maker agent large language model, and fine-tuning the decision maker agent large language model so that the decision maker agent large language model generates decision content that meets the requirements;

[0008] S40, inputting the critic agent training data into the critic agent large language model, and fine-tuning the critic agent large language model to minimize the difference between the generated decision content and the standard decision content;

[0009] S50, deploying a multi-agent system to generate industry research reports;

[0010] S60. Receive instructions for generating an industry research report, call the multi-agent system, and the fine-tuned decision-maker agent in the multi-agent system generates decision content that meets the requirements according to the instructions. The executor agent generates a task execution structure according to the decision content of the decision-maker agent; the summarizer agent generates the final industry research report according to the decision content of the decision-maker agent and the task execution structure of the executor agent.

[0011] As described above, a data generation method and system based on a multi-agent large language model, wherein training data for a decision maker agent and a critic agent are constructed, is specifically divided into the following sub-steps:

[0012] Collect existing industry research reports;

[0013] Label decision data from existing industry research reports as training data for decision-maker agents;

[0014] Generate incorrect decision data based on the labeled decision data as training data for the critic agent.

[0015] As described above, a data generation method and system based on a multi-agent large language model, wherein after obtaining an existing industry research report, the standard output of the decision-maker agent corresponding to the existing industry research report is extracted, and according to the structure of the existing industry research report, the theme T, structure S and the summary Y of each link are extracted, and the extracted data constitutes the training data D1 = (T, S, Y) of the decision-maker agent.

[0016] As described above, a data generation method and system based on a multi-agent large language model is used, in which the structure S extracted from an existing industry research report is subjected to a sequence permutation and link deletion operation O to obtain the deleted and modified erroneous structure S′ and the corresponding summary Y′, and the corresponding erroneous decision and error type data, i.e., the training data D2 = (T, S′, Y′, O) of the commentator agent.

[0017] As described above, a data generation method and system based on a multi-agent large language model, wherein the multi-agent system provides services through an API interface, calls the API interface, inputs the subject of the industry report, and the decision-maker agent receives instructions for generating the industry research report, determines the structure of the industry report according to the subject, and generates summaries for all aspects of the report; the commentator agent evaluates and modifies the decision content of the decision-maker agent to regenerate a more complete subject, structure and content; the executor agent queries information and generates the content of each link of the report according to the instructions of the decision-maker agent, and performs self-reflection to modify the generated results; the summarizer agent summarizes the report content according to the commands of the decision-maker agent and the task execution structure of the executor agent to generate the final industry research report.

[0018] This article also provides a data generation system based on a multi-agent large language model, including: a multi-agent building module, a data acquisition and processing module, a fine-tuning module, a deployment module, and a calling module.

[0019] Multi-agent building module: used to build a multi-agent architecture, including building a decision maker agent, a commentator agent, an executor agent, and a summarizer agent.

[0020] Data collection and processing module: used to collect data from existing industry research reports, and to construct decision maker agent training data and commentator agent training data based on existing industry research reports.

[0021] Fine-tuning module: used to input training data into the corresponding intelligent agent large language model that needs fine-tuning, and fine-tune the model. The fine-tuned intelligent agent large language model includes the decision maker intelligent agent large language model and the critic intelligent agent large language model.

[0022] Deployment module: used to deploy the fine-tuned decision maker agent large language model and critic agent large language model into the multi-agent architecture.

[0023] Calling module: used to receive the input command for generating an industry research report and call the multi-agent system. The fine-tuned decision-maker agent in the multi-agent system generates decision content that meets the requirements according to the instructions, and the executor agent generates a task execution structure according to the decision content of the decision-maker agent; the summarizer agent generates the final industry research report according to the decision content of the decision-maker agent and the task execution structure of the executor agent.

[0024] As described above, a data generation system based on a multi-agent large language model, in which training data for a decision maker agent and a critic agent are constructed, is specifically divided into the following sub-steps:

[0025] Collect existing industry research reports;

[0026] Label decision data from existing industry research reports as training data for decision-maker agents;

[0027] Generate incorrect decision data based on the labeled decision data as training data for the critic agent.

[0028] As described above, a data generation system based on a multi-agent large language model is described, in which after obtaining an existing industry research report, the standard output of the decision-maker agent corresponding to the existing industry research report is extracted, and according to the structure of the existing industry research report, the theme T, structure S and the summary Y of each link are extracted, and the extracted data constitutes the training data D1 = (T, S, Y) of the decision-maker agent.

[0029] As described above, a data generation system based on a multi-agent large language model is used, in which the structure S extracted from an existing industry research report is subjected to a sequence permutation and link deletion operation O to obtain the deleted and modified erroneous structure S′ and the corresponding summary Y′, and the corresponding erroneous decision and error type data, i.e., the training data D2 = (T, S′, Y′, O) of the commentator agent.

[0030] As described above, a data generation system based on a multi-agent large language model is described, wherein the multi-agent system provides services through an API interface, calls the API interface, inputs the subject of the industry report, and the decision-maker agent receives instructions for generating the industry research report, determines the structure of the industry report according to the subject, and generates summaries for all aspects of the report; the commentator agent evaluates and modifies the decision content of the decision-maker agent to regenerate a more complete subject, structure, and content; the executor agent queries information and generates the content of each link of the report according to the instructions of the decision-maker agent, and performs self-reflection to modify the generated results; the summarizer agent summarizes the report content according to the commands of the decision-maker agent and the task execution structure of the executor agent to generate the final industry research report.

[0031] The beneficial effects achieved by the present invention are as follows: The present invention uses industry research report data to fine-tune the large language model and builds an industry research report generation system that is collaboratively operated by multiple intelligent agents, avoiding the limitations of a single intelligent agent, improving the efficiency and quality of report writing, and has high value. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0033] Figure 1 This is a flow chart of a data generation method based on a multi-agent large language model provided in Example 1 of the present application.

[0034] Figure 2 This is a schematic diagram of a data generation system based on a multi-agent large language model provided in Example 2 of the present application. DETAILED DESCRIPTION

[0035] The following is a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0036] Embodiment 1

[0037] like Figure 1 As shown, the first embodiment of the present application provides a method for generating an industry research report based on a large language model and multiple agents, including:

[0038] S10. Build a multi-agent architecture, including building a decision maker agent, a commentator agent, an executor agent, and a summarizer agent.

[0039] The multi-agent system constructed by the present invention includes a decision-maker agent, a commentator agent, an executor agent and a summarizer agent. Among them, the decision-maker agent is responsible for determining the structure of the industry report and generating summaries for all links of the industry research report; the commentator agent is responsible for evaluating and modifying the decision content of the decision-maker agent so that it can regenerate a more complete theme, structure and content; the executor agent is responsible for querying information and generating the content of each link of the report according to the instructions of the decision-maker agent, and self-reflection to modify the generated results; the summarizer agent summarizes the report content according to the command of the decision-maker agent and the task execution structure of the executor agent to generate the final industry research report.

[0040] Build workflows for each agent's tasks and design corresponding prompts: Decision maker agent Prompt decide , the critic agent Prompt criticize , executor agent Prompt execute , Summarizer Agent Prompt summarize .

[0041] S20. Collect existing industry research reports, and construct decision maker agent training data and commentator agent training data based on the existing industry research reports.

[0042] Constructing training data for the decision maker agent and the critic agent is divided into the following sub-steps:

[0043] S21. Collect existing industry research reports.

[0044] In order to obtain data for training decision maker agents and commentator agents, we first need to collect real data from industry research reports. This data can be obtained from websites, academic databases, forums and conference materials, libraries, corporate websites and annual reports, news media and business publications, and professional social groups. It can be existing industry research reports, industry news, and industry analysis.

[0045] S22. Label decision data from existing industry research reports as training data for decision-making agents.

[0046] After obtaining the industry report, extract the standard output of the decision-maker agent corresponding to the industry report. It is divided into the following sub-steps:

[0047] S221. First, determine the structured information to be extracted based on the structure of the industry research report, and extract the theme, structure and summary of each link of the industry research report.

[0048] S222. Design specific labels for each information category, with the theme as T, the structure as S, and the summary of each link as Y.

[0049] S223. Write detailed annotation guidelines for identifying and labeling each type of information, including distinguishing summary paragraphs from detailed analysis and dealing with ambiguous or contradictory information.

[0050] S224. Use annotation tools or self-built web interface to perform annotation work, proceed part by part according to the logical structure of the industry research report, and perform multiple iterations to ensure that all key information is correctly labeled.

[0051] S225. Perform multiple rounds of quality checks, including self-checks, cross-checks, and expert reviews. Use built-in or third-party quality control tools to monitor annotation consistency and accuracy.

[0052] S226. After labeling is completed, the data is organized into a structured format to facilitate subsequent data use and processing.

[0053] The extracted data constitutes the training data D1 = (T, S, Y) of the decision maker agent.

[0054] S23. Generate erroneous decision data based on the labeled decision data as training data for the critic agent.

[0055] In order to train the reviewer agent, it is necessary to generate some wrong decision data to improve the reviewer agent's ability to modify these wrong decision data. The source of the wrong data is to perform operations O such as sequence permutation and link deletion on the annotated structure S to obtain the deleted and modified wrong structure S' and the corresponding summary Y'. Finally, the corresponding wrong decision and error type data D2 = (T, S', Y', O) are obtained.

[0056] S30, inputting the decision maker agent training data into the decision maker agent large language model, and fine-tuning the decision maker agent large language model so that the decision maker agent large language model generates decision content that meets the requirements.

[0057] In order to enable the decision-maker agent large language model to generate decision content that meets the requirements, it needs to be fine-tuned. The fine-tuning method is to input the training data D1 of the decision-maker agent obtained by S22 into the large language model, and adjust the model parameters by minimizing the difference between the generated decision content and the standard decision content through supervised fine-tuning technology and low-rank adaptive technology.

[0058] The supervised fine-tuning technique uses a labeled training dataset to fine-tune the model, improving the model's performance in a specific domain. The fine-tuning process is as follows: Feed the labeled input data into the decision-making agent large language model to obtain the predicted output; use the selected loss function to calculate the gap between the predicted output and the true label; calculate the gradient of the loss with respect to the model parameters; use the optimization algorithm to update the model parameters according to the gradient and the set learning rate; perform iterative training until the performance of the model on the validation set no longer improves significantly or reaches the preset number of training rounds.

[0059] The low-rank adaptation technique uses matrix factorization to map the originally high-dimensional parameter updates to a low-dimensional space, approximating the complete weight update through the product of two low-rank matrices, thereby reducing the computational complexity and memory footprint.

[0060] Specifically, for all fully connected layers W in the decision-making agent large language model, construct a trainable low-rank matrix ΔW = BA, and replace the original W matrix with W' = W + ΔW, where W' represents the modified weight matrix, the W matrix parameters are fixed, A is a projection matrix from the original dimension to the low-rank dimension, and B is an adaptation matrix that restores from the low-rank dimension to the original dimension. B is an n×k matrix, A is a k×m matrix, n is the input dimension, m is the output dimension, and k is the rank of the low-rank matrix. B ∈ R r×z ,A ∈ R d×r ,W ∈ R d×z ,where d is the original dimension, r << z is the low-rank dimension, r << min(d, k), and r is much smaller than the number of rows and columns of W.

[0061] The fine-tuning of the decision-making agent large language model is specifically divided into the following sub-steps:

[0062] S31. Take the decision-making agent prompt Prompt decide and the topic in the decision-making agent training data as input data, and take the structure and the summary of each link in the decision-making agent training data as labels, and input them into the decision-making agent large language model to generate the decision-making agent large language model conditional probability.

[0063] For each decision-making agent training data D 1i = (T i , S i , Y i ), where T i is the topic, S i is the structure, and Y i is the summary of each link. Take T i and the prompt Prompt decide as inputs, and S i , Y iAs labels, the labeled data D 1i The model predicts the input data and generates the conditional probability p(S i , Y i |T i , Prompt decide ).

[0064] S32. Use the cross entropy loss function to calculate the loss between the predicted output and the actual data.

[0065] The cross entropy loss function is used to evaluate the inconsistency between the model prediction output and the true label. The cross entropy loss function is L decide =-log p1(S i , Y i |T i , Prompt decide ), where L decide Represents the value of the cross entropy loss function.

[0066] S33. Calculate the gradient of the loss relative to the model parameters and minimize the cross entropy loss function.

[0067] Calculate the loss L decide Derivative of the predicted output p1: y represents the real data. This derivative shows how p1 affects the loss L decide Changes in: When p1 approaches y, the derivative of the loss function approaches zero, which means that the rate of loss reduction slows down; when p1 moves away from y, the absolute value of the derivative increases, pushing p1 to move in the y direction to reduce the loss.

[0068] The model’s predicted output p1 is a function of the parameter θ, i.e., p1 = σ(z), where z = w T x+b, σ is the sigmoid function, w and b are weights and biases respectively, x is the input feature vector, T is the transpose of the matrix, w T represents the transpose of w, that is, the column vector is converted into a row vector and matrix multiplication is performed. The derivative of the sigmoid function is σ(z)(1-σ(z)), so the derivative with respect to z is:

[0069]

[0070] Therefore, the gradient of the model parameter θ is:

[0071] For weight w, the gradient is Therefore the partial derivative of z with respect to w is x.

[0072] For bias b, the gradient is Therefore z is directly related to b, and the partial derivative is 1.

[0073] S34. Use the optimization algorithm to update the model parameters according to the gradient and the set learning rate.

[0074] The parameters of the decision-maker agent model are adjusted by minimizing the loss function using an optimization algorithm. The update step of the optimization algorithm involves calculating the first-order moment (momentum) m t and the second moment (variance) v t , and then update the parameters θ.

[0075] First moment: m t =β1*m t-1 +(1-β1)*g t , m t Represents the estimated value of the first-order moment (momentum) at time step t. β1 is the attenuation factor of the first-order moment, which is usually close to but less than 1, controlling the influence of past gradients. t-1 is the first-order moment estimate at the previous time step t-1. t is the gradient at time step t, that is, with respect to the loss function L decide The derivative with respect to the model parameter θ 1-β1 represents the current gradient g t The proportion in the update means that the contribution of the new gradient is added to the previously accumulated momentum in a certain proportion. This formula reflects how to combine past gradient information (through momentum) to smooth the gradient estimate, thereby helping the optimization process to be more stable and better able to cross the valley of the loss function.

[0076] Second order moment: v t Represents the estimated value of the second-order moment at time t, which is used to approximate the variance of the gradient or the uncentered second-order moment. β2 is the decay factor of the second-order moment, which is usually close to but less than 1 (for example, 0.999) and is used to control the decay rate of the square of the historical gradient. t-1 is the second-order moment estimate at the previous time t-1. t is the gradient at time t, that is, with respect to the loss function L decide The derivative with respect to the model parameter θ 1-β2 determines the current gradient square The ratio in the update means that the new squared gradient information is added to the previous accumulation at a certain ratio.

[0077] Deviation correction: In order to eliminate the deviation caused by the momentum decay factor (β1 and β2) being initialized to 0, the first-order moment and the second-order moment will be corrected. The formula for deviation correction is as follows:

[0078] First-order moment deviation correction: is the corrected first-order moment estimate, mt is the uncorrected first-order moment estimate, β1 is the first-order momentum decay rate, and t is the number of steps in the current iteration.

[0079] Second-order moment deviation correction: is the corrected second-order moment estimate, v t is the uncorrected second-order moment estimate, β2 is the second-order momentum decay rate, and t is the number of steps in the current iteration.

[0080] Parameter update: Apply weight decay directly to the parameters. The specific formula is θ t+1 is the updated parameter, θ t is the parameter before updating, η is the learning rate, is the corrected first-order moment estimate, is the corrected second-order moment estimate, λ is the weight attenuation coefficient, and ∈ is a small constant (such as 10 -8 ) is used for numerical stability.

[0081] S35. Perform iterative training until the performance of the model on the validation set no longer improves significantly or reaches the preset training rounds.

[0082] S40. Input the critic agent training data into the critic agent large language model, and fine-tune the critic agent large language model to minimize the difference between the generated decision content and the standard decision content.

[0083] In order to enable the critic agent large language model to generate decision content that meets the requirements, it needs to be fine-tuned. Fine-tuning uses D2 = (T, S', Y', O) as data, and uses supervised fine-tuning technology and low-rank adaptive technology to minimize the difference between the generated decision content and the standard decision content to adjust the model parameters.

[0084] Fine-tuning the large language model of the critic agent is divided into the following sub-steps:

[0085] S41, prompt the commentator agent criticize The topics in the critic agent training data are taken as input data, the structure in the critic agent training data and the summary of each link are taken as labels, and input into the critic agent large language model to generate the conditional probability of the critic agent large language model.

[0086] For each reviewer agent training data D 2i =(T i , S′ i , Y′ i , O i ), where T i For the theme, S′i is the wrong structure after deletion, Y′ i For the revised error summary, T i , S′ i , Y′ i and the prompt word Prompt criticize As input, O i As labels, the labeled data D 2i The model predicts the input data and generates the conditional probability p(O i |S′ i , Y′ i , T i , Prompt criticize ).

[0087] S42. Use the cross entropy loss function to calculate the loss between the predicted output and the actual data.

[0088] The cross entropy loss function is used to evaluate the inconsistency between the model prediction output and the true label. The cross entropy loss function is L criticize =-log p2(O i |S′ i , Y′ i , T i , Prompt criticize ), where L criticize Represents the value of the cross entropy loss function.

[0089] S43. Calculate the gradient of the loss relative to the model parameters and minimize the cross entropy loss function.

[0090] Calculate the loss L criticize The derivative of the predicted output p2: y represents the real data. This derivative shows how p2 affects the loss L criticize Changes in: When p2 approaches y, the derivative of the loss function approaches zero, which means that the rate of loss reduction slows down; when p2 moves away from y, the absolute value of the derivative increases, pushing p2 to move in the y direction to reduce the loss.

[0091] The model’s predicted output p2 is a function of the parameter θ, i.e., p2 = σ(z), where z = w T x+b, σ is the sigmoid function, w and b are weights and biases respectively, x is the input feature vector, T is the transpose of the matrix, w T represents the transpose of w, that is, the column vector is converted into a row vector and matrix multiplication is performed. The derivative of the sigmoid function is σ(z)(1-σ(z)), so the derivative with respect to z is:

[0092]

[0093] Therefore, the gradient of the model parameter θ is:

[0094] For weight w, the gradient is Therefore the partial derivative of z with respect to w is x.

[0095] For bias b, the gradient is Therefore z is directly related to b, and the partial derivative is 1.

[0096] S44. Use an optimization algorithm to update model parameters according to the gradient and the set learning rate.

[0097] The parameters of the decision-maker agent model are adjusted by minimizing the loss function using an optimization algorithm. The update step of the optimization algorithm involves calculating the first-order moment (momentum) m t and the second moment (variance) v t , and then update the parameters θ.

[0098] First moment: m t =β1*m t-1 +(1-β1)*g t , m t Represents the estimated value of the first-order moment (momentum) at time step t. β1 is the attenuation factor of the first-order moment, which is usually close to but less than 1, controlling the influence of past gradients. t-1 is the first-order moment estimate at the previous time step t-1. t is the gradient at time step t, that is, with respect to the loss function L criticize The derivative with respect to the model parameter θ 1-β1 represents the current gradient g t The proportion in the update means that the contribution of the new gradient is added to the previously accumulated momentum in a certain proportion. This formula reflects how to combine past gradient information (through momentum) to smooth the gradient estimate, thereby helping the optimization process to be more stable and better able to cross the valley of the loss function.

[0099] Second moment: v t Represents the estimated value of the second-order moment at time t, which is used to approximate the variance of the gradient or the uncentered second-order moment. β2 is the decay factor of the second-order moment, which is usually close to but less than 1 (for example, 0.999) and is used to control the decay rate of the square of the historical gradient. t-1 is the second-order moment estimate at the previous time t-1. t is the gradient at time t, that is, with respect to the loss function L criticize The derivative with respect to the model parameter θ 1-β2 determines the current gradient square The ratio in the update means that the new squared gradient information is added to the previous accumulation at a certain ratio.

[0100] Deviation correction: In order to eliminate the deviation caused by the momentum decay factor (β1 and β2) being initialized to 0, the first-order moment and the second-order moment will be corrected. The formula for deviation correction is as follows:

[0101] First-order moment deviation correction: is the corrected first-order moment estimate, m t is the uncorrected first-order moment estimate, β1 is the first-order momentum decay rate, and t is the number of steps in the current iteration.

[0102] Second-order moment deviation correction: is the corrected second-order moment estimate, v t is the uncorrected second-order moment estimate, β2 is the second-order momentum decay rate, and t is the number of steps in the current iteration.

[0103] Parameter update: Apply weight decay directly to the parameters. The specific formula is θ t+1 is the updated parameter, θ t is the parameter before updating, η is the learning rate, is the corrected first-order moment estimate, is the corrected second-order moment estimate, λ is the weight attenuation coefficient, and ∈ is a small constant (such as 10 -8 ) is used for numerical stability.

[0104] S45. Perform iterative training until the performance of the model on the validation set no longer improves significantly or reaches the preset training rounds.

[0105] S50. Deploy a multi-agent system to generate industry research reports.

[0106] After completing fine-tuning of the decision maker agent and the critic agent, updating the corresponding models to the multi-agent system is divided into the following sub-steps:

[0107] S51. In order to reduce the computing resource consumption of the model and improve the reasoning speed, the model is compressed, including weight pruning, quantization, and knowledge distillation.

[0108] S52. Perform format conversion to convert the model from the framework used in the training environment to a format suitable for deployment in the production environment, usually in ONNX or TensorRT format, to facilitate cross-platform deployment and optimization.

[0109] S53. Perform environment configuration and dependency management. Prepare the production environment, including servers, cloud services, or edge devices, to ensure that they have the hardware resources and software environment required to run the model. Install necessary dependency packages and libraries to ensure compatibility between the production environment and the model training environment.

[0110] S54. Design RESTful API or gRPC service interface according to the application scenario and define the input and output formats to facilitate calls from other systems.

[0111] S55. Use Docker container technology to package the model and its operating environment to achieve environmental consistency and facilitate deployment and migration.

[0112] S56. Deploy containerized applications to Kubernetes clusters, cloud services, or other server management systems to realize model service.

[0113] S57. Implement a monitoring system to track the model's prediction latency, resource usage, and error logs to ensure stable service operation. Record request logs and model outputs to facilitate subsequent analysis of model performance and optimization.

[0114] S60. Receive instructions for generating an industry research report, call the multi-agent system, and the fine-tuned decision-maker agent in the multi-agent system generates decision content that meets the requirements according to the instructions. The executor agent generates a task execution structure according to the decision content of the decision-maker agent; the summarizer agent generates the final industry research report according to the decision content of the decision-maker agent and the task execution structure of the executor agent.

[0115] This system model has undergone adaptive training and possesses knowledge in the field of industry research reports. The system provides services through an API interface. Users input the theme of the industry report by calling the API interface. The decision-maker agent receives instructions for generating the industry research report, determines the structure of the industry report based on the theme, and generates summaries for all aspects of the report. The reviewer agent evaluates and modifies the decision content of the decision-maker agent to regenerate a more complete theme, structure, and content. The executor agent queries data and generates the content of each link of the report according to the instructions of the decision-maker agent, and conducts self-reflection to modify the generated results. The summarizer agent summarizes the report content according to the command of the decision-maker agent and the task execution structure of the executor agent to generate the final industry research report.

[0116] Embodiment 2

[0117] like Figure 2 As shown, Embodiment 2 of the present application provides a data generation system based on a multi-agent large language model, including:

[0118] Multi-agent building module: used to build a multi-agent architecture, including building a decision maker agent, a commentator agent, an executor agent, and a summarizer agent.

[0119] The multi-agent system constructed by the present invention includes a decision-maker agent, a commentator agent, an executor agent and a summarizer agent. Among them, the decision-maker agent is responsible for determining the structure of the industry report and generating summaries for all links of the industry research report; the commentator agent is responsible for evaluating and modifying the decision content of the decision-maker agent so that it can regenerate a more complete theme, structure and content; the executor agent is responsible for querying information and generating the content of each link of the report according to the instructions of the decision-maker agent, and self-reflection to modify the generated results; the summarizer agent summarizes the report content according to the command of the decision-maker agent and the task execution structure of the executor agent to generate the final industry research report.

[0120] Build workflows for each agent's tasks and design corresponding prompts: Decision maker agent Prompt decide , the critic agent Prompt criticize , executor agent Prompt execute , Summarizer Agent Prompt summarize .

[0121] Data collection and processing module: used to collect data from existing industry research reports, and to construct decision maker agent training data and commentator agent training data based on existing industry research reports.

[0122] 1. Collect existing industry research reports.

[0123] In order to obtain data for training decision maker agents and commentator agents, we first need to collect real data from industry research reports. This data can be obtained from websites, academic databases, forums and conference materials, libraries, corporate websites and annual reports, news media and business publications, and professional social groups. It can be existing industry research reports, industry news, and industry analysis.

[0124] 2. Label decision data from existing industry research reports as training data for decision-making agents.

[0125] After obtaining the industry report, extract the standard output of the decision-maker agent corresponding to the industry report. It is divided into the following sub-steps:

[0126] (1) First, determine the structured information to be extracted based on the structure of the industry research report, and extract the theme, structure, and summary of each link of the industry research report.

[0127] (2) Design specific labels for each information category, with the theme as T, the structure as S, and the summary of each link as Y.

[0128] (3) Develop detailed annotation guidelines for identifying and labeling each type of information, including distinguishing summary paragraphs from detailed analysis and dealing with ambiguous or contradictory information.

[0129] (4) Use annotation tools or a self-built web interface to perform annotation work, proceed part by part according to the logical structure of the industry research report, and perform multiple iterations to ensure that all key information is correctly labeled.

[0130] (5) Implement multiple rounds of quality checks, including self-checks, cross-checks, and expert reviews. Use built-in or third-party quality control tools to monitor the consistency and accuracy of annotations.

[0131] (6) After labeling, organize the data into a structured format to facilitate subsequent data use and processing.

[0132] The extracted data constitutes the training data D1 = (T, S, Y) of the decision maker agent.

[0133] 3. Generate incorrect decision data based on the labeled decision data as training data for the critic agent.

[0134] In order to train the reviewer agent, it is necessary to generate some wrong decision data to improve the reviewer agent's ability to modify these wrong decision data. The source of the wrong data is to perform operations O such as sequence permutation and link deletion on the annotated structure S to obtain the deleted and modified wrong structure S' and the corresponding summary Y'. Finally, the corresponding wrong decision and error type data D2 = (T, S', Y', O) are obtained.

[0135] Fine-tuning module: used to input training data into the corresponding intelligent agent large language model that needs fine-tuning, and fine-tune the model. The fine-tuned intelligent agent large language model includes the decision maker intelligent agent large language model and the critic intelligent agent large language model.

[0136] In order to enable the decision-maker agent large language model to generate decision content that meets the requirements, it needs to be fine-tuned. The fine-tuning method is to input the obtained decision-maker agent training data D1 into the large language model, and adjust the model parameters by minimizing the difference between the generated decision content and the standard decision content through supervised fine-tuning technology and low-rank adaptive technology.

[0137] The supervised fine-tuning technique uses a labeled training dataset to fine-tune the model, so as to improve the performance of the model in a specific field. The fine-tuning process is as follows: Feed the labeled input data into the decision-making agent large language model to obtain the predicted output; use the selected loss function to calculate the gap between the predicted output and the true label; calculate the gradient of the loss with respect to the model parameters; use the optimization algorithm to update the model parameters according to the gradient and the set learning rate; perform iterative training until the performance of the model on the validation set no longer improves significantly or reaches the preset number of training epochs.

[0138] The low-rank adaptation technique uses matrix factorization to map the originally high-dimensional parameter updates to a low-dimensional space, approximating the complete weight update through the product of two low-rank matrices, thereby reducing the computational complexity and memory footprint.

[0139] Specifically, for all fully connected layers W in the decision-making agent large language model, construct a trainable low-rank matrix ΔW = BA, and replace the original W matrix with W′ = W + ΔW, where W′ represents the modified weight matrix, the parameters of the W matrix are fixed, A is a projection matrix from the original dimension to the low-rank dimension, and B is an adaptation matrix that restores from the low-rank dimension to the original dimension. B is an n×k matrix, A is a k×m matrix, n is the input dimension, m is the output dimension, and k is the rank of the low-rank matrix. B ∈ R r×z ,A ∈ R d×r ,W ∈ R d×z ,where d is the original dimension, r << z is the low-rank dimension, r << min(d, k), and r is much smaller than the number of rows and columns of W.

[0140] The fine-tuning of the decision-making agent large language model is specifically divided into the following sub-steps:

[0141] 1. Use the decision-making agent prompt Prompt decide and the theme in the decision-making agent training data as input data, and use the structure and the summary of each link in the decision-making agent training data as labels, and input them into the decision-making agent large language model to generate the conditional probability of the decision-making agent large language model.

[0142] For each piece of decision-making agent training data D 1i =(T i , S i , Y i ), where T i is the theme, S i is the structure, Y i is the summary of each link, use T i and the prompt Prompt decide as input, S i , Y iAs labels, the labeled data D 1i The model predicts the input data and generates the conditional probability p(S i , Y i |T i , Prompt decide ).

[0143] 2. Use the cross entropy loss function to calculate the loss between the predicted output and the real data.

[0144] The cross entropy loss function is used to evaluate the inconsistency between the model prediction output and the true label. The cross entropy loss function is L decide =-log p1(S i , Y i |T i , Prompt decide ), where L decide Represents the value of the cross entropy loss function.

[0145] 3. Calculate the gradient of the loss with respect to the model parameters and minimize the cross entropy loss function.

[0146] Calculate the loss L decide Derivative of the predicted output p1: y represents the real data. This derivative shows how p1 affects the loss L decide Changes in: When p1 approaches y, the derivative of the loss function approaches zero, which means that the rate of loss reduction slows down; when p1 moves away from y, the absolute value of the derivative increases, pushing p1 to move in the y direction to reduce the loss.

[0147] The model’s predicted output p1 is a function of the parameter θ, i.e., p1 = σ(z), where z = w T x+b, σ is the sigmoid function, w and b are weights and biases respectively, x is the input feature vector, T is the transpose of the matrix, w T represents the transpose of w, that is, the column vector is converted into a row vector and matrix multiplication is performed. The derivative of the sigmoid function is σ(z)(1-σ(z)), so the derivative with respect to z is:

[0148]

[0149] Therefore, the gradient of the model parameter θ is:

[0150] For weight w, the gradient is Therefore the partial derivative of z with respect to w is x.

[0151] For bias b, the gradient is Therefore z is directly related to b, and the partial derivative is 1.

[0152] 4. Use the optimization algorithm to update the model parameters according to the gradient and the set learning rate.

[0153] The parameters of the decision-maker agent model are adjusted by minimizing the loss function using an optimization algorithm. The update step of the optimization algorithm involves calculating the first-order moment (momentum) m t and the second moment (variance) v t , and then update the parameters θ.

[0154] First moment: m t =β1*m t-1 +(1-β1)*g t , m t Represents the estimated value of the first-order moment (momentum) at time step t. β1 is the attenuation factor of the first-order moment, which is usually close to but less than 1, controlling the influence of past gradients. t-1 is the first-order moment estimate at the previous time step t-1. t is the gradient at time step t, that is, with respect to the loss function L decide The derivative with respect to the model parameter θ 1-β1 represents the current gradient g t The proportion in the update means that the contribution of the new gradient is added to the previously accumulated momentum in a certain proportion. This formula reflects how to combine past gradient information (through momentum) to smooth the gradient estimate, thereby helping the optimization process to be more stable and better able to cross the valley of the loss function.

[0155] Second moment: v t Represents the estimated value of the second-order moment at time t, which is used to approximate the variance of the gradient or the uncentered second-order moment. β2 is the decay factor of the second-order moment, which is usually close to but less than 1 (for example, 0.999) and is used to control the decay rate of the square of the historical gradient. t-1 is the second-order moment estimate at the previous time t-1. t is the gradient at time t, that is, with respect to the loss function L decide The derivative with respect to the model parameter θ 1-β2 determines the current gradient square The ratio in the update means that the new squared gradient information is added to the previous accumulation at a certain ratio.

[0156] Deviation correction: In order to eliminate the deviation caused by the momentum decay factor (β1 and β2) being initialized to 0, the first-order moment and the second-order moment will be corrected. The formula for deviation correction is as follows:

[0157] First-order moment deviation correction: is the corrected first-order moment estimate, mt is the uncorrected first-order moment estimate, β1 is the first-order momentum decay rate, and t is the number of steps in the current iteration.

[0158] Second-order moment deviation correction: is the corrected second-order moment estimate, v t is the uncorrected second-order moment estimate, β2 is the second-order momentum decay rate, and t is the number of steps in the current iteration.

[0159] Parameter update: Apply weight decay directly to the parameters. The specific formula is θ t+1 is the updated parameter, θ t is the parameter before updating, η is the learning rate, is the corrected first-order moment estimate, is the corrected second-order moment estimate, λ is the weight attenuation coefficient, and ∈ is a small constant (such as 10 -8 ) is used for numerical stability.

[0160] 5. Perform iterative training until the model's performance on the validation set no longer improves significantly or reaches the preset training rounds.

[0161] In order to enable the critic agent large language model to generate decision content that meets the requirements, it needs to be fine-tuned. Fine-tuning uses D2 = (T, S', Y', O) as data, and uses supervised fine-tuning technology and low-rank adaptive technology to minimize the difference between the generated decision content and the standard decision content to adjust the model parameters.

[0162] Fine-tuning the large language model of the critic agent is divided into the following sub-steps:

[0163] 1. Set the commentator agent prompt word Prompt criticize The topics in the critic agent training data are taken as input data, the structure in the critic agent training data and the summary of each link are taken as labels, and input into the critic agent large language model to generate the conditional probability of the critic agent large language model.

[0164] For each reviewer agent training data D 2i =(T i , S′ i , Y′ i , O i ), where T i For the theme, S′ i is the wrong structure after deletion, Y′ i For the revised error summary, T i , S′ i , Y′ i and the prompt word Promptcriticize As input, O i As labels, the labeled data D 2i The model predicts the input data and generates the conditional probability p(O i |S′ i , Y′ i , T i , Prompt criticize ).

[0165] 2. Use the cross entropy loss function to calculate the loss between the predicted output and the real data.

[0166] The cross entropy loss function is used to evaluate the inconsistency between the model prediction output and the true label. The cross entropy loss function is L criticize =-log p2(O i |S′ i , Y′ i , T i , Prompt criticize ), where L criticize Represents the value of the cross entropy loss function.

[0167] 3. Calculate the gradient of the loss with respect to the model parameters and minimize the cross entropy loss function.

[0168] Calculate the loss L criticize The derivative of the predicted output p2: y represents the real data. This derivative shows how p2 affects the loss L criticize Changes in: When p2 approaches y, the derivative of the loss function approaches zero, which means that the rate of loss reduction slows down; when p2 moves away from y, the absolute value of the derivative increases, pushing p2 to move in the y direction to reduce the loss.

[0169] The model’s predicted output p2 is a function of the parameter θ, i.e., p2 = σ(z), where z = w T x+b, σ is the sigmoid function, w and b are weights and biases respectively, x is the input feature vector, T is the transpose of the matrix, w T represents the transpose of w, that is, the column vector is converted into a row vector and matrix multiplication is performed. The derivative of the sigmoid function is σ(z)(1-σ(z)), so the derivative with respect to z is:

[0170]

[0171] Therefore, the gradient of the model parameter θ is:

[0172] For weight w, the gradient is Therefore the partial derivative of z with respect to w is x.

[0173] For bias b, the gradient is Therefore z is directly related to b, and the partial derivative is 1.

[0174] 4. Use the optimization algorithm to update the model parameters according to the gradient and the set learning rate.

[0175] The parameters of the decision-maker agent model are adjusted by minimizing the loss function using an optimization algorithm. The update step of the optimization algorithm involves calculating the first-order moment (momentum) m t and the second moment (variance) v t , and then update the parameters θ.

[0176] First moment: m t =β1*m t-1 +(1-β1)*g t , m t Represents the estimated value of the first-order moment (momentum) at time step t. β1 is the attenuation factor of the first-order moment, which is usually close to but less than 1, controlling the influence of past gradients. t-1 is the first-order moment estimate at the previous time step t-1. t is the gradient at time step t, that is, with respect to the loss function L criticize The derivative with respect to the model parameter θ 1-β1 represents the current gradient g t The proportion in the update means that the contribution of the new gradient is added to the previously accumulated momentum in a certain proportion. This formula reflects how to combine past gradient information (through momentum) to smooth the gradient estimate, thereby helping the optimization process to be more stable and better able to cross the valley of the loss function.

[0177] Second moment: v t Represents the estimated value of the second-order moment at time t, which is used to approximate the variance of the gradient or the uncentered second-order moment. β2 is the decay factor of the second-order moment, which is usually close to but less than 1 (for example, 0.999) and is used to control the decay rate of the square of the historical gradient. t-1 is the second-order moment estimate at the previous time t-1. t is the gradient at time t, that is, with respect to the loss function L criticize The derivative with respect to the model parameter θ 1-β2 determines the current gradient square The ratio in the update means that the new squared gradient information is added to the previous accumulation at a certain ratio.

[0178] Deviation correction: In order to eliminate the deviation caused by the momentum decay factor (β1 and β2) being initialized to 0, the first-order moment and the second-order moment will be corrected. The formula for deviation correction is as follows:

[0179] First-order moment deviation correction: is the corrected first-order moment estimate, m t is the uncorrected first-order moment estimate, β1 is the first-order momentum decay rate, and t is the number of steps in the current iteration.

[0180] Second-order moment deviation correction: is the corrected second-order moment estimate, v t is the uncorrected second-order moment estimate, β2 is the second-order momentum decay rate, and t is the number of steps in the current iteration.

[0181] Parameter update: Apply weight decay directly to the parameters. The specific formula is θ t+1 is the updated parameter, θ t is the parameter before updating, η is the learning rate, is the corrected first-order moment estimate, is the corrected second-order moment estimate, λ is the weight attenuation coefficient, and ∈ is a small constant (such as 10 -8 ) is used for numerical stability.

[0182] 5. Perform iterative training until the model's performance on the validation set no longer improves significantly or reaches the preset training rounds.

[0183] Deployment module: used to deploy the fine-tuned decision maker agent large language model and critic agent large language model into the multi-agent architecture.

[0184] The fine-tuned decision maker agent model and critic agent model are deployed to the multi-agent system. The summarizer agent module can update the fine-tuned model to the multi-agent system according to the command of the decision maker agent and the task execution structure of the executor agent. The specific steps are as follows:

[0185] 1. In order to reduce the computing resource consumption of the model and improve the inference speed, the model is compressed, including weight pruning, quantization, and knowledge distillation.

[0186] 2. Perform format conversion to convert the model from the framework used in the training environment to a format suitable for deployment in the production environment, usually in ONNX and TensorRT formats, to facilitate cross-platform deployment and optimization.

[0187] 3. Perform environment configuration and dependency management. Prepare the production environment, including servers, cloud services, or edge devices, to ensure that they have the hardware resources and software environment required to run the model.

[0188] Install necessary dependency packages and libraries to ensure compatibility between the production environment and the model training environment.

[0189] 4. Design RESTful API or gRPC service interface according to the application scenario and define the input and output formats to facilitate calls by other systems.

[0190] 5. Use Docker container technology to package the model and its operating environment to achieve environmental consistency and facilitate deployment and migration.

[0191] 6. Deploy containerized applications to Kubernetes clusters, cloud services, or other server management systems to realize model service.

[0192] 7. Implement a monitoring system to track the model’s prediction latency, resource usage, and error logs to ensure stable service operation. Record request logs and model outputs to facilitate subsequent analysis of model performance and optimization.

[0193] Calling module: used to receive the input command for generating an industry research report and call the multi-agent system. The fine-tuned decision-maker agent in the multi-agent system generates decision content that meets the requirements according to the instructions, and the executor agent generates a task execution structure according to the decision content of the decision-maker agent; the summarizer agent generates the final industry research report according to the decision content of the decision-maker agent and the task execution structure of the executor agent.

[0194] This system model has undergone adaptive training and possesses knowledge in the field of industry research reports. The system provides services through an API interface. Users input the theme of the industry report by calling the API interface. The decision-maker agent receives instructions for generating the industry research report, determines the structure of the industry report based on the theme, and generates summaries for all aspects of the report. The reviewer agent evaluates and modifies the decision content of the decision-maker agent to regenerate a more complete theme, structure, and content. The executor agent queries data and generates the content of each link of the report according to the instructions of the decision-maker agent, and conducts self-reflection to modify the generated results. The summarizer agent summarizes the report content according to the command of the decision-maker agent and the task execution structure of the executor agent to generate the final industry research report.

[0195] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.

Claims

1. A data generation method based on a multi-agent large language model, characterized in that: include: S10. Build a multi-agent architecture, including building a decision maker agent, a commentator agent, an executor agent, and a summarizer agent; S20. Collect existing industry research reports, and construct decision maker agent training data and commentator agent training data based on the existing industry research reports; S30, inputting the decision maker agent training data into the decision maker agent large language model, and fine-tuning the decision maker agent large language model so that the decision maker agent large language model generates decision content that meets the requirements; S40, inputting the critic agent training data into the critic agent large language model, and fine-tuning the critic agent large language model to minimize the difference between the generated decision content and the standard decision content; S50, deploying a multi-agent system to generate industry research reports; S60, receiving an instruction to generate an industry research report, calling the multi-agent system, generating a decision content that meets the requirements according to the instruction based on the fine-tuned decision maker agent in the multi-agent system, and the executor agent generating a task execution structure according to the decision content of the decision maker agent; The summarizer agent generates the final industry research report based on the decision content of the decision maker agent and the task execution structure of the executor agent; Fine-tuning the decision-maker agent's large language model is divided into the following sub-steps: Step 1: Set the prompt word of the decision maker agent decide The topic in the decision maker agent training data is used as input data, the structure and summary of each link in the decision maker agent training data are used as labels, and the decision maker agent large language model is input to generate the conditional probability of the decision maker agent large language model; for each decision maker agent training data D 1i =(T i , S i , Y i ), where T i For the theme, S i For structure, Y i For each link, the summary of T i and the prompt word Prompt decide As input, S i , Y i As labels, the labeled data D 1i The model predicts the input data and generates the conditional probability p(S i , Y i |T i , Prompt decide ); Step 2: Use the cross entropy loss function to calculate the loss between the predicted output and the real data; the cross entropy loss function is used to evaluate the inconsistency between the model's predicted output and the real label. The cross entropy loss function is L decide =-log p1(S i , Y i |T i , Prompt decide ), where L decide Represents the value of the cross entropy loss function; Step 3: Calculate the gradient of the loss relative to the model parameters and minimize the cross entropy loss function; calculate the loss L decide Derivative of the predicted output p1: y represents the real data; This derivative shows the effect of p1 on the loss L decide Impact of the changes: The model’s predicted output p1 is a function of the parameter θ, i.e., p1 = σ(z), where z = w T x+b, σ is the sigmoid function, w and b are weights and biases respectively, x is the input feature vector, T is the transpose of the matrix, w T represents the transpose of w, that is, converting the column vector into a row vector and performing matrix multiplication; the derivative of the sigmoid function is σ(z)(1-σ(z)), so the derivative with respect to z is: So the gradient of the model parameter θ is: For the weight w, the gradient is So the partial derivative of z with respect to w is x; for the bias b, the gradient is Therefore, z is directly related to b, and the partial derivative is 1; Step 4: Use the optimization algorithm to update the model parameters according to the gradient and the set learning rate; The parameters of the decision-maker agent model are adjusted by minimizing the loss function using an optimization algorithm; the update step of the optimization algorithm includes calculating the first-order moment m t and the second moment v t , then update the parameter θ; First moment: m t =β1*m t-1 +(1-β1)*g t , m t represents the estimated value of the first-order moment at time step t; β1 is the attenuation factor of the first-order moment; m t-1 is the first-order moment estimate at the previous time step t-1; g t is the gradient at time step t, that is, with respect to the loss function L decide The derivative with respect to the model parameter θ 1-β1 represents the current gradient g t proportion in the update; Second moment: v t represents the estimated value of the second-order moment at time t; β2 is the attenuation factor of the second-order moment; v t-1 is the second-order moment estimate at the previous time t-1; g t is the gradient at time t, that is, with respect to the loss function L decide The derivative with respect to the model parameter θ 1-β2 determines the current gradient square proportion in the update; Deviation correction: In order to eliminate the deviation caused by the attenuation factor β1 of the first-order moment and the attenuation factor β2 of the second-order moment being initialized to 0, deviation correction is performed on the first-order moment and the second-order moment; the deviation correction formula is as follows: First-order moment deviation correction: is the corrected first-order moment estimate, m t is the uncorrected first-order moment estimate, β1 is the attenuation factor of the first-order moment, and t is the number of steps in the current iteration; Second-order moment deviation correction: is the corrected second-order moment estimate, v t is the uncorrected second-order moment estimate, β2 is the attenuation factor of the second-order moment, and t is the number of steps in the current iteration; Parameter update: Apply weight decay directly to the parameters. The specific formula is θ t+1 is the updated parameter, θ t is the parameter before updating, η is the learning rate, is the corrected first-order moment estimate, is the corrected second-order moment estimate, λ is the weight decay coefficient, and ∈ is a constant used to ensure numerical stability; Step 5: Perform iterative training until the model's performance on the validation set no longer improves or reaches the preset training rounds.

2. A data generation method based on a multi-agent large language model as claimed in claim 1, characterized in that: Constructing training data for the decision maker and critic agents is divided into the following sub-steps: Collect existing industry research reports; Label decision data from existing industry research reports as training data for decision-making agents; Generate incorrect decision data based on the labeled decision data as training data for the critic agent.

3. A data generation method based on a multi-agent large language model as claimed in claim 2, characterized in that: After obtaining the existing industry research report, extract the standard output of the decision maker agent corresponding to the existing industry research report. According to the structure of the existing industry research report, extract the theme T, structure S and the summary Y of each link. The extracted data constitutes the training data D1 = (T, S, Y) of the decision maker agent.

4. The data generation method based on a multi-agent large language model as claimed in claim 3, characterized in that: The structure S extracted from the existing industry research report is subjected to sequence permutation and link deletion operations O to obtain the deleted and modified erroneous structure S′ and the corresponding summary Y′, and the corresponding erroneous decision and error type data, i.e., the training data D2 = (T, S′, Y′, O) of the reviewer agent.

5. The data generation method based on a multi-agent large language model as claimed in claim 4, characterized in that: The multi-agent system provides services through the API interface. By calling the API interface and inputting the subject of the industry report, the decision-maker agent receives the instructions for generating the industry research report, determines the structure of the industry report according to the subject, and generates a summary for all aspects of the report; the reviewer agent evaluates and modifies the decision content of the decision-maker agent, so that it can regenerate a more complete subject, structure and content; The executor agent queries data according to the instructions of the decision-maker agent, generates the contents of each link of the report, and conducts self-reflection to modify the generated results; The summarizer agent summarizes the report content according to the commands of the decision maker agent and the task execution structure of the executor agent to generate the final industry research report.

6. A data generation system based on a multi-agent large language model, characterized in that: include: Multi-agent building module: used to build a multi-agent architecture, including decision maker agents, commentator agents, executor agents, and summarizer agents; Data collection and processing module: used to collect data from existing industry research reports and construct training data for decision maker agents and commentator agents based on existing industry research reports; Fine-tuning module: used to input training data into the corresponding intelligent agent large language model that needs fine-tuning, and fine-tune the model. The fine-tuned intelligent agent large language model includes the decision maker intelligent agent large language model and the critic intelligent agent large language model; Deployment module: used to deploy the fine-tuned decision maker agent large language model and critic agent large language model to the multi-agent architecture; Calling module: used to receive the input command for generating industry research reports, call the multi-agent system, and the fine-tuned decision-maker agent in the multi-agent system generates the decision content that meets the requirements according to the instructions, and the executor agent generates the task execution structure according to the decision content of the decision-maker agent; The summarizer agent generates the final industry research report based on the decision content of the decision maker agent and the task execution structure of the executor agent; Fine-tuning the decision-maker agent's large language model is divided into the following sub-steps: Step 1: Set the prompt word of the decision maker agent decide The topic in the decision maker agent training data is used as input data, the structure and summary of each link in the decision maker agent training data are used as labels, and the decision maker agent large language model is input to generate the conditional probability of the decision maker agent large language model; for each decision maker agent training data D 1i =(T i , S i , Y i ), where T i For the theme, S i For structure, Y i For each link, the summary of T i and the prompt word Prompt decide As input, S i , Y i As labels, the labeled data D 1i The model predicts the input data and generates the conditional probability p(S i , Y i |T i , Prompt decide ); Step 2: Use the cross entropy loss function to calculate the loss between the predicted output and the real data; the cross entropy loss function is used to evaluate the inconsistency between the model's predicted output and the real label. The cross entropy loss function is L decide =-log p1(S i , Y i |T i , Prompt decide ), where L decide Represents the value of the cross entropy loss function; Step 3: Calculate the gradient of the loss relative to the model parameters and minimize the cross entropy loss function; calculate the loss L decide Derivative of the predicted output p1: y represents the real data; this derivative shows the effect of p1 on the loss L decide Impact of the changes: The model’s predicted output p1 is a function of the parameter θ, i.e., p1 = σ(z), where z = w T x+b, σ is the sigmoid function, w and b are weights and biases respectively, x is the input feature vector, T is the transpose of the matrix, w T represents the transpose of w, that is, converting the column vector into a row vector and performing matrix multiplication; the derivative of the sigmoid function is σ(z)(1-σ(z)), so the derivative with respect to z is: So the gradient of the model parameter θ is: For the weight w, the gradient is So the partial derivative of z with respect to w is x; for the bias b, the gradient is Therefore, z is directly related to b, and the partial derivative is 1; Step 4: Use the optimization algorithm to update the model parameters according to the gradient and the set learning rate; The parameters of the decision-maker agent model are adjusted by minimizing the loss function using an optimization algorithm; the update step of the optimization algorithm includes calculating the first-order moment m t and the second moment v t , then update the parameter θ; First moment: m t =β1*m t-1 +(1-β1)*g t , m t represents the estimated value of the first-order moment at time step t; β1 is the attenuation factor of the first-order moment; m t-1 is the first-order moment estimate at the previous time step t-1; g t is the gradient at time step t, that is, with respect to the loss function L decide The derivative with respect to the model parameter θ 1-β1 represents the current gradient g t proportion in the update; Second order moment: v t represents the estimated value of the second-order moment at time t; β2 is the attenuation factor of the second-order moment; v t-1 is the second-order moment estimate at the previous time t-1; g t is the gradient at time t, that is, with respect to the loss function L decide The derivative with respect to the model parameter θ 1-β2 determines the current gradient square proportion in the update; Deviation correction: In order to eliminate the deviation caused by the attenuation factor β1 of the first-order moment and the attenuation factor β2 of the second-order moment being initialized to 0, deviation correction is performed on the first-order moment and the second-order moment; the deviation correction formula is as follows: First-order moment deviation correction: is the corrected first-order moment estimate, m t is the uncorrected first-order moment estimate, β1 is the attenuation factor of the first-order moment, and t is the number of steps in the current iteration; Second-order moment deviation correction: is the corrected second-order moment estimate, v t is the uncorrected second-order moment estimate, β2 is the attenuation factor of the second-order moment, and t is the number of steps in the current iteration; Parameter update: Apply weight decay directly to the parameters. The specific formula is θ t+1 is the updated parameter, θ t is the parameter before updating, η is the learning rate, is the corrected first-order moment estimate, is the corrected second-order moment estimate, λ is the weight decay coefficient, and ∈ is a constant used to ensure numerical stability; Step 5: Perform iterative training until the model's performance on the validation set no longer improves or reaches the preset training rounds.

7. A data generation system based on a multi-agent large language model as claimed in claim 6, characterized in that: Constructing training data for the decision maker and critic agents is divided into the following sub-steps: Collect existing industry research reports; Label decision data from existing industry research reports as training data for decision-making agents; Generate incorrect decision data based on the labeled decision data as training data for the critic agent.

8. A data generation system based on a multi-agent large language model as claimed in claim 7, characterized in that: After obtaining the existing industry research report, extract the standard output of the decision maker agent corresponding to the existing industry research report. According to the structure of the existing industry research report, extract the theme T, structure S and the summary Y of each link. The extracted data constitutes the training data D1 = (T, S, Y) of the decision maker agent.

9. A data generation system based on a multi-agent large language model as claimed in claim 8, characterized in that: The structure S extracted from the existing industry research report is subjected to sequence permutation and link deletion operations O to obtain the deleted and modified erroneous structure S′ and the corresponding summary Y′, and the corresponding erroneous decision and error type data, i.e., the training data D2 = (T, S′, Y′, O) of the reviewer agent.

10. A data generation system based on a multi-agent large language model as claimed in claim 9, characterized in that: The multi-agent system provides services through the API interface. By calling the API interface and inputting the subject of the industry report, the decision-maker agent receives the instructions for generating the industry research report, determines the structure of the industry report according to the subject, and generates a summary for all aspects of the report; the reviewer agent evaluates and modifies the decision content of the decision-maker agent, so that it can regenerate a more complete subject, structure and content; The executor agent queries data according to the instructions of the decision-maker agent, generates the contents of each link of the report, and conducts self-reflection to modify the generated results; The summarizer agent summarizes the report content according to the commands of the decision maker agent and the task execution structure of the executor agent to generate the final industry research report.

Citation Information

Patent Citations

  • Multi-agent reinforcement learning training method with high sample efficiency

    CN113313209A

  • Cluster track automatic planning method based on multi-agent safety reinforcement learning

    CN116661503A

  • Multi-agent collaborative decision reinforcement learning method, system and device

    CN117151206A

  • Large model fine-tuning training method combined with knowledge graph

    CN118013294A

  • Model-driven lithium hydroxide production autonomous control method and system

    CN118113005A