Collaborative method and device for large language model and reinforcement learning model

By working collaboratively between large language models and reinforcement learning models, and using demand pyramid screening and sorting target tools, the problem of insufficient adaptability and flexibility of the agent is solved, and the event processing efficiency of the agent is improved.

CN118377848BActive Publication Date: 2024-10-11TSINGHUA UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410798640.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-20
Publication Date
2024-10-11
Estimated Expiration
2044-06-20

AI Technical Summary

Technical Problem

The large language model does not fully understand the reinforcement learning model, resulting in limited adaptability and flexibility of the agent. It is also unclear when the reinforcement learning model will be called by the large language model, which increases the complexity of the training process.

Method used

By determining the basic information and environmental image of the open world agent, inputting it into the large language model, using the preset demand pyramid to select and output the target tool with execution order among multiple candidate tools, and controlling the agent by the reinforcement learning model Execute these tool events to iteratively adjust and optimize operating instructions.

Benefits of technology

It improves the flexibility and processing capabilities of collaborative processing of large language models and reinforcement learning models, and achieves flexible control and event processing efficiency of intelligent agents.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118377848B_ABST
    Figure CN118377848B_ABST
Patent Text Reader

Abstract

The present disclosure relates to the field of large language models, and in particular to a collaborative method and device of a large language model and a reinforcement learning model, which determines the basic information and the environment image corresponding to an open-world intelligent agent, inputs the basic information and the knowledge base into a large language model obtained by training based on a preset demand pyramid, selects and outputs multiple target tools with execution order from multiple candidate tools, and controls the intelligent agent to execute corresponding events according to the reinforcement learning model corresponding to the target tool with the best execution order. Among them, the execution process of the event includes executing the following steps at least once in an iterative manner: inputting the environment image into the reinforcement learning model to obtain an operation instruction, and re-determining the environment image of the intelligent agent after the intelligent agent completes the operation corresponding to the operation instruction. The present disclosure realizes flexible control of the intelligent agent through a large language model and a reinforcement learning model, and improves the efficiency of the intelligent agent in handling events.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of large language models, and in particular to a method and device for coordinating a large language model with a reinforcement learning model. Background Art

[0002] As a virtual environment, open-world survival games provide an ideal platform for studying the application of skills of artificial intelligence agents in complex tasks. Early attempts were mainly based on reinforcement learning, requiring a single model to master multiple skills. However, with the rise of large language models, especially their excellent ability to automatically call various programs, researchers began to integrate large language models into the study of open-world survival games to further expand the skill range of agents. However, there are currently two major challenges in practice: first, large language models do not have a comprehensive understanding of the use of reinforcement learning models, and need to rely on prior knowledge injected by humans, but this knowledge is not always available or sufficient, which limits the adaptability and flexibility of the agent; second, reinforcement learning models are not clear when they will be called by large language models, which forces reinforcement learning models to generalize their capabilities for a wide range of situations during training, increasing the complexity of the training process. Summary of the invention

[0003] In view of this, the present disclosure proposes a collaborative method and device for a large language model and a reinforcement learning model, aiming to improve the flexibility and processing capability of the collaborative processing process of the large language model and the reinforcement learning model.

[0004] According to a first aspect of the present disclosure, a collaborative method of a large language model and a reinforcement learning model is provided, the method comprising:

[0005] Determine the basic information and environment image corresponding to the open world agent;

[0006] The basic information and the knowledge base are input into a large language model obtained by training based on a preset demand pyramid, and multiple target tools with execution order are selected and output from multiple candidate tools, each of the candidate tools has a corresponding event, the demand pyramid is used to determine the demand level corresponding to different target tools, and the knowledge base includes attribute information of the event corresponding to each of the candidate tools;

[0007] According to the reinforcement learning model corresponding to the target tool with the best execution order, the intelligent agent is controlled to execute the event corresponding to the target tool;

[0008] The reinforcement learning model controls the agent to execute events corresponding to the target tool, including:

[0009] Perform the following steps at least once in an iterative manner:

[0010] Inputting the environment image into the reinforcement learning model, and outputting operation instructions for controlling the intelligent agent;

[0011] After the agent completes the operation corresponding to the operation instruction, the environment image where the agent is located is re-determined.

[0012] In a possible implementation, the basic information and the knowledge base are input into a large language model trained based on a preset demand pyramid, and multiple target tools with execution order are selected and output from multiple candidate tools, including:

[0013] Inputting the basic information and the knowledge base into a large language model trained based on a preset demand pyramid, and selecting at least one target tool from a plurality of candidate tools through the large language model;

