Intelligent agent setting optimization method based on evolutionary algorithm

Through the agent setting optimization method based on evolution algorithm, the most adaptable mutant agent is generated, which solves the problem that agent setting is difficult to automatically optimize in the existing technology, and realizes the realistic agent behavior in the virtual sandbox environment. Simulation and scene compliance.

CN119180295APending Publication Date: 2024-12-24SOUTHERN UNIVERSITY OF SCIENCE AND TECHNOLOGY

Patent Information

Application Number
CN202410974819.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-19
Publication Date
2024-12-24

AI Technical Summary

Technical Problem

The prior art is difficult to automatically optimize the settings of the agent so that it can realistically simulate human behavior in a virtual sandbox environment. Especially in complex scenarios, it is difficult to ensure that the action logic of the agent meets the needs of the scene and lacks sufficient background. There is nothing to do when it comes to information.

Method used

Adopting an agent setting optimization method based on evolutionary algorithm, pre-processing and mutation processing are performed by receiving the agent setting information input by the user, multiple mutation agents are generated, and the optimal mutation agent is determined based on the evaluation indicators, so that it can be used to make it Work in a sandbox environment.

Benefits of technology

There is no need for human correction to ensure that the action logic of the agent meets the needs of the scenario, greatly improving the level of intelligence and simplifying the complexity of the agent's settings.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119180295A_ABST
    Figure CN119180295A_ABST
Patent Text Reader

Abstract

The invention provides an agent setting optimization method based on an evolutionary algorithm. The method comprises the following steps: receiving agent setting information input by a user; preprocessing the agent setting information to obtain a preprocessing result; based on an evolutionary algorithm, performing variation processing on the preprocessing result to obtain a plurality of variation agents; based on an evaluation index, evaluating the fitness score of each variant agent in the working scene of the sandbox environment; determining an optimal variant agent based on the fitness score of each variant agent; and determining the optimal variant agent as the agent working in the working scene. According to the method, it is ensured that the optimal variant agent finally works in the virtual sandbox environment, so that the action logic of the agent meets the scene requirement, the agent does not need to be manually corrected, and intelligence is improved to a great extent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer data processing, and in particular to an intelligent agent setting optimization method based on an evolutionary algorithm. Background Art

[0002] At present, how to use large language models (such as ChatGPT) to create intelligent agents that can simulate human behavior in a virtual sandbox environment has become a hot research trend. These agents can autonomously perform daily activities, form opinions and emotions, dialogue and interact with other agents or users, and even generate some social behaviors. By giving the agents appropriate roles, personalities, knowledge, goals, etc., designing and building a reasonable interactive virtual environment, including background maps, props, sound effects, etc., the interactions between them can simulate or restore some classic scenes (history, novels or dramas, etc.).

[0003] The setting of the agent is preset according to the story background of the target scene. Artificial settings cannot guarantee that the action logic of the agent meets the scene requirements. When the number of agents increases, the interaction within the scene will become more complicated. A slight deviation in the setting of a single agent may have a greater impact on the entire scene, and manual correction is very difficult. In addition, manual presets require sufficient and clear background information, and are powerless to restore scenes that lack information. Summary of the invention

[0004] The present invention aims to solve the above problems through evolutionary algorithms and provide a better solution for finding suitable intelligent agent settings.

[0005] The embodiment of the present invention provides an agent setting optimization method based on an evolutionary algorithm, comprising:

[0006] Receive agent setting information input by the user;

[0007] Preprocessing the agent setting information to obtain a preprocessing result;

[0008] Based on the evolutionary algorithm, the preprocessing result is mutated to obtain multiple mutated intelligent agents;

[0009] Based on the evaluation index, evaluate the fitness score of each of the variant agents in the working scenario of the sandbox environment;

[0010] Determine the best variant agent based on the fitness scores of each of the variant agents;

[0011] The optimal variant agent is determined as the agent working in the working scenario.

[0012] Optionally, the preprocessing the agent setting information to obtain a preprocessing result includes:

[0013] Parsing the setting information of the plurality of initial agents in the agent setting information; wherein the setting information at least includes name information, age information, gender information, appearance information, occupation information and background story information;

[0014] Verifying the legitimacy of the setting information of each of the initial intelligent agents;

[0015] The setting information of the initial intelligent agent that has passed the legality verification is processed by data format standardization to obtain the preprocessing result.

[0016] Optionally, the preprocessing result is subjected to mutation processing based on an evolutionary algorithm to obtain a plurality of mutated intelligent agents, including:

