Group game strategy generation method and group game method

By constructing an initial policy population and iteratively optimizing it to generate executable policy code, the interpretability and training efficiency issues of policy generation in existing technologies are solved, achieving efficient and diverse group game policy generation, which is suitable for demanding application scenarios.

CN122021941APending Publication Date: 2026-05-12INST OF AUTOMATION CHINESE ACAD OF SCI
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
INST OF AUTOMATION CHINESE ACAD OF SCI
Filing Date
2026-04-10
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing group game strategy generation technologies have bottlenecks in terms of strategy interpretability and agent training efficiency, especially in terms of strategy interpretability and diversity, making it difficult to meet the needs of high-frequency or real-time games.

Method used

By acquiring an initial prompt vocabulary, generating initial policy code using a large language model, constructing an initial policy population, and solving the Nash equilibrium distribution of mixed policies through multiple rounds of iteration, an executable and well-structured restraint policy code is generated. Combined with grammatical validity checks and hyperparameter optimization, the policy population is updated and optimized.

Benefits of technology

The generated policy code is interpretable and diverse, reducing computational power consumption and time costs. It is suitable for application scenarios with high requirements for policy interpretability and logical complexity, and improves the robustness and credibility of the agent in complex games.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122021941A_ABST
    Figure CN122021941A_ABST
Patent Text Reader

Abstract

The invention provides a group game strategy generation method and a group game method, and relates to the technical field of artificial intelligence, a game strategy is explicitly defined as an executable strategy code with a clear structure, so that people can directly read decision logic of an intelligent agent, strategy interpretability is achieved, a user can debug and correct logic vulnerabilities conveniently, and user experience is improved. And the method can also be applied to the field with high requirements on safety and compliance. Moreover, according to the method, programming knowledge of a large language model is utilized, so that the generated strategy population has natural diversity in algorithm structure, strategy codes with high-level competitiveness can be directly written in the initial stage of the game, zero-sample cold start is realized, and computing power consumption and time cost are greatly reduced. The method can be suitable for application scenes with high requirements for strategy interpretability, logic complexity and diversity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method for generating group game strategies and a group game method. Background Technology

[0002] In the fields of artificial intelligence and complex system control, swarm game theory has always been a core research challenge. Swarm game theory refers to the participation of a large number of intelligent agents, where individual gains depend not only on their own strategies but also on the interaction of the strategies of other participants. It is widely used in application scenarios such as swarm confrontation in large-scale real-time strategy games and attack and defense exercises in cybersecurity.

[0003] Currently, in the fields of group game theory and multi-agent systems, the core idea of ​​policy generation technology based on neural network parameter optimization is to model the agent's policy as a deep neural network, with the policy knowledge implicitly stored in the deep neural network. Its workflow typically relies on large-scale self-play, where the agent continuously plays against itself to collect a large amount of state and action data, and then uses gradient descent or evolutionary algorithms to fine-tune the network parameters. While these methods exhibit excellent performance in terms of reaction speed and accuracy, the interpretability and controllability of the generated policies are poor, lacking an explicit logical structure.

[0004] With the rise of generative artificial intelligence, researchers have begun to explore using the semantic understanding capabilities of large language models for decision-making. These methods do not train specific network parameters; instead, they design natural language prompts to describe the game strategy, current situation, and historical information to the large language model, allowing it to directly output suggestions for the next move or tactical analysis. This approach leverages the general reasoning capabilities of large language models and possesses a degree of zero-shot adaptability. However, because it relies on natural language for thought chain reasoning, its decision-making process is often accompanied by the risk of illusion, and its reasoning speed is relatively slow, making it difficult to meet the needs of high-frequency or real-time games. Furthermore, its strategic logic remains unstructured natural language text rather than rigorous executable logic.

[0005] Furthermore, reinforcement learning typically starts training with randomly initialized weights, requiring the agent to explore a large number of actions to learn basic policies, leading to difficulties in cold starts and consuming huge amounts of computing power and time.

