Command generation method and device, electronic equipment and storage medium

By identifying and generating game commands, the problem of players needing to remember and use complex command syntax is solved, and the player's experience when issuing commands is improved.

CN120181228APending Publication Date: 2025-06-20GUANGZHOU BOGUAN TELECOMM TECH LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510244801.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-03
Publication Date
2025-06-20

AI Technical Summary

Technical Problem

In some games, players need to use complex command syntax to issue commands, which causes players to spend a lot of energy to memorize and use the correct command syntax, thereby reducing the player's gaming experience.

Method used

By obtaining the natural language information entered by the user in the game, identifying the game command feature information indicated by the information, determining the matching target prompt template, generating prompt information, and inputting it into the large language model to generate the corresponding game command.

Benefits of technology

This method can automatically recognize and generate game commands, reducing the burden of players' memory and using complex command syntax, and improving the player's experience when issuing commands.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120181228A_ABST
    Figure CN120181228A_ABST
Patent Text Reader

Abstract

The invention discloses a command generation method and device, electronic equipment and a computer readable storage medium. According to the embodiment of the invention, natural language information input in a game by a current user account is obtained; identifying feature information of a game command indicated by the natural language information based on the natural language information; determining a target prompt template matched with the feature information; generating prompt information based on the natural language information and the target prompt template; the prompt information is input into a first large language model, command generation is carried out based on the prompt information through the first large language model, the game command corresponding to the natural language information is obtained, and the player experience when a player issues the command can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of machine learning, and particularly to a command generation method, apparatus, electronic device, and storage medium. Background Art

[0002] In the wave of the Internet, the continuous development and evolution of hardware and software technologies have promoted the emergence of intelligent devices and software. At the same time, a large number of games with different themes have emerged to meet the needs of users. With the vigorous development of various technologies in the game industry, people pay more attention to the game experience.

[0003] Currently, in some games, players issue specific commands to enrich the gameplay in the game scene. For some advanced game elements or some customized content, players often need to use relatively complex command syntax to issue corresponding commands, resulting in players having to spend a lot of energy to accurately remember and strictly use the corresponding command syntax for command issuance, leading to a poor player experience. Summary of the Invention

[0004] Embodiments of the present application provide a command generation method, apparatus, electronic device, and storage medium, which can improve the player experience when players issue commands.

[0005] In a first aspect, embodiments of the present application provide a command generation method, which includes:

[0006] Obtain natural language information input by the current user account in the game;

[0007] Identify feature information of the game command indicated by the natural language information based on the natural language information;

[0008] Determine a target prompt template that matches the feature information;

[0009] Generate prompt information based on the natural language information and the target prompt template;

[0010] Input the prompt information into a first large language model, and generate a game command corresponding to the natural language information through the first large language model based on the prompt information.

[0011] In a second aspect, embodiments of the present application provide a command generation apparatus, which includes:

[0012] An information acquisition module, configured to obtain natural language information input by the current user account in the game;

[0013] An information identification module, configured to identify feature information of the game command indicated by the natural language information based on the natural language information;

[0014] A template matching module for determining a target prompt template that matches the feature information;

[0015] An information generation module for generating prompt information based on the natural language information and the target prompt template;

[0016] A command generation module for inputting the prompt information into a first large language model, and generating a game command corresponding to the natural language information by generating a command based on the prompt information through the first large language model.

[0017] In a third aspect, an embodiment of the present application further provides an electronic device, including a memory storing multiple instructions; a processor loads instructions from the memory to execute the steps of any command generation method provided by the embodiment of the present application.

[0018] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium storing multiple instructions, and the instructions are suitable for being loaded by a processor to execute the steps of any command generation method provided by the embodiment of the present application.

[0019] In a fifth aspect, an embodiment of the present application further provides a computer program product, including a computer program or instructions, and when the computer program or instructions are executed by a processor, the steps in any command generation method provided by the embodiment of the present application are implemented.

[0020] By adopting the solution of the embodiment of the present application, it is possible to obtain the natural language information input by the current user account in the game; identify the feature information of the game command indicated by the natural language information based on the natural language information; determine the target prompt template that matches the feature information; generate prompt information based on the natural language information and the target prompt template; input the prompt information into the first large language model, and generate a game command corresponding to the natural language information by generating a command based on the prompt information through the first large language model, so as to identify the natural language information input by the current user account to obtain the game command corresponding to the natural language information, avoiding the situation where players need to spend a lot of energy to accurately remember and strictly use the corresponding command syntax to issue commands, and improving the player experience when issuing commands. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative efforts.

[0022] Figure 1 It is a schematic flowchart of an embodiment of the command generation method provided in the embodiment of the present application;

[0023] Figure 2 It is another schematic flowchart of an embodiment of the command generation method provided in the embodiment of the present application;

[0024] Figure 3 It is yet another schematic flowchart of an embodiment of the command generation method provided in the embodiment of the present application;

[0025] Figure 4 It is a schematic structural diagram of the command generation device provided in the embodiment of the present application;

[0026] Figure 5 It is a schematic structural diagram of the electronic device provided in the embodiment of the present application. Detailed implementation manners

[0027] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present application. At the same time, in the description of the embodiments of the present application, terms such as "first" and "second" are only used for distinguishing descriptions, and cannot be understood as indicating or implying relative importance. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more features. In the description of the embodiments of the present application, the meaning of "a plurality" is two or more, unless otherwise specifically defined.

[0028] The embodiment of the present application provides a command generation method, device, electronic device, and computer-readable storage medium.

[0029] Specifically, this embodiment will be described from the perspective of the command generation device. The command generation device can be specifically integrated in the electronic device, that is, the command generation method in the embodiment of the present application can be executed by the electronic device. Optionally, the electronic device may include: a terminal device. The terminal device may be a mobile phone, a tablet computer, a smart Bluetooth device, a laptop computer, a game console, or a personal computer (PC) and other devices.

[0030] The command generation method provided in the embodiment of the present application can be applied to a command generation system. Among them, the command generation system may include a player terminal device and a server. The terminal may be a device that includes both receiving and transmitting hardware, that is, a device with receiving and transmitting hardware capable of performing two-way communication on a two-way communication link. The player terminal device and the server can perform two-way communication through the network.

