Method, device, equipment and medium for generating instruction data

Through structured disassembly and rules of natural language reference instructions, sample slots and slot values ​​are determined, and sample instructions are generated, which solves the problem of insufficient ability to follow large model instructions and improves the flexibility and pertinence of training data.

CN116860328BActive Publication Date: 2024-08-23BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310804563.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-30
Publication Date
2024-08-23
Estimated Expiration
2043-06-30

AI Technical Summary

Technical Problem

In the existing technology, the instruction following ability of large models is limited by manually written instruction data, which lacks pertinence and directionality, resulting in an inflexible training data generation process and the inability to provide complex, diverse, and targeted instruction training data.

Method used

By structurally disassembling the reference instructions based on natural language, the reference slots and slot values ​​corresponding to the required categories are obtained. Based on these slots and slot values ​​and the preset rules, the sample slots and sample slot values ​​are determined and generated based on Natural language sample instructions improve the flexibility of the instruction training data generation process.

Benefits of technology

It is possible to provide more complex, diverse, targeted and directional instruction training data for large generative models, effectively improving the instruction following ability of large models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116860328B
    Figure CN116860328B
Patent Text Reader

Abstract

The present disclosure provides a method, device, equipment and medium for generating instruction data, which relates to the field of artificial intelligence technology, and in particular to the technical fields of natural language processing and deep learning. The method includes: obtaining a reference instruction based on natural language, wherein the reference instruction can instruct a large model to generate reply data that meets multiple first requirements corresponding to multiple first requirement categories; obtaining a structured decomposition result of the reference instruction to obtain multiple reference slots corresponding to multiple first requirement categories and multiple reference slot values ​​corresponding to multiple first requirements; determining multiple sample slots and multiple sample slot values ​​corresponding to multiple sample slots based on multiple reference slots, multiple reference slot values ​​and preset rules; and generating a sample instruction based on natural language based on multiple sample slots and multiple sample slot values, wherein the sample instruction can instruct the large model to generate reply data that meets multiple second requirements corresponding to multiple sample slot values.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, in particular to the field of natural language processing and the like, and specifically to a method for generating instruction data for a large model, an apparatus for generating instruction data for a large model, an electronic device, a computer-readable storage medium and a computer program product. Background Art

[0002] Artificial intelligence is a discipline that studies how to use computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.). It includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include natural language processing technology, computer vision technology, speech recognition technology, machine learning / , big data processing technology, knowledge graph technology, and other major directions.

[0003] The methods described in this section are not necessarily methods that have been previously conceived or employed. Unless otherwise indicated, it should not be assumed that any method described in this section is considered to be prior art simply because it is included in this section. Similarly, unless otherwise indicated, the issues mentioned in this section should not be considered to have been recognized in any prior art. Summary of the invention

[0004] The present disclosure provides a method for generating instruction data for a large model, an apparatus for generating instruction data for a large model, an electronic device, a computer-readable storage medium, and a computer program product.

[0005] According to one aspect of the present disclosure, there is provided a method for generating instruction data for a large model, comprising: obtaining a reference instruction based on natural language, the reference instruction being capable of instructing the large model to generate reply data satisfying multiple first requirements corresponding to multiple first requirement categories; obtaining a structured decomposition result of the reference instruction to obtain multiple reference slots corresponding to the multiple first requirement categories and multiple reference slot values ​​corresponding to the multiple first requirements; determining multiple sample slots and multiple sample slot values ​​corresponding to the multiple sample slots based on the multiple reference slots, the multiple reference slot values ​​and preset rules; and generating a sample instruction based on natural language based on the multiple sample slots and the multiple sample slot values, the sample instruction being capable of instructing the large model to generate reply data satisfying multiple second requirements corresponding to the multiple sample slot values.

[0006] According to another aspect of the present disclosure, there is provided a device for generating instruction data for a large model, comprising: a first acquisition unit, configured to acquire a reference instruction based on natural language, the reference instruction being capable of instructing the large model to generate reply data satisfying a plurality of first requirements corresponding to a plurality of first requirement categories; a second acquisition unit, configured to acquire a structured decomposition result of the reference instruction to obtain a plurality of reference slots corresponding to the plurality of first requirement categories and a plurality of reference slot values ​​corresponding to the plurality of first requirements; a determination unit, configured to determine a plurality of sample slots and a plurality of sample slot values ​​corresponding to the plurality of sample slots based on a plurality of reference slots, a plurality of reference slot values ​​and preset rules; and a generation unit, configured to generate a sample instruction based on natural language based on the plurality of sample slots and a plurality of sample slot values, the sample instruction being capable of instructing the large model to generate reply data satisfying a plurality of second requirements corresponding to the plurality of sample slot values.

[0007] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the above method.

[0008] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute the above method.

[0009] According to another aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein the computer program implements the above method when executed by a processor.

[0010] According to one or more embodiments of the present disclosure, the present disclosure structurally decomposes natural language-based reference instructions to obtain multiple reference slots corresponding to requirement categories and multiple reference slot values ​​corresponding to specific requirements of each requirement category, and then determines multiple sample slots and multiple sample slot values ​​for generating sample instructions based on the multiple reference slots, the multiple reference slot values ​​and preset rules, and finally obtains natural language-based sample instructions, thereby improving the flexibility of the instruction training data generation process, providing the generative large model with more complex, diverse, targeted and directional instruction training data, and effectively improving the instruction compliance capability of the large model.

[0011] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] The accompanying drawings exemplarily illustrate the embodiments and constitute a part of the specification, and together with the text description of the specification, are used to explain the exemplary implementation of the embodiments. The embodiments shown are for illustrative purposes only and do not limit the scope of the claims. In all drawings, the same reference numerals refer to similar but not necessarily identical elements.

[0013] Figure 1 A schematic diagram showing an exemplary system in which the various methods described herein may be implemented according to an embodiment of the present disclosure;