[0006] In summary, existing policy generation techniques have bottlenecks in terms of policy interpretability and agent training efficiency, thus necessitating a new method for generating strategies in group games. Summary of the Invention

[0007] This invention provides a method for generating group game strategies and a group game method to address the deficiencies in related technologies.

[0008] This invention provides a method for generating group game strategies, comprising: Obtain an initial prompt word library, which includes multiple initial prompt words, each of which includes a game strategy description text; Based on the initial prompt vocabulary, a large language model is applied to generate a preset number of initial strategy codes, and an initial strategy population is constructed based on each of the initial strategy codes; The initial policy population is iterated multiple times. In each iteration, a combinatorial game is performed based on the policy codes in the current policy population, and the mixed policy Nash equilibrium distribution of the current policy population is solved. Based on the optimal strategy code corresponding to the Nash equilibrium distribution of the hybrid strategy and the game trajectory record of the winning strategy code in the game, the large language model is applied to generate the restraining strategy code corresponding to the optimal strategy code, and the current strategy population is updated based on the restraining strategy code.

[0009] According to a method for generating group game strategies provided by the present invention, the step of updating the current strategy population based on the restraint strategy code includes, prior to: Perform a syntax validity check on the aforementioned restraint strategy code; If the restraint strategy code contains a syntax error, then based on the syntax error information of the restraint strategy code, the optimal strategy code, and the game trajectory record, the large language model is applied to generate a syntactically correct restraint strategy code.

[0010] According to a method for generating group game strategies provided by the present invention, the step of updating the current strategy population based on the restraint strategy code further includes: If the restraint strategy code contains adjustable hyperparameters, then a self-game is performed based on the restraint strategy code, and the optimal parameter configuration of the adjustable hyperparameters is determined during the self-game process. Based on the optimal parameter configuration, determine the optimal restraint strategy code.

[0011] According to a method for generating strategies in a group game provided by the present invention, the step of solving the mixed-policy Nash equilibrium distribution of the current strategy population includes: Calculate the meta-game payoff matrix obtained from the combinatorial game; Based on the meta-game payoff matrix, the mixed-policy Nash equilibrium distribution of the current policy population is solved.

[0012] According to a group game strategy generation method provided by the present invention, the termination condition of the multi-round iteration includes any of the following conditions: The maximum number of iterations has been reached. The meta-game payoff matrix converges.

[0013] According to a group game strategy generation method provided by the present invention, each of the initial prompt words further includes tactical style information, and the initial prompt word library contains diverse tactical style information.

[0014] This invention also provides a group game theory method, comprising: Based on the above-mentioned group game strategy generation method, the target mixed strategy Nash equilibrium distribution of the optimal strategy population is determined. Based on the Nash equilibrium distribution of the target mixed strategy, a target strategy code is selected from the optimal strategy population, and the target strategy code is executed to conduct the game.

[0015] The present invention also provides a group game strategy generation device, comprising: The acquisition module is used to acquire an initial prompt word library, which includes multiple initial prompt words, each of which includes a game strategy description text; The population construction module is used to generate a preset number of initial strategy codes based on the initial prompt vocabulary and a large language model, and to construct an initial strategy population based on each of the initial strategy codes. The population iteration module is used to perform multiple rounds of iteration on the initial strategy population. In each round of iteration, a combinatorial game is performed based on the strategy codes in the current strategy population, and the mixed strategy Nash equilibrium distribution of the current strategy population is solved. The population update module is used to generate a restraining strategy code corresponding to the optimal strategy code based on the optimal strategy code corresponding to the Nash equilibrium distribution of the mixed strategy and the game trajectory record of the optimal strategy code winning in the game, by applying the large language model, and to update the current strategy population based on the restraining strategy code.