[0031] Optionally, the server can be an independent server, or a server network or server cluster composed of servers, including but not limited to computers, network hosts, single network servers, multiple sets of network servers, or cloud servers composed of multiple servers. Among them, the cloud server is composed of a large number of computers or network servers based on cloud computing.

[0032] The following will be described in detail with reference to the accompanying drawings. In this embodiment, the execution entity is taken as an example of a terminal device. It should be noted that the description order of the following embodiments does not limit the preferred order of the embodiments. Although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown in the drawings.

[0033] The command generation method of this embodiment obtains the natural language information input by the current user account in the game; identifies the characteristic information of the game command indicated by the natural language information based on the natural language information; determines the target prompt template that matches the characteristic information; generates prompt information based on the natural language information and the target prompt template; inputs the prompt information into the first large language model, and through the first large language model, generates a command based on the prompt information to obtain the game command corresponding to the natural language information, which can improve the player experience when the player issues a command.

[0034] Please refer to Figure 1 , taking the terminal as an example for illustration. This embodiment provides a command generation method. The specific process of this command generation method can be as follows: Step 101 to Step 105, where:

[0035] Step 101: Obtain the natural language information input by the current user account in the game.

[0036] Among them, the natural language information is used to indicate the natural language input by the player in the game, such as text, voice, etc. The above-mentioned current user account is the account of the player in the game.

[0037] In the embodiment, by obtaining and receiving the natural language information input by the current user account, as the starting point of the entire command conversion process, subsequent command conversion processes are carried out based on this natural language information to generate corresponding game commands.

[0038] Step 102: Identify the characteristic information of the game command indicated by the natural language information based on the natural language information.

[0039] In this embodiment, since the natural language information input by the player is given around the game command to be issued, the terminal can clarify the relevant features of the game command that the player currently wants to issue through the natural language information, that is, by identifying the natural language information, to clarify the feature information of the game command indicated by the natural language information.

[0040] Among them, the feature information of the game command can include the feature information of the game command in at least one game command description dimension. For example, the command function in the function description dimension, the command type in the type description dimension, the command purpose in the purpose description dimension, the command theme in the theme description dimension, the command application scenario (level, dungeon) in the scenario description dimension of the virtual scene to which it belongs, etc. It can be specifically set according to requirements and will not be limited here.

[0041] It can be understood that since there are various commands in the game, such as different types of game commands (such as teleportation type game commands, item generation type game commands, attack type game commands, interaction type game commands, etc.), therefore, in order to clarify the game command that the current user account wants to issue, the player's intention can be recognized based on the natural language information input by the current user account, so as to perform subsequent operations based on the recognition result of the player's intention.

[0042] Specifically, the identifying the feature information of the game command indicated by the natural language information based on the natural language information may include: the terminal can perform intention recognition on the natural language information to obtain an intention feature vector, and then, the terminal can determine the feature information of the game command indicated by the natural language information in at least one game command description dimension based on the intention feature vector, so as to quickly determine the feature information of the game command indicated by the natural language information through intention recognition and improve the processing efficiency.

[0043] Specifically, the game command description dimension includes the type description dimension. The terminal can use a classification model to quickly identify the game command in the type description dimension. The performing intention recognition on the natural language information to obtain an intention feature vector may include: the terminal can perform intention recognition on the natural language information through a preset classification model to obtain an intention feature vector.

[0044] Correspondingly, the determining the feature information of the game command indicated by the natural language information in at least one game command description dimension based on the intention feature vector may include: the terminal can determine the target command type of the game command indicated by the natural language information in the type description dimension based on the intention feature vector through the classification model.

[0045] Specifically, the terminal can use the natural language information to be trained as a sample and the command type of the game command corresponding to the natural language information to be trained as a label to construct and train a classification model based on the sample and the label, so that the classification model can learn multiple command types. After obtaining the natural language information, the natural language information can be input into the classification model to identify the user intention in the natural language information through the classification model, obtain an intention feature vector, and then determine the corresponding target command type based on the intention feature vector.

[0046] Step 103: Determine a target prompt template that matches the feature information.

[0047] In this embodiment, the terminal can match the relevant features of the game command that the player currently wants to issue obtained from the natural language information to clarify the target prompt template that best matches the feature information, so that the corresponding prompt information can be generated more standardly through the target prompt template.

[0048] Among them, the above target prompt template may include command description information for the game command indicated by the natural language information. The command description information may include both general information and specific information for describing the game command, and may also include command generation indication information for generating the game command, etc., which can be specifically set according to requirements and are not limited here.

[0049] Exemplarily, the above general information includes but is not limited to: an explanation of the player identity who generates the command, such as "You are an expert proficient in... commands. You can write the correct command according to the specific information and command indication information in the provided prompt information. Since the command syntax is relatively complex, please follow the relevant rules", or an explanation of the task to be generated, such as "Please refer to the above specific information and command indication information and write it in a specific format", etc., which can be specifically set according to requirements and are not limited here.

[0050] Exemplarily, the above specific information includes but is not limited to: command description information for the game command, such as "This command is used to locate a specific object structure in the generated or ungenerated world area", or the writing method of the game command is as follows:

[0051] ` / locate structure <structure:structure>[useNewChunksOnly:Boolean]`

[0052] ` / locate biome <biome:biome>`

[0053] Exemplarily, the generated indication information may include at least one field to be filled, and based on the natural language information, the content of the field to be filled is filled, so that the filled target prompt template is a game command indicated by the natural language information.

[0054] Specifically, the above-mentioned target prompt template can be constructed by the Chain-of-Thought method, so that the content in the target prompt template is structured, which can guide the large language model to gradually perform reasoning, perform step-by-step reasoning, improve the generation accuracy of complex commands, and reduce the time cost of players' repeated attempts.

[0055] Among them, the above-mentioned Chain-of-Thought (CoT) is a method to improve the ability to solve complex tasks by guiding the model to generate intermediate reasoning steps. Through this method, the large language model can be prompted to gradually think and generate a coherent reasoning process when solving tasks such as mathematical problems and logical reasoning, so as to obtain a more accurate final answer, that is, a more accurate game command can be obtained. Among them, when using the CoT technology, appropriate prompt templates and reasoning paths can be designed in combination with specific task scenarios to ensure the logic and consistency of the generated content.

[0056] In some embodiments, determining the target prompt template matching the feature information may include: First, a preset template set can be obtained, and the template set includes candidate prompt templates corresponding to at least one command type. Then, the candidate prompt template corresponding to the target command type can be selected from the candidate prompt templates as the target prompt template.