[0014] Figure 2 A flowchart of a method for generating instruction data for a large model according to an embodiment of the present disclosure is shown;

[0015] Figure 3 A flow chart of determining a plurality of sample slots and a plurality of sample slot values ​​corresponding to the plurality of sample slots according to an embodiment of the present disclosure is shown;

[0016] Figure 4 A flowchart of a method for generating instruction data for a large model according to an embodiment of the present disclosure is shown;

[0017] Figure 5 A structural block diagram of an apparatus for generating instruction data for a large model according to an embodiment of the present disclosure is shown; and

[0018] Figure 6 A structural block diagram of an exemplary electronic device that can be used to implement the embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0019] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0020] In the present disclosure, unless otherwise specified, the use of the terms "first", "second", etc. to describe various elements is not intended to limit the positional relationship, temporal relationship, or importance relationship of these elements, and such terms are only used to distinguish one element from another element. In some examples, the first element and the second element may refer to the same instance of the element, and in some cases, based on the description of the context, they may also refer to different instances.

[0021] The terms used in the description of various examples in this disclosure are only for the purpose of describing specific examples and are not intended to be limiting. Unless the context clearly indicates otherwise, if the number of elements is not specifically limited, the element can be one or more. In addition, the term "and / or" used in this disclosure covers any one of the listed items and all possible combinations.

[0022] In the related art, in order to train the instruction-following ability of a large model, usually only manually written instruction data can be relied upon, and such instruction data lacks specificity and directionality.

[0023] To solve the above problems, the present invention structurally decomposes the reference instructions based on natural language to obtain multiple reference slots corresponding to the requirement categories and multiple reference slot values ​​corresponding to the specific requirements of each requirement category, and then determines multiple sample slots and multiple sample slot values ​​for generating sample instructions based on the multiple reference slots, the multiple reference slot values ​​and preset rules, and finally obtains the sample instructions based on natural language, thereby improving the flexibility of the instruction training data generation process, providing the generative large model with more complex, diverse, targeted and directional instruction training data, and effectively improving the instruction compliance ability of the large model.

[0024] The embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.

[0025] Figure 1 FIG. 1 is a schematic diagram of an exemplary system 100 in which various methods and apparatuses described herein may be implemented according to an embodiment of the present disclosure. Figure 1 , the system 100 includes one or more client devices 101, 102, 103, 104, 105, and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. The client devices 101, 102, 103, 104, 105, and 106 may be configured to execute one or more applications.

[0026] In an embodiment of the present disclosure, the server 120 may run one or more services or software applications that enable the method of generating instruction data for a large model of the present disclosure to be executed. In an exemplary embodiment, a large model may be deployed on the server.

[0027] In some embodiments, server 120 may also provide other services or software applications, which may include non-virtualized environments and virtualized environments. In some embodiments, these services may be provided as web-based services or cloud services, such as provided to users of client devices 101, 102, 103, 104, 105, and / or 106 under a software as a service (SaaS) model.

[0028] exist Figure 1 In the configuration shown, the server 120 may include one or more components that implement the functions performed by the server 120. These components may include software components, hardware components, or a combination thereof that can be executed by one or more processors. Users operating client devices 101, 102, 103, 104, 105, and / or 106 may in turn utilize one or more client applications to interact with the server 120 to utilize the services provided by these components. It should be understood that a variety of different system configurations are possible, which may differ from the system 100. Therefore, Figure 1 is one example of a system for implementing the various methods described herein and is not intended to be limiting.

[0029] The user may use client devices 101, 102, 103, 104, 105, and / or 106 to generate reply data using the big model. The client device may provide an interface that enables the user of the client device to interact with the client device. The client device may also output information to the user via the interface, for example, the reply generated by the big model for the user input may be output to the user. Figure 1 Only six client devices are depicted, but one skilled in the art will appreciate that the present disclosure may support any number of client devices.

[0030] Client devices 101, 102, 103, 104, 105 and / or 106 may include various types of computer devices, such as portable handheld devices, general-purpose computers (such as personal computers and laptop computers), workstation computers, wearable devices, smart screen devices, self-service terminal devices, service robots, game systems, thin clients, various messaging devices, sensors or other sensing devices, etc. These computer devices may run various types and versions of software applications and operating systems, such as MICROSOFT Windows, APPLE iOS, UNIX-like operating systems, Linux or Linux-like operating systems (such as GOOGLE Chrome OS); or include various mobile operating systems, such as MICROSOFT Windows Mobile OS, iOS, Windows Phone, Android. Portable handheld devices may include cellular phones, smart phones, tablet computers, personal digital assistants (PDAs), etc. Wearable devices may include head-mounted displays (such as smart glasses) and other devices. Game systems may include various handheld game devices, Internet-enabled game devices, etc. Client devices are capable of executing various different applications, such as various Internet-related applications, communication applications (such as email applications), short message service (SMS) applications, and may use various communication protocols.

[0031] The network 110 may be any type of network known to those skilled in the art that may support data communications using any of a variety of available protocols, including but not limited to TCP / IP, SNA, IPX, etc. By way of example only, the one or more networks 110 may be a local area network (LAN), an Ethernet-based network, a token ring, a wide area network (WAN), the Internet, a virtual network, a virtual private network (VPN), an intranet, an extranet, a blockchain network, a public switched telephone network (PSTN), an infrared network, a wireless network (e.g., Bluetooth, WIFI), and / or any combination of these and / or other networks.