[0014] The at least one target tool is sorted and outputted based on the basic information and the knowledge base by the large language model.

[0015] In a possible implementation, inputting the basic information and the knowledge base into a large language model trained based on a preset demand pyramid, and selecting at least one target tool from a plurality of candidate tools through the large language model, includes:

[0016] Inputting the basic information and the knowledge base into a large language model trained based on a preset demand pyramid, and judging whether each layer of the demand pyramid is satisfied according to the basic information by the large language model;

[0017] In response to a layer of the demand pyramid being satisfied, determining, by the large language model, that the layer does not have a corresponding target tool;

[0018] In response to a layer of the demand pyramid being unsatisfied, at least one target tool corresponding to the layer is selected from a plurality of candidate tools based on the basic information and the knowledge base through the large language model.

[0019] In a possible implementation, the outputting the at least one target tool after sorting it by the large language model based on the basic information and the knowledge base includes:

[0020] Determine the urgency corresponding to each of the target tools according to the basic information and the attribute information of each of the target tools in the knowledge base through the large language model;

[0021] The at least one target tool is sorted and outputted through the large language model according to the urgency corresponding to each target tool and the position of the corresponding layer in the demand pyramid.

[0022] In a possible implementation, the method further includes:

[0023] Record the event execution trajectory of each reinforcement learning model in the process of controlling the intelligent agent to execute the event corresponding to the target tool.

[0024] In a possible implementation, the method further includes:

[0025] In response to a plurality of event execution trajectories corresponding to the candidate tool satisfying a preset condition, re-determining attribute information according to the plurality of event execution trajectories;

[0026] In response to the attribute information being different from the attribute information of the candidate tool in the knowledge base, the attribute information is replaced into the knowledge base.

[0027] In a possible implementation, the training process of the large language model and the reinforcement learning model are performed collaboratively.

[0028] According to a second aspect of the present disclosure, a collaborative device for a large language model and a reinforcement learning model is provided, the device comprising:

[0029] The image determination module is used to determine the basic information and the environment image corresponding to the open world agent;

[0030] A tool prediction module, used for inputting the basic information and the knowledge base into a large language model obtained by training based on a preset demand pyramid, selecting and outputting a plurality of target tools with an execution order from a plurality of candidate tools, each of the candidate tools having a corresponding event, the demand pyramid being used to determine the demand levels corresponding to different target tools, and the knowledge base including attribute information of the event corresponding to each of the candidate tools;

[0031] An event execution module, used to control the agent to execute the event corresponding to the target tool according to the reinforcement learning model corresponding to the target tool with the best execution order;

[0032] The reinforcement learning model controls the agent to execute events corresponding to the target tool, including:

[0033] Perform the following steps at least once in an iterative manner:

[0034] Inputting the environment image into the reinforcement learning model, and outputting operation instructions for controlling the intelligent agent;

[0035] After the agent completes the operation corresponding to the operation instruction, the environment image where the agent is located is re-determined.

[0036] In a possible implementation, the tool prediction module is further used to:

[0037] Inputting the basic information and the knowledge base into a large language model trained based on a preset demand pyramid, and selecting at least one target tool from a plurality of candidate tools through the large language model;

[0038] The at least one target tool is sorted and outputted based on the basic information and the knowledge base by the large language model.

[0039] In a possible implementation, the tool prediction module is further used to:

[0040] Inputting the basic information and the knowledge base into a large language model trained based on a preset demand pyramid, and judging whether each layer of the demand pyramid is satisfied according to the basic information by the large language model;

[0041] In response to a layer of the demand pyramid being satisfied, determining, by the large language model, that the layer does not have a corresponding target tool;

[0042] In response to a layer of the demand pyramid being unsatisfied, at least one target tool corresponding to the layer is selected from a plurality of candidate tools based on the basic information and the knowledge base through the large language model.

[0043] In a possible implementation, the tool prediction module is further used to:

[0044] Determine the urgency corresponding to each of the target tools according to the basic information and the attribute information of each of the target tools in the knowledge base through the large language model;

[0045] The at least one target tool is sorted and outputted through the large language model according to the urgency corresponding to each target tool and the position of the corresponding layer in the demand pyramid.

[0046] In a possible implementation manner, the device further includes:

[0047] The trajectory recording module is used to record the event execution trajectory of each reinforcement learning model in the process of controlling the intelligent agent to execute the event corresponding to the target tool.

[0048] In a possible implementation manner, the device further includes:

[0049] an attribute determination module, configured to redetermine attribute information according to a plurality of event execution trajectories corresponding to the candidate tool in response to the plurality of event execution trajectories corresponding to the candidate tool satisfying a preset condition;