[0057] In this embodiment, candidate prompt templates corresponding to multiple different types of commands can be pre-constructed. For example, one prompt template can correspond to at least one command type. To facilitate finding a suitable target prompt template, the terminal can store multiple candidate prompt templates in a preset template set, so that when needed, the candidate prompt template corresponding to the target command type can be quickly obtained from a specific storage location, that is, the preset template set, and the obtained candidate prompt template can be used as the target prompt template.

[0058] Step 104: Generate prompt information based on the natural language information and the target prompt template.

[0059] In this embodiment, after obtaining the target prompt template, the terminal can fuse the natural language information input by the user with the target prompt template to generate corresponding prompt information, so as to more effectively and standardly transmit knowledge and provide a certain guiding direction for the subsequent processing of the large language model.

[0060] In some embodiments, in order to enable the generated prompt information to more accurately guide the large language model to accurately output the game command corresponding to the natural language information, before generating the prompt information based on the natural language information and the target prompt template, more content that can assist the large language model in understanding the game command to be output can be added to the target prompt template. For example, command examples can be added to the target prompt template, and the command examples are used to assist the large language model in learning the structure or related information of the game command to be output, so as to provide an accurate reference.

[0061] Specifically, it may include: First, based on the natural language information, information retrieval can be performed in a preset command library to obtain historical game commands that match the natural language information; then, based on the historical game commands, the content of the target prompt template can be updated to obtain an updated target prompt template.

[0062] Optionally, the terminal can use retrieval-augmented generation (knowledge retrieval) technology to find relevant command examples from a preset command library. Then, the terminal can randomly sample a preset number of historical game commands from the relevant command examples as reference commands to update the content of the target prompt template.

[0063] Among them, the retrieval-augmented generation technology can be vector retrieval technology, and the vector retrieval technology can include two methods: semantic retrieval based on Embedding and exact matching based on keywords. By establishing a suitable index structure and retrieval strategy, relevant command examples can be found from a preset command library.

[0064] Specifically, the terminal can use a vector retrieval tool (such as Faiss, Milvus, etc.) to use vector retrieval technology to find relevant command examples from a preset command library, so as to efficiently perform large-scale vector similarity retrieval.

[0065] Exemplarily, if the game command indicated by the above natural language information is a positioning command, the retrieved historical game commands are as follows:

[0066] Historical game command 1 is: {"zh": "Find a village", "minecraft_code": " / locatestructure village"}

[0067] Historical game command 2 is: {"zh": "Where is the nearest ocean monument?", "minecraft_code": " / locate structure monument"}

[0068] The historical game command 3 is: {"zh": "Search for ancient cities", "minecraft_code": " / locatestructure ancient_city"}

[0069] The historical game command 4 is: {"zh": "Locate a village", "minecraft_code": " / locatestructure village"}

[0070] The historical game command 5 is: {"zh": "Find a new village", "minecraft_code": " / locatestructure village true"}

[0071] The historical game command 6 is: {"zh": "Find a shipwreck that has not been visited", "minecraft_code": " / locatestructure shipwreck true"}

[0072] The historical game command 7 is: {"zh": "Locate a cherry grove", "minecraft_code": " / locatebiome cherry_grove"}

[0073] Among them, as can be seen from the historical game commands 1 to 7 provided above, the relevant historical game commands retrieved for the location command are also about location.

[0074] Specifically, updating the content of the target prompt template based on the historical game command to obtain the updated target prompt template includes: writing the historical game command at a preset position in the target prompt template to obtain the updated target prompt template, so as to enable the updated target prompt template to have the guidance of relevant command examples.

[0075] In some embodiments, since the target prompt template includes command generation indication information, and the command generation indication information includes at least one field to be filled, generating the prompt information based on the natural language information and the target prompt template may include: determining the target filling content corresponding to each field to be filled based on the natural language information; filling the target filling content into the corresponding field to be filled in the target prompt template, so as to use the target prompt template after field filling as the prompt information.

[0076] Exemplarily, there is corresponding parameter description at each field to be filled, as well as parameter type description of the target content to be filled, so as to avoid incorrect content filling. For example, the above parameter types include but are not limited to strings, booleans, etc., which can be specifically set according to requirements and are not limited here.

[0077] Step 105: Input the prompt information into the first large language model, and generate a command based on the prompt information through the first large language model to obtain the game command corresponding to the natural language information.

[0078] In this embodiment, the terminal inputs the prompt information into the first large language model, so that the first large language model performs feature recognition based on the prompt information, and generates a command based on the recognized features, so as to more accurately obtain the game command corresponding to the natural language information, avoiding the inaccurate command generation that often occurs when directly using a general large language model, which makes it difficult to meet the strict requirements of the game command system for accuracy and reliability. It realizes the accurate understanding of the natural language information input by the current user account, and converts the natural language information into a game command that conforms to the corresponding grammar specification, thus providing a more intuitive and efficient command input method for the current user account and greatly reducing the learning threshold of the current user account.

[0079] Specifically, the above large language model (Large Language Model, LLM) is a text generation model based on transformer. Usually, the model is pre-trained on a large corpus to enable the model to have basic text generation capabilities. Among them, the above transformer is a neural network model architecture for text modeling based on the attention mechanism, and its function is to calculate the mutual information weights of the input information through self-attention, so as to obtain a new vector representation containing global information by weighting. Among them, the above attention mechanism is a mechanism used to improve the context attention effect of the LLM model.

[0080] It should be noted that the above large language models (such as GPT series, Claude, etc.) can, through pre-training with a large amount of text data, possess natural language understanding and generation capabilities, so as to generate coherent dialogue content according to the context and can perform role-playing according to a specific persona. However, simply relying on large language models may produce inconsistent or off-topic content, so an additional constraint mechanism is needed to ensure the consistency of the generated content.

[0081] It should be noted that the above LLM can be an important branch in the field of Natural Language Processing (NLP).

[0082] For example, if the game command indicated by the above natural language information is a positioning command, then the game command corresponding to the natural language information is as follows:

[0083] {"en":"Find a pillager outpost","minecraft_code":" / locate structurepillager_outpost true"}

[0084] {"en":"Find a new ancient ruin","minecraft_code":" / locate structure trail_ruins true"}