[0032] Server 120 may include one or more general purpose computers, dedicated server computers (e.g., PC (personal computer) servers, UNIX servers, mid-range servers), blade servers, mainframe computers, server clusters, or any other suitable arrangement and / or combination. Server 120 may include one or more virtual machines running virtual operating systems, or other computing architectures involving virtualization (e.g., one or more flexible pools of logical storage devices that may be virtualized to maintain a server's virtual storage device). In various embodiments, server 120 may run one or more services or software applications that provide the functionality described below.

[0033] The computing units in the server 120 may run one or more operating systems including any of the above operating systems and any commercially available server operating systems. The server 120 may also run any of a variety of additional server applications and / or middle-tier applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, etc.

[0034] In some implementations, server 120 may include one or more applications to analyze and consolidate data feeds and / or event updates received from users of client devices 101, 102, 103, 104, 105, and / or 106. Server 120 may also include one or more applications to display data feeds and / or real-time events via one or more display devices of client devices 101, 102, 103, 104, 105, and / or 106.

[0035] In some embodiments, the server 120 may be a server of a distributed system, or a server combined with a blockchain. The server 120 may also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology. A cloud server is a host product in a cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and virtual private servers (VPS) services.

[0036] The system 100 may also include one or more databases 130. In some embodiments, these databases may be used to store data and other information. For example, one or more of the databases 130 may be used to store information such as audio files and video files. The databases 130 may reside in various locations. For example, the database used by the server 120 may be local to the server 120, or may be remote from the server 120 and may communicate with the server 120 via a network-based or dedicated connection. The databases 130 may be of different types. In some embodiments, the databases used by the server 120 may be, for example, relational databases. One or more of these databases may store, update, and retrieve data to and from the databases in response to commands.

[0037] In some embodiments, one or more of the databases 130 may also be used by applications to store application data. The databases used by the applications may be different types of databases, such as a key-value store, an object store, or a conventional store backed by a file system.

[0038] Figure 1The system 100 may be configured and operated in various ways to enable the application of various methods and apparatuses described in the present disclosure.

[0039] According to one aspect of the present disclosure, a method for generating instruction data for a large model is provided. Figure 2 As shown, the method for generating instruction data for a large model includes: step S201, obtaining a reference instruction based on natural language, the reference instruction can instruct the large model to generate response data that meets multiple first requirements corresponding to multiple first requirement categories; step S202, obtaining a structured decomposition result of the reference instruction to obtain multiple reference slots corresponding to multiple first requirement categories and multiple reference slot values ​​corresponding to the multiple first requirements; step S203, based on multiple reference slots, multiple reference slot values ​​and preset rules, determining multiple sample slots and multiple sample slot values ​​corresponding to the multiple sample slots; and step S204, based on the multiple sample slots and the multiple sample slot values, generating a sample instruction based on natural language, the sample instruction can instruct the large model to generate response data that meets multiple second requirements corresponding to the multiple sample slot values.

[0040] Therefore, by structurally decomposing the reference instructions based on natural language to obtain multiple reference slots corresponding to the requirement categories and multiple reference slot values ​​corresponding to the specific requirements of each requirement category, and then based on the multiple reference slots, multiple reference slot values ​​and preset rules, multiple sample slots and multiple sample slot values ​​for generating sample instructions are determined, and finally sample instructions based on natural language are obtained, thereby improving the flexibility of the instruction training data generation process, providing the generative large model with more complex, diverse, targeted and directional instruction training data, and effectively improving the instruction compliance ability of the large model.

[0041] In the present disclosure, the large model is a generative large model based on deep learning. The large model has end-to-end characteristics and can directly generate reply data based on the instruction data input by the user. In other words, the large model itself has a generation function. In some embodiments, the large model can be a large language model based on deep learning. Large language models usually have billions or even hundreds of billions of parameters, and they are usually trained on large-scale text data or data of other modalities. Large language models can be used for various natural language processing tasks, such as text generation, language translation, and question-answering systems.

[0042] The large model can, for example, adopt an N-layer Transformer network structure with an encoder and a decoder, or a unified pre-trained language model (Unified pre-trained LanguageModel, UniLM) network structure. It is understandable that the large model can also be other neural network models based on the Transformer network structure, which is not limited here. The input and output of the large model are both composed of tokens. Each token can correspond to a single word, character, word, or special symbol. The large model can be trained using pre-training tasks and fine-tuned using instruction data and corresponding true value response data to have the above-mentioned generation function.

[0043] In some embodiments, in step S201, training instructions can be obtained from the training set, or real target instructions can be obtained from online user logs, and these instructions are used as reference instructions. In an exemplary embodiment, an example reference instruction can be "Please write an essay about wine with less than 100 words, and the word "wine" cannot appear in the full text." The reference instruction involves five first requirement categories, namely "tasks that need to be performed by the big model", "genre of generated content", "theme of generated content", "number of words of generated content" and "requirements for generated content", and for these five first requirement categories, there are five first requirements, namely "text creation as task", "genre is prose", "theme about wine", "number of words less than 100 words" and "the word "wine" cannot appear in the full text". The reference instruction can instruct the big model to generate reply data that meets multiple first requirements corresponding to multiple first requirement categories.

[0044] As can be seen from the above examples, "requirement category" can be understood as the conditions that need to be met in the process of using the big model to generate response data, such as the genre and theme of the generated content, etc. The "requirement" corresponding to the "requirement category" is used to describe the specific conditions that need to be met to generate response data for this requirement category. For example, for the requirement category of "genre of generated content", the big model needs to generate prose, or for the requirement category of "theme of generated content", it needs to generate content about wine.

[0045] In some embodiments, in step S202, the structured decomposition result of the reference instruction can be obtained to obtain multiple reference slots corresponding to multiple first requirement categories and multiple reference slot values ​​corresponding to multiple first requirements. In an exemplary embodiment, the above-mentioned example reference instruction can be structured and decomposed to obtain five reference slots of "task", "genre", "theme", "number of words" and "content requirement" corresponding to the above-mentioned five first requirement categories, and obtain five reference slot values ​​of "text creation", "prose", "wine", "<100 words" and "the word "wine" cannot appear" corresponding to the above-mentioned five first requirements.

[0046] It should be noted that the first requirement category and the first requirement can be understood as abstract concepts of conditions that need to be met for the large model to generate reply data, while the reference slot and the reference slot value are specific and definite structured representations obtained by decomposing the abstract concept. In some embodiments, multiple reference slots can be selected from multiple preset slots, and multiple candidate slot values ​​can be selected from multiple preset slot values.

[0047] In some embodiments, the structured disassembly result of the reference instruction may be obtained by processing the reference instruction using a natural language instruction disassembly model. The natural language instruction disassembly model may be a classification model to select a plurality of reference slots corresponding to the reference instruction from a plurality of preset slots, and select a plurality of reference slot values ​​corresponding to the reference instruction from a plurality of preset slot values. The natural language instruction disassembly model may also be a generative model (which may be a model different from the large model mentioned above), and directly obtain a plurality of reference slots and a plurality of reference slot values ​​corresponding to the reference instruction by means of content generation.

[0048] At this point, through the above steps, the structured disassembly result of the reference instruction can be obtained, and then the reference instruction can be statistically analyzed based on the structured disassembly result, and based on the corresponding statistical analysis results, it is determined which sample slots and sample slot values ​​need to be generated. In some embodiments, sample instructions can also be directly generated based on the structured disassembly result of the reference instruction.

[0049] According to some embodiments, the preset rules may indicate that multiple reference slots are directly determined as multiple sample slots, and multiple reference slot values ​​are directly determined as multiple sample slot values. Thus, the rewriting of the reference instruction can be achieved. In addition, by structurally decomposing the reference instruction and then rewriting the instruction based on the structural decomposition result, it is possible to ensure that each requirement category and each requirement in the reference instruction are reflected in the newly generated sample instruction, thereby ensuring that the generated sample instruction is accurate.

[0050] In some embodiments, multiple sample slots and multiple sample slot values ​​can be input into a natural language instruction generation model to obtain sample instructions. The natural language instruction generation model can be another large model different from the large model mentioned above (for example, a large language model based on deep learning). The model can combine multiple sample slot values ​​corresponding to multiple sample slots to generate sample instructions based on natural language. By using the natural language instruction disassembly model to obtain the disassembly results of the reference instruction, and using the natural language instruction generation model to generate sample instructions, a fully automated sample instruction generation process is implemented, without the need for manual labor, thereby reducing the generation cost of the sample instruction and improving the generation speed.

[0051] According to some embodiments, step S204, generating a sample instruction based on natural language based on multiple sample slots and multiple sample slot values ​​includes: based on multiple sample slots and multiple sample slot values, using a natural language instruction generation model to generate multiple sample instructions with different expressions but the same meaning. Thus, through the above method, a large number of sample instructions with different expressions but the same meaning can be automatically generated, thereby helping and accelerating the large model to learn the corresponding slots and slot values. In addition, since these sample instructions have the same meaning, these sample instructions can correspond to the same ground truth response data, so a large amount of sample data (including sample instructions and corresponding ground truth response data) can be quickly generated.

[0052] In an exemplary embodiment, based on the five sample slots of "task", "genre", "theme", "number of words" and "content requirement" and the five sample slot values ​​of "text creation", "prose", "wine", "<100 words" and "the word 'wine' cannot appear", a sample instruction "write a prose with the theme of wine, requiring that the word 'wine' does not appear in the text and the number of words does not exceed 100" can be generated. In the exemplary embodiment, since the sample slots are the same as the reference slots and the sample slot values ​​are the same as the reference slot values, the multiple second requirements corresponding to the sample instruction are the same as the multiple first requirements corresponding to the reference instruction.

[0053] Return to step S203. According to some embodiments, the preset rule may indicate that a plurality of sample slots are randomly determined from a plurality of reference slots, and a plurality of sample slot values ​​are randomly determined from a plurality of reference slot values. Thus, by means of random determination, a large number of sample instructions with different meanings can be automatically and quickly generated, and sample instructions with slot combinations or slot value combinations that have never appeared in training data or online log data can be generated, thereby improving the generalization performance of the large model.

[0054] According to some embodiments, the reference instruction may include a plurality of training instructions obtained from a training set. Figure 3As shown, step S203, determining multiple sample slots and multiple sample slot values ​​corresponding to the multiple sample slots based on multiple reference slots, multiple reference slot values ​​and preset rules may include: step S301, counting the distribution results of multiple existing slots and multiple existing slot values ​​corresponding to multiple training instructions, the multiple existing slots include multiple reference slots corresponding to each of the multiple training instructions, and the multiple existing slot values ​​include multiple reference slot values ​​corresponding to each of the multiple training instructions; and step S302, determining multiple sample slots and multiple sample slot values ​​based on the distribution results and preset rules.

[0055] Therefore, by structurally decomposing the training instructions in the training set and counting the distribution of multiple existing slots and multiple existing slot values ​​corresponding to multiple training instructions, and then determining which sample slots and which sample slot values ​​need to be generated based on the statistical distribution results, it is possible to construct and supplement sample instruction data in a more targeted and systematic manner.

[0056] In some embodiments, after disassembling multiple training instructions, a structured instruction system set can be constructed, which includes all slots (i.e., multiple existing slots) and all slot values ​​(i.e., multiple existing slot values) involved in multiple training instructions. The process of randomly determining the sample slot / sample slot value described in the above embodiment can be random sampling in the instruction system set to combine new sample instructions. After obtaining the instruction system set, the distribution results of multiple existing slots / existing slot values ​​can be counted, such as the distribution number of each existing slot / existing slot value. It can be understood that the distribution results can also include other content, such as the number of co-occurrences to be introduced below, which is not limited here.

[0057] In some embodiments, the sample instructions included in the training set are often biased (for example, a small number of specific slots / slot values ​​or their combinations are distributed in larger numbers, while other slots / slot values ​​or their combinations are distributed in smaller numbers), and using such a training set to train a large model will affect the quality of the response data it generates.

[0058] According to some embodiments, the preset rule may indicate that multiple sample slots are determined based on at least a portion of the existing slots with the smallest number of distributions among multiple existing slots, and / or the preset rule may indicate that multiple sample slot values ​​are determined based on at least a portion of the existing slot values ​​with the smallest number of distributions among multiple existing slot values. Thus, by analyzing which slots or slot values ​​are seriously missing in the training instructions based on the distribution results, and determining the seriously missing slots or slot values ​​as sample slots or sample slot values, targeted sample instruction data construction and supplementation is achieved, and then corresponding training data can be constructed for the defects of the large model, overcoming the biased problem of the training set and improving the quality of the response data generated by the large model.

[0059] In some embodiments, the preset rules may indicate that a portion of the sample slots / sample slot values ​​among multiple sample slots are determined by the above method, and another portion of the sample slots / sample slot values ​​are determined by other methods (for example, based on co-occurrence relationships, or random sampling); the preset rules may also indicate that all sample slots / sample slot values ​​are determined by the above method.

[0060] In some embodiments, a preset number of existing slots / existing slot values ​​with the least distribution quantity among multiple existing slots / existing slot values ​​can be determined as sample slots / sample slot values, or an existing slot / existing slot value with a distribution quantity less than a preset value among multiple existing slots / existing slot values ​​can be determined as sample slots / existing slot values, and existing slots / existing slot values ​​with serious missing training data can also be determined as sample slots / sample slot values ​​by other means, which are not limited here.

[0061] In some embodiments, in step S301, the co-occurrence of multiple reference slot values / reference slots included in each of the multiple training instructions can be counted to obtain distribution results (e.g., co-occurrence times) of multiple existing slot value combinations / existing slot combinations. In an exemplary embodiment, the existing slot combination consisting of the two slots "genre" and "number of words" has a higher co-occurrence number, and the existing slot value combination consisting of the two slot values ​​"argumentative essay" and ">800 words" has a higher co-occurrence number.

[0062] Generally, the fewer slots / slot values ​​included in an existing slot combination / existing slot value combination, the higher their co-occurrence times; while there are fewer sample data with a larger number of slots / slot values, which results in poor quality of response data generated by large models when processing user requirement categories or complex instructions with more requirements.

[0063] According to some embodiments, the preset rules may indicate that multiple sample slots are determined based on multiple existing slot combinations with the largest number of co-occurrences, and the number of the multiple sample slots is greater than the number of existing slots included in any existing slot combination among the multiple existing slot combinations, and / or the preset rules may indicate that multiple sample slot values ​​are determined based on multiple existing slot value combinations with the largest number of co-occurrences, and the number of the multiple sample slot values ​​is greater than the number of existing slot values ​​included in any existing slot value combination among the multiple existing slot value combinations.

[0064] Therefore, by counting the number of co-occurrences of existing slot combinations / existing slot value combinations, and determining multiple sample slots / sample slot values ​​based on the multiple existing slot combinations / existing slot value combinations with the largest number of co-occurrences, it is possible to reasonably construct richer and more complex sample instructions, thereby effectively improving the large model's ability to follow complex instructions.

[0065] In an exemplary embodiment, a first existing slot combination consisting of two slots of "genre" and "number of words" has a higher number of co-occurrences, a second existing slot combination consisting of two slots of "task" and "genre" also has a higher number of co-occurrences, but a third existing slot combination consisting of three slots of "task", "genre" and "number of words" has a lower number of co-occurrences. In the above manner, a plurality of sample slots can be determined based on the first existing slot combination and the second existing slot combination, for example, the first existing slot combination and the second existing slot combination are merged to determine the three slots of "task", "genre" and "number of words" as sample slots. It is understandable that a plurality of sample slots / sample slot values ​​can also be determined based on a plurality of existing slot combinations / existing slot value combinations with the largest number of co-occurrences in other ways, which are not limited here.

[0066] In some embodiments, the preset rules may indicate that a portion of the sample slots / sample slot values ​​among multiple sample slots are determined by the above method, and another portion of the sample slots / sample slot values ​​are determined by other methods (for example, based on co-occurrence relationships, or random sampling); the preset rules may also indicate that all sample slots / sample slot values ​​are determined by the above method.

[0067] In some embodiments, a preset number of existing slots / existing slot values ​​with the least distribution quantity among multiple existing slots / existing slot values ​​can be determined as sample slots / sample slot values, or an existing slot / existing slot value with a distribution quantity less than a preset value among multiple existing slots / existing slot values ​​can be determined as sample slots / existing slot values, and existing slots / existing slot values ​​with serious missing training data can also be determined as sample slots / sample slot values ​​by other means, which are not limited here.

[0068] According to some embodiments, the reference instruction may include a target instruction obtained from an online user log. The multiple reference slots corresponding to the target instruction may include a target slot, and the multiple reference slot values ​​corresponding to the target instruction may include a target slot value. The preset rule may indicate that in response to determining that the multiple existing slots do not include the target slot, and / or the distribution number with the target slot is less than a first preset value or less than the distribution number of at least a portion of other existing slots, the target slot is set to a sample slot, or the preset rule may be in response to determining that the multiple existing slot values ​​do not include the target slot value, or the distribution number with the target slot value is less than a second preset value or less than the distribution number of at least a portion of other existing slot values, the target slot value is set to a sample slot value.

[0069] Therefore, by splitting the target instructions obtained from the online user logs and determining the sample slots / sample slot values ​​according to the number of occurrences of the target slots / target slot values ​​included in the training instructions, it is possible to construct and supplement the sample instruction data in a more targeted manner, and then to construct corresponding training data for the defects of the large model. In addition, by continuously mining online logs, we can continuously discover the defects of the large model and build the corresponding instruction data supplementation capabilities, and ultimately promote the large model to obtain a stronger instruction compliance capability.

[0070] In some embodiments, each of the multiple reference slots / reference slot values ​​corresponding to the target instruction can be used as the target slot / target slot value, and the above preset rules are used for judgment. It is understandable that those skilled in the art can determine the range of the above first preset value, the second preset value and at least a portion of other existing slots according to needs, and are not limited here.

[0071] In some embodiments, the preset rules may indicate that a portion of the sample slots / sample slot values ​​among multiple sample slots are determined by the above method, and another portion of the sample slots / sample slot values ​​are determined by other methods (for example, based on co-occurrence relationships, or random sampling); the preset rules may also indicate that all sample slots / sample slot values ​​are determined by the above method.

[0072] According to some embodiments, the large model may be a large language model. Figure 4 As shown, the method for generating instruction data for a large model further includes: step S405, obtaining ground truth response data corresponding to the sample instruction; and step S406, training the large model using the sample instruction and the ground truth response data corresponding to the sample instruction. It can be understood that Figure 4 The operations of steps S401 to S404 in Figure 2 The operations of step S201 to step S204 are similar and will not be described in detail here.

[0073] Therefore, by obtaining the true value response data corresponding to the sample instructions and using the true value response data and sample instructions to train the large model, more complex, diverse, targeted and directional instruction training data can be used to effectively improve the instruction-following ability of the large model.

[0074] In some embodiments, in step S405, the true value response data may be obtained by manual annotation, by model generation, or by other methods, which are not limited here.

[0075] In some embodiments, in step S406, the sample instruction may be input into the large model to obtain the predicted response data output by the large model, and then the loss value is calculated based on the true value response data and the predicted response data, and the parameters of the large model are adjusted based on the loss value to achieve training of the large model. It is understandable that the large model may also be trained using the sample instruction and the corresponding true value response data in other ways, which are not limited here.

[0076] According to some embodiments, step S406, training the large model using the sample instructions and the truth value reply data corresponding to the sample instructions may include: adding the sample instructions and the truth value reply data corresponding to the sample instructions to the training set to obtain a target training set; and training the large model using the target training set. Thus, by adding the sample instructions constructed based on the distribution results and the corresponding truth value reply data to the training set, and using the training set to train the large model, a large model with more balanced and comprehensive capabilities can be obtained.

[0077] In some embodiments, the instruction system set can be updated based on the updated target training set, and then the distribution results of the updated instruction system combination can be statistically analyzed to generate new sample instructions and sample data, thereby continuously improving the large model instruction compliance capability.

[0078] As described above, in some embodiments, for multiple sample slots and multiple sample slot values, a natural language instruction generation model can be used to generate multiple sample instructions with different expressions but the same meaning. For these sample instructions, only one true value response data can be obtained, and each sample instruction and the true value response data can be combined and added to the training set.

[0079] According to another aspect of the present disclosure, a device for generating instruction data for a large model is provided. Figure 5 As shown, the device 500 includes: a first acquisition unit 510, configured to acquire a reference instruction based on a natural language, the reference instruction being able to instruct the large model to generate reply data satisfying a plurality of first requirements corresponding to a plurality of first requirement categories; a second acquisition unit 520, configured to acquire a structured decomposition result of the reference instruction to obtain a plurality of reference slots corresponding to a plurality of first requirement categories and a plurality of reference slot values ​​corresponding to the plurality of first requirements; a determination unit 530, configured to determine a plurality of sample slots and a plurality of sample slot values ​​corresponding to the plurality of sample slots based on a plurality of reference slots, a plurality of reference slot values ​​and preset rules; and a generation unit 540, configured to generate a sample instruction based on a natural language based on a plurality of sample slots and a plurality of sample slot values, the sample instruction being able to instruct the large model to generate reply data satisfying a plurality of second requirements corresponding to a plurality of sample slot values.

[0080] It is understood that the operations of units 510-540 in device 500 are similar to those of Figure 2 The operations of step S201 to step S204 are similar and will not be described in detail here.

[0081] According to some embodiments, the preset rule may indicate that a plurality of reference slots are directly determined as a plurality of sample slots, and a plurality of reference slot values ​​are directly determined as a plurality of sample slot values.

[0082] According to some embodiments, the preset rule may indicate that a plurality of sample slots are randomly determined among a plurality of reference slots, and a plurality of sample slot values ​​are randomly determined among a plurality of reference slot values.

[0083] According to some embodiments, the reference instruction may include a plurality of training instructions obtained from a training set. The determination unit may include: a statistical subunit configured to count the distribution results of a plurality of existing slots and a plurality of existing slot values ​​corresponding to the plurality of training instructions, the plurality of existing slots including a plurality of reference slots corresponding to each of the plurality of training instructions, and the plurality of existing slot values ​​including a plurality of reference slot values ​​corresponding to each of the plurality of training instructions; and a determination subunit configured to determine a plurality of sample slots and a plurality of sample slot values ​​based on the distribution results and a preset rule.

[0084] According to some embodiments, the preset rule may indicate that multiple sample slots are determined based on at least a portion of the existing slots with the smallest number of distributions among multiple existing slots, and / or the preset rule may indicate that multiple sample slot values ​​are determined based on at least a portion of the existing slot values ​​with the smallest number of distributions among multiple existing slot values.

[0085] According to some embodiments, the preset rules may indicate that multiple sample slots are determined based on multiple existing slot combinations with the largest number of co-occurrences, and the number of the multiple sample slots is greater than the number of existing slots included in any existing slot combination among the multiple existing slot combinations, and / or the preset rules may indicate that multiple sample slot values ​​are determined based on multiple existing slot value combinations with the largest number of co-occurrences, and the number of the multiple sample slot values ​​is greater than the number of existing slot values ​​included in any existing slot value combination among the multiple existing slot value combinations.

[0086] According to some embodiments, the reference instruction may include a target instruction obtained from an online user log. A plurality of reference slots corresponding to the target instruction include a target slot, and a plurality of reference slot values ​​corresponding to the target instruction include a target slot value. The preset rule may indicate that in response to determining that a plurality of existing slots do not include a target slot, or the distribution number with the target slot is less than a first preset value or less than the distribution number of at least a portion of other existing slots, the target slot is set as a sample slot, and / or the preset rule may indicate that in response to determining that a plurality of existing slot values ​​do not include a target slot value, or the distribution number with the target slot value is less than a second preset value or less than the distribution number of at least a portion of other existing slot values, the target slot value is set as a sample slot value.

[0087] According to some embodiments, the large model may be a large language model based on deep learning. The device 900 may also include (not shown in the figure): a third acquisition unit configured to acquire true value reply data corresponding to the sample instruction; and a training unit configured to train the large model using the sample instruction and the true value reply data corresponding to the sample instruction.

[0088] According to some embodiments, the training unit may include: an updating subunit configured to add sample instructions and true value response data corresponding to the sample instructions to a training set to obtain a target training set; and a training subunit configured to train a large model using the target training set.

[0089] According to some embodiments, the generation unit may include: a generation subunit configured to generate a plurality of sample instructions having different expressions but the same meaning using a natural language instruction generation model based on a plurality of sample slots and a plurality of sample slot values.

[0090] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0091] According to an embodiment of the present disclosure, an electronic device, a readable storage medium and a computer program product are also provided.