[0017] Based on the evolutionary algorithm, the preprocessing results are subjected to random mutation processing and crossover operation processing in sequence to obtain mutation processing data;

[0018] Based on the mutation processing data, a plurality of mutation agents are determined.

[0019] Optionally, the step of evaluating the fitness scores of the respective variant agents in the working scenarios of the sandbox environment based on the evaluation indicators includes:

[0020] Based on the preset computing system and according to the evaluation indicators, the fitness scores of each of the mutated agents in the working scenarios of the sandbox environment are calculated.

[0021] Optionally, determining the optimal variant agent based on the fitness scores of the variant agents comprises:

[0022] The mutant agent corresponding to the maximum fitness score is taken as the optimal mutant agent.

[0023] An embodiment of the present invention provides an agent setting optimization system based on an evolutionary algorithm, comprising:

[0024] A receiving module, used for receiving agent setting information input by a user;

[0025] A preprocessing module, used to preprocess the agent setting information to obtain a preprocessing result;

[0026] A mutation processing module, used to perform mutation processing on the preprocessing result based on an evolutionary algorithm to obtain multiple mutant intelligent agents;

[0027] An evaluation module, used to evaluate the fitness score of each of the variant agents in the working scenario of the sandbox environment based on the evaluation index;

[0028] A determination module, configured to determine an optimal variant agent based on the fitness scores of the respective variant agents;

[0029] A setting module is used to determine the optimal variant agent as the agent working in the working scene.

[0030] An embodiment of the present invention provides an electronic device, the electronic device comprising:

[0031] at least one processor; and

[0032] A memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the above-mentioned intelligent agent setting optimization method based on evolutionary algorithm.

[0033] An embodiment of the present invention provides a computer-readable storage medium, characterized in that the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement any of the above-mentioned intelligent agent setting optimization methods based on evolutionary algorithms when executed.

[0034] An embodiment of the present invention provides a computer program product, which includes computer instructions. When executed by an electronic device, the electronic device executes the computer program code of any of the above-mentioned intelligent agent setting optimization methods based on evolutionary algorithms.

[0035] This application has achieved the following beneficial effects:

[0036] The present application pre-processes the agent setting information, and based on the evolutionary algorithm, mutates the pre-processing results to obtain multiple mutant agents. When each mutant agent works in a virtual sandbox environment, the fitness score of each mutant agent is evaluated based on the evaluation index, and the optimal mutant agent is determined based on the fitness score of each mutant agent. The optimal mutant agent is set to ensure that the optimal mutant agent finally works in the virtual sandbox environment, so that the action logic of the agent meets the scene requirements, and there is no need for manual correction of the agent, which greatly improves the intelligence.

[0037] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings.

[0038] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:

[0040] Figure 1 A schematic diagram of an agent setting optimization method based on an evolutionary algorithm in an embodiment of the present invention;

[0041] Figure 2 is another schematic diagram of an agent setting optimization method based on an evolutionary algorithm in an embodiment of the present invention;

[0042] Figure 3 A schematic diagram of a variation operation process in an embodiment of the present invention;

[0043] Figure 4 Schematic diagram of a feedback loop mechanism in the evaluation process of evolution results in an embodiment of the present invention;

[0044] Figure 5 Schematic diagram of an agent setting optimization system based on an evolutionary algorithm in an embodiment of the present invention. DETAILED DESCRIPTION

[0045] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.

[0046] The embodiment of the present invention provides an agent setting optimization method based on an evolutionary algorithm, such as Figure 1 As shown, including:

[0047] S1, receiving agent setting information input by the user;

[0048] S2. Preprocessing the agent setting information to obtain a preprocessing result;

[0049] S3. Based on an evolutionary algorithm, performing mutation processing on the preprocessing result to obtain a plurality of mutated intelligent agents;

[0050] S4. Based on the evaluation index, evaluate the fitness score of each of the variant agents in the working scenario of the sandbox environment;

[0051] S5. Determine the optimal variant agent based on the fitness scores of the variant agents;

[0052] S6. Determine the optimal variant agent as the agent working in the working scenario.

[0053] In the above technical solution:

[0054] The agent setting information includes setting information of multiple initial agents, where an agent refers to an entity with basic characteristics of autonomy, sociality, responsiveness and proactivity, such as a game, an intelligent model or a vehicle control system; the setting information includes name information, age information, gender information, appearance information, occupation information and background story information; the agent setting information is first preprocessed; based on an evolutionary algorithm, the preprocessing result is mutated to obtain multiple mutant agents; based on an evaluation indicator, the fitness score of each mutant agent is evaluated; based on the fitness score of each mutant agent, the optimal mutant agent is determined; finally, a setting operation is performed on the optimal mutant agent, and the setting operation refers to setting the optimal mutant agent as the agent that continues to work in the virtual sandbox environment in the future.