[0050] The knowledge base updating module is used for replacing the attribute information into the knowledge base in response to the attribute information being different from the attribute information of the candidate tool in the knowledge base.

[0051] In a possible implementation, the training process of the large language model and the reinforcement learning model are performed collaboratively.

[0052] According to a third aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to implement the above method when executing the instructions stored in the memory.

[0053] According to a fourth aspect of the present disclosure, a non-volatile computer-readable storage medium is provided, on which computer program instructions are stored, wherein the computer program instructions implement the above method when executed by a processor.

[0054] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above method.

[0055] In an embodiment of the present disclosure, the basic information and the environment image corresponding to the open world agent are determined, the basic information and the knowledge base are input into a large language model obtained by training based on a preset demand pyramid, multiple target tools with execution order are selected and output from multiple candidate tools, and the agent is controlled to execute the corresponding event according to the reinforcement learning model corresponding to the target tool with the best execution order. Among them, the execution process of the event includes performing the following steps at least once in an iterative manner: inputting the environment image into the reinforcement learning model to obtain the operation instruction, and re-determining the environment image of the agent after the agent completes the operation corresponding to the operation instruction. The present disclosure realizes flexible control of the agent through the large language model and the reinforcement learning model together, and improves the efficiency of the agent in handling events.

[0056] Further features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the disclosure and, together with the description, serve to explain the principles of the disclosure.

[0058] Figure 1 A flowchart of a collaborative method of a large language model and a reinforcement learning model according to an embodiment of the present disclosure is shown.

[0059] Figure 2 A schematic diagram showing a collaborative training process of a large language model and a reinforcement learning model according to an embodiment of the present disclosure is shown.

[0060] Figure 3 A schematic diagram of a collaborative device of a large language model and a reinforcement learning model according to an embodiment of the present disclosure is shown.

[0061] Figure 4 A schematic diagram of an electronic device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0062] Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.

[0063] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.

[0064] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present disclosure.

[0065] The collaborative method of the large language model and the reinforcement learning model of the embodiment of the present disclosure can be executed by an electronic device such as a terminal device or a server. Among them, the terminal device can be any fixed or mobile terminal such as a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. The server can be a single server or a server cluster composed of multiple servers. Any electronic device can implement the collaborative method of the large language model and the reinforcement learning model of the embodiment of the present disclosure by a processor calling a computer-readable instruction stored in a memory.

[0066] Figure 1 A flowchart of a collaborative method of a large language model and a reinforcement learning model according to an embodiment of the present disclosure is shown. Figure 1 As shown, the collaborative method of the large language model and the reinforcement learning model of the embodiment of the present disclosure may include the following steps S10-S30.

[0067] Step S10: Determine the basic information corresponding to the open-world intelligent agent and the environment image in which it is located.

[0068] In a possible implementation, an agent that needs to operate an event in an open world is determined by an electronic device, and the basic information of the agent and the image of the environment in which it is located are further determined. The open world can be a virtual survival game world, and the agent can be any game character such as a virtual person, a virtual animal or even a virtual plant in the survival game. The events that the agent needs to operate in the survival game may include collecting resources, eating, sleeping, drinking water, and building. The image of the environment in which the agent is located is an image of the environment obtained by capturing an image of the environment near the location of the agent in the open world, and may include the environment within the range that the agent's line of sight can cover. The basic information of the agent is used to characterize the goals and status of the agent in the open world, and may include a preset ultimate goal or a staged goal, as well as a self-state used to characterize the basic situation of the agent and an inventory status of the resources that the agent already has.

[0069] For example, in the basic information of the agent determined by the electronic device, the preset ultimate goal may be "the largest open world for exploration", and the self-state of the agent may include at least one of the agent's health value, food value, beverage value, energy value, and intelligence value, which are used to represent the agent's health state, hunger state, thirst state, physical state, and mental state, respectively. The inventory state may include the basic resources that the agent has collected and the advanced resources that have been built, wherein the basic resources may include ore, wood, and branches, etc., and the advanced resources that have been built may include wooden pickaxes, wooden swords, and rafts built with wood, fires and walls made of ore, and tents built with wood, branches, and ore, etc. The environmental image determined by the electronic device may include basic backgrounds such as trees, mountains, rivers, and grass in the open world, as well as animals such as cows, bees, butterflies, and fish that move in the basic background.

[0070] Step S20: input the basic information and knowledge base into a large language model trained based on a preset demand pyramid, and select and output multiple target tools with an execution order from multiple candidate tools.