[0092] refer to Figure 6 , a block diagram of an electronic device 600 that can be used as a server or client of the present disclosure will now be described, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0093] like Figure 6As shown, the electronic device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 can also be stored. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0094] Multiple components in the electronic device 600 are connected to the I / O interface 605, including: an input unit 606, an output unit 607, a storage unit 608, and a communication unit 609. The input unit 606 can be any type of device that can input information to the electronic device 600. The input unit 606 can receive input digital or character information and generate key signal input related to user settings and / or function control of the electronic device, and can include but is not limited to a mouse, a keyboard, a touch screen, a track pad, a track ball, a joystick, a microphone, and / or a remote controller. The output unit 607 can be any type of device that can present information, and can include but is not limited to a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 608 can include but is not limited to a disk, an optical disk. The communication unit 609 allows the electronic device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks, and can include but is not limited to a modem, a network card, an infrared communication device, a wireless communication transceiver, and / or a chipset, such as a Bluetooth device, an 802.11 device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.

[0095] The computing unit 601 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 601 performs the various methods and processes described above, such as a method for generating instruction data for a large model. For example, in some embodiments, the method for generating instruction data for a large model may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the method for generating instruction data for a large model described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured in any other appropriate manner (eg, by means of firmware) to execute the method for generating instruction data for a large model.