[0085] {"en":"Locate a new nether fortress","minecraft_code":" / locate structurefortress true"}

[0086] {"en":"Search for new jungle temples","minecraft_code":" / locate structure templetrue"}

[0087] {"en":"Find a new ancient city","minecraft_code":" / locate structureancient_city true"}

[0088] In some embodiments, Figure 2 As shown, when processing the command generation method, multiple modules can be set up for implementation, such as Figure 2 The user input module (denoted as User Input), intent recognition module (denoted as Intent), knowledge retrieval module (denoted as Retrieval Augmented Generation (RAG)), prompt engineering module (denoted as CoT Prompt), large language model (denoted as LLM) and output parsing adaptation module (denoted as output-parser), etc.

[0089] Among them, through the user input module, natural language information input by the current user account is received as the starting point of the entire command conversion process. Then, the natural language information can be split into two paths and processed in parallel through the intent recognition module and the knowledge retrieval module respectively, so as to balance processing efficiency and accuracy through the collaborative processing of multiple modules. Then, the prompt engineering module receives the information processed by the intent recognition module and the knowledge retrieval module, and generates prompt information based on the information processed by the intent recognition module and the knowledge retrieval module, so as to send the prompt information to the large language model to output the initial game command through the large language model. Finally, the initial game command can be obtained through the parsing and adaptation module to adapt the initial game command to the game environment, output the final game command, and execute the corresponding game logic in the game.

[0090] Specifically, the intent recognition model can be used to recognize the intent of the natural language information to obtain an intent feature vector; based on the intent feature vector, the game command indicated by the natural language information and the feature information in at least one game command description dimension are determined.

[0091] Specifically, the instruction retrieval module can perform information retrieval in a preset command library based on the natural language information to obtain a historical game command that matches the natural language information.

[0092] Specifically, the prompt engineering module can receive the feature information in at least one game command description dimension, and determine a target prompt template that matches the feature information based on the feature information in at least one game command description dimension. In addition, the prompt engineering module can also receive the historical game command that matches the natural language information, and update the content of the target prompt template based on the historical game command that matches the natural language information and the natural language information, so as to obtain the corresponding prompt information.

[0093] Among them, Figure 2 Repeats, Set system env, and Commands in are used to indicate different adaptation methods in the parsing and adaptation module.

[0094] In some embodiments, after obtaining the game command corresponding to the natural language information, the game command can also be parsed to determine whether the game command is compatible with the game platform of the game, ensuring that the generated content conforms to the game grammar specification. Specifically, it can include: First, obtain the command rules corresponding to the game; then, determine whether the game command conforms to the command rules. If the game command conforms to the command rules, the game command is executed in the game to perform the corresponding game logic. If the game command does not conform to the command rules, it means that the game command cannot run in the game, and then the game command needs to be command-converted so that the converted game command conforms to the command rules, realizing the conversion of command formats between different game platforms. Moreover, by designing a command verification mechanism, it is ensured that the generated command conforms to the game grammar specification and can be correctly executed in the game environment.

[0095] Specifically, the command conversion of the game command to make the converted game command conform to the command rules can be: performing normalization processing on the game command to make the normalized game command conform to the corresponding command rules. For example, normalization processing such as digital repair and punctuation repair; or, for commands not supported by the game, a command conversion method can be set to convert the corresponding command based on the command conversion method. For example, some commands are permanent and have no time limit, then they can be converted into special commands with a higher number, such as 999999 for processing.

[0096] In some embodiments, the training process of the first large language model includes: First, obtain training samples, and then, based on the training samples, train the first large language model to obtain the trained first large language model.

[0097] It should be noted that since the above training samples are used to train the large language model, and the large language model generates corresponding game commands based on prompt information in actual applications, the above training samples can include prompt samples and labeled commands.

[0098] Among them, when training the above large language model, an initial general large language model can be used to perform parameter fine-tuning on the initial general large language model to tune it into a domain-specific large language model, that is, a large language model that can output game commands based on natural language information.

[0099] In some embodiments, the training samples include prompt samples and labeled commands. Training the first large language model based on the training samples to obtain a trained first large language model may include: First, generating a first predicted game command by the first large language model based on the prompt samples; then, calculating a first loss of the first large language model based on the difference between the first predicted game command and the labeled command; and finally, adjusting the model parameters of the first large language model based on the first loss to obtain a trained first large language model.

[0100] In some embodiments, the training samples include prompt samples. Training the first large language model based on the training samples to obtain a trained first large language model may include: First, generating a first predicted game command by the first large language model based on the prompt samples; then, generating a second predicted game command by a second large language model based on the prompt samples, where the number of parameters of the second large language model is greater than that of the first large language model; and finally, calculating a second loss of the first large language model based on the difference between the first predicted game command and the second predicted game command, and then adjusting the model parameters of the first large language model based on the second loss.

[0101] In this embodiment, by introducing a second large language model, the ability of the large language model is transferred to the lightweight model through the model distillation technology. Using the teacher-student model framework, the large model guides the small model to learn, optimizes the model structure, realizes efficient operation on low-configuration devices, reduces the model deployment cost while ensuring the effect, and ensures that the model response speed meets the real-time interaction requirements.

[0102] Among them, the number of parameters of the second large language model is greater than that of the first large language model. For example, the second large language model is a large-parameter model of 32b or 72b, while the first large language model is a small-parameter model of 4b or 7b.

[0103] In some embodiments, since the training samples include prompt samples and labeled commands, and the prompt samples are obtained based on natural language information, obtaining the training samples may include: directly obtaining historical natural language information and the corresponding historical commands, determining the corresponding historical prompt information based on the historical natural language information, and then using the historical prompt information and the historical commands as the prompt samples and labeled commands respectively.

[0104] Alternatively, the obtained historical natural language information and the corresponding historical commands may be reprocessed to construct high-quality training data.

[0105] Among them, self-generated data technology can be used to reprocess the obtained historical natural language information and the historical commands corresponding to the historical natural language information. The self-generated data technology can include two methods, Self-Instruct and Evol-Instruct, to improve the generalization ability and task adaptability of the LLM, that is, to use models such as large language models for data augmentation, generate new training samples through in-context learning, and moreover, by designing appropriate generation strategies and filtering mechanisms, the quality and diversity of the generated data can be ensured, avoiding the high cost and time consumption of manually constructing a large-scale high-quality dataset.

[0106] Among them, Self-Instruct fine-tunes itself by self-generating command data through a large language model (LLM), reducing the dependence on human-annotated data, thereby improving the model's command-following ability. Evol-Instruct, on the other hand, generates diverse and complex command data through command evolution (such as depth evolution and breadth evolution), further enhancing the model's ability to handle complex tasks.

[0107] Specifically, as Figure 3 shown, first, historical natural language information and the historical commands corresponding to the historical natural language information can be obtained, that is, Figure 3 the game instruction data in, which contains historical natural language information and the historical commands corresponding to the historical natural language information; then, the game instruction data is input into the prompt engineering module as seed data to determine the historical prompt information corresponding to the historical natural language information through the prompt engineering module, that is, Figure 3 the prompts in; finally, through Figure 3 the large language model module in, based on the historical prompt information, process the historical natural language information and the historical commands, such as performing information conversion and expansion, to obtain a processed new data graph, that is, Figure 3 the Synthetic Data in, and use the processed new data as prompt samples and labeled commands, that is, use the prompt information corresponding to the processed historical natural language information as prompt samples, and use the processed historical commands as labeled commands.

[0108] Among them, Figure 3 Evol-Instruct in is an evolutionary command. By using the method of generating complex instructions through a large model, it aims to improve data diversity, thereby enhancing the model's ability to handle complex tasks. This method generates a high-quality instruction dataset through steps such as instruction evolution, depth evolution, breadth evolution, and eliminating inefficient instructions.

[0109] Specifically, the historical natural language information and the corresponding historical commands can be that the data source module collects the original game commands and the corresponding natural language information in scenarios such as official documents, community discussions, and tutorials written by experts, so as to ensure the quality and authority of the initial data. In addition, the data source module can also generate a sample pair through the examples input by online players, that is, the natural language issued by the current user account. After the system recognizes the command, if the current user account does not give feedback on errors, a sample pair can be generated. For example, "Generate zombies" is the historical natural language information, and "-> / summon zombie" is the historical command corresponding to the historical natural language information. Among them, the above data source module: collects the original Minecraft command examples and the natural language descriptions of the current user account as the seed data for evolution.

[0110] In some embodiments, determining the historical prompt information corresponding to the historical natural language information may include: First, obtaining the historical prompt template corresponding to the historical natural language information; Then, the terminal can perform content expansion processing based on the historical prompt template according to specific evolution strategies (such as deepening, specifying, generalizing, etc.) to obtain the expanded historical prompt template, so as to guide the large language model to generate diverse command scenarios through the expanded historical prompt template; Finally, based on the historical natural language information and the expanded historical prompt template, the historical prompt information is generated.

[0111] Specifically, the content expansion processing includes at least one of the following: Adjusting the complexity of the parameters in the historical prompt template to deepen the content (such as for positioning commands, some specific creatures can be located, and more complex description scenarios can be located) to obtain the expanded historical prompt template; Adding game scene indication information to the historical prompt template to specify a specific game scene by further adding game scene indication information (such as for positioning commands, some other locatable objects can be located) to obtain the expanded historical prompt template; Generating the prompt template sample of the target command based on the target command and the prompt template sample of the historical command to generalize the application scenario corresponding to the target command (such as for positioning commands, the description content corresponding to other commands can be generalized) to be used as the expanded historical prompt template.

[0112] In some embodiments, since the prompt samples and label commands in the training samples can be the data generated by reprocessing the obtained historical natural language information and the corresponding historical commands, or there are abnormal data in the process of obtaining the training samples, therefore, before using the data to train the large language model, the data can be screened and verified, such as Figure 3 the screening and verification module shown, to clean the training samples based on the verification results of the screening and verification module, that is Figure 3 The Clean Data in it, such as removing the training samples that fail the verification, so as to obtain the new screened data, and use the new data to update the game instruction data to ensure the correctness and practicability of the data.

[0113] Specifically, the training samples include prompt samples and labeled commands. Before training the first large language model based on the training samples to obtain the trained first large language model, it may further include: First, control the labeled commands to run in the game to obtain the command running result, so as to verify the correctness of the data through the game environment. Then, judge the command running result to determine whether the command running result is abnormal. If the command running result is abnormal, it means that the labeled command has not been successfully run in the game, or the user feedbacks that the labeled command runs abnormally. Then, remove the training samples to which the abnormally resulting labeled commands belong, thereby establishing a complete data closed-loop including natural language descriptions, command syntax, and command running results, ensuring that the generated commands can be correctly executed in the game.

[0114] Specifically, the training samples include prompt samples and labeled commands. Before training the first large language model based on the training samples to obtain the trained first large language model, it may further include: If at least two training samples are repeated, then keep one training sample among the at least two repeated training samples and remove the remaining training samples.

[0115] Specifically, the training samples include prompt samples and labeled commands. Before training the first large language model based on the training samples to obtain the trained first large language model, it may further include: Introduce a verification prompt module in the screening and verification module, input the training samples into the verification prompt module, and the verification prompt module performs matching recognition on the prompt samples and labeled commands in the training samples to output a matching result. For example, if the matching result is correct, it means that the training sample is correct and the prompt sample and the labeled command correspond to each other. If the matching result is incorrect, it means that the training sample is incorrect and the prompt sample and the labeled command do not correspond to each other.

[0116] Furthermore, if there are training samples that fail the verification, the training samples that fail the verification can be reported to receive the adjustment information from the user for the training samples that fail the verification, and make adjustments based on this adjustment information, such as adjusting the indicated partial content in the prompt template based on this adjustment information.

[0117] In some embodiments, before model deployment, through the AutoAWQ library, the model parameters of the float type can be compressed into the int type to reduce the model size, thereby reducing the model parameter precision through quantization technology and reducing the storage and calculation requirements.

[0118] As can be seen from the above, by obtaining the natural language information input by the current user account in the game; identifying the feature information of the game command indicated by the natural language information based on the natural language information; determining the target prompt template that matches the feature information; generating a prompt information based on the natural language information and the target prompt template; inputting the prompt information into the first large language model, and generating a game command corresponding to the natural language information through the first large language model based on the prompt information, so as to identify the natural language information input by the current user account to obtain the game command corresponding to the natural language information, avoiding the situation that players need to spend a lot of energy to accurately remember and strictly use the corresponding command syntax to issue commands, thereby improving the player experience when issuing commands.

[0119] This embodiment also provides a command generation device, which can be specifically integrated in a terminal device. For example, as Figure 4 shown, the command generation device may include:

[0120] An information acquisition module 401, configured to acquire natural language information input by the current user account in the game;

[0121] An information recognition module 402, configured to identify the feature information of the game command indicated by the natural language information based on the natural language information;

[0122] A template matching module 403, configured to determine a target prompt template that matches the feature information;

[0123] An information generation module 404, configured to generate a prompt information based on the natural language information and the target prompt template;

[0124] A command generation module 405, configured to input the prompt information into the first large language model, and generate a game command corresponding to the natural language information through the first large language model based on the prompt information.

[0125] In some embodiments, the information recognition module 402 is specifically configured to:

[0126] Perform intention recognition on the natural language information to obtain an intention feature vector;

[0127] Determine the feature information of the game command indicated by the natural language information in at least one game command description dimension based on the intention feature vector.

[0128] In some embodiments, the game command description dimension includes a type description dimension, and the information recognition module 402 is specifically configured to:

[0129] Identify the intent of the natural language information through a preset classification model to obtain an intent feature vector;

[0130] Based on the intent feature vector, determine the target command type of the game command indicated by the natural language information in the type description dimension through the classification model.

[0131] In some embodiments, the template matching module 403 is specifically configured to:

[0132] Obtain a preset template set, where the template set includes candidate prompt templates corresponding to at least one command type;

[0133] Select the candidate prompt template corresponding to the target command type from the candidate prompt templates as the target prompt template.

[0134] In some embodiments, the above command generation device further includes a content update module, and the content update module is specifically configured to:

[0135] Perform information retrieval in a preset command library based on the natural language information to obtain a historical game command that matches the natural language information;

[0136] Update the content of the target prompt template based on the historical game command to obtain an updated target prompt template.

[0137] In some embodiments, the content update module is specifically configured to:

[0138] Write the historical game command at a preset position in the target prompt template to obtain an updated target prompt template.

[0139] In some embodiments, the target prompt template includes command generation indication information, and the command generation indication information includes at least one field to be filled. The information generation module 404 is specifically configured to:

[0140] Determine the target filling content corresponding to each field to be filled based on the natural language information;

[0141] Fill the target filling content into the corresponding field to be filled in the target prompt template, and use the target prompt template after field filling as the prompt information.

[0142] In some embodiments, the above command generation device further includes a command conversion module, and the command conversion module is specifically configured to:

[0143] Obtain the command rules corresponding to the game;

[0144] If the game command does not conform to the command rule, the game command is converted so that the converted game command conforms to the command rule.

[0145] In some embodiments, the above command generation device further includes a model training module, and the model training module is specifically configured to:

[0146] Obtain training samples;

[0147] Based on the training samples, train the first large language model to obtain the trained first large language model.

[0148] In some embodiments, the training samples include prompt samples and labeled commands, and the model training module is specifically configured to:

[0149] Generate a first predicted game command based on the prompt samples through the first large language model;

[0150] Calculate the first loss of the first large language model based on the difference between the first predicted game command and the labeled command;

[0151] Adjust the model parameters of the first large language model based on the first loss to obtain the trained first large language model.

[0152] In some embodiments, the training samples include prompt samples, and the model training module is specifically configured to:

[0153] Generate a first predicted game command based on the prompt samples through the first large language model;

[0154] Generate a second predicted game command based on the prompt samples through a second large language model, where the number of parameters of the second large language model is greater than the number of parameters of the first large language model;

[0155] Calculate the second loss of the first large language model based on the difference between the first predicted game command and the second predicted game command;

[0156] Adjust the model parameters of the first large language model based on the second loss.

[0157] In some embodiments, the training samples include prompt samples and labeled commands, and the model training module is specifically configured to:

[0158] Obtain historical natural language information and the historical command corresponding to the historical natural language information;

[0159] Determine the historical prompt information corresponding to the historical natural language information;

[0160] Based on the historical prompt information, process the historical natural language information and the historical command, use the prompt information corresponding to the processed historical natural language information as the prompt sample, and use the processed historical command as the labeled command.

[0161] In some embodiments, the model training module is specifically configured to:

[0162] Obtain the historical prompt template corresponding to the historical natural language information;

[0163] Perform content expansion processing based on the historical prompt template to obtain an expanded historical prompt template;

[0164] Generate the historical prompt information based on the historical natural language information and the expanded historical prompt template.

[0165] In some embodiments, the content expansion processing includes at least one of the following:

[0166] Adjust the complexity of the parameters in the historical prompt template to obtain an expanded historical prompt template;

[0167] Add game scene indication information to the historical prompt template to obtain an expanded historical prompt template;

[0168] Generate a prompt template sample for the target command based on the target command and the prompt template sample of the historical command as the expanded historical prompt template.

[0169] In some embodiments, the training sample includes a prompt sample and a labeled command. The above command generation device further includes a data elimination module, and the data elimination module is specifically configured to:

[0170] Control the labeled command to run in the game to obtain a command running result;

[0171] If the command running result is abnormal, eliminate the training sample to which the labeled command with the abnormal result belongs.

[0172] As can be seen from the above, by obtaining the natural language information input by the current user account in the game; identifying the feature information of the game command indicated by the natural language information based on the natural language information; determining the target prompt template that matches the feature information; generating a prompt information based on the natural language information and the target prompt template; inputting the prompt information into the first large language model, and generating a command through the first large language model based on the prompt information, so as to obtain the game command corresponding to the natural language information, thereby identifying the natural language information input by the current user account to obtain the game command corresponding to the natural language information, avoiding the situation that players need to spend a lot of energy to accurately remember and strictly use the corresponding command syntax to issue commands, and improving the player experience when issuing commands.

[0173] Correspondingly, an embodiment of the present application further provides an electronic device. The electronic device may be a terminal, and the terminal may be a smart phone, a tablet computer, a laptop computer, a touch screen, a game console, a personal computer (PC), a personal digital assistant (PDA), or other terminal devices. Alternatively, the electronic device may be a server.