[0071] In a possible implementation, after determining the basic information of the agent, the electronic device can input the basic information of the agent and the predetermined knowledge base into a large language model obtained by training based on a preset demand pyramid, so as to select and output multiple target tools with execution order from multiple candidate tools through the large language model. Among them, each candidate tool has a corresponding event and a corresponding reinforcement learning model, and the candidate tool can control the agent to execute the corresponding event through the corresponding reinforcement learning model. The event can be pre-set in the open world, for example, it can include collecting coal, collecting stones, collecting wood, making axes, making fires, making food, drinking water, eating, fishing, catching rabbits, etc. The demand pyramid is a multi-level pyramid based on Maslow's hierarchy of needs and the background of the open world survival game. The demand level of each layer gradually increases from bottom to top, which is used to judge the demand level corresponding to different target tools while screening the target tools. The knowledge base includes attribute information of the event corresponding to each candidate tool, which is used to define the characteristics of the execution process of each event. For example, for the event "eating grilled fish", the corresponding attribute information may be "you need to grill the fish on the fire before fishing". Optionally, the knowledge base may be obtained based on the prior accumulation during the training process, and may be updated in real time during the execution of events by each agent in the open world.

[0072] Optionally, in an open world survival game, the electronic device can construct a demand pyramid by considering key factors such as immediate tasks, agent health factors with long-term impact, and safety factors. Exemplarily, the needs of the demand pyramid from the bottom to the top can be determined as the agent's physiological needs, safety needs, cognitive needs, and self-actualization needs. After determining the demand pyramid, the demand pyramid can be input as a prerequisite into the large language model, and then the large language model can be trained for the scenario of the open world survival game.

[0073] Further, the electronic device inputs the basic information and the knowledge base into the large language model obtained based on the training, and can first select at least one target tool from multiple candidate tools through the large language model. That is, the large language model can fuse the basic information and the information in the knowledge base as prompt information, and screen the target tools corresponding to each layer of the demand pyramid from multiple candidate tools. Among them, whether each layer of the demand pyramid has a corresponding target tool needs to be judged based on whether the demand of the layer is met, that is, after the basic information and the knowledge base are input into the large language model obtained based on the preset demand pyramid training, the large language model is used to judge whether each layer of the demand pyramid is met according to the basic information. When the layer of the demand pyramid is met, it is determined through the large language model that the layer does not have a corresponding target tool. That is, it is judged that the intelligent agent does not need to execute the event corresponding to the demand of the layer. When the layer of the demand pyramid is not met, the large language model is used to select the target tool corresponding to at least one layer from multiple candidate tools based on the basic information and the knowledge base.

[0074] Furthermore, after selecting at least one target tool from the candidate tools, the large language model is used to sort the at least one target tool based on the basic information and the knowledge base and then output. Specifically, the large language model can be used to determine the urgency corresponding to each target tool based on the basic information and the attribute information of each target tool in the knowledge base. Then, the large language model is used to sort the at least one target tool based on the urgency corresponding to each target tool and the position of the corresponding layer in the demand pyramid and then output.

[0075] That is, the large language model of the embodiment of the present disclosure includes a proposal stage for screening target tools based on the demand pyramid, and a ranking stage for ranking the target tools based on the importance determined by the demand pyramid and the urgency determined according to the basic information and knowledge base. Among them, in the proposal stage, the large language model considers the basic information of the agent and the demand pyramid for two-step thinking. First, evaluate whether each layer of demand is met. If it is met, skip the tool proposal of this layer. If it is not met, screen the target tool corresponding to this layer according to the basic information and knowledge base. In the ranking stage, the large language model integrates urgency and importance and also performs two-step thinking to avoid overly conservative ranking results. Specifically, the large language model can first evaluate the urgency of each target tool, and this process is affected by different subjective degrees from different needs. In order to alleviate potential hallucinations, the large language model can refer to the supporting facts of the proposal stage during the evaluation process and consider them during the evaluation process. Among them, the supporting facts are the facts on which the proposal is based. For example, when the "food" status of the agent is 1, the large language model selects the candidate tool of "eating beef" as the proposal. In the proposal stage, the large language model will also output supporting facts that can be: "food" status is 1. Subsequently, the large language model ranks the target tools according to the urgency of each proposal and the corresponding demand level (i.e., importance), and outputs the ranking results. The disclosed embodiment uses a large language model based on demand pyramid training to screen and rank the target tools, and under the guidance of Maslow's hierarchy of needs theory, enables the intelligent agents in the open world to develop the ability to solve low-level needs in the long term, as well as the pursuit of higher-level goals.