[0016] The present invention also provides a group game device, comprising: The equilibrium distribution determination module is used to determine the target mixed policy Nash equilibrium distribution of the optimal policy population based on the above-mentioned group game strategy generation method. The game-playing module is used to select a target strategy code from the optimal strategy population based on the target mixed strategy Nash equilibrium distribution, and execute the target strategy code to conduct a game.

[0017] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the group game strategy generation method or group game method as described above.

[0018] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the group game strategy generation method or group game method as described above.

[0019] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the group game strategy generation method or group game method as described above.

[0020] The group game strategy generation method and group game method provided by this invention explicitly define the game strategy as executable and structurally clear strategy code, allowing humans to directly read the decision logic of the intelligent agent. This provides strategy interpretability, facilitating user debugging and correction of logical vulnerabilities, and enabling application in fields with high security and compliance requirements. Furthermore, this method utilizes programming knowledge from large language models, resulting in a naturally diverse algorithmic population of generated strategies. It also allows for the direct writing of highly competitive strategy code at the initial stage of the game, achieving zero-sample cold start and significantly reducing computational power consumption and time costs. This method is suitable for application scenarios with high requirements for strategy interpretability, logical complexity, and diversity. Attached Figure Description

[0021] To more clearly illustrate the technical solutions in this invention or related technologies, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 This is one of the flowcharts illustrating the group game strategy generation method provided by the present invention.

[0023] Figure 2 This is the second flowchart of the group game strategy generation method provided by the present invention.

[0024] Figure 3 This is a flowchart illustrating the group game theory method provided by the present invention.

[0025] Figure 4 This is a schematic diagram of the group game strategy generation device provided by the present invention.

[0026] Figure 5 This is a schematic diagram of the group game device provided by the present invention.

[0027] Figure 6 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0028] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0029] To address the issues of interpretability and agent training efficiency in existing policy generation techniques, this invention provides a method for generating group game strategies that can directly generate readable policy code with high efficiency.

[0030] Figure 1 This is a flowchart illustrating a group game strategy generation method provided in an embodiment of the present invention, such as... Figure 1 As shown, the method includes: S11, Obtain an initial prompt word library, wherein the initial prompt word library includes multiple initial prompt words, and each initial prompt word includes a game strategy description text; S12, based on the initial prompt vocabulary, apply a large language model to generate a preset number of initial strategy codes, and construct an initial strategy population based on each of the initial strategy codes; S13, perform multiple rounds of iteration on the initial strategy population. In each round of iteration, perform combinatorial game based on the strategy codes in the current strategy population, and solve the mixed strategy Nash equilibrium distribution of the current strategy population. S14. Based on the optimal strategy code corresponding to the Nash equilibrium distribution of the mixed strategy and the game trajectory record of the winning strategy code in the game, the large language model is applied to generate the restraining strategy code corresponding to the optimal strategy code, and the current strategy population is updated based on the restraining strategy code.

[0031] Specifically, the group game strategy generation method provided in this embodiment of the invention is executed by a group game strategy generation device, which can be configured in a computer. The computer can be a local computer or a cloud computer. The local computer can be a computer, tablet, etc., and no specific limitation is made here.

[0032] First, step S11 is executed to determine the game environment and the allowed programming languages, and to obtain the initial prompt word library.

[0033] The programming language can be set as needed; for example, it can be C, Python, etc.

[0034] The initial prompt word library can include multiple initial prompt words, each of which includes a game strategy description text. Here, the game strategy description text describes the rules of the game and can be obtained through user input.

[0035] Next, step S12 is executed, where some or all of the initial prompt words in the initial prompt word library are used as input to the Large Language Model (LLM). The powerful programming and reasoning capabilities of the LLM are applied to generate a preset number of initial policy codes. The preset number can be set as needed and is not specifically limited here. Each initial policy code is a complete, callable program code class policy.

[0036] Understandably, when applying a large language model, it is also necessary to determine the application programming interface (API) documentation for the large language model, through which the large language model can be applied.