[0055] like Figure 2 As shown in the figure, the agent setting information required for the target scenario is represented and processed, and each set of setting information is regarded as a solution. First, a certain amount of initial solutions are randomly generated according to the scale of the problem, and the initial solutions are put into the model to observe the restoration effect. The quality of each solution is evaluated according to the designed evaluation function, and the solutions with good performance are screened out. Some setting information in the screened solutions is cross-linked or randomly replaced to generate new solutions, and the new solutions are continued to be put into the model to observe the effect. Repeat the above process until a set of setting information is found to completely restore the target scenario.

[0056] The agent setting information is preprocessed, and the preprocessing results are mutated based on the evolutionary algorithm to obtain multiple mutant agents. When each mutant agent works in a virtual sandbox environment, the fitness score of each mutant agent is evaluated based on the evaluation index. Based on the fitness score of each mutant agent, the optimal mutant agent is determined, and the optimal mutant agent is set to ensure that the optimal mutant agent finally works in the virtual sandbox environment, so that the action logic of the agent meets the scene requirements, and there is no need for manual correction of the agent, which greatly improves the intelligence.

[0057] In one embodiment, the preprocessing of the agent setting information to obtain a preprocessing result includes:

[0058] Parsing the setting information of the plurality of initial agents in the agent setting information; wherein the setting information at least includes name information, age information, gender information, appearance information, occupation information and background story information;

[0059] Verifying the legitimacy of the setting information of each of the initial intelligent agents;

[0060] The setting information of the initial intelligent agent that has passed the legality verification is processed by data format standardization to obtain the preprocessing result.

[0061] In the above technical solution:

[0062] Name information, age information, gender information, appearance information, occupation information and background story information can be set in advance by the user according to actual needs; verifying the legality of the setting information refers to verifying whether the setting information is reasonable, whether there is any information that violates the law or deviates from public order and good order (for example, whether the age is within a reasonable range, etc.), and whether the gender is legal. If so, the legality verification fails; standardizing the data format of the setting information of the initial intelligent body that has passed the legality verification refers to converting the setting information of the initial intelligent body that has passed the legality verification into a unified data format. The unified data format depends on the specific virtual sandbox environment and can be set in advance by technical personnel.

[0063] The technical solution of the embodiment of the present invention is described in detail below by taking examples:

[0064] Define setting elements: First, decide what elements you want to include in your character setting. For example, personality, appearance, background, etc.

[0065] Create a library of settings: For each setting element, create a library of preset information. For example, personality can have the following numbers:

[0066] 1. Be cautious

[0067] 2. Passion

[0068] 3:Calm down

[0069] 4. Curiosity

[0070] Coding rules: Assign a specific coding range or prefix to each set element to avoid number conflicts between different elements. For example, the coding of personality can be in the 1000 series (1001, 1002, ...), appearance can be in the 2000 series, and background can be in the 3000 series.

[0071] Serialize text information: Convert the text description of each character into a series of numbers. For example, a cautious and curious character with a tall appearance and aristocratic background can be serialized as: [1001, 1004, 2003, 3002].

[0072] Application of evolutionary algorithms: In evolutionary algorithms, new character settings can be generated by mutating these numbers. Mutation can be changing a number or adding / deleting numbers in the sequence.

[0073] Decoding sequences: When evaluating new sequences generated by the evolutionary algorithm, these numbers need to be decoded back into the corresponding text descriptions for easy understanding and selection.

[0074] Code example:

[0075]

[0076] In one embodiment, the preprocessing result is subjected to mutation processing based on an evolutionary algorithm to obtain a plurality of mutated intelligent agents, including:

[0077] Based on the evolutionary algorithm, the preprocessing results are subjected to random mutation processing and crossover operation processing in sequence to obtain mutation processing data;

[0078] Based on the mutation processing data, a plurality of mutation agents are determined.