[0076] Step S30: Control the agent to execute events corresponding to the target tool according to the reinforcement learning model corresponding to the target tool with the best execution order.

[0077] In a possible implementation, after the large language model outputs multiple target tools with an execution order, the electronic device can obtain a reinforcement learning model corresponding to the target tool with the highest execution order priority, and control the agent to execute the event corresponding to the target tool based on the reinforcement learning model. Optionally, the process of the reinforcement learning model controlling the agent to execute the event can be an iterative process, and the environment image can be input to the reinforcement learning model at least once in an iterative manner, and the operation instruction for controlling the agent can be output. After the agent completes the operation corresponding to the operation instruction, the environment image in which the agent is located is re-determined to enter the next iterative process, and the iterative process is stopped when the agent completes the entire event.

[0078] Optionally, after each event is completed by the agent, the electronic device can record the event execution trajectory of each reinforcement learning model in the process of controlling the agent to execute the event corresponding to the target tool. For example, after completing steps S10 and S20, in step S30, the reinforcement learning model controls the operation instructions of the agent in each iteration, and obtains a point in the event execution trajectory after the agent completes the operation corresponding to the operation instruction. After the iteration process is completed, the event execution trajectory is obtained, and the event execution trajectory corresponds to the optimal reinforcement learning model corresponding to the target tool. If steps S10, S20, and S30 are re-executed, a new event execution trajectory is obtained. The information recorded at each point in the event execution trajectory may include at least one of the state of the agent after executing the operation instruction and the environmental reward. The state of the agent may include survival or death, etc., and the environmental reward may include feedback on the execution result of the event, such as success or failure.

[0079] Further, after the electronic device executes steps S10, S20, and S30 for multiple times, it can obtain multiple event execution trajectories corresponding to multiple candidate tools, and can judge in real time whether the knowledge base needs to be updated according to the multiple event execution trajectories currently corresponding to each candidate tool. Specifically, when the multiple event execution trajectories corresponding to the candidate tool meet the preset conditions, the electronic device can re-determine the attribute information based on the multiple event execution trajectories and the high-level knowledge therein. And when the attribute information is different from the attribute information of the candidate tool in the knowledge base, the attribute information is replaced in the knowledge base. Among them, the high-level knowledge can include some learned experiences, such as the execution order that must be met between certain operations, and certain consequences that will occur to the intelligent agent after the execution of certain operations. The preset condition can be that the number of event execution trajectories corresponding to the candidate tool reaches a preset number threshold. The condition for the electronic device to determine whether to update the knowledge base can be that after each event execution trajectory is recorded, it is determined whether the multiple event execution trajectories corresponding to the candidate tool corresponding to the event execution trajectory meet the preset conditions. As the number of event execution trajectories corresponding to each candidate tool increases, the frequency of noisy events tends to decrease, so that the electronic device can identify truly important events. Furthermore, the knowledge base summarized based on the event execution trajectory in the disclosed embodiment can promote the tool proposal and ranking process of the large language model, thereby enabling the intelligent agent to gradually learn the best way to use various tools.

[0080] Figure 2 A schematic diagram showing a collaborative training process of a large language model and a reinforcement learning model according to an embodiment of the present disclosure is shown. Figure 2As shown, in the embodiment of the present disclosure, the training process of the large language model and the reinforcement learning model is carried out in coordination. Specifically, during the training process, the embodiment of the present disclosure introduces a reflection module composed of an execution log and a knowledge base that record the execution trajectory of the event, and a motivation module composed of a demand pyramid. The electronic device can determine the basic information of the current agent and the image of the environment in which it is located in real time during the training process. The basic information and the knowledge base are then input into the motivation module as prompt information, and a large language model based on a preset demand pyramid selects and outputs multiple target tools with execution order from multiple candidate tools. The large language model trained based on the demand pyramid enables the agent to learn to fully consider its state. For example, in the game Crafter, physiological needs prompt the agent to propose the use of tools such as collecting drinks or eating beef to prevent entering a low state, while cognitive needs prompt the proposal to use advanced tools such as making a wooden pickaxe to enhance the exploration of the world.