[0037] Due to the randomness of the results generated by the large language model, different initial strategy codes can correspond to either the same initial prompt word or different prompt words.

[0038] Furthermore, the generated initial policy codes can constitute an initial policy population. Each initial policy code can be considered an individual within the initial policy population.

[0039] The initial policy population can be represented as N represents the preset quantity.

[0040] Then, step S13 is executed, performing multiple rounds of iteration on the initial policy population. In each iteration, different agents engage in combinatorial games using the policy codes in the current policy population. Specifically, the policy codes in the current policy population are first subjected to full permutations or sampled combinations, and then different agents select policy codes from each combination for gameplay. For example, the policy codes... With strategy code For a combination, the agent selects the policy code. and selection strategy code Another intelligent agent engages in a game.

[0041] Find the mixed-policy Nash equilibrium distribution of the current policy population during a game. The mixed-policy Nash equilibrium distribution refers to the probability distribution of the optimal mixed-policy code in the current policy population.

[0042] In a mixed-strategy Nash equilibrium distribution, the strategy code corresponding to the highest probability is the optimal strategy code. Furthermore, the game trajectory record of the optimal strategy code winning in the game can be determined; that is, a systematic record of the execution logic and payoff changes of the optimal strategy code during the game process. This is usually presented in the form of graphs, data, or models, and is used to analyze the dynamic evolution and equilibrium state of the game process.

[0043] Finally, in step S14, using the optimal strategy code corresponding to the mixed-policy Nash equilibrium distribution and the game trajectory record of the optimal strategy code winning in the game, a large language model can be applied to generate the counter-strategy code corresponding to the optimal strategy code. Here, the counter-strategy code refers to the strategy code that can be used to successfully attack the optimal strategy code. Target prompts can be constructed first using the optimal strategy code and the game trajectory record, combined with the counter-strategy prompt word template.

[0044] For example, the counter-strategy prompt template could be: "The current strongest strategy code is [optimal strategy code], and its core logic is [game trajectory record]. Please analyze the logical flaws of the current strongest strategy code and write a new strategy code to defeat it." By filling in the optimal strategy code and the game trajectory record in the corresponding positions, the target prompt can be obtained.

[0045] By using the target prompt word as input to the large language model, a new policy code can be generated and output. This new policy code is the restraint policy code.

[0046] Furthermore, adding the restraint policy code generated by the large language model to the current policy population allows for updating the current policy population and obtaining the next generation of policy populations. For example, if the current policy population is... The restraint strategy code is Then the next generation of strategy population It can be represented as: .

[0047] In step S14, the large language model can act as an intelligent mutation operator in the traditional genetic algorithm to continuously improve the diversity of the current strategy population by expanding the current strategy population through the generated restraint strategy code.

[0048] Afterward, the next generation of policy population continues to iterate as the current policy population. The iteration ends when the number of iterations reaches the maximum number of iterations. The maximum number of iterations can be set as needed and is not specifically limited here.

[0049] After iteration, the optimal policy population is obtained, which constitutes the optimal policy codebase. This policy codebase satisfies the requirements of diversity, logical transparency, and interpretability, thereby improving the robustness and credibility of the agent in complex games. Furthermore, the hybrid policy Nash equilibrium distribution of this optimal policy population is the target hybrid policy Nash equilibrium distribution.

[0050] When the game strategy changes, the strategy change description is input into the large language model. The large language model can accurately locate and modify the relevant individuals in the optimal strategy population without retraining the network, thus enabling rapid adaptation to environmental changes and low-cost maintenance.