[0079] The evolutionary algorithm can realize the function of performing random mutation processing and crossover operation processing on the data, which belongs to the scope of the prior art and will not be elaborated on here; based on the evolutionary algorithm, the preprocessing results are subjected to random mutation processing (for example, changing the character's occupation, appearance, hobbies, etc.) and crossover processing (for example, combining the occupation of one character with the appearance of another character) in turn to obtain mutated processing data; the mutated processing data includes multiple intelligent agents newly assigned with setting information, that is, multiple mutated intelligent agents.

[0080] like Figure 3 As shown, it is a specific example of the technical solution of an embodiment of the present invention: first, the initial agent setting information is input to set the mutation parameters, such as the mutation rate and the crossover rate (these two parameters are parameters in the existing evolutionary algorithm and will not be described in detail), etc., after the mutation operation controller, the mutation operation controller is used to perform crossover mutation and random mutation. In the crossover mutation process, the attributes set by multiple agents are combined. In the random mutation process, the attributes are randomly changed. After the crossover mutation process and the random mutation process, the mutation result is verified, and then the diversity evaluation is performed to obtain the output mutation result.

[0081] In one embodiment, the step of evaluating the fitness scores of the variant agents in the working scenarios of the sandbox environment based on the evaluation indicators includes:

[0082] Based on the preset calculation system and according to the evaluation index, the fitness score of each of the mutated intelligent agents is calculated.

[0083] In the above technical solution:

[0084] The technicians can consider aspects such as the requirements of the target scenario and the parameters that can actually be obtained in the model, and select appropriate evaluation indicators based on the requirements; the calculation system is a weighted sum calculation system set in advance by the technicians.

[0085] The technical solution of the embodiment of the present invention is described in detail below by taking examples:

[0086] A possible example: if you want to simulate the game scenario of Liu Bei's group reviving the Han Dynasty, calculate the fitness score of the agent Liu Bei;

[0087] Original indicators:

[0088] Military Force (MF): indicates the size of the army controlled by Liu Bei.

[0089] Prestige (P): Indicates Liu Bei's reputation and status among the people and allies.

[0090] Political Alliances (PA): Indicates the number and quality of alliances Liu Bei has established with other forces.

[0091] Economic Power (EP): refers to the financial resources controlled by Liu Bei.

[0092] The fitness score can be calculated by the following weighted sum formula:

[0093] Fitness Score=(w1×MF)+(w2×P)+(w3×PA)+(w4×EP)

[0094] Among them, w1, w2, w3, and w4 are the weights of military strength, reputation, political alliance, and economic strength respectively.

[0095] Assume that we set the following weights for each indicator:

[0096] Force Weight: 30%

[0097] Reputation Weight: 25%

[0098] Political alliance weight: 20%

[0099] Economic power weight: 25%

[0100] Assume that the scores of the agent Liu Bei on each original indicator are as follows: (Note: the indicator values ​​here are the internal parameters after the model is run, not the initial agent setting values)

[0101] Troops: 8

[0102] Reputation: 7

[0103] Political alliances: 6

[0104] Economic strength: 5

[0105] According to the above weights, calculate the fitness score:

[0106] FitnessScore=(0.3×8)+(0.25×7)+(0.2×6)+(0.25×5=2.4+1.75+1.2+1.25=6.6

[0107] This fitness score reflects the comprehensive performance of the intelligent agent Liu Bei in the scenario of reviving the Han Dynasty, and is calculated by a simple weighted summation method. This is just a simple example. The selection of indicators in the actual model will be more complicated. Each indicator may not only be calculated by a simple weighted summation, but also needs to be adjusted according to the actual situation of the model to achieve the best effect.

[0108] In one embodiment, determining the optimal variant agent based on the fitness scores of the variant agents includes:

[0109] The mutant agent corresponding to the maximum fitness score is taken as the optimal mutant agent.

[0110] In addition, the above technical solution can be Figure 4 The components shown are technically implemented as follows:

[0111] Agent behavior simulation area: also known as the sandbox model body, where agents perform activities and interactions in this environment.

[0112] Real-time performance monitor: monitors the agent’s behavior, decision-making, and interaction results, and provides feedback to the indicator dynamic adjuster.

[0113] Evaluation indicator dynamic adjuster: Automatically adjust the weights and parameters of evaluation indicators according to the real-time performance of the intelligent agent.

[0114] Fitness Score Calculator: Calculates the agent's fitness score based on the adjusted evaluation metric.

[0115] Evolutionary algorithm optimization engine: guides the mutation and optimization of agent settings based on fitness scores.

[0116] Agent Settings Library: Stores the settings and historical performance data of all agents.

[0117] The embodiment of the present invention provides an agent setting optimization system based on evolutionary algorithm, such as Figure 5 As shown, including:

[0118] Receiving module 1, used to receive agent setting information input by the user;

[0119] A preprocessing module 2 is used to preprocess the agent setting information to obtain a preprocessing result;

[0120] A mutation processing module 3 is used to perform mutation processing on the preprocessing result based on an evolutionary algorithm to obtain multiple mutant intelligent agents;

[0121] Evaluation module 4, used to evaluate the fitness score of each of the variant agents in the working scenario of the sandbox environment based on the evaluation index;

[0122] A determination module 5, configured to determine an optimal variant agent based on the fitness scores of the respective variant agents;

[0123] The setting module 6 is used to determine the optimal variant agent as the agent working in the working scene.

[0124] An embodiment of the present invention provides an electronic device, the electronic device comprising:

[0125] at least one processor; and

[0126] A memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute any of the above-mentioned intelligent agent setting optimization methods based on evolutionary algorithms.

[0127] An embodiment of the present invention provides a computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable a processor to implement any of the above-mentioned intelligent agent setting optimization methods based on evolutionary algorithms when executed.

[0128] An embodiment of the present invention provides a computer program product, which includes computer instructions. When executed by an electronic device, the electronic device executes the computer program code of any of the above-mentioned intelligent agent setting optimization methods based on evolutionary algorithms.

[0129] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. An agent setting optimization method based on evolutionary algorithm, characterized in that: include: Receive agent setting information input by the user; Preprocessing the agent setting information to obtain a preprocessing result; Based on the evolutionary algorithm, the preprocessing result is mutated to obtain multiple mutated intelligent agents; Based on the evaluation index, evaluate the fitness score of each of the variant agents in the working scenario of the sandbox environment; Determine the best variant agent based on the fitness scores of each of the variant agents; The optimal variant agent is determined as the agent working in the working scenario.

2. The agent setting optimization method based on evolutionary algorithm as claimed in claim 1, characterized in that: The preprocessing of the agent setting information to obtain a preprocessing result includes: Parsing the setting information of the plurality of initial agents in the agent setting information; wherein the setting information at least includes name information, age information, gender information, appearance information, occupation information and background story information; Verifying the legitimacy of the setting information of each of the initial intelligent agents; The setting information of the initial intelligent agent that has passed the legality verification is processed by data format standardization to obtain the preprocessing result.

3. The agent setting optimization method based on evolutionary algorithm as claimed in claim 1, characterized in that: The preprocessing result is subjected to mutation processing based on the evolutionary algorithm to obtain multiple mutant intelligent agents, including: Based on the evolutionary algorithm, the preprocessing results are subjected to random mutation processing and crossover operation processing in sequence to obtain mutation processing data; Based on the mutation processing data, a plurality of mutation agents are determined.

4. The agent setting optimization method based on evolutionary algorithm as claimed in claim 1, characterized in that: The step of evaluating the fitness scores of the variant agents in the working scenarios of the sandbox environment based on the evaluation indicators includes: Based on the preset computing system and according to the evaluation indicators, the fitness scores of each of the mutated agents in the working scenarios of the sandbox environment are calculated.

5. The agent setting optimization method based on evolutionary algorithm as claimed in claim 1, characterized in that: The step of determining the optimal variant agent based on the fitness scores of the variant agents comprises: The mutant agent corresponding to the maximum fitness score is taken as the optimal mutant agent.

6. An agent setting optimization system based on evolutionary algorithm, characterized in that: include: A receiving module, used for receiving agent setting information input by a user; A preprocessing module, used to preprocess the agent setting information to obtain a preprocessing result; A mutation processing module, used to perform mutation processing on the preprocessing result based on an evolutionary algorithm to obtain multiple mutant intelligent agents; An evaluation module, used to evaluate the fitness score of each of the variant agents in the working scenario of the sandbox environment based on the evaluation index; A determination module, configured to determine an optimal variant agent based on the fitness scores of the respective variant agents; A setting module is used to determine the optimal variant agent as the agent working in the working scene.

7. An electronic device, characterized in that: The electronic device comprises: at least one processor; and A memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the intelligent agent setting optimization method based on an evolutionary algorithm as described in any one of claims 1-5.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the agent setting optimization method based on an evolutionary algorithm as described in any one of claims 1 to 5 when executed.

9. A computer program product, characterized in that The computer program product includes computer instructions, and when executed by an electronic device, the electronic device executes the computer program code of the agent setting optimization method based on evolutionary algorithm as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Intelligent agent generation method and system based on self-learning

    CN112446963A

Cited By

  • Agent health score for agentic automations

    US12619488B1