Large language model multi-agent collaborative decision-making method facing confrontation game
Through the fine-tuning and memory module of the large language model, combined with the LoRA method, the problem of decision-making complexity and data requirements in the adversarial game environment is solved, the ability to quickly adapt and efficient decision-making in the adversarial game environment is achieved, and the multi-agent system is improved. capabilities of collaboration and confrontation.
Patent Information
- Application Number
- CN202410798787.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-20
- Publication Date
- 2024-10-01
AI Technical Summary
The existing technology lacks interpretability in multi-agent collaborative decision-making in adversarial game environments, requires a large amount of training data, and is difficult to cope with complex and changing scenarios. Based on the limitations of reinforcement learning methods, it is difficult to adapt quickly in complex environments. and dealing with long-term dependence.
The fine-tuning technology of the large language model is combined with the LoRA method and the memory module to construct a fine-tuning training data set for the adversarial game environment. The large language model is fine-tuned through LoRA, the memory module is introduced to store historical data, and multi-source information is combined for decision-making to generate text action decisions and Update memory module.
It achieves rapid learning and generation of effective strategies in a confrontational game environment, maintains consistency and coherence, improves decision-making accuracy and adaptability in complex environments, and reduces computing resource requirements.
Smart Images

Figure CN118734967A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of large language model intelligent agents, and in particular to a large language model multi-agent collaborative decision-making method for adversarial games. Background Art
[0002] With the rapid development of artificial intelligence technology, multi-agent collaborative decision-making based on large language models (LLMs) in adversarial game environments has become an important research field. This adversarial game mechanism is widely used in various complex environments, including financial transactions, network security, military strategy, multiplayer online games, etc.
[0003] A multi-agent system is a system in which multiple agents interact, cooperate or compete in the same environment. Each agent is autonomous and intelligent, and can perceive the environment, make decisions and take actions. In collaborative game confrontation, agents need to constantly learn and adapt to the dynamically changing environment, make decisions based on incomplete information, and find a balance between cooperation and confrontation to achieve their respective goals. This dynamic and complex interaction process requires agents to have not only strong individual intelligence, but also efficient communication and collaboration capabilities.
[0004] Traditional collaborative decision-making methods for adversarial games include methods based on game theory, methods based on heuristic algorithms, and methods based on reinforcement learning. Among them, methods based on reinforcement learning are the most widely used. The reinforcement learning-based method models the collaborative decision-making process of multiple agents in an adversarial game environment as a Markov decision process (MDPs), which enables agents to continuously learn and evolve their own strategies in the interaction with the environment. The reinforcement learning-based method balances the competition and cooperation between agents by designing reward mechanisms and strategy frameworks, improves the performance of agents in different situations, and effectively improves the collaborative ability and adaptability of multi-agent systems in adversarial game environments through different means such as strategy sharing, communication mechanisms, self-confrontation, and hierarchical decision-making. However, the reinforcement learning-based method has problems such as lack of explainability when making decisions, requiring a large amount of training data, and being unable to cope with highly complex and changing game scenarios. The introduction of large language models provides a new path to solve these challenges.
[0005] Large language models, such as OpenAI's GPT series, are being widely used in multi-agent systems due to their outstanding performance in natural language processing and generation. LLMs can understand and generate natural language text, making communication between agents more natural and efficient. This ability is crucial for strategy formulation and execution in complex game environments.
[0006] LLMs are pre-trained with massive data and have extensive knowledge and reasoning capabilities, which can quickly learn and generate effective strategies during the game. In addition, LLMs can also adjust strategies in real time to respond to changes in opponent behavior through interactive learning.
[0007] Fine-tuning techniques for large language models are of great significance for collaborative decision-making in adversarial games, because fine-tuning can significantly improve the performance and efficiency of models in specific downstream tasks. Common fine-tuning techniques include full model fine-tuning, frozen layer fine-tuning, gradual unfreezing, parameter efficient fine-tuning, and methods such as contrastive learning and multi-task learning. Through fine-tuning techniques, large language models can better adapt to the data distribution and requirements of specific tasks, thereby improving accuracy and performance of specific tasks. Fine-tuning can also reduce the risk of overfitting, make full use of limited task-specific data, optimize computing resources, and shorten training time. In addition, the fine-tuned large language model performs well in processing tasks such as natural language understanding and generation, and can be directly used for tasks such as strategy generation, opponent modeling, and collaborative decision-making in adversarial games. In contrast, reinforcement learning-based methods usually require a large amount of interactive data and exploration processes, as well as a large number of iterations and trial-and-error processes to optimize strategies, which are difficult to generalize to other environments. Therefore, fine-tuning techniques are a key step in successfully applying large models to downstream tasks.
[0008] The introduction of memory modules further improves the performance of LLMs in multi-agent systems. Memory modules can store and retrieve past interaction information, allowing agents to maintain consistency and coherence in continuous dialogues or multiple rounds of games. This memory ability enables large language model agents to summarize past experiences, optimize current strategies, and quickly adapt to new tasks and new environments, thereby achieving better results in complex adversarial game environments. In contrast, reinforcement learning-based methods focus more on short-term feedback and immediate rewards, have difficulty processing long-term dependencies, are slow to adapt to new tasks, and have relatively weak capabilities in processing complex patterns and high-dimensional state spaces.
[0009] In short, the collaborative decision-making of multiple language model agents for adversarial games integrates the latest advances in natural language processing, machine learning, and game theory, and provides innovative methods and tools for solving collaborative and adversarial game problems in complex systems. This research direction not only has important theoretical significance, but also shows great potential and prospects in practical applications. Summary of the invention
[0010] The purpose of the present invention is to address the problems existing in the above-mentioned prior art and to provide a large language model multi-agent collaborative decision-making method for adversarial games, which can effectively identify the situation, make reasonable decisions, and adjust strategies in real time to cope with dynamic environments in a collaborative adversarial game environment, and ultimately defeat the enemy.
[0011] The technical solution to achieve the purpose of the present invention is: a large language model multi-agent collaborative decision-making method for adversarial games, the method comprising the following steps:
[0012] Step 1: Construct a fine-tuning training dataset for the large language model of collaborative decision-making in an adversarial game environment;
[0013] Step 2, based on the fine-tuning training data set, using the LoRA method to fine-tune the collaborative decision-making large language model in the adversarial game environment;
[0014] Step 3: Build a memory module and set its update mechanism to store the agent’s historical game data and its understanding of the game;
[0015] Step 4: Obtain the initial local observation data of the agent from the adversarial game environment, and obtain the global state information required for subsequent decision-making from the shared message pool, and combine the multi-source information as the subsequent model input data;
[0016] Step 5: Use the large language model for collaborative decision-making in the adversarial game environment fine-tuned in step 2 as the reasoning model for collaborative decision-making of multiple agents in the adversarial game environment, use the combined information obtained in step 4 as the input of the reasoning model, analyze the game situation, and generate a summary and analysis of the current game situation and agent strategy recommendations;
[0017] Step 6, the large language model for collaborative decision-making in the adversarial game environment generates a text action decision for this round based on the result of step 5 and strictly in accordance with the format of the sample example;
[0018] Step 7, generating actions for this round according to the text action decision;
[0019] Step 8: Perform actions in the adversarial game environment and update the memory module constructed in step 3 according to the action results. After the memory module update is completed, enter the next round of the game.
[0020] Furthermore, step 2 specifically includes:
[0021] Step 2.1, load the software library required to fine-tune the collaborative game against the large language model;
[0022] Step 2.2, data preparation:
[0023] Using the fine-tuning training data set;
[0024] Convert text format data into a format that the model can process;
[0025] Step 2.3, fine-tune the large language model for collaborative decision-making in adversarial games:
[0026] The parameters of the large language model for collaborative decision-making in adversarial games are divided into two parts: pre-trained weights and fine-tuned incremental weights. W0 is the initialization parameter of the pre-trained large language model for collaborative decision-making in adversarial games, and ΔW is the weight update amount generated during the fine-tuning process. Let the input be x and the output be h, then h = W0x + ΔWx.
[0027] In the training process of LoRA, W0 is fixed, and two low-rank matrices A and B are used to represent ΔW, that is, h = W0x + BAx, B∈R d×r , A∈R r×k , where rank r<<min(d,k);
[0028] Initialize A with a random Gaussian distribution and initialize B with a zero matrix. During the training process, train the low-rank matrices A and B, and only save the low-rank matrix part as the model weight. Set the training parameters, start the fine-tuning training of the adversarial game collaborative decision-making large language model, save the model weight with the lowest loss value Loss during the training process, and obtain the initial adversarial game collaborative decision-making large language model with a certain game adversarial ability.
[0029] Step 2.4, Evaluation and Optimization:
[0030] Use part of the training data to verify the model effect, evaluate the model performance on the validation set, and adjust the parameters and hyperparameters based on the results; add the trained matrix product BA to the originally fixed weight matrix W0 as the new model matrix, i.e., h = W0x + BAx, and use the weight matrix h as the new weight parameter to replace the parameters of the initial pre-trained adversarial game collaborative decision-making large language model. Compare the model test result result1 with the model test result result0 before fine-tuning through comparison indicators;
[0031] If result1 is better than result0, the model fine-tuning effect is improved, and it can be used as the inference model for the subsequent multi-agent collaborative decision-making in the adversarial game environment. Otherwise, readjust the training parameters and repeat steps 2.3 and 2.4 until the test results of the fine-tuned model are better than the results before training.
[0032] Furthermore, step 3 specifically includes:
[0033] Step 3.1, build the memory module:
[0034] Define the memory module Memory = (History, Belief, Example), where History is the historical state information and historical action sequence of the current agent in this round of the game, Belief is the summary of the agent's in-depth understanding of the game during the game, and Example is a sample example, including positive samples and negative samples. The adversarial game collaborative decision-making large language model should refer to positive samples and negative samples when making decisions;
[0035] Step 3.2, set the memory module space limit:
[0036] The memory module only retains the historical data of the previous k rounds of the current agent;
[0037] Step 3.3, set the update mechanism of the memory module:
[0038] The memory module is updated after each round of action. If the historical data does not exceed the space limit of the memory storage, the data is directly stored in the memory module. Otherwise, the earliest historical data in the memory module is deleted and the new data is stored in the memory module.
[0039] Furthermore, step 4 specifically includes:
[0040] Step 4.1, obtain the initial local observation data of the agent:
[0041] Obtain the initial local observation data of the agent from the adversarial game environment, and define the initial local observation data of the agent as observation = {S self , S enemy , S ally};
[0042] Among them, the state S self =(H, S, R), enemy status S enemy =(VA, P, H, S, R), companion status S ally =(VA, P, H, S, R), H is the relative health, S is the relative shield value, R is the type of soldier, VA is whether it is visible and alive, and P is the relative position;
[0043] Step 4.2, obtain the global state information of the adversarial game environment:
[0044] Obtain the global state information State = (Agent_1, Agent_2, ..., Agent_n) required for the agent's subsequent decision-making from the shared message pool, where Agent_n is the historical data shared by Agent_n in the message pool in the confrontation game. When the agent needs to use the global state information to judge the intention of its companions, it can access the shared message pool to obtain the global state information for subsequent decision-making;
[0045] Step 4.3, combine the above information and convert it into text data as the input of the model:
[0046] The combined data is expressed in natural language as text data that can be understood by the large language model of adversarial game collaborative decision-making. The whole process is formalized as follows:
[0047]
[0048] in, For the process of text data conversion, V is a finite vocabulary of words related to the current adversarial game environment, and o is the input data of the adversarial game collaborative decision-making large language model.
[0049] Furthermore, step 5 specifically includes:
[0050] Step 5.1, summarize the game situation:
[0051] According to the combined data obtained in step 4, the large language model of collaborative decision-making in adversarial games summarizes the current game situation and formalizes the whole process as follows:
[0052]
[0053] in, The process of summarizing the game situation for the adversarial game collaborative decision-making large language model. Summary is the current game situation summary obtained by the adversarial game collaborative decision-making large language model based on the combined data;
[0054] Step 5.2, analyze the game situation:
[0055] According to the above summary of the game situation, as well as the record of historical game data and its understanding of the game in the memory module of the agent, the large language model of collaborative decision-making in adversarial games is used to analyze the game situation, including the advantages and disadvantages of both sides, threats and opportunities, and dynamic changes in the situation. The whole process is formally expressed as follows:
[0056]
[0057] in, It is the process of analyzing the game situation by the big language model of collaborative decision-making in adversarial games. Analysis is the analysis of the current game situation drawn by the big language model of collaborative decision-making in adversarial games based on the summary of the game situation.
[0058] Step 5.3, generate policy recommendations:
[0059] According to the above game situation analysis, the adversarial game collaborative decision-making large language model generates strategic suggestions for the agent to make collaborative decisions in the current adversarial game environment, including tactical suggestions, measures and plans to deal with possible actions of the enemy; the whole process is formally expressed as:
[0060]
[0061] in, It is the process of generating strategy suggestions for the big language model of collaborative decision-making in adversarial games. Suggestion is the action strategy suggestion given by the big language model of collaborative decision-making in adversarial games based on the analysis of the current situation.
[0062] Furthermore, step 7 specifically includes:
[0063] Step 7.1, action extraction:
[0064] The text action decision generated in step 6 is used to extract actions from the action library action_dict of the intelligent agent. Through regular matching, the actions matching the action library are extracted from the complex text generated by the large language model of the adversarial game collaborative decision-making, and the executable actions in the adversarial game environment are obtained. The whole process is formally expressed as:
[0065] action=ε(v i )
[0066] Among them, ε is the action extractor based on regular matching, v i The text action decision generated in step 6;
[0067] Step 7.2, action validity check:
[0068] The actions extracted in step 7.1 are evaluated and checked for validity to ensure that the actions can be executed in the game.
[0069] Furthermore, in step 7.2, the action extracted in step 7.1 is evaluated to check its validity to ensure that the action can be executed in the game, specifically:
[0070]
[0071] Among them, Efc is the result of the action validity check by the large language model of the adversarial game collaborative decision-making. If the action can be executed by the agent in the current adversarial game scenario, the value is 1, otherwise, the value is 0;
[0072] If Efc=1, the action decision inferred by the large language model of collaborative decision-making in the adversarial game is valid and can be used as the action of the agent in the next round of the adversarial game; if Efc=0, the action decision is made again, and steps 5, 6 and 7 are repeated until the large language model of collaborative decision-making in the adversarial game comes up with a valid action decision.
[0073] Compared with the prior art, the present invention has the following significant advantages:
[0074] 1) The present invention uses the method of fine-tuning a large language model to train the initial model, so that it has extensive knowledge and reasoning capabilities, and can quickly learn and generate effective strategies during the game process.
[0075] 2) The present invention introduces a memory module into the adversarial game collaborative decision-making agent for storing and retrieving past interaction information, so that the adversarial game collaborative decision-making agent can maintain consistency and coherence in multiple rounds of games, summarize past experience, and optimize current strategies, thereby achieving better results in a complex adversarial game environment.
[0076] The present invention is further described in detail below in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0077] Figure 1 This is a flow chart of a large language model multi-agent collaborative decision-making method for adversarial games according to the present invention.
[0078] Figure 2 This is a flow chart of the method for fine-tuning the large language model for collaborative decision-making in adversarial games of the present invention.
[0079] Figure 3 This is the overall operational process framework diagram of the large language model multi-agent collaborative decision-making method for adversarial games. DETAILED DESCRIPTION
[0080] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0081] It should be noted that if the embodiments of the present invention involve directional indications (such as up, down, left, right, front, back, etc.), the directional indications are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.
[0082] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present invention, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0083] In one embodiment, in combination Figure 1 , provides a large language model multi-agent collaborative decision-making method for adversarial games, the method comprising the following steps:
[0084] Step 1: Construct a fine-tuning training dataset for the large language model of collaborative decision-making in an adversarial game environment;
[0085] Step 2, based on the fine-tuning training data set, using the LoRA method to fine-tune the collaborative decision-making large language model in the adversarial game environment;
[0086] Step 3: Build a memory module and set its update mechanism to store the agent’s historical game data and its understanding of the game;
[0087] Step 4: Obtain the initial local observation data of the agent from the adversarial game environment, and obtain the global state information required for subsequent decision-making from the shared message pool, and combine the multi-source information as the subsequent model input data;
[0088] Step 5: Use the large language model for collaborative decision-making in the adversarial game environment fine-tuned in step 2 as the reasoning model for collaborative decision-making of multiple agents in the adversarial game environment, use the combined information obtained in step 4 as the input of the reasoning model, analyze the game situation, and generate a summary and analysis of the current game situation and agent strategy recommendations;
[0089] Step 6, the large language model for collaborative decision-making in the adversarial game environment generates a text action decision for this round based on the result of step 5 and strictly in accordance with the format of the sample example;
[0090] Step 7, generating actions for this round according to the text action decision;
[0091] Step 8: Perform actions in the adversarial game environment and update the memory module constructed in step 3 according to the action results. After the memory module update is completed, enter the next round of the game.
[0092] Further, in one embodiment, the step 1 of constructing a fine-tuning training dataset for a large language model for collaborative decision-making in an adversarial game environment specifically includes:
[0093] Step 1.1, construct the observation set and action set of training data:
[0094] Collect data from the multi-agent collaborative game confrontation environment and convert it into structured data triple = [observation, action], where observation = {S self , S enemy , S ally} is the local observation information of the agent obtained from the game confrontation environment, including its own state S self , Enemy Status S enemy , companion status S ally There are three parts: action is the best action under observation, thereby obtaining a batch of multi-agent game confrontation data;
[0095] Convert the local observation information observation of the agent into a text format suitable for input of a large language model; establish an action library action_dict = {[0: action_1], ..., [n: action_n]} for the agent in the current game confrontation environment, where n is the unique ID of each action in the action library, and action_n is the corresponding action;
[0096] Step 1.2, construct the prompt statement for the training data:
[0097] The structured instance data E mentioned above is obtained through the collaborative game confrontation history record, and a prompt template P is constructed for the tasks in the collaborative game confrontation environment. The instance data is added to the prompt template to generate a prompt sentence Prompt = (P, E) for model training.
[0098] Further, in one embodiment, step 2 specifically includes:
[0099] Step 2.1, load the software library required to fine-tune the collaborative game against the large language model;
[0100] Step 2.2, data preparation:
[0101] Using the fine-tuning training data set;
[0102] Convert text format data into a format that the model can process;
[0103] Step 2.3, fine-tune the large language model for collaborative decision-making in adversarial games:
[0104] The parameters of the large language model for collaborative decision-making in adversarial games are divided into two parts: pre-trained weights and fine-tuned incremental weights. W0 is the initialization parameter of the pre-trained large language model for collaborative decision-making in adversarial games, and ΔW is the weight update amount generated during the fine-tuning process. Let the input be x and the output be h, then h = W0x + ΔWx.
[0105] In the training process of LoRA, W0 is fixed, and two low-rank matrices A and B are used to represent ΔW, that is, h = W0x + BAx, B∈R d×r , A∈R r×k , where rank r<<min(d,k);
[0106] Initialize A with a random Gaussian distribution and initialize B with a zero matrix. During the training process, train the low-rank matrices A and B, and only save the low-rank matrix part as the model weight. Set the training parameters, start the fine-tuning training of the adversarial game collaborative decision-making large language model, save the model weight with the lowest loss value Loss during the training process, and obtain the initial adversarial game collaborative decision-making large language model with a certain game adversarial ability.
[0107] Step 2.4, Evaluation and Optimization:
[0108] Use part of the training data to verify the model effect, evaluate the model performance on the validation set, and adjust the parameters and hyperparameters based on the results; add the trained matrix product BA to the originally fixed weight matrix W0 as the new model matrix, i.e., h = W0x + BAx, and use the weight matrix h as the new weight parameter to replace the parameters of the initial pre-trained adversarial game collaborative decision-making large language model. Compare the model test result result1 with the model test result result0 before fine-tuning through comparison indicators;
[0109] If result1 is better than result0, the model fine-tuning effect is improved, and it can be used as the inference model for the subsequent multi-agent collaborative decision-making in the adversarial game environment. Otherwise, readjust the training parameters and repeat steps 2.3 and 2.4 until the test results of the fine-tuned model are better than the results before training.
[0110] In some embodiments, step 2.1 includes: loading the ChatGLM-6B model as the basic model of the adversarial game large model agent, and introducing the software library for processing data sets and LoRA.
[0111] Preferably, in some embodiments, the comparison indicator in step 2.4 adopts the action decision accuracy Acc, and the calculation formula is:
[0112]
[0113] Among them, n is the total number of test samples, x iTo represent the decision result of the large language model of collaborative decision-making in adversarial games, if the decision action is the same as the best action, the value is 1, otherwise, the value is 0.
[0114] Further, in one embodiment, step 3 specifically includes:
[0115] Step 3.1, build the memory module:
[0116] Define the memory module Memory = (History, Belief, Example), where History is the historical state information and historical action sequence of the current agent in this round of the game, Belief is the summary of the agent's in-depth understanding of the game during the game, and Example is a sample example, including positive samples and negative samples. The adversarial game collaborative decision-making large language model should refer to positive samples and negative samples when making decisions;
[0117] Step 3.2, set the memory module space limit:
[0118] The memory module only retains the historical data of the previous k rounds of the current agent;
[0119] Step 3.3, set the update mechanism of the memory module:
[0120] The memory module is updated after each round of action. If the historical data does not exceed the space limit of the memory storage, the data is directly stored in the memory module. Otherwise, the earliest historical data in the memory module is deleted and the new data is stored in the memory module.
[0121] Further, in one embodiment, step 4 specifically includes:
[0122] Step 4.1, obtain the initial local observation data of the agent:
[0123] Obtain the initial local observation data of the agent from the adversarial game environment, and define the initial local observation data of the agent as observation = {S self , S enemy , S ally};
[0124] Among them, the state S self =(H, S, R), enemy status S enemy =(VA, P, H, S, R), companion status S ally =(VA, P, H, S, R), H is the relative health, S is the relative shield value, R is the type of soldier, VA is whether it is visible and alive, and P is the relative position;
[0125] Step 4.2, obtain the global state information of the adversarial game environment:
[0126] Obtain the global state information State = (Agent_1, Agent_2, ..., Agent_n) required for the agent's subsequent decision-making from the shared message pool, where Agent_n is the historical data shared by Agent_n in the message pool in the confrontation game. When the agent needs to use the global state information to judge the intention of its companions, it can access the shared message pool to obtain the global state information for subsequent decision-making;
[0127] Step 4.3, combine the above information and convert it into text data as the input of the model:
[0128] The combined data is expressed in natural language as text data that can be understood by the large language model of adversarial game collaborative decision-making. The whole process is formalized as follows:
[0129]
[0130] in, For the process of text data conversion, V is a finite vocabulary of words related to the current adversarial game environment, and o is the input data of the adversarial game collaborative decision-making large language model.
[0131] Further, in one embodiment, step 5 specifically includes:
[0132] Step 5.1, summarize the game situation:
[0133] According to the combined data obtained in step 4, the large language model of collaborative decision-making in adversarial games summarizes the current game situation and formalizes the whole process as follows:
[0134]
[0135] in, The process of summarizing the game situation for the adversarial game collaborative decision-making large language model. Summary is the current game situation summary obtained by the adversarial game collaborative decision-making large language model based on the combined data;
[0136] Step 5.2, analyze the game situation:
[0137] According to the above summary of the game situation, as well as the record of historical game data and its understanding of the game in the memory module of the agent, the large language model of collaborative decision-making in adversarial games is used to analyze the game situation, including the advantages and disadvantages of both sides, threats and opportunities, and dynamic changes in the situation. The whole process is formally expressed as follows:
[0138]
[0139] in, It is the process of analyzing the game situation by the big language model of collaborative decision-making in adversarial games. Analysis is the analysis of the current game situation drawn by the big language model of collaborative decision-making in adversarial games based on the summary of the game situation.
[0140] Step 5.3, generate policy recommendations:
[0141] According to the above game situation analysis, the adversarial game collaborative decision-making large language model generates strategic suggestions for the agent to make collaborative decisions in the current adversarial game environment, including tactical suggestions, measures and plans to deal with possible actions of the enemy; the whole process is formally expressed as:
[0142]
[0143] in, It is the process of generating strategy suggestions for the big language model of collaborative decision-making in adversarial games. Suggestion is the action strategy suggestion given by the big language model of collaborative decision-making in adversarial games based on the analysis of the current situation.
[0144] Further, in one embodiment, step 7 specifically includes:
[0145] Step 7.1, action extraction:
[0146] The text action decision generated in step 6 is used to extract actions from the action library action_dict of the intelligent agent. Through regular matching, the actions matching the action library are extracted from the complex text generated by the large language model of the adversarial game collaborative decision-making, and the executable actions in the adversarial game environment are obtained. The whole process is formally expressed as:
[0147] action=ε(v i )
[0148] Among them, ε is the action extractor based on regular matching, v i The text action decision generated in step 6;
[0149] Step 7.2, action validity check:
[0150] The actions extracted in step 7.1 are evaluated and checked for validity to ensure that the actions can be executed in the game.
[0151] Preferably, in some embodiments, in step 7.2, the action extracted in step 7.1 is evaluated to check its validity to ensure that the action can be executed in the game, specifically:
[0152]
[0153] Among them, Efc is the result of the action validity check by the large language model of the adversarial game collaborative decision-making. If the action can be executed by the agent in the current adversarial game scenario, the value is 1, otherwise, the value is 0;
[0154] If Efc=1, the action decision inferred by the large language model of collaborative decision-making in the adversarial game is valid and can be used as the action of the agent in the next round of the adversarial game; if Efc=0, the action decision is made again, and steps 5, 6 and 7 are repeated until the large language model of collaborative decision-making in the adversarial game comes up with a valid action decision.
[0155] In one embodiment, a large language model multi-agent collaborative decision-making system for adversarial games is provided, the system comprising:
[0156] The first module is used to construct a fine-tuning training dataset for a large language model for collaborative decision-making in an adversarial game environment;
[0157] The second module is used to fine-tune the collaborative decision-making large language model in the adversarial game environment using the LoRA method based on the fine-tuning training data set;
[0158] The third module is used to build a memory module and set its update mechanism to store the agent’s historical game data and its understanding of the game;
[0159] The fourth module is used to obtain the initial local observation data of the intelligent agent from the adversarial game environment, and obtain the global state information required for subsequent decision-making from the shared message pool, and combine the multi-source information as the subsequent model input data;
[0160] The fifth module is used to use the fine-tuned large language model for collaborative decision-making in an adversarial game environment as an inference model for collaborative decision-making of multiple agents in an adversarial game environment, and use the combined information obtained in the fourth module as the input of the inference model to analyze the game situation, generate a summary and analysis of the current game situation, and agent strategy recommendations;
[0161] The sixth module is used for the collaborative decision-making large language model in the adversarial game environment to generate text action decisions for this round based on the results of the fifth module and strictly in accordance with the format of the sample examples;
[0162] The seventh module is used to make action decisions based on the text and generate actions for this round;
[0163] The eighth module is used to perform actions in the adversarial game environment and update the memory module constructed by the third module according to the action results. After the memory module update is completed, the next round of the game begins.
[0164] For the specific limitations of the large language model multi-agent collaborative decision-making system for adversarial games, please refer to the limitations of the large language model multi-agent collaborative decision-making method for adversarial games mentioned above, which will not be repeated here. Each module in the above-mentioned large language model multi-agent collaborative decision-making system for adversarial games can be implemented in whole or in part through software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0165] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the following is achieved:
[0166] Step 1: Construct a fine-tuning training dataset for the large language model of collaborative decision-making in an adversarial game environment;
[0167] Step 2, based on the fine-tuning training data set, using the LoRA method to fine-tune the collaborative decision-making large language model in the adversarial game environment;
[0168] Step 3: Build a memory module and set its update mechanism to store the agent’s historical game data and its understanding of the game;
[0169] Step 4: Obtain the initial local observation data of the agent from the adversarial game environment, and obtain the global state information required for subsequent decision-making from the shared message pool, and combine the multi-source information as the subsequent model input data;
[0170] Step 5: Use the large language model for collaborative decision-making in the adversarial game environment fine-tuned in step 2 as the reasoning model for collaborative decision-making of multiple agents in the adversarial game environment, use the combined information obtained in step 4 as the input of the reasoning model, analyze the game situation, and generate a summary and analysis of the current game situation and agent strategy recommendations;
[0171] Step 6, the large language model for collaborative decision-making in the adversarial game environment generates a text action decision for this round based on the result of step 5 and strictly in accordance with the format of the sample example;
[0172] Step 7, generating actions for this round according to the text action decision;
[0173] Step 8, execute actions in the adversarial game environment, and update the memory module constructed in step 3 according to the action results; after completing the memory module update, enter the next round of game.
[0174] For the specific limitations of each step, please refer to the above limitations on the large language model multi-agent collaborative decision-making method for adversarial games, which will not be repeated here.
[0175] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the computer program implements:
[0176] Step 1: Construct a fine-tuning training dataset for the large language model of collaborative decision-making in an adversarial game environment;
[0177] Step 2, based on the fine-tuning training data set, using the LoRA method to fine-tune the collaborative decision-making large language model in the adversarial game environment;
[0178] Step 3: Build a memory module and set its update mechanism to store the agent’s historical game data and its understanding of the game;
[0179] Step 4: Obtain the initial local observation data of the agent from the adversarial game environment, and obtain the global state information required for subsequent decision-making from the shared message pool, and combine the multi-source information as the subsequent model input data;
[0180] Step 5: Use the large language model for collaborative decision-making in the adversarial game environment fine-tuned in step 2 as the reasoning model for collaborative decision-making of multiple agents in the adversarial game environment, use the combined information obtained in step 4 as the input of the reasoning model, analyze the game situation, and generate a summary and analysis of the current game situation and agent strategy recommendations;
[0181] Step 6, the large language model for collaborative decision-making in the adversarial game environment generates a text action decision for this round based on the result of step 5 and strictly in accordance with the format of the sample example;
[0182] Step 7, generating actions for this round according to the text action decision;
[0183] Step 8, execute actions in the adversarial game environment, and update the memory module constructed in step 3 according to the action results; after completing the memory module update, enter the next round of game.
[0184] For the specific limitations of each step, please refer to the above limitations on the large language model multi-agent collaborative decision-making method for adversarial games, which will not be repeated here.
[0185] The method of the present invention can effectively improve the ability of intelligent agents to make collaborative decisions in an adversarial game environment, and provides an innovative method for solving collaborative and adversarial game problems in complex systems.
[0186] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited by the above embodiments, and the above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A large language model multi-agent collaborative decision-making method for adversarial games, characterized in that: The method comprises the following steps: Step 1: Construct a fine-tuning training dataset for the large language model of collaborative decision-making in an adversarial game environment; Step 2, based on the fine-tuning training data set, using the LoRA method to fine-tune the collaborative decision-making large language model in the adversarial game environment; Step 3: Build a memory module and set its update mechanism to store the agent’s historical game data and its understanding of the game; Step 4: Obtain the initial local observation data of the agent from the adversarial game environment, and obtain the global state information required for subsequent decision-making from the shared message pool, and combine the multi-source information as the subsequent model input data; Step 5: Use the large language model for collaborative decision-making in the adversarial game environment fine-tuned in step 2 as the reasoning model for collaborative decision-making of multiple agents in the adversarial game environment, use the combined information obtained in step 4 as the input of the reasoning model, analyze the game situation, and generate a summary and analysis of the current game situation and agent strategy recommendations; Step 6, the large language model for collaborative decision-making in the adversarial game environment generates a text action decision for this round based on the result of step 5 and strictly in accordance with the format of the sample example; Step 7, generating actions for this round according to the text action decision; Step 8, execute actions in the adversarial game environment, and update the memory module constructed in step 3 according to the action results; after completing the memory module update, enter the next round of game.
2. The method for collaborative decision-making of multi-agents with a large language model for adversarial games according to claim 1 is characterized in that: Step 1 constructs a fine-tuning training dataset for a large language model for collaborative decision-making in an adversarial game environment, specifically including: Step 1.1, construct the observation set and action set of training data: Collect data from the multi-agent collaborative game confrontation environment and convert it into structured data triple = [observation, action], where observation = {S self ,S enemy ,S ally } is the local observation information of the agent obtained from the game confrontation environment, including its own state S self , Enemy Status S enemy , companion status S ally There are three parts: action is the best action under observation, thereby obtaining a batch of multi-agent game confrontation data; Convert the local observation information observation of the agent into a text format suitable for input of a large language model; establish an action library action_dict = {[0: action_1], ..., [n: action_n]} for the agent in the current game confrontation environment, where n is the unique ID of each action in the action library, and action_n is the corresponding action; Step 1.2, construct the prompt statement for the training data: The structured instance data E mentioned above is obtained through the collaborative game confrontation history record, and a prompt template P is constructed for the tasks in the collaborative game confrontation environment. The instance data is added to the prompt template to generate a prompt sentence Prompt = (P, E) for model training.
3. The method for multi-agent collaborative decision-making based on a large language model for adversarial games according to claim 1 is characterized in that: Step 2 specifically includes: Step 2.1, load the software library required to fine-tune the collaborative game against the large language model; Step 2.2, data preparation: Using the fine-tuning training data set; Convert text format data into a format that the model can process; Step 2.3, fine-tune the large language model for collaborative decision-making in adversarial games: The parameters of the large language model for collaborative decision-making in adversarial games are divided into two parts: pre-trained weights and fine-tuned incremental weights. W0 is the initialization parameter of the pre-trained large language model for collaborative decision-making in adversarial games, and ΔW is the weight update amount generated during the fine-tuning process. Let the input be x and the output be h, then h = W0x + ΔWx. In the training process of LoRA, W0 is fixed, and two low-rank matrices A and B are used to represent ΔW, that is, h = W0x + BAx, B∈R d×r , A∈R r×k , where rank r<<min(d,k); Initialize A with a random Gaussian distribution and initialize B with a zero matrix. During the training process, train the low-rank matrices A and B, and only save the low-rank matrix part as the model weight. Set the training parameters, start the fine-tuning training of the adversarial game collaborative decision-making large language model, save the model weight with the lowest loss value Loss during the training process, and obtain the initial adversarial game collaborative decision-making large language model with a certain game adversarial ability. Step 2.4, evaluate and optimize: Use part of the training data to verify the model effect, evaluate the model performance on the validation set, and adjust the parameters and hyperparameters based on the results; add the trained matrix product BA to the originally fixed weight matrix W0 as the new model matrix, i.e., h = W0x + BAx, and use the weight matrix h as the new weight parameter to replace the parameters of the initial pre-trained adversarial game collaborative decision-making large language model. Compare the model test result result1 with the model test result result0 before fine-tuning through comparison indicators; If result1 is better than result0, the model fine-tuning effect is improved, and it can be used as the inference model for the subsequent multi-agent collaborative decision-making in the adversarial game environment. Otherwise, readjust the training parameters and repeat steps 2.3 and 2.4 until the test results of the fine-tuned model are better than the results before training.
4. The method for multi-agent collaborative decision-making based on a large language model for adversarial games according to claim 3 is characterized in that: Step 2.1 includes: loading the ChatGLM-6B model as the basic model of the adversarial game large model agent, and introducing the software library for processing data sets and LoRA.
5. The method for collaborative decision-making of multi-agents with a large language model for adversarial games according to claim 3 is characterized in that: The comparison index in step 2.4 uses the action decision accuracy Acc, and the calculation formula is: Among them, n is the total number of test samples, x i To represent the decision result of the large language model of collaborative decision-making in adversarial games, if the decision action is the same as the best action, the value is 1, otherwise, the value is 0.
6. The method for collaborative decision-making of multi-agents with a large language model for adversarial games according to claim 1 is characterized in that: Step 3 specifically includes: Step 3.1, build the memory module: Define the memory module Memory = (History, Belief, Example), where History is the historical state information and historical action sequence of the current agent in this round of the game, Belief is the summary of the agent's in-depth understanding of the game during the game, and Example is a sample example, including positive samples and negative samples. The adversarial game collaborative decision-making large language model should refer to positive samples and negative samples when making decisions; Step 3.2, set the memory module space limit: The memory module only retains the historical data of the previous k rounds of the current agent; Step 3.3, set the update mechanism of the memory module: The memory module is updated after each round of action. If the historical data does not exceed the space limit of the memory storage, the data is directly stored in the memory module. Otherwise, the earliest historical data in the memory module is deleted and the new data is stored in the memory module.
7. The method for collaborative decision-making of multi-agents with a large language model for adversarial games according to claim 1 is characterized in that: Step 4 specifically includes: Step 4.1, obtain the initial local observation data of the agent: Obtain the initial local observation data of the agent from the adversarial game environment, and define the initial local observation data of the agent as observation = {S self ,S enemy ,S ally }; Among them, the state S self =(H, S, R), enemy status S enemy =(VA, P, H, S, R), companion status S ally =(VA, P, H, S, R), H is the relative health, S is the relative shield value, R is the type of soldier, VA is whether it is visible and alive, and P is the relative position; Step 4.2, obtain the global state information of the adversarial game environment: Obtain the global state information State=(Agent_1,Agent_2,…,Agent_n) required for the agent's subsequent decision-making from the shared message pool, where Agent_n is the historical data shared by Agent_n in the adversarial game. When the agent needs to use the global state information to judge the intention of its companions, it can access the shared message pool to obtain the global state information for subsequent decision-making; Step 4.3, combine the above information and convert it into text data as the input of the model: The combined data is expressed in natural language as text data that can be understood by the large language model of adversarial game collaborative decision-making. The whole process is formalized as follows: in, For the process of text data conversion, V is a finite vocabulary of words related to the current adversarial game environment, and o is the input data of the adversarial game collaborative decision-making large language model.
8. The method for collaborative decision-making of multi-agents with a large language model for confrontational games according to claim 7 is characterized in that: Step 5 specifically includes: Step 5.1, summarize the game situation: According to the combined data obtained in step 4, the large language model of collaborative decision-making in adversarial games summarizes the current game situation and formalizes the whole process as follows: in, The process of summarizing the game situation for the adversarial game collaborative decision-making large language model. Summary is the current game situation summary obtained by the adversarial game collaborative decision-making large language model based on the combined data; Step 5.2, analyze the game situation: Based on the above summary of the game situation, as well as the record of historical game data and its understanding of the game in the agent's memory module Memory, the adversarial game collaborative decision-making language model is used to analyze the game situation, including the advantages and disadvantages of both sides, threats and opportunities, and dynamic changes in the situation. The whole process is formally expressed as: in, It is the process of analyzing the game situation by the big language model of collaborative decision-making in adversarial games. Analysis is the analysis of the current game situation drawn by the big language model of collaborative decision-making in adversarial games based on the summary of the game situation. Step 5.3, generate policy recommendations: According to the above game situation analysis, the adversarial game collaborative decision-making large language model generates strategic suggestions for the agent to make collaborative decisions in the current adversarial game environment, including tactical suggestions, measures and plans to deal with possible actions of the enemy; the whole process is formally expressed as: in, It is the process of generating strategy suggestions for the big language model of collaborative decision-making in adversarial games. Suggestion is the action strategy suggestion given by the big language model of collaborative decision-making in adversarial games based on the analysis of the current situation.
9. The method for collaborative decision-making of multi-agents with a large language model for adversarial games according to claim 1, characterized in that: Step 7 specifically includes: Step 7.1, action extraction: The text action decision generated in step 6 is used to extract actions from the action library action_dict of the intelligent agent. Through regular matching, the actions matching the action library are extracted from the complex text generated by the large language model of the adversarial game collaborative decision-making, and the executable actions in the adversarial game environment are obtained. The whole process is formally expressed as: action=ε(v i ) Among them, ε is the action extractor based on regular matching, v i The text action decision generated in step 6; Step 7.2, action validity check: The actions extracted in step 7.1 are evaluated and checked for validity to ensure that the actions can be executed in the game.
10. The method for large language model multi-agent collaborative decision-making for adversarial games according to claim 9, characterized in that: In step 7.2, the actions extracted in step 7.1 are evaluated and checked for validity to ensure that the actions can be executed in the game. Specifically: Among them, Efc is the result of the action validity check by the large language model of the adversarial game collaborative decision-making. If the action can be executed by the agent in the current adversarial game scenario, the value is 1, otherwise, the value is 0; If Efc=1, the action decision inferred by the large language model of collaborative decision-making in the adversarial game is valid and can be used as the action of the agent in the next round of the adversarial game; if Efc=0, the action decision is made again, and steps 5, 6 and 7 are repeated until the large language model of collaborative decision-making in the adversarial game comes up with a valid action decision.
Citation Information
Cited By
Comprehensive energy coordinated optimization method and system based on language model analysis
CN119228092A
Hierarchical multi-agent game confrontation and collaborative decision-making algorithm based on federated learning
CN119443312A
High-confidence unmanned aerial vehicle game decision intelligent sensing system
CN119646232A
A high-confidence UAV game decision-making intelligent perception system
CN119646232B
Network security situation analysis method and device based on multi-agent cooperation
CN120263466A