[0051] The group game strategy generation method provided in this invention explicitly defines the game strategy as executable and structurally clear strategy code, allowing humans to directly read the decision logic of the intelligent agent. This provides strategy interpretability, facilitating user debugging and correction of logical flaws, and enabling application in fields with high security and compliance requirements. Furthermore, by leveraging the programming knowledge of large language models, this method not only ensures the generated strategy population possesses inherent diversity in algorithmic structure but also allows for the direct writing of highly competitive strategy code at the initial stage of the game, achieving zero-sample cold start and significantly reducing computational power consumption and time costs. This method is applicable to application scenarios with high requirements for strategy interpretability, logical complexity, and diversity. For example, in quantitative finance and trading, it can generate and evolve strategy code, facilitating compliance review and risk control. In large-scale real-time strategy and MOBA game AI, it can be used to generate macro-level scripts for the game. In industrial logistics and supply chain scheduling, it can automatically generate scheduling strategy code.

[0052] Based on the above embodiments, the step of updating the current strategy population based on the restraint strategy code includes the following prior steps: Perform a syntax validity check on the aforementioned restraint strategy code; If the restraint strategy code contains a syntax error, then based on the syntax error information of the restraint strategy code, the optimal strategy code, and the game trajectory record, the large language model is applied to generate a syntactically correct restraint strategy code.

[0053] Specifically, since the restraint strategy code generated by the large language model may contain syntax errors, the Abstract Syntax Tree (AST) parsing tool can be used to check the syntax validity of the restraint strategy code before applying it.

[0054] If the judgment result is that the restraint strategy code has a syntax error, the syntax error information of the restraint strategy code, the optimal strategy code, and the game trajectory record can be used to reconstruct the target prompt word. The new target prompt word is used as the input of the large language model. The large language model uses the syntax error information to self-correct and then regenerates the grammatically correct restraint strategy code.

[0055] In this embodiment of the invention, by feeding back grammatical error information to the large language model, the large language model can self-correct, improve the grammatical accuracy of the generated restraint policy code, and thus enhance the usability of the policy code in the optimal policy population.

[0056] Based on the above embodiments, the step of updating the current strategy population based on the restraint strategy code further includes: If the restraint strategy code contains adjustable hyperparameters, then a self-game is performed based on the restraint strategy code, and the optimal parameter configuration of the adjustable hyperparameters is determined during the self-game process. Based on the optimal parameter configuration, determine the optimal restraint strategy code.

[0057] Specifically, since the restraint strategy code generated by the large language model may contain unoptimized adjustable hyperparameters, such as a threshold of 0.5, a self-game can be conducted using restraint strategy codes with different adjustable hyperparameters before applying the restraint strategy code. During the self-game, a gradient-free optimization algorithm can be used to quickly find the optimal parameter configuration under the logic of the restraint strategy code. This gradient-free optimization algorithm can be CMA-ES or other algorithms.

[0058] The optimal parameter configuration can be expressed as: , For optimal parameter configuration, This indicates that the restraint strategy code contains adjustable hyperparameters. , This represents the optimization function of a gradient-free optimization algorithm.

[0059] In this embodiment of the invention, the optimal parameter configuration of the adjustable hyperparameters in the restraint strategy code is determined through a self-game process, thereby improving the game success rate of the restraint strategy code and thus enhancing the availability of the strategy code in the optimal strategy population.

[0060] Based on the above embodiments, solving the mixed-policy Nash equilibrium distribution of the current policy population includes: Calculate the meta-game payoff matrix obtained from the combinatorial game; Based on the meta-game payoff matrix, the mixed-policy Nash equilibrium distribution of the current policy population is solved.

[0061] Specifically, when solving for the mixed-policy Nash equilibrium distribution of the current policy population, we can first calculate the meta-game payoff matrix obtained from the combinatorial game. Each element in the meta-game payoff matrix represents the expected payoff of the two policy codes in the game. For example, the meta-game payoff matrix is... The element in the i-th row and j-th column of the meta-game payoff matrix is... , indicating strategy code Adversarial strategy code The expected return, and have , As expected, Indicates strategy code Adversarial strategy code The payoff function.