[0096] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0097] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0098] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, 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), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0099] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0100] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), the Internet, and a blockchain network.

[0101] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.

[0102] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0103] Although the embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it should be understood that the above-mentioned methods, systems and devices are merely exemplary embodiments or examples, and the scope of the present invention is not limited by these embodiments or examples, but only by the claims after authorization and their equivalent scope. Various elements in the embodiments or examples can be omitted or replaced by their equivalent elements. In addition, each step can be performed in an order different from that described in the present disclosure. Further, the various elements in the embodiments or examples can be combined in various ways. It is important that with the evolution of technology, many elements described herein can be replaced by equivalent elements that appear after the present disclosure.

Claims

1. A method for generating instruction data for a large model, comprising: Acquire a reference instruction based on natural language, wherein the reference instruction can instruct the large model to generate reply data satisfying a plurality of first requirements corresponding to a plurality of first requirement categories, wherein the reference instruction includes a plurality of training instructions acquired from a training set; Acquire a structural disassembly result of the reference instruction to obtain a plurality of reference slots corresponding to the plurality of first requirement categories and a plurality of reference slot values ​​corresponding to the plurality of first requirements; Based on the multiple reference slots, the multiple reference slot values, and a preset rule, determining multiple sample slots and multiple sample slot values ​​corresponding to the multiple sample slots includes: Counting distribution results of a plurality of existing slots and a plurality of existing slot values ​​corresponding to the plurality of training instructions, the plurality of existing slots including a plurality of reference slots corresponding to each of the plurality of training instructions, and the plurality of existing slot values ​​including a plurality of reference slot values ​​corresponding to each of the plurality of training instructions; and Based on the distribution result and the preset rule, determining the plurality of sample slots and the plurality of sample slot values; and Based on the multiple sample slots and the multiple sample slot values, a natural language-based sample instruction is generated, wherein the sample instruction can instruct the large model to generate reply data that meets multiple second requirements corresponding to the multiple sample slot values.