[0174] As Figure 5 shown, Figure 5 is a schematic structural diagram of the electronic device provided by an embodiment of the present application. The electronic device 500 includes a processor 501 having one or more processing cores, a memory 502 having one or more computer-readable storage media, and a computer program stored on the memory 502 and executable on the processor. Among them, the processor 501 is electrically connected to the memory 502. Those skilled in the art can understand that the structural diagram of the electronic device shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0175] The processor 501 is the control center of the electronic device 500, connecting various parts of the entire electronic device 500 through various interfaces and lines. By running or loading the software programs and / or units stored in the memory 502, and calling the data stored in the memory 502, the processor 501 executes various functions of the electronic device 500 and processes data, thereby monitoring the entire electronic device 500. The processor 501 may be a central processing unit (CPU), a graphics processing unit (GPU), a network processor (NP), etc., and may implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application.

[0176] In an embodiment of the present application, the processor 501 in the electronic device 500 will load the instructions corresponding to the processes of one or more application programs into the memory 502 according to the following steps, and the processor 501 will run the application programs stored in the memory 502 to implement various functions, such as:

[0177] Obtain the natural language information input by the current user account in the game;

[0178] Based on the natural language information, identify the characteristic information of the game command indicated by the natural language information;

[0179] Determine the target prompt template that matches the characteristic information;

[0180] Based on the natural language information and the target prompt template, generate a prompt message;

[0181] Input the prompt message into the first large language model, and the first large language model generates a command based on the prompt message to obtain the game command corresponding to the natural language information.

[0182] Thus, the electronic device 500 provided in this embodiment can bring the following technical effects: improving the player experience when the player issues commands.

[0183] For the specific implementation of each of the above operations, reference may be made to the previous embodiments, which will not be elaborated here.

[0184] Optionally, as Figure 5 shown, the electronic device 500 further includes: a touch display screen 503, a radio frequency circuit 504, an audio circuit 505, an input unit 506, and a power supply 507. Among them, the processor 501 is electrically connected to the touch display screen 503, the radio frequency circuit 504, the audio circuit 505, the input unit 506, and the power supply 507 respectively. Those skilled in the art can understand that Figure 5 the structure of the electronic device shown in

[0185] The touch display screen 503 can be used to display a graphical user interface and receive operation instructions generated by a user acting on the graphical user interface. The touch display screen 503 may include a display panel and a touch panel. Among them, the display panel can be used to display information input by the user or information provided to the user, as well as various graphical user interfaces of the electronic device. These graphical user interfaces can be composed of graphics, text, icons, videos, and any combination thereof. Optionally, the display panel can be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. The touch panel can be used to collect touch operations of the user on or near it (such as operations of the user using a finger, a stylus, or any suitable object or accessory on or near the touch panel), and generate corresponding operation instructions, and the operation instructions execute the corresponding program. Optionally, the touch panel can include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the touch orientation of the user, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 501, and can receive and execute the commands sent by the processor 501. The touch panel can cover the display panel. When the touch panel detects a touch operation on or near it, it is transmitted to the processor 501 to determine the type of touch event. Subsequently, the processor 501 provides a corresponding visual output on the display panel according to the type of touch event. In the embodiments of the present application, the touch panel and the display panel can be integrated into the touch display screen 503 to implement input and output functions. However, in some embodiments, the touch panel and the touch panel can be implemented as two independent components to implement input and output functions. That is, the touch display screen 503 can also be used as a part of the input unit 506 to implement the input function.

[0186] The radio frequency circuit 504 can be used to transmit and receive radio frequency signals to establish wireless communication with a network device or other electronic devices through wireless communication, and transmit and receive signals with the network device or other electronic devices.

[0187] The audio circuit 505 can be used to provide an audio interface between the user and the electronic device through a speaker and a microphone. The audio circuit 505 can transmit the electrical signal converted from the received audio data to the speaker, and the speaker converts it into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 505 and then converted into audio data. After the audio data is output to the processor 501 for processing, it is transmitted through the radio frequency circuit 504 to, for example, another electronic device, or the audio data is output to the memory 502 for further processing. The audio circuit 505 may also include an earphone jack to provide communication between the peripheral earphone and the electronic device.

[0188] The input unit 506 can be used to receive input digital, character information or user feature information (such as fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.

[0189] The power supply 507 is used to supply power to each component of the electronic device 500. Optionally, the power supply 507 can be logically connected to the processor 501 through a power management system, so as to realize functions such as management of charging, discharging, and power consumption management through the power management system. The power supply 507 can also include any components such as one or more DC or AC power supplies, a recharge system, a power failure detection circuit, a power converter or inverter, and a power status indicator.

[0190] Although Figure 5 not shown in the figure, the electronic device 500 may also include a camera, a sensor, a Wi-Fi module, a Bluetooth module, etc., which will not be elaborated here.

[0191] In the above embodiments, the descriptions of each embodiment have their own emphases. For the parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0192] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructions, or by controlling relevant hardware through instructions. The instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.

[0193] Therefore, an embodiment of the present application provides a computer-readable storage medium, in which multiple computer programs are stored. The computer programs can be loaded by a processor to execute any command generation method provided by the embodiments of the present application. The computer programs can execute the steps of the following command generation method:

[0194] Obtain the natural language information input by the current user account in the game;

[0195] Based on the natural language information, identify the feature information of the game command indicated by the natural language information;

[0196] Determine the target prompt template that matches the feature information;

[0197] Based on the natural language information and the target prompt template, generate prompt information;

[0198] Input the prompt information into a first large language model, and generate a game command corresponding to the natural language information through the first large language model based on the prompt information.

[0199] It can be seen that the computer program can be loaded by the processor to execute any command generation method provided by the embodiments of the present application, thereby bringing the following technical effects: improving the player experience when the player issues commands.

[0200] For the specific implementation of each of the above operations, reference can be made to the previous embodiments, which will not be elaborated here.

[0201] Among them, the computer-readable storage medium may include: read-only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk, etc.

[0202] Since the computer program stored in the computer-readable storage medium can execute any command generation method provided by the embodiments of the present application, the beneficial effects that can be achieved by any command generation method provided by the embodiments of the present application can be realized. For details, refer to the previous embodiments, which will not be elaborated here.

[0203] According to one aspect of the present application, there is also provided a computer program product or computer program. The computer program product or computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device executes the methods provided in various optional implementation manners in the above embodiments.

[0204] In the above embodiments of the command generation device, computer-readable storage medium, electronic device, and computer program product, the descriptions of each embodiment have their own emphases. For parts not elaborated in a certain embodiment, reference can be made to the relevant descriptions of other embodiments. Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes and the beneficial effects that can be brought by the above-described command generation device, computer-readable storage medium, computer program product, electronic device, and their corresponding units can refer to the description of the command generation method in the above embodiments, which will not be elaborated here specifically.

[0205] The above has introduced in detail a command generation method, device, electronic device, computer-readable storage medium, and computer program product provided by the embodiments of the present application. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.< / biome:biome> < / structure:structure>

Claims

1. A command generation method, characterized in that: The method comprises: Get the natural language information entered by the current user account in the game; identifying feature information of a game command indicated by the natural language information based on the natural language information; Determine a target prompt template matching the feature information; Generate prompt information based on the natural language information and the target prompt template; The prompt information is input into a first large language model, and commands are generated based on the prompt information by the first large language model to obtain game commands corresponding to the natural language information.

2. The command generation method according to claim 1, characterized in that: The identifying, based on the natural language information, feature information of the game command indicated by the natural language information includes: Performing intent recognition on the natural language information to obtain an intent feature vector; The game command indicated by the natural language information is determined based on the intention feature vector, and feature information of at least one game command description dimension.

3. The command generation method according to claim 2, characterized in that: The game command description dimension includes a type description dimension, and the performing intent recognition on the natural language information to obtain an intent feature vector includes: Using a preset classification model, the natural language information is subjected to intent recognition to obtain an intent feature vector; The determining the game command indicated by the natural language information based on the intention feature vector, wherein feature information of at least one game command description dimension includes: The classification model is used to determine the target command type of the game command indicated by the natural language information based on the intention feature vector and under the type description dimension.

4. The command generation method according to claim 3, characterized in that: The determining of a target prompt template matching the feature information includes: Obtaining a preset template set, wherein the template set includes a candidate prompt template corresponding to at least one command type; A candidate prompt template corresponding to the target command type is selected from the candidate prompt templates to serve as the target prompt template.

5. The command generation method according to claim 1, characterized in that: Before generating prompt information based on the natural language information and the target prompt template, the method further includes: Based on the natural language information, information is searched in a preset command library to obtain historical game commands that match the natural language information; Based on the historical game commands, the content of the target prompt template is updated to obtain an updated target prompt template.

6. The command generation method according to claim 5, characterized in that: The updating of the target prompt template based on the historical game command to obtain an updated target prompt template includes: The historical game command is written at a preset position in the target prompt template to obtain an updated target prompt template.

7. The command generation method according to claim 1, characterized in that: The target prompt template includes command generation indication information, the command generation indication information includes at least one field to be filled, and the generating prompt information based on the natural language information and the target prompt template includes: Determine the target filling content corresponding to each of the to-be-filled fields based on the natural language information; The target filling content is filled into the corresponding to-be-filled field in the target prompt template, so that the target prompt template after the field is filled is used as prompt information.

8. The command generation method according to claim 1, characterized in that: After obtaining the game command corresponding to the natural language information, the method further includes: Obtaining command rules corresponding to the game; If the game command does not comply with the command rule, the game command is converted so that the converted game command complies with the command rule.

9. The command generation method according to any one of claims 1 to 8, characterized in that: The training process of the first language model includes: Get training samples; Based on the training samples, the first largest language model is trained to obtain a trained first largest language model.

10. The command generation method according to claim 9, characterized in that: The training samples include prompt samples and label commands. The first language model is trained based on the training samples to obtain the trained first language model, including: Generate a first predicted game command based on the prompt sample by using the first language model; Calculating a first loss of the first large language model based on a difference between the first predicted game command and the label command; The model parameters of the first largest language model are adjusted based on the first loss to obtain the trained first largest language model.

11. The command generation method according to claim 9, characterized in that: The training samples include prompt samples, and the first large language model is trained based on the training samples to obtain the trained first large language model, including: Generate a first predicted game command based on the prompt sample by using the first language model; generating a second predicted game command based on the prompt sample by a second largest language model, wherein the number of parameters of the second largest language model is greater than the number of parameters of the first largest language model; Calculating a second loss of the first large language model based on a difference between the first predicted game command and the second predicted game command; A model parameter of the first language model is adjusted based on the second loss.

12. The command generation method according to claim 9, characterized in that: The training sample includes a prompt sample and a label command, and the obtaining of the training sample includes: Acquire historical natural language information and historical commands corresponding to the historical natural language information; Determining historical prompt information corresponding to the historical natural language information; Based on the historical prompt information, the historical natural language information and the historical commands are processed, the prompt information corresponding to the processed historical natural language information is used as a prompt sample, and the processed historical commands are used as label commands.

13. The command generation method according to claim 12, characterized in that: The determining of the historical prompt information corresponding to the historical natural language information includes: Obtaining a history prompt template corresponding to the history natural language information; Performing content expansion processing based on the history prompt template to obtain an expanded history prompt template; The historical prompt information is generated based on the historical natural language information and the expanded historical prompt template.

14. The command generation method according to claim 13, characterized in that: The content extension process includes at least one of the following: Adjusting the complexity of the parameters in the history prompt template to obtain an expanded history prompt template; Adding game scene indication information to the history prompt template to obtain an extended history prompt template; Based on the target command and the prompt template sample of the historical command, a prompt template sample of the target command is generated as an extended historical prompt template.

15. The command generation method according to claim 9, characterized in that: The training samples include prompt samples and label commands. Before training the first language model based on the training samples to obtain the trained first language model, the method further includes: Control the tag command to run in the game and obtain the command running result; If the command execution result is an abnormal result, the training sample to which the label command with the abnormal result belongs is removed.

16. A command generating device, characterized in that: The device comprises: The information acquisition module is used to obtain the natural language information entered by the current user account in the game; An information identification module, used to identify characteristic information of the game command indicated by the natural language information based on the natural language information; A template matching module, used to determine a target prompt template that matches the feature information; An information generation module, used for generating prompt information based on the natural language information and the target prompt template; The command generation module is used to input the prompt information into the first large language model, generate commands based on the prompt information through the first large language model, and obtain the game command corresponding to the natural language information.

17. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute the steps of the command generation method according to any one of claims 1 to 15.

18. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps of the command generation method according to any one of claims 1 to 15.