[0062] Subsequently, using the meta-game payoff matrix, the mixed-policy Nash equilibrium distribution of the current policy population can be solved. The mixed-policy Nash equilibrium distribution can be expressed as: ; in, The mixed-policy Nash equilibrium distribution represents the distribution of each combination in the current policy population under the mixed-policy Nash equilibrium. coefficient The probability vector formed.

[0063] Based on the above embodiments, the termination condition for multiple iterations can also be that the meta-game payoff matrix converges, that is, the meta-game payoffs do not significantly improve.

[0064] In evolutionary game theory, to prevent being targeted by an opponent, a hybrid equilibrium containing multiple heterogeneous strategies needs to be constructed. However, existing technologies typically use a fixed network architecture to train all agents, resulting in a homogeneous cognitive topology for processing information. This structural uniformity leads to generated strategies often lacking fundamental tactical differentiation, making them vulnerable to exploitation by the opponent and preventing the formation of genuine checks and balances and robust defenses.

[0065] Based on this, in addition to the above embodiments, each of the initial prompt words also includes tactical style information, and the initial prompt word library contains diverse tactical style information.

[0066] Specifically, each initial prompt word in the initial prompt word library includes not only the game strategy description text, but also tactical style information, which describes the tactical style of the initial strategy code to be generated.

[0067] Understandably, tactical style can be determined by the algorithm used to generate the initial policy code. Therefore, the tactical style information contained in each initial cue word can be one of the following: a policy based on a greedy algorithm, a policy based on a random forest, a policy based on a rule system, a policy based on Monte Carlo tree search, or a policy based on a heuristic algorithm.

[0068] Furthermore, the initial cue word library as a whole can contain diverse tactical style information, meaning that each initial cue word in the initial cue word library contains at least two different tactical style information.

[0069] Therefore, by using an initial prompt lexicon and applying a large language model, an initial strategy population with diverse tactical styles can be generated, and through population iteration, each current strategy population can have a diverse tactical style.

[0070] In this embodiment of the invention, by introducing diverse tactical style information, the strategy populations can be made heterogeneous, which further enhances diversity, and the resulting mixed strategy Nash equilibrium distribution is more stable.

[0071] Based on the above embodiments, such as Figure 2 As shown, the specific steps of the group game strategy generation method provided in this embodiment of the invention may include, in sequence: Obtain the initial suggestion dictionary; Based on the initial prompt vocabulary, a large language model is applied to generate a preset number of initial strategy codes, and an initial strategy population is constructed based on each initial strategy code; Starting from the initial policy population, multiple rounds of iteration are performed. In each round of iteration, a combinatorial game is conducted based on the policy codes in the current policy population, and the mixed policy Nash equilibrium distribution of the current policy population is solved. Based on the optimal strategy code corresponding to the mixed strategy Nash equilibrium distribution and the game trajectory record of the optimal strategy code winning in the game, a large language model is applied to generate the restraint strategy code corresponding to the optimal strategy code. Perform a syntax validity check on the restraint strategy code, and generate a syntactically correct restraint strategy code when there is a syntax error in the restraint strategy code; If the restraint strategy code contains adjustable hyperparameters, then a self-game is performed based on the restraint strategy code, and during the self-game, the optimal parameter configuration of the adjustable hyperparameters is determined. Based on the optimal parameter configuration, the restraint strategy code with optimal parameters is determined. Add the restraint strategy code to the current strategy population to update the current strategy population and obtain the next generation strategy population; Determine whether the termination condition for multiple iterations is met. If it is met, the iteration ends, the next generation of policy population is taken as the optimal policy population, and the target mixed policy Nash equilibrium distribution of the optimal policy population is determined. If it is not met, the next generation of policy population is taken as the current policy population and the iteration continues until the termination condition for multiple iterations is met.

[0072] like Figure 3 As shown, based on the above embodiments, this embodiment of the invention provides a group game theory method, including: S21. Based on the group game strategy generation method provided in the above embodiments, determine the target mixed strategy Nash equilibrium distribution of the optimal strategy population. S22, based on the target mixed strategy Nash equilibrium distribution, select the target strategy code from the optimal strategy population and execute the target strategy code to conduct the game.

[0073] Specifically, the group game method provided in this embodiment of the invention is executed by a group game device, which can be configured within an intelligent body.

[0074] First, step S21 is executed, based on the group game strategy generation method provided in the above embodiments, to determine the target mixed strategy Nash equilibrium distribution of the optimal strategy population obtained after the iteration.

[0075] Then, step S22 is executed. Using the Nash equilibrium distribution of the target mixed policy, the policy code with the highest probability in the optimal policy population can be selected as the target policy code, and the target policy code is executed to conduct the game. This game can be a game against other intelligent agents, a human-computer game with a user, or other forms of competition; no specific limitations are made here.

[0076] The group game method provided in this embodiment of the invention, by employing the optimal strategy population and its target mixed strategy Nash equilibrium distribution obtained by the group game strategy generation method provided in the above embodiments, can enable the agent to exhibit unpredictable and robust game behavior.

[0077] like Figure 4 As shown, based on the above embodiments, this embodiment of the invention provides a group game strategy generation device, including: The acquisition module 41 is used to acquire an initial prompt word library, which includes multiple initial prompt words, each of which includes a game strategy description text; The population construction module 42 is used to generate a preset number of initial strategy codes based on the initial prompt vocabulary and a large language model, and to construct an initial strategy population based on each of the initial strategy codes. The population iteration module 43 is used to perform multiple rounds of iteration on the initial strategy population. In each round of iteration, a combinatorial game is performed based on the strategy codes in the current strategy population, and the mixed strategy Nash equilibrium distribution of the current strategy population is solved. The population update module 44 is used to generate a restraining strategy code corresponding to the optimal strategy code based on the optimal strategy code corresponding to the Nash equilibrium distribution of the mixed strategy and the game trajectory record of the optimal strategy code winning in the game, by applying the large language model, and to update the current strategy population based on the restraining strategy code.

[0078] Specifically, the functions of each module in the group game strategy generation device provided in this embodiment of the invention correspond one-to-one with the operation flow of each step in the above method-like embodiments, and the achieved effects are also the same. For details, please refer to the above embodiments, and this will not be repeated in this embodiment of the invention.

[0079] like Figure 5 As shown, based on the above embodiments, this embodiment of the invention provides a group game-playing device, including: The equilibrium distribution determination module 51 is used to determine the target mixed strategy Nash equilibrium distribution of the optimal strategy population based on the group game strategy generation method provided in the above embodiments. The game-playing module 52 is used to select a target strategy code from the optimal strategy population based on the target mixed strategy Nash equilibrium distribution, and execute the target strategy code to conduct a game.

[0080] Specifically, the functions of each module in the group game device provided in this embodiment of the invention correspond one-to-one with the operation flow of each step in the above method-like embodiments, and the achieved effects are also the same. For details, please refer to the above embodiments, and this will not be repeated in this embodiment of the invention.

[0081] Figure 6 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 6 As shown, the electronic device may include a processor 810, a communications interface 820, a memory 830, and a communication bus 840, wherein the processor 810, the communications interface 820, and the memory 830 communicate with each other via the communication bus 840. The processor 810 can call logical instructions in the memory 830 to execute the group game strategy generation method or group game method provided in the above embodiments.

[0082] Furthermore, the logical instructions in the aforementioned memory 830 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to related technologies, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0083] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the group game strategy generation method or the group game method provided in the above embodiments.

[0084] In another aspect, the present invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the group game strategy generation method or group game method provided in the above embodiments. This computer-readable storage medium can be either a non-transitory computer-readable storage medium or a transient computer-readable storage medium, and is not specifically limited herein.

[0085] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0086] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of software products. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0087] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for generating strategies in group games, characterized in that, include: Obtain an initial hint word library, which includes multiple initial hint words, each of which includes a game strategy description text; Based on the initial prompt vocabulary, a large language model is applied to generate a preset number of initial strategy codes, and an initial strategy population is constructed based on each of the initial strategy codes; The initial policy population is iterated multiple times. In each iteration, a combinatorial game is performed based on the policy codes in the current policy population, and the mixed policy Nash equilibrium distribution of the current policy population is solved. Based on the optimal strategy code corresponding to the Nash equilibrium distribution of the hybrid strategy and the game trajectory record of the winning strategy code in the game, the large language model is applied to generate the restraining strategy code corresponding to the optimal strategy code, and the current strategy population is updated based on the restraining strategy code.

2. The method for generating group game strategies according to claim 1, characterized in that, The step of updating the current policy population based on the restraint strategy code includes, prior to: Perform a syntax validity check on the aforementioned restraint strategy code; If the restraint strategy code contains a syntax error, then based on the syntax error information of the restraint strategy code, the optimal strategy code, and the game trajectory record, the large language model is applied to generate a syntactically correct restraint strategy code.

3. The method for generating group game strategies according to claim 1, characterized in that, The step of updating the current policy population based on the restraint strategy code includes, prior to: If the restraint strategy code contains adjustable hyperparameters, then a self-game is performed based on the restraint strategy code, and the optimal parameter configuration of the adjustable hyperparameters is determined during the self-game process. Based on the optimal parameter configuration, determine the optimal restraint strategy code.

4. The method for generating group game strategies according to any one of claims 1-3, characterized in that, Solving for the mixed-policy Nash equilibrium distribution of the current policy population includes: Calculate the meta-game payoff matrix obtained from the combinatorial game; Based on the meta-game payoff matrix, the mixed-policy Nash equilibrium distribution of the current policy population is solved.

5. The method for generating group game strategies according to claim 4, characterized in that, The termination condition for the multi-round iteration includes any of the following conditions: The maximum number of iterations has been reached. The meta-game payoff matrix converges.

6. The method for generating group game strategies according to any one of claims 1-3, characterized in that, Each of the initial prompt words also includes tactical style information, and the initial prompt word library contains diverse tactical style information.

7. A group game theory method, characterized in that, include: Based on the group game strategy generation method as described in any one of claims 1-6, the target mixed strategy Nash equilibrium distribution of the optimal strategy population is determined; Based on the Nash equilibrium distribution of the target mixed strategy, a target strategy code is selected from the optimal strategy population, and the target strategy code is executed to conduct the game.

8. A group game strategy generation device, characterized in that, include: The acquisition module is used to acquire an initial prompt word library, which includes multiple initial prompt words, each of which includes a game strategy description text; The population construction module is used to generate a preset number of initial strategy codes based on the initial prompt vocabulary and a large language model, and to construct an initial strategy population based on each of the initial strategy codes. The population iteration module is used to perform multiple rounds of iteration on the initial strategy population. In each round of iteration, a combinatorial game is performed based on the strategy codes in the current strategy population, and the mixed strategy Nash equilibrium distribution of the current strategy population is solved. The population update module is used to generate a restraining strategy code corresponding to the optimal strategy code based on the optimal strategy code corresponding to the Nash equilibrium distribution of the mixed strategy and the game trajectory record of the optimal strategy code winning in the game, by applying the large language model, and to update the current strategy population based on the restraining strategy code.

9. A group game-playing device, characterized in that, include: The equilibrium distribution determination module is used to determine the target mixed strategy Nash equilibrium distribution of the optimal strategy population based on the group game strategy generation method as described in any one of claims 1-6. The game-playing module is used to select a target strategy code from the optimal strategy population based on the target mixed strategy Nash equilibrium distribution, and execute the target strategy code to conduct a game.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the group game strategy generation method as described in any one of claims 1-6, or the group game method as described in claim 7.