2. The method according to claim 1, wherein: The preset rule indicates that the plurality of sample slots are determined based on at least a portion of the plurality of existing slots having the smallest number of distributions, and / or The preset rule indicates that the plurality of sample slot values ​​are determined based on at least a portion of the plurality of existing slot values ​​having the smallest distribution number.

3. The method according to claim 1, wherein: The preset rule indicates that the plurality of sample slots are determined based on a plurality of existing slot combinations with the largest number of co-occurrences, the number of the plurality of sample slots being greater than the number of existing slots included in any existing slot combination among the plurality of existing slot combinations, and / or The preset rule indicates that the multiple sample slot values ​​are determined based on multiple existing slot value combinations with the largest number of co-occurrences, and the number of the multiple sample slot values ​​is greater than the number of existing slot values ​​included in any existing slot value combination among the multiple existing slot value combinations.

4. The method according to claim 1, wherein: The reference instruction includes a target instruction obtained from an online user log, the multiple reference slots corresponding to the target instruction include a target slot, and the multiple reference slot values ​​corresponding to the target instruction include a target slot value. The preset rule indicates that in response to determining that the multiple existing slots do not include the target slot, or the distribution quantity with the target slot is less than a first preset value or less than the distribution quantity of at least a portion of other existing slots, the target slot is set as a sample slot, and / or The preset rule indicates that in response to determining that the multiple existing slot values ​​do not include the target slot value, or the distribution number with the target slot value is less than a second preset value or less than the distribution number of at least a portion of other existing slot values, the target slot value is set to a sample slot value.