[0081] A common approach to rooting a large language model involves using immediate feedback from the current tool, which is a common practice in many previous works. However, this approach is susceptible to noisy trajectories in the game and may lead to incorrect interpretations. For example, if the agent uses the Eat Beef tool before using the Make Wooden Pickaxe tool, it may mistakenly conclude that eating beef is a prerequisite for making a wooden pickaxe. Therefore, the embodiment of the present disclosure designs a reflection module to better root the large language model in the environment without prior knowledge. During the model training process, the execution log and knowledge base in the reflection module are initialized to empty dictionaries. As the agent interacts with the environment multiple times, the execution log accumulates the event execution trajectory of each candidate tool, and when the corresponding event execution trajectory meets the preset conditions, the high-level knowledge is integrated to obtain the corresponding attribute information and store it in the knowledge base. As the number of event execution trajectories increases, the frequency of noisy events tends to decrease, enabling the reflection module to identify truly important events. The reflection knowledge is fed into the motivation module to facilitate the tool proposal and ranking process. Therefore, the agent gradually learns the best way to use various tools, enabling the large language model to participate in the tool learning process.

[0082] After obtaining the reinforcement learning model corresponding to the target tool with the best execution order, the agent is controlled to execute the event corresponding to the target tool. When the reinforcement learning model controls the agent to execute the event, each iteration process inputs the environment image and feedback information to the reinforcement learning model, and outputs the operation instruction for controlling the agent. After the agent completes the operation corresponding to the operation instruction, the environment image and feedback information of the agent are re-determined. Among them, the feedback information can be provided by the software API of the environment, specifically including the new self-state and inventory of the agent, and whether the operation corresponding to the current target tool (such as eating beef) is completed. The feedback information can be determined based on the information of whether the operation is completed. For example, if it is completed, the reinforcement learning model will be given a positive reward, otherwise no reward will be given, so as to use the reinforcement learning algorithm to update the model parameters.

[0083] In the study of the integration of large language models and reinforcement learning models, the dominant approach in the related art involves freezing the reinforcement learning models of candidate tools and focusing on adjusting the large language model. Although this strategy has shown promising results due to the powerful reasoning ability of the large language model, it ignores the potential of the synergistic large language model and the reinforcement learning models of the tools. Specifically, when trained independently, the reinforcement learning model of each tool needs to complete its functions from scratch. However, in collaboration with the large language model, the reinforcement learning models of different tools may only need to solve part of the task based on the prerequisites established by other tools. For example, the reinforcement learning model of the tool "collect iron ore" only needs to learn to explore iron ore if the reinforcement learning model of the tool "make iron pickaxe" has already created the necessary equipment. Compared with starting from scratch, this collaborative approach simplifies the learning process and makes reinforcement learning model training more accessible and efficient.

[0084] In order to achieve the above objectives, the embodiments of the present disclosure can use a collaborative learning framework and a large language model to collaboratively train a reinforcement learning model. At the beginning of each event, the motivation module proposes a target tool to be used based on the basic information of the agent. Subsequently, the agent takes action by calling the reinforcement learning model of the target tool. After the event of the target tool of the reinforcement learning model is completed or a certain number of steps are exceeded, the event execution trajectory is appended to the execution log of the reflection module, and the action trajectory is appended to the replay buffer of the tool training of the reinforcement learning model. Among them, the action trajectory may include the environment image corresponding to each step of the operation during the event execution process, the action of the agent, and the feedback information after the operation. Then, the motivation module proposes a new target tool based on the updated state of the agent. Throughout the process, the reflection module has been running to update the knowledge base according to the event execution trajectory included in the execution log.

[0085] In the training process of the large language model and the reinforcement school model of the embodiment of the present disclosure, given that the motivation module prioritizes low-level tools over high-level tools, the agent completes the necessary preparations before pursuing more complex goals. Therefore, the advanced reinforcement learning model is trained with appropriate prerequisites, thereby reducing the overall learning difficulty. At the same time, the collaborative training framework of the embodiment of the present disclosure is very flexible and does not impose any restrictions on the training method of the original reinforcement learning model, and has strong flexibility. The learning method can be online or offline, or model-free or model-based. The training process can combine the training of the reinforcement learning model with the learning process of the large language model to coordinate the use of tools. And through the large language model motivation model based on the demand pyramid, the reinforcement learning model is called according to the state of the agent, and the model training is performed considering the survival needs and long-term task planning of the agent.

[0086] Based on the above technical features, the disclosed embodiment realizes flexible control of the intelligent agent based on the large language model and the reinforcement learning model, and improves the efficiency of the intelligent agent in handling events. At the same time, the large language model is used to screen the reinforcement learning model based on the demand pyramid and the state of the intelligent agent, which improves the accuracy of the screening results, and can efficiently guide the intelligent agent to complete the goals in the basic information while meeting the needs of the intelligent agent. And in the process of use, the instructions for tool execution are summarized in real time, and a better order of tool use and more appropriate timing are learned.

[0087] Figure 3 A schematic diagram of a collaborative device of a large language model and a reinforcement learning model according to an embodiment of the present disclosure is shown. Figure 3 As shown, the collaborative device of the large language model and the reinforcement learning model of the embodiment of the present disclosure may include:

[0088] An image determination module 30 is used to determine basic information corresponding to the open-world agent and the environment image in which it is located;

[0089] The tool prediction module 31 is used to input the basic information and the knowledge base into a large language model obtained by training based on a preset demand pyramid, select and output multiple target tools with execution order from multiple candidate tools, each of the candidate tools has a corresponding event, the demand pyramid is used to determine the demand level corresponding to different target tools, and the knowledge base includes attribute information of the event corresponding to each candidate tool;

[0090] An event execution module 32, used to control the agent to execute the event corresponding to the target tool according to the reinforcement learning model corresponding to the target tool with the best execution order;

[0091] The reinforcement learning model controls the agent to execute events corresponding to the target tool, including:

[0092] Perform the following steps at least once in an iterative manner:

[0093] Inputting the environment image into the reinforcement learning model, and outputting operation instructions for controlling the intelligent agent;

[0094] After the agent completes the operation corresponding to the operation instruction, the environment image where the agent is located is re-determined.

[0095] In a possible implementation, the tool prediction module 31 is further used to:

[0096] Inputting the basic information and the knowledge base into a large language model trained based on a preset demand pyramid, and selecting at least one target tool from a plurality of candidate tools through the large language model;

[0097] The at least one target tool is sorted and outputted based on the basic information and the knowledge base by the large language model.

[0098] In a possible implementation, the tool prediction module 31 is further used to:

[0099] Inputting the basic information and the knowledge base into a large language model trained based on a preset demand pyramid, and judging whether each layer of the demand pyramid is satisfied according to the basic information by the large language model;

[0100] In response to a layer of the demand pyramid being satisfied, determining, by the large language model, that the layer does not have a corresponding target tool;

[0101] In response to a layer of the demand pyramid being unsatisfied, at least one target tool corresponding to the layer is selected from a plurality of candidate tools based on the basic information and the knowledge base through the large language model.

[0102] In a possible implementation, the tool prediction module 31 is further used to:

[0103] Determine the urgency corresponding to each of the target tools according to the basic information and the attribute information of each of the target tools in the knowledge base through the large language model;

[0104] The at least one target tool is sorted and outputted through the large language model according to the urgency corresponding to each target tool and the position of the corresponding layer in the demand pyramid.

[0105] In a possible implementation manner, the device further includes:

[0106] The trajectory recording module is used to record the event execution trajectory of each reinforcement learning model in the process of controlling the intelligent agent to execute the event corresponding to the target tool.

[0107] In a possible implementation manner, the device further includes:

[0108] an attribute determination module, configured to redetermine attribute information according to a plurality of event execution trajectories corresponding to the candidate tool in response to the plurality of event execution trajectories corresponding to the candidate tool satisfying a preset condition;

[0109] The knowledge base updating module is used for replacing the attribute information into the knowledge base in response to the attribute information being different from the attribute information of the candidate tool in the knowledge base.

[0110] In a possible implementation, the training process of the large language model and the reinforcement learning model are performed collaboratively.

[0111] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0112] The embodiment of the present disclosure also provides a computer-readable storage medium on which computer program instructions are stored, and the computer program instructions implement the above method when executed by a processor. The computer-readable storage medium can be a volatile or non-volatile computer-readable storage medium.

[0113] An embodiment of the present disclosure further proposes an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to implement the above method when executing the instructions stored in the memory.

[0114] The embodiments of the present disclosure also provide a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above method.

[0115] Figure 4 1 is a schematic diagram showing an electronic device 1900 according to an embodiment of the present disclosure. For example, the electronic device 1900 may be provided as a server or a terminal device. Figure 4, the electronic device 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions executable by the processing component 1922, such as an application. The application stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above method.

[0116] The electronic device 1900 may also include a power supply component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input / output interface 1958 (I / O interface). The electronic device 1900 may operate based on an operating system stored in the memory 1932, such as Windows Server 2000. TM , Mac OS X TM , Unix TM , Linux TM , FreeBSD TM or similar.

[0117] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 1932 including computer program instructions, which can be executed by the processing component 1922 of the electronic device 1900 to perform the above method.

[0118] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.

[0119] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the above. More specific examples (a non-exhaustive list) of computer-readable storage media include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the above. The computer-readable storage medium used herein is not to be interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.

[0120] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0121] The computer program instructions for performing the operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect through the Internet). In some embodiments, by using the state information of the computer-readable program instructions to personalize an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), the electronic circuit may execute the computer-readable program instructions, thereby implementing various aspects of the present disclosure.

[0122] Various aspects of the present disclosure are described herein with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of boxes in the flowchart and / or block diagram can be implemented by computer-readable program instructions.

[0123] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0124] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0125] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.

[0126] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A collaborative method of a large language model and a reinforcement learning model, characterized in that: The method comprises: Determine the basic information and environment image corresponding to the open world agent; The basic information and the knowledge base are input into a large language model obtained by training based on a preset demand pyramid, and multiple target tools with execution order are selected and output from multiple candidate tools, each of the candidate tools has a corresponding event, the demand pyramid is used to determine the demand level corresponding to different target tools, and the knowledge base includes attribute information of the event corresponding to each of the candidate tools; According to the reinforcement learning model corresponding to the target tool with the best execution order, the intelligent agent is controlled to execute the event corresponding to the target tool; The reinforcement learning model controls the agent to execute events corresponding to the target tool, including: Perform the following steps at least once in an iterative manner: Inputting the environment image into the reinforcement learning model, and outputting operation instructions for controlling the intelligent agent; After the agent completes the operation corresponding to the operation instruction, re-determine the environment image where the agent is located; The step of inputting the basic information and the knowledge base into a large language model obtained by training based on a preset demand pyramid, selecting and outputting a plurality of target tools with an execution order from a plurality of candidate tools, includes: Inputting the basic information and the knowledge base into a large language model trained based on a preset demand pyramid, and judging whether each layer of the demand pyramid is satisfied according to the basic information by the large language model; In response to a layer of the demand pyramid being satisfied, determining, by the large language model, that the layer does not have a corresponding target tool; In response to a layer of the demand pyramid being unsatisfied, selecting at least one target tool corresponding to the layer from a plurality of candidate tools based on the basic information and the knowledge base through the large language model; Determine the urgency corresponding to each of the target tools according to the basic information and the attribute information of each of the target tools in the knowledge base through the large language model; The at least one target tool is sorted and outputted through the large language model according to the urgency corresponding to each target tool and the position of the corresponding layer in the demand pyramid.

2. The method according to claim 1, characterized in that The method further comprises: Record the event execution trajectory of each reinforcement learning model in the process of controlling the intelligent agent to execute the event corresponding to the target tool.

3. The method according to claim 2, characterized in that The method further comprises: In response to a plurality of event execution trajectories corresponding to the candidate tool satisfying a preset condition, re-determining attribute information according to the plurality of event execution trajectories; In response to the attribute information being different from the attribute information of the candidate tool in the knowledge base, the attribute information is replaced into the knowledge base.

4. The method according to claim 1, characterized in that: The training process of the large language model and the reinforcement learning model is carried out in coordination.

5. A collaborative device for a large language model and a reinforcement learning model, characterized in that: The device comprises: The image determination module is used to determine the basic information and the environment image corresponding to the open world agent; A tool prediction module, used for inputting the basic information and the knowledge base into a large language model obtained by training based on a preset demand pyramid, selecting and outputting a plurality of target tools with an execution order from a plurality of candidate tools, each of the candidate tools having a corresponding event, the demand pyramid being used to determine the demand levels corresponding to different target tools, and the knowledge base including attribute information of the event corresponding to each of the candidate tools; An event execution module, used to control the agent to execute the event corresponding to the target tool according to the reinforcement learning model corresponding to the target tool with the best execution order; The reinforcement learning model controls the agent to execute events corresponding to the target tool, including: Perform the following steps at least once in an iterative manner: Inputting the environment image into the reinforcement learning model, and outputting operation instructions for controlling the intelligent agent; After the agent completes the operation corresponding to the operation instruction, re-determine the environment image where the agent is located; Wherein, the tool prediction module is further used for: Inputting the basic information and the knowledge base into a large language model trained based on a preset demand pyramid, and judging whether each layer of the demand pyramid is satisfied according to the basic information by the large language model; In response to a layer of the demand pyramid being satisfied, determining, by the large language model, that the layer does not have a corresponding target tool; In response to a layer of the demand pyramid being unsatisfied, selecting at least one target tool corresponding to the layer from a plurality of candidate tools based on the basic information and the knowledge base through the large language model; Determine the urgency corresponding to each of the target tools according to the basic information and the attribute information of each of the target tools in the knowledge base through the large language model; The at least one target tool is sorted and outputted through the large language model according to the urgency corresponding to each target tool and the position of the corresponding layer in the demand pyramid.

6. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to implement the method described in any one of claims 1 to 4 when executing the instructions stored in the memory.

7. A non-volatile computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 4 is implemented.