5. The method according to claim 1, wherein: Based on the multiple sample slots and the multiple sample slot values, generating a sample instruction based on a natural language includes: Based on the multiple sample slots and the multiple sample slot values, a natural language instruction generation model is used to generate multiple sample instructions with different expressions but the same meaning.

6. The method according to claim 5, wherein: The preset rule indicates that the plurality of reference slots are directly determined as the plurality of sample slots, and the plurality of reference slot values ​​are directly determined as the plurality of sample slot values.

7. The method according to claim 1, wherein: The preset rule indicates that the plurality of sample slots are randomly determined among the plurality of reference slots, and the plurality of sample slot values ​​are randomly determined among the plurality of reference slot values.

8. The method according to any one of claims 1 to 7, wherein: The large model is a large language model based on deep learning, and the method further includes: Acquire true value reply data corresponding to the sample instruction; and The large model is trained using the sample instructions and true value response data corresponding to the sample instructions.

9. The method according to claim 8, wherein: Training the large model using the sample instructions and the true value reply data corresponding to the sample instructions includes: adding the sample instruction and the true value reply data corresponding to the sample instruction to a training set to obtain a target training set; and The large model is trained using the target training set.

10. A device for generating instruction data for a large model, comprising: A first acquisition unit is configured to acquire a reference instruction based on a natural language, wherein the reference instruction can instruct the large model to generate reply data that meets a plurality of first requirements corresponding to a plurality of first requirement categories, and the reference instruction includes a plurality of training instructions acquired from a training set; a second acquisition unit configured to acquire a structural disassembly result of the reference instruction to obtain a plurality of reference slots corresponding to the plurality of first requirement categories and a plurality of reference slot values ​​corresponding to the plurality of first requirements; A determining unit is configured to determine a plurality of sample slots and a plurality of sample slot values ​​corresponding to the plurality of sample slots based on the plurality of reference slots, the plurality of reference slot values ​​and a preset rule, comprising: a statistical subunit configured to count distribution results of a plurality of existing slots and a plurality of existing slot values ​​corresponding to the plurality of training instructions, the plurality of existing slots including a plurality of reference slots corresponding to each of the plurality of training instructions, and the plurality of existing slot values ​​including a plurality of reference slot values ​​corresponding to each of the plurality of training instructions; and a determining subunit, configured to determine the plurality of sample slots and the plurality of sample slot values ​​based on the distribution result and the preset rule; and A generating unit is configured to generate a natural language-based sample instruction based on the multiple sample slots and the multiple sample slot values, wherein the sample instruction can instruct the large model to generate reply data that meets multiple second requirements corresponding to the multiple sample slot values.

11. The device according to claim 10, wherein: The preset rule indicates that the plurality of sample slots are determined based on at least a portion of the plurality of existing slots having the smallest number of distributions, and / or The preset rule indicates that the plurality of sample slot values ​​are determined based on at least a portion of the plurality of existing slot values ​​having the smallest distribution number.

12. The device according to claim 10, wherein: The preset rule indicates that the plurality of sample slots are determined based on a plurality of existing slot combinations with the largest number of co-occurrences, the number of the plurality of sample slots being greater than the number of existing slots included in any existing slot combination among the plurality of existing slot combinations, and / or The preset rule indicates that the multiple sample slot values ​​are determined based on multiple existing slot value combinations with the largest number of co-occurrences, and the number of the multiple sample slot values ​​is greater than the number of existing slot values ​​included in any existing slot value combination among the multiple existing slot value combinations.

13. The device according to claim 10, wherein: The reference instruction includes a target instruction obtained from an online user log, the multiple reference slots corresponding to the target instruction include a target slot, and the multiple reference slot values ​​corresponding to the target instruction include a target slot value. The preset rule indicates that in response to determining that the multiple existing slots do not include the target slot, or the distribution quantity with the target slot is less than a first preset value or less than the distribution quantity of at least a portion of other existing slots, the target slot is set as a sample slot, or The preset rule indicates that in response to determining that the multiple existing slot values ​​do not include the target slot value, or the distribution number with the target slot value is less than a second preset value or less than the distribution number of at least a portion of other existing slot values, the target slot value is set to a sample slot value.

14. The device according to claim 10, wherein: The generating unit comprises: The generation subunit is configured to generate a plurality of sample instructions with different expressions but the same meaning by using a natural language instruction generation model based on the plurality of sample slots and the plurality of sample slot values.

15. The device according to claim 14, wherein: The preset rule indicates that the plurality of reference slots are directly determined as the plurality of sample slots, and the plurality of reference slot values ​​are directly determined as the plurality of sample slot values.

16. The device according to claim 10, wherein: The preset rule indicates that the plurality of sample slots are randomly determined among the plurality of reference slots, and the plurality of sample slot values ​​are randomly determined among the plurality of reference slot values.

17. The device according to any one of claims 10 to 16, wherein: The large model is a large language model based on deep learning, and the device further includes: A third acquisition unit is configured to acquire true value reply data corresponding to the sample instruction; and A training unit is configured to train the large model using the sample instructions and true value response data corresponding to the sample instructions.

18. The device according to claim 17, wherein: The training unit comprises: an updating subunit, configured to add the sample instruction and the true value reply data corresponding to the sample instruction to a training set to obtain a target training set; and The training subunit is configured to train the large model using the target training set.

19. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively coupled to the at least one processor; wherein The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 9.

20. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-9.

21. A computer program product comprising a computer program, wherein: When the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.