Generative large language model training method, model-based human-computer speech interaction method
By constructing a training set of interface call instructions and reinforcement learning of user preference ranking, the generative large language model solves the problem in the existing technology of being unable to rely on external knowledge to generate accurate responses, and realizes the generation of accurate and real-time information in real-world tasks. capabilities, improving the effect of human-computer voice interaction.
Patent Information
- Application Number
- CN202310233936.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-03
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2043-03-03
AI Technical Summary
Existing generative large language models are difficult to generate accurate responses in real-world task-solving applications, especially when real-time information is required. They cannot rely on external knowledge, resulting in inaccurate responses.
A generative large language model training method is proposed. By constructing a training set containing interface call instructions, the pre-trained model is supervised and fine-tuned, and user preference sorting and preset templates are used for reinforcement learning to generate a target generative large language model. , can automatically generate interface calling instructions to obtain accurate answers.
It has implemented a generative large language model that can deeply understand user needs, build its own interface to call instructions for query, and generate results that are more in line with users' actual needs and expectations, improving the accuracy and user experience of human-computer voice interaction.
Smart Images

Figure CN116127046B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing, specifically to artificial intelligence technical fields such as generative models, intelligent speech, and human-computer interaction, and in particular to a generative large language model training and a human-computer speech interaction method based on the generative large language model, as well as corresponding devices, electronic devices, computer-readable storage media, and computer program products. Background Art
[0002] Large language models (LLM, Large Language Model, which is essentially a generative model), such as ChatGPT (Chat Generative Pre-trained Transformer, a chatbot program developed by OpenAI), can generate fluent human-like responses for many downstream tasks (such as task-oriented dialogues and question answering).
[0003] However, applying LLMs to real-world task-solving applications remains challenging, mainly due to their potential to generate responses that are inconsistent with reality and their inability to use external knowledge as reference for response generation.
[0004] For example, questions such as "What is the current weather in City A?", "What is the exchange rate of currency B to currency C?", and "How long does it take to get from location C to location D?" all require real-time information when answering them. However, this real-time information (such as real-time time, real-time exchange rate, real-time road conditions, and real-time traffic information) cannot be generated simply by relying on the knowledge contained in the LLM parameters. It is necessary to rely on external knowledge to generate accurate results. Summary of the invention
[0005] The embodiments of the present disclosure provide a generative large language model training method and a human-computer speech interaction method based on the generative large language model, as well as a device, an electronic device, a computer-readable storage medium, and a computer program product supporting the method.
[0006] In a first aspect, an embodiment of the present disclosure proposes a generative large language model training method, including: constructing a first training set based on user input text and a matching output result containing an interface call instruction, wherein the user input text is obtained by converting the user input voice, and the service interface called by the interface call instruction corresponds to the functional usage intention expressed by the user input text; using the first training set to perform supervised fine-tuning training on a pre-trained first generative large language model to obtain a second generative large language model; constructing a second training set based on user preference ranking and a preset template set between the same user input text and different candidate outputs; using the second training set to perform supervised training on a pre-trained third generative large language model to obtain a reward model; training the second generative large language model in a reinforcement learning manner based on the score returned by the reward model to obtain a target generative large language model.
[0007] In a second aspect, an embodiment of the present disclosure proposes a generative large language model training device, comprising: a first training set construction unit, configured to construct a first training set based on a user input text and a matching output result containing an interface call instruction, wherein the user input text is obtained by converting the user input voice, and the service interface called by the interface call instruction corresponds to the functional usage intention expressed by the user input text; a supervised fine-tuning training unit, configured to use the first training set to perform supervised fine-tuning training on a pre-trained first generative large language model to obtain a second generative large language model; a second training set construction unit, configured to construct a second training set based on a user preference ranking and a preset template set between the same user input text and different candidate outputs; a reward model training unit, configured to use the second training set to perform supervised training on a pre-trained third generative large language model to obtain a reward model; a reinforcement learning training unit, configured to train the second generative large language model in a reinforcement learning manner based on the score returned by the reward model to obtain a target generative large language model.
[0008] In a third aspect, an embodiment of the present disclosure proposes a human-computer voice interaction method based on a generative large language model, including: obtaining a user input voice issued by a user in the form of voice; inputting a user input text corresponding to the user input voice as input data into a target generative large language model; wherein the target generative large language model is obtained according to the generative large language model training method as described in the first aspect above; receiving an output text returned by the target generative large language model; wherein the output text is generated based on the response information obtained after executing an interface call instruction; and converting the output text into a machine reply voice in the form of voice.
[0009] In the fourth aspect, the embodiment of the present disclosure proposes a human-computer speech interaction device based on a generative large language model, comprising: a user input speech acquisition unit, configured to acquire a user input speech emitted by a user in the form of speech; a model calling unit, configured to input a user input text corresponding to the user input speech as input data into a preset target generative large language model; wherein the target generative large language model is obtained according to the generative large language model training device as described in the second aspect; an output text receiving unit, configured to receive an output text returned by the target generative large language model; wherein the output text is generated based on the response information obtained after executing the interface calling instruction; and a machine reply speech generation unit, configured to convert the output text into a machine reply speech in speech form.
[0010] In a fifth aspect, an embodiment of the present disclosure provides an electronic device, 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 so that when the at least one processor executes, it can implement the generative large language model training method as described in the first aspect or the human-computer speech interaction method based on the generative large language model as described in the third aspect.
[0011] In a sixth aspect, an embodiment of the present disclosure provides a non-transitory computer-readable storage medium storing computer instructions, which are used to enable a computer to implement the generative large language model training method as described in the first aspect or the human-computer speech interaction method based on the generative large language model as described in the third aspect when executed.
[0012] In the seventh aspect, an embodiment of the present disclosure provides a computer program product comprising a computer program, which, when executed by a processor, can implement the steps of the generative large language model training method as described in the first aspect or the steps of the human-computer speech interaction method based on the generative large language model as described in the third aspect.
[0013] The generative large language model training scheme provided by the embodiment of the present disclosure has a first training set constructed by user input text (obtained by converting user input speech) and an output result containing an interface call instruction that expresses the intention of using the corresponding function, so that the pre-trained first generative large language model is fine-tuned in a supervised manner through the first training set, so that the trained second generative large language model has the ability to rewrite the user input text into a matching output result containing the interface call instruction, and the pre-trained third generative large language model is supervisedly trained by the second training set constructed by user preference ranking and a preset template set between the same user input text and different candidate outputs, so that the trained reward model has the ability to perform quality scoring for different candidates generated by the generative large language model for the user input text, so that under the training of reinforcement learning based on human feedback, the target generative large language model finally obtained not only has the ability to rewrite the user input text into a matching output result containing the interface call instruction, but also has the ability to output results that better meet user needs. That is, through the above training scheme, the trained target generative large language model has the ability to deeply understand user needs and construct corresponding interface call instructions to query and return accurate answers. It can not only generate natural language output based on natural language input and the knowledge contained in the large model parameters, but also call the corresponding functions with the help of application program interfaces that provide professional capabilities to more effectively solve user needs. Under the influence of the reward model, the returned results will be more in line with the actual needs and expectations of users.
[0014] Based on the beneficial effects of the generative large language model training scheme provided in the above-mentioned embodiments, the human-computer voice interaction scheme based on the generative large language model provided in the embodiments of the present disclosure is specifically aimed at the scenario in which the voice assistant acts as the executor, and the target generative large language model trained according to the above-mentioned training scheme is applied to the human-computer voice interaction scenario. After the voice assistant inputs the user input text corresponding to the user input voice into the target generative large language model, the voice assistant generates the corresponding results with the help of the capabilities of the target generative large language model, and automatically generates interface call instructions and executes them to obtain the returned call results when encountering the need to call the service interface, and returns the output text generated based on the generated reply text and the call result to the voice assistant, so that the voice assistant converts it into machine reply voice and returns it to the user to complete the human-computer voice interaction, thereby improving the human-computer voice interaction experience.
[0015] 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
[0016] Other features, objects and advantages of the present disclosure will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:
[0017] Figure 1 is an exemplary system architecture in which the present disclosure may be applied;
[0018] Figure 2 A flowchart of a generative large language model training method provided in an embodiment of the present disclosure;
[0019] Figure 3 A flowchart of a method for constructing a first training set provided in an embodiment of the present disclosure;
[0020] Figure 4 A flowchart of a method for constructing a first training set based on sample pairs consisting of user input text and matching output results provided in an embodiment of the present disclosure;
[0021] Figure 5 A flowchart of a method for constructing a second training set provided in an embodiment of the present disclosure;
[0022] Figure 6 A flowchart of a human-computer speech interaction method based on a generative large language model provided in an embodiment of the present disclosure;
[0023] Figure 7 A schematic diagram of a human-computer voice interaction process for a specific example provided in an embodiment of the present disclosure;
[0024] Figure 8 A structural block diagram of a generative large language model training device provided in an embodiment of the present disclosure;
[0025] Fig. 9 A structural block diagram of a human-computer voice interaction device based on a generative large language model provided in an embodiment of the present disclosure;
[0026] Fig.10 A schematic diagram of the structure of an electronic device suitable for executing a generative large language model training method and / or a human-computer voice interaction method based on a generative large language model, provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0027] 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 and spirit of the present disclosure. Similarly, for clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description. It should be noted that the embodiments in the present disclosure and the features in the embodiments may be combined with each other without conflict.
[0028] 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.
[0029] Figure 1 An exemplary system architecture 100 of an embodiment of the generative large language model training method of the present application, a human-computer speech interaction method based on a generative large language model, and supporting devices, electronic devices, and computer-readable storage media is shown.
[0030] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0031] The user can use the terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various applications for realizing information communication between the terminal devices 101, 102, 103 and the server 105 can be installed, such as human-computer voice interaction applications (such as navigation voice assistant applications, smart terminal voice assistant applications, etc.), model training applications, etc.
[0032] Terminal devices 101, 102, 103 and server 105 can be hardware or software. When terminal devices 101, 102, 103 are hardware, they can be various electronic devices with display screens, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, etc.; when terminal devices 101, 102, 103 are software, they can be installed in the electronic devices listed above, which can be implemented as multiple software or software modules, or as a single software or software module, and no specific limitation is made here. When server 105 is hardware, it can be implemented as a distributed server cluster composed of multiple servers, or as a single server; when the server is software, it can be implemented as multiple software or software modules, or as a single software or software module, and no specific limitation is made here.
[0033] The server 105 can provide various services through various built-in applications. For example, a human-computer voice interaction application that can provide human-computer voice interaction services to users can achieve the following effects when the server 105 runs the human-computer voice interaction application: first, the user input voice in the form of voice recorded by the terminal devices 101, 102, and 103 transmitted through the network 104; then, the user input text corresponding to the user input voice is input as input data into the pre-trained target generative large language model; next, the output text returned by the target generative large language model is received; wherein the output text is generated based on the response information obtained after executing the interface call instruction; finally, the output text is converted into a machine reply voice in the form of voice. Further, the machine reply voice can also be retransmitted back to the terminal devices 101, 102, and 103 through the network 104, so that the terminal devices 101, 102, and 103 can reply to the corresponding user by playing the machine reply voice.
[0034] Among them, the target generative large language model can be trained by the model training application built into the server 105 according to the following steps: first, based on the user input text and the matching output result containing the interface call instruction, a first training set is constructed, the user input text is converted from the user input voice, and the service interface called by the interface call instruction corresponds to the functional usage intention expressed by the user input text; then, the first training set is used to perform supervised fine-tuning training on the pre-trained first generative large language model to obtain a second generative large language model; then, based on the user preference ranking and preset template set between the same user input text and different candidate outputs, a second training set is constructed; next, the second training set is used to perform supervised training on the pre-trained third generative large language model to obtain a reward model; finally, the second generative large language model is trained in a reinforcement learning manner based on the score returned by the reward model to obtain a target generative large language model.
[0035] Since it takes more computing resources and stronger computing power to train the target generative large language model, the generative large language model training method provided in the subsequent embodiments of the present application is generally performed by a server 105 with stronger computing power and more computing resources. Correspondingly, the generative large language model training device is generally also arranged in the server 105. However, it should also be pointed out that when the terminal devices 101, 102, and 103 also have computing power and computing resources that meet the requirements, the terminal devices 101, 102, and 103 can also complete the above-mentioned various operations handed over to the server 105 through the model training application installed thereon, and then output the same result as the server 105. Correspondingly, the generative large language model training device can also be arranged in the terminal devices 101, 102, and 103. In this case, the exemplary system architecture 100 may also not include the server 105 and the network 104.
[0036] Of course, the server used to train the target generative large language model can be different from the server that calls the trained target generative large language model for use. In particular, the target generative large language model trained by the server 105 can also be used to obtain a lightweight target generative large language model suitable for being placed in the terminal devices 101, 102, and 103 by model distillation, that is, it can be flexibly selected to use the lightweight target generative large language model in the terminal devices 101, 102, and 103 according to the recognition accuracy of actual needs, or to choose to use the more complex target generative large language model in the server 105.
[0037] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0038] Please refer to Figure 2 , Figure 2 A flowchart of a generative large language model training method provided in an embodiment of the present disclosure, wherein process 200 includes the following steps:
[0039] Step 201: constructing a first training set based on the user input text and the matching output result including the interface call instruction;
[0040] This step is intended to be performed by the execution subject of the generative large language model training method (e.g. Figure 1The server 105 shown in the figure constructs a first training set based on a large number of sample pairs of "user input text-output results containing interface call instructions" consisting of user input text (converted from user input speech sent by the user in speech form) and matched output results containing interface call instructions. The user input speech can be obtained from various channels, and can come from a user speech data set collected and recorded from a large number of authorized users over a long period of time in the past, or from a historical human-computer interaction sequence set. In order to realize the conversion of user input speech into user input text, it can be achieved with the help of Automatic Speech Recognition (ASR) technology, and in order to improve the accuracy of the conversion result, it can also be carried out with the help of a speech-to-text model based on deep learning.
[0041] Among them, the service interface called by the interface call instruction corresponds to the functional usage intention expressed by the user input text, that is, the service interface called by the interface call instruction corresponds to the expected demand expressed by the user input text, and then the user demand is realized or a reply that satisfies the user's functional usage intention is obtained by executing the interface call instruction to obtain a return response and organizing the output results based on the response information.
[0042] Among them, the "service interface" described in the present disclosure refers to the Application Programming Interface (API) used to provide services. Different APIs can be provided by related applications installed on the operating system (including system-related applications that support the normal operation of the operating system and other applications built on the normal operation of the operating system), or directly provided by the operating system or some system components running on the operating system, such as the GetNum API that can be used to implement the function of obtaining the last digit of the user's license plate (usually provided by vehicle information maintenance applications or components), the GetTR API that is used to implement the function of querying the restriction policy (usually provided by news policy or search engine applications), the Navi API that implements the navigation function (usually provided by map applications), the FindPOI API that is used to implement the point of interest positioning function (usually provided by map applications, the full name of the English abbreviation POI is: Point of Interest), the Option API that is used to implement the selection function (usually provided by a specific application that provides multiple alternative options, such as when seeking a preferred choice among multiple alternative routes to the same destination, it is provided by a map application), the Date API that is used to implement the specific date acquisition function (usually provided by clock applications or time components), and the FindSong API that is used to implement the song search function. API (usually provided by song applications or search applications), in addition to, including but not limited to corresponding APIs for implementing the following functions:
[0043] Time query, date query, registered license plate number query, user search, friend query, song recognition, picture search, travel route planning, weather query, task scheduling, location query, restricted license plate number query, exchange rate conversion, base conversion, translation, surrounding environment query, encryption and decryption, data download, data transmission, problem query, picture editing, etc.
[0044] In addition, the output result that matches the user input text and includes interface call instructions may only include one interface call instruction. In this case, the user input text may only express an intention to use one function. At this time, only this intention to use the function corresponds to this interface call instruction; it is also possible that the user input text expresses multiple intentions to use multiple functions at the same time, but only one of them must be executed through the corresponding interface call instruction to seek a return response in order to obtain the required accurate results (for example, the situation mentioned in the background technology part that requires real-time calculations in combination with real-time and dynamic information). The corresponding interface call instructions can be used to obtain the corresponding answers for the remaining function usage intentions, or the corresponding answers can be directly generated for the user input text only by relying on the knowledge contained in the large model parameters. In this case, whether it is necessary to still choose to generate an interface call instruction to obtain the corresponding answer can be flexibly selected according to the actual situation, and no specific limitation is made here.
[0045] If the output result containing interface call instructions that matches the user input text contains multiple interface call instructions at the same time, it is also necessary to consider whether there is an execution dependency between different interface call instructions, so as to correctly organize them into a service interface call sequence according to the determined execution order. Specifically, for each interface call instruction, it generally contains the interface name of the target service interface and specific interface call parameters, and the two are combined in the required format. However, for some special APIs, their interface call parameters can be empty; for some other special APIs, their interface call parameters can also be another interface call instruction. In addition, the specific interface call parameters can be directly served by a text fragment in the user input text, or by other forms of content that express the same meaning as the corresponding text fragment.
[0046] Taking the simple user input text "Navigate to People's Park" as an example, it only has one functional usage intention, which is to navigate to the preset destination. The target service interface corresponding to this functional usage intention may be NaviAPI, which refers to the navigation function. Its specific interface parameters should be played by "People's Park". The interface call instruction contained in the output result at this time is: Navi (People's Park).
[0047] To facilitate understanding of the solution described in this step, the following will be explained through a specific example:
[0048] Assume that after the voice-to-text operation is performed on the user input voice, the user input text obtained is: "Navigate to Z on Y street in X place, take the fastest route", then the output result containing the interface call instruction matching the user input text can be expressed as: "FindPOI (Z on Y street in X place)-->Z1, located on Y street in X place, Option (take the route with fewer traffic lights)-->The route with the least traffic lights is as follows: Navi (Z1, with the least traffic lights)", or it can be expressed as "Z1, located on Y street in X place, the route with the least traffic lights is as follows: Navi (Z1, with the least traffic lights)".
[0049] For the output result presented as “FindPOI (Z on Y Street in X place)-->Z1, located on Y Street in X place, Option (take the route with fewer traffic lights)-->the route with the fewest traffic lights is as follows: Navi (Z1, least traffic lights)”, each function usage intention expressed in the user input text is expressed as an interface call instruction; and for the output result presented as “Z1, located on Y Street in X place, the route with the fewest traffic lights is as follows: Navi (Z1, least traffic lights)”, only the navigation function usage intention expressed in the user input text that must be calculated based on real-time and dynamic information is expressed as a unique interface call instruction (that is, navigating to the destination requires determining the current location, real-time road conditions, real-time traffic information, etc. when the navigation request is initiated), and the remaining determination of “Z1” based on “Z on Y Street in X place” and determination of “the fewest traffic lights” based on “taking the route with the fewest traffic lights” do not necessarily need to be determined by constructing interface call instructions, but can be generated based on the knowledge contained in the parameters of the conventional generative large language model.
[0050] In addition, for the output result of "FindPOI (Z on Y street in X place) --> Z1, located on Y street in X place, Option (take the route with fewer traffic lights) --> the route with the least traffic lights is as follows: Navi (Z1, least traffic lights)", it can be seen that for three different interface call instructions, the "-->" method is used to construct them into a service interface call sequence with a clear execution sequence. Of course, the execution sequence can also be achieved through methods such as instruction nesting. That is, according to the user input text, it can be determined that the final function call intention is navigation. However, in order to realize the final function call intention, it is also necessary to accurately determine the inaccurate description of the point of interest "Z on Y street in X place" serving as the destination, and select the route with the least traffic lights when the destination is accurately determined. Therefore, the execution order of the above three interface call instructions should be: first execute FindPOI (Z on Y street in X place) and Option (the least traffic lights) (because there is no execution dependency between the two, when only serial is supported, you can choose one to execute first and then the other. In the above example, the point of interest determination instruction is executed first; when parallel is supported, the two instructions can be executed concurrently), and then when the results of the two instructions are obtained, the Navi (Z1, the fastest route) instruction is executed based on the two instruction results.
[0051] It should be noted that the above-mentioned output results containing interface call instructions that match the user input text can be obtained by manual annotation based on one's own understanding of the user input text and knowledge of the relevant usage of the service interface, or can be obtained by non-artificial objects based on concentrated extraction of data samples that implicitly contain the corresponding relationship between the above-mentioned two, so as to achieve efficient construction of sample pairs of "user input text-output results containing interface call instructions".
[0052] In some understandings, if the user input text is understood as a query, the output result containing the interface call instructions is actually an answer consisting of the interface call instructions consisting of the API and API parameters that can meet the corresponding requirements.
[0053] Step 202: Perform supervised fine-tuning training on the pre-trained first generative large language model using the first training set to obtain a second generative large language model;
[0054] On the basis of step 201, this step aims to use the first training set as a fine-tuning training set by the above-mentioned execution subject to perform supervised fine-tuning training (Supervised Fine-Tuning, SFT) on the first pre-trained generative large language model, so as to further obtain a second generative large language model.
[0055] The SFT technology used in this step means that the training object is not the initial model that has not undergone any training, but the general generative large language model obtained through training with basic training samples, that is, the general generative large language model obtained through training with basic training samples usually only generates a text sequence as a result based on the predicted probability of the language unit (token) according to the knowledge contained in the text input and the large model parameters, and does not have the ability to rewrite it into an output result containing interface call instructions including the target API and API parameters. With the help of this SFT technology, the huge time-consuming effort required to train the model from scratch can be avoided. It only needs to construct a first training set containing a small amount of training samples (the small amount here is the order of magnitude relative to the basic training samples), and then the general generative large language model can be trained twice to enable it to have the ability to rewrite the user input text into an output result containing interface call instructions including the target API and API parameters.
[0056] Of course, in some application scenarios, the general generative large language model trained with basic training samples may not be suitable as the basic model for using SFT technology (for example, the knowledge learned by the general generative large language model conflicts with the knowledge implicit in the newly constructed training samples). The initial generative language model can also be trained based on the newly constructed training samples, in order to make the trained target generative large language model have the desired capabilities.
[0057] Step 203: constructing a second training set based on the user preference ranking between the same user input text and different candidate outputs and the preset template set;
[0058] On the basis of step 202, this step aims to construct a second training set by the above-mentioned execution subject based on the user preference ranking between the same user input text and different candidate outputs and the preset templates recording the corresponding relationship between the input text and the corresponding interface call instruction. The preset template can be specifically expressed as: "I want to find [String]—find the place for you, located at No. X, X Street, and the detailed information of the merchant is as follows: GetInfo(POIName)", "Navigate to [String]—FindPOI(POIName), located at No. X, X Street, there are N routes to here, and under the current road conditions, the fastest route is as follows: Navi(POIName)", that is, the preset template is used to indicate what style of text fragment corresponds to what kind of output text containing the interface call instruction, where "String" is used to refer to the corresponding part can be filled with any string. Specifically, the preset template can be extracted from each "user input text—output result containing the interface call instruction" sample pair used to constitute the first training set, and can also be extracted from other data sets containing the above-mentioned corresponding relationship.
[0059] That is, first, for each user input text, a sample pair formed by the user input text and each candidate output is constructed, and these sample pairs are sorted according to the user preference ranking of the candidate output in each sample pair; then, the preset templates (the preset template set contains multiple preset templates) that record the correspondence between the input text and the corresponding interface call instruction are combined to jointly construct the second training set, so that by using the second training set constructed in this way, the model can learn which results are more in line with the actual needs of the user.
[0060] It should be noted that the training samples described above for constructing the second training set can be manually labeled and generated by humans based on their own subjective understanding, or they can be extracted by non-artificial objects based on a data sample set that implies the correspondence between the above two (for example, a retrieval log that reflects the search terms and retrieval results in the user's retrieval operation) to achieve efficient construction of corresponding sample pairs.
[0061] When the retrieval log is used as the data sample set, the user preference ranking can be specifically expressed as the cumulative number of clicks on each candidate output in the candidate output list returned for the same user input text recorded in the retrieval log within a period of time, that is, the more cumulative clicks, the more the candidate output meets the user's actual needs. The length of the time period can be set by yourself, such as one week, half a month or a whole month. When the data sample set is served by other databases, the user preference ranking can also be expressed as other similar parameters that can express user preferences, such as the number of collections, the number of comments, etc., which will not be listed here one by one.
[0062] Step 204: Use the second training set to perform supervised training on the pre-trained third generative large language model to obtain a reward model.
[0063] On the basis of step 203, this step aims to use the second training set by the above-mentioned execution subject to perform supervised training on the pre-trained third generative large language model to obtain a reward model (Reward Model, RM). The reward model described here refers to learning how to give different rewards (generally returned in the form of high and low scores) to different alternative outputs under the same input by learning the user preference ranking between different sample pairs under each training sample in the second training set, so as to make the model learn in the direction of obtaining higher rewards, so as to be able to output results that better meet the actual needs of users.
[0064] Step 205: The second generative large language model is trained in a reinforcement learning manner based on the score returned by the reward model to obtain a target generative large language model.
[0065] On the basis of step 202 and step 204, this step aims to train the second generative large language model by the above-mentioned execution subject based on the score returned by the reward model in a reinforcement learning (RL) manner to obtain a target generative large language model.
[0066] The brief process of training the target generative large language model based on RL can be referred to the following description:
[0067] 1) Initializing a new generative large language model M based on the parameters of the second generative large language model;
[0068] 2) Based on the new prompt (prompt words, usually natural language input from the user), let M generate a response for each prompt and then input the response to the reward model (RM);
[0069] 3) RM will calculate a score for each reply as a scalar reward, and the score indicates the quality of the reply;
[0070] 4) Using the RL approach, the strategy (corresponding to English: policy) is continuously updated based on the total reward score obtained by the model M until convergence. At this point, M trained to this point is the target generative large language model that meets the requirements.
[0071] To facilitate understanding of the “generative large language model” described and used in the present disclosure, the working principle of the generative model corresponding to the prefix “generative” is briefly introduced here:
[0072] The reason why it is called a generative model is that the working process of this type of model is similar to "text chain", that is, based on the user input and the previous output of the model, it continuously predicts the next token (language unit) and finally generates a text sequence. See the following example:
[0073] Assuming that the target generative large language model has learned the ability to output the user input text as an output result containing the interface call instruction according to the above scheme, then still taking "navigation to Z on Y street in X place, take the route with the least traffic lights" (for the convenience of the following examples, "query" is used to refer to it) as an example, the process of the target generative model outputting the corresponding output result containing the interface call instruction is carried out in the following steps:
[0074] query-->Z1;
[0075] query+Z1-->,;
[0076] query+Z1+,-->position;
[0077] query+Z1+,+located-->at;
[0078] query+Z1+,+located+at-->X;
[0079] query+Z1+,+located+at+X->place;
[0080] query+Z1+,+located+at+X+location-->Y;
[0081] query+Z1+,+located+at+X+place+Y->street;
[0082] query+Z1+,+located+at+X+place+Y+street-->,;
[0083] query+Z1+,+located+at+X+place+Y+street+,-->red;
[0084] query+Z1+,+located+at+X+place+Y+street+,+red-->green;
[0085] query+Z1+,+located+at+X+place+Y+street+,+red+green-->light;
[0086] query+Z1+,+located+at+X+place+Y+street+,+red+green+light-->most;
[0087] query+Z1+,+located+at+X+place+Y+street+,+red+and+green+lights+least;
[0088] query+Z1+,+located+at+X+place+Y+street+with+the+least+red+and+green+lights-->;
[0089] query+Z1+,+located+at+X+place+Y+street+,+the+road+with+the+least+red+and+green+lights;
[0090] query+Z1+,+located+at+X+place+Y+street+,+the+road+with+the+least+red+and+green+lights-->;
[0091] query+Z1+,+located+at+X+place+Y+street+,+the+road+with+the+least+red+and+green+lights-->such as;
[0092] query+Z1+,+located+at+X+place+Y+street+,+the+road+with+the+least+red+and+green+lights+is+as+follows;
[0093] query+Z1+,+located+at+X+place+Y+street+,+the+road+with+the+fewest+red+and+green+lights+is+as+follows-->Navi;
[0094] query+Z1+,+located+at+X+place+Y+street+,+the+road+with+the+least+red+and+green+lights+is+as+follows+Navi-->(;
[0095] query+Z1+,+located+at+X+place+Y+street+,+the+road+with+the+least+red+and+green+lights+is+as+follows+Navi+(-->Z1;
[0096] query+Z1+,+located+at+X+place+Y+street+,+the+road+with+the+least+red+and+green+lights+is+as+follows+Navi+(+Z1-->,;
[0097] query+Z1+,+located+at+X+place+Y+street+,+the+road+with+the+least+red+and+green+lights+is+as+follows+Navi+(+Z1+,-->red;
[0098] query+Z1+,+located+at+X+place+Y+street+,+the+road+with+the+least+red+and+green+lights+is+as+follows+Navi+(+Z1+,+red-->green;
[0099] query+Z1+,+located+at+X+place+Y+street+,+the+road+with+the+least+red+and+green+lights+is+as+follows+Navi+(+Z1+,+red+green-->lights;
[0100] query+Z1+,+located+at+X+place+Y+street+,+the+road+with+the+least+red+and+green+lights+is+as+followed+Navi+(+Z1+,+red+and+green+lights-->most;
[0101] query+Z1+,+located+at+X+place+Y+street+,+the+road+with+the+least+red+and+green+lights+is+as+follows+Navi+(+Z1+,+the+least-->red+and+green+lights;
[0102] query+Z1+,+the+road+at+X+place+Y+street+with+the+fewest+red+and+green+lights+is+as+follows+Navi+(+Z1+,+the+fewest+red+and+green+lights-->);
[0103] query+Z1+,+located+at+X+place+Y+street+,+the+road+with+the+fewest+red+and+green+lights+is+as+follows+Navi+(+Z1+,+the+fewest+red+and+green+lights)-->End.
[0104] That is, we can finally get: Z1, located at Y street in X place, the route with the least traffic lights is as follows: Navi (Z1, least traffic lights) such an output result.
[0105] In Chinese, a token is usually a Chinese character; in English, a token usually refers to a sub-word (literally translated as "sub-word" in Chinese) rather than a word. The corresponding sub-word granularity is a form between word granularity and character granularity. Sub-words can retain the meaning of the language while effectively reducing the size of the vocabulary (i.e., the number of words in the vocabulary) and effectively solving the problem of out-of-vocabulary words. Taking the three English words "loved", "loving" and "loves" as examples, the following four sub-words can be obtained: "lov", "ed", "ing" and "es". In this way, the meaning and tense of the word itself can be separated to obtain sub-words with smaller granularity. In the above example, "FindPOI, Option and Navi" representing the API name will be used as an indivisible whole as a token.
[0106] In the generative large language model training method provided by the embodiment of the present disclosure, since the first training set is constructed by the user input text (obtained by converting the user input speech) and the output result containing the interface call instruction expressing the corresponding function usage intention, the first training set is used to perform supervised fine-tuning training on the pre-trained first generative large language model, so that the trained second generative large language model has the ability to rewrite the user input text into a matching output result containing the interface call instruction, and the second training set constructed by the user preference ranking between the same user input text and different candidate outputs is used to perform supervised training on the pre-trained third generative large language model, so that the trained reward model has the ability to perform quality scoring for different candidates generated by the generative large language model for the user input text, so that under the training of reinforcement learning based on human feedback, the target generative large language model finally obtained not only has the ability to rewrite the user input text into a matching output result containing the interface call instruction, but also has the ability to output results that better meet user needs. That is, through the above training scheme, the trained target generative large language model has the ability to deeply understand user needs and construct corresponding interface call instructions to query and return accurate answers. It can not only generate natural language output based on natural language input and the knowledge contained in the large model parameters, but also call the corresponding functions with the help of application program interfaces that provide professional capabilities to more effectively solve user needs. Under the influence of the reward model, the returned results will be more in line with the actual needs and expectations of users.
[0107] On the basis of the above embodiment, in the supervised fine-tuning training process using SFT technology, for special API-related symbols that do not appear in the first generative large language model, it is necessary to expand the language unit (i.e., token), which can be called a new token. The initialization of the features of the new token can be performed by sampling the multivariate normal distribution parameters of the features of the existing language unit.
[0108] Specifically, since the inserted API and API format-related special symbols do not exist in the vocabulary of the first generative large language model, the vocabulary of the first generative large language model also needs to be expanded. Regarding the initialization problem of the embedding (usually translated as word vector or word embedding) corresponding to the new token after the vocabulary expansion, a parameter sampling initialization method can also be used: that is, for the embedding corresponding to the newly added token, if it is randomly initialized or initialized with 0, it will usually increase the difficulty of the model to predict the new token. This is because the initialization embedding of the new token is too different from the embedding distribution of the existing token obtained after a large amount of pre-training of the general generative large language model. In order to reduce this difference, the embedding of each new token can be sampled according to the multivariate normal distribution (also called multivariate normal distribution or multivariate Gaussian distribution) of the embedding of the existing token. Formally, for each new token corresponding to the embedding—e n+i , sampling can be performed as follows:
[0109]
[0110] Among them, E∈R n×d It is the embedding [e1; ...; e n ] is a matrix composed of .
[0111] Please refer to Figure 3 , Figure 3 A flowchart of a method for constructing a first training set provided in an embodiment of the present disclosure, that is, for Figure 2 Step 201 in the process 200 shown provides a specific implementation method, and the other steps in the process 200 are not adjusted. The specific implementation method provided in this embodiment is replaced by step 201 to obtain a new complete embodiment. The process 300 includes the following steps:
[0112] Step 301: Acquire a human-computer dialogue sequence, and determine a valid machine response that successfully responds to a user input text in the human-computer dialogue sequence;
[0113] This step aims to obtain the human-machine dialogue sequence that records the dialogue between the user and the machine by the above-mentioned execution subject, and determine the effective machine response that successfully responds to the user input text. The user input text can be obtained by converting the user input voice originally input by the user, or it can be obtained directly.
[0114] Step 302: Determine a matching interface call instruction according to the function called when generating a valid machine reply;
[0115] On the basis of step 301, this step aims to determine the matching interface call instruction according to the function called when generating the valid machine reply. Since the machine reply is the reply that the machine makes to the function usage intention expressed by the user input text and satisfies its expected response, it is necessary to determine the matching interface call instruction according to the function called when the machine generates the valid machine reply according to the user input text. It can also be seen from this that the non-valid machine reply in the machine dialogue sequence will not be used to determine the matching interface call instruction.
[0116] Step 303: replace part or all of the valid machine replies that can be returned by executing the interface call instruction with the corresponding interface call instruction to obtain an output result;
[0117] Based on step 302, this step aims to obtain an output result by replacing part or all of the responses in the valid machine response that can be returned by executing the interface call instruction with the corresponding interface call instruction.
[0118] For the output result given in the above example, "FindPOI(Z on Y street in X place)-->Z1, located on Y street in X place, Option(take the route with fewer traffic lights)-->the route with the least traffic lights is as follows: Navi(Z1, least traffic lights)", all replies are replaced with corresponding interface call instructions; and for the output result given in the above example, "Z1, located on Y street in X place, the route with the least traffic lights is as follows: Navi(Z1, least traffic lights)", part of the reply is replaced with corresponding interface call instructions.
[0119] Step 304: Construct a first training set based on sample pairs consisting of user input text and matching output results.
[0120] Based on step 303, this step aims to construct the first training set from a plurality of sample pairs of “user input text—output result”.
[0121] Please refer to Figure 4 , Figure 4A flowchart of a method for constructing a first training set based on sample pairs consisting of user input text and matching output results provided in an embodiment of the present disclosure, that is, for Figure 3 Step 304 in the process 300 shown provides a specific implementation method, and other steps in the process 300 are not adjusted. The specific implementation method provided in this embodiment is replaced by step 304 to obtain a new complete embodiment. The process 400 includes the following steps:
[0122] Step 401: Generate a new human-computer dialogue sequence according to the user input text and the matching output result;
[0123] Step 402: taking the first user input text and the first output result in the new human-computer dialogue sequence as a starting sample pair;
[0124] Step 403: taking all the dialogue contents and the non-first output results in the new human-computer dialogue sequence before the non-first output results as non-starting sample pairs;
[0125] For a new human-machine dialogue sequence that is as follows:
[0126] User A: "User input text 1";
[0127] Voice assistant: "Contains the output result 1 of the interface call instruction";
[0128] User A: "User input text 2";
[0129] Voice assistant: "Contains the output result 2 of the interface call instruction";
[0130] User A: "User input text 3";
[0131] Voice assistant: "Contains the output result 3 of the interface call instruction".
[0132] Then the first sample pair consists of: "user input text 1" and "output result 1 containing interface call instructions";
[0133] Then the second sample pair is composed of "user input text 1 + output result 1 containing interface call instruction + user input text 2" and "output result 2 containing interface call instruction";
[0134] Then the third sample pair is composed of “user input text 1+output result 1 containing interface call instructions+user input text 2+output result 2 containing interface call instructions+user input text 3” and “output result 3 containing interface call instructions”.
[0135] That is, by constructing sample pairs in the above manner, the model trained thereby can fully combine the previous context of the conversation to generate subsequent conversations.
[0136] Step 404: construct a first training set based on the starting sample pairs and the non-starting samples.
[0137] That is, for the new human-computer dialogue sequence shown above, a total of three training samples can be extracted, and the first training set is constructed based on them.
[0138] Please refer to Figure 5 , Figure 5 A flowchart of a method for constructing a second training set provided in an embodiment of the present disclosure, that is, for Figure 2 Step 203 in the process 200 shown provides a specific implementation method, and the other steps in the process 200 are not adjusted. The specific implementation method provided in this embodiment is replaced by step 203 to obtain a new complete embodiment. The process 500 includes the following steps:
[0139] Step 501: Obtain search terms from the search log;
[0140] Step 502: confirm all search results returned for the same search term from the search log, and determine the cumulative number of clicks on each search result within a time window;
[0141] Step 503: Generate multiple sample pairs for the same search term and each search result, and determine the ranking information between the corresponding different sample pairs according to the accumulated number of clicks corresponding to the different search results;
[0142] Step 504: construct a second training set based on each sample pair sorted by user preference according to the sorting information and each preset template recording the corresponding relationship between the input text and the corresponding output text containing the interface call instruction.
[0143] To facilitate understanding of the solution provided by this embodiment, the following will be described in detail through another example:
[0144] Assume that there is a query (i.e. the user input text mentioned above) called "XX big", and aggregate the number of clicks on different results of this query within a period of time (e.g. 30 days), and assume that the following results are obtained as shown in Table 1:
[0145] Table 1 Statistics of cumulative click counts
[0146] Result No. result Total number of clicks r1 XX University 100 r2 East Gate of XX University 10 r3 XX University West Gate 9 r4 XX University Teachers Building 8 r5 XX University Library 0
[0147] Then the paired samples that can be constructed according to the above table can be:
[0148] rel(q,r1)>rel(q,r2);
[0149] rel(q,r1)>rel(q,r3);
[0150] rel(q,r1)>rel(q,r4);
[0151] rel(q,r1)>rel(q,r5);
[0152] rel(q,r2)>rel(q,r3);
[0153] rel(q,r2)>rel(q,r4);
[0154] rel(q,r2)>rel(q,r5);
[0155] rel(q,r3)>rel(q,r4);
[0156] rel(q,r3)>rel(q,r5);
[0157] rel(q,r4)>rel(q,r5), rel is a function used to express the user preference between the two.
[0158] Based on the above information, the query-answer template consisting of the input text and the matched output text containing the interface call instruction, as well as the pairwise relationship given above, is automatically constructed to construct the second training set. The following takes the template "I want to find [String] - find this place for you, located at No. X, X Street, the detailed address information is as follows: GetInfo(POIName)" as an example. It can be seen that the "String" in the template corresponds to the query (i.e. "XX University") input by the user, and the "POIName" corresponds to the text of the result clicked by the user:
[0159] rel(prompt=I want to find XX University, a1=The place is found for you, located at No. X, X Street, the detailed information of the address is as follows: GetInfo(XX University))>rel(prompt=I want to find XX University, a2=The place is found for you, located at No. X, X Street, the detailed information of the address is as follows: GetInfo(XX University East Gate));
[0160] rel(prompt=I want to find XX University, a1=The place is found for you, located at No. X, X Street, the detailed information of the address is as follows: GetInfo(XX University))>rel(prompt=I want to find XX University, a3=The place is found for you, located at No. X, X Street, the detailed information of the address is as follows: GetInfo(West Gate of XX University));
[0161] rel(prompt=I want to find XX University, a1=The address is found for you, located at No. X, X Street, the detailed information of the address is as follows: GetInfo(XX University))>rel(prompt=I want to find XX University, a4=The address is found for you, located at No. X, X Street, the detailed information of the address is as follows: GetInfo(XX University Teacher Building));
[0162] rel(prompt=I want to find XX University, a1=Found the place for you, located at No. X, X Street, the detailed address information is as follows: GetInfo(XX University))>rel(prompt=I want to find XX University, a5=Found the place for you, located at No. X, X Street, the detailed address information is as follows: GetInfo(XX University Library));
[0163] rel(prompt=I want to find XX University, a2=The address is found for you, located at No. X, X Street, the detailed information of the address is as follows: GetInfo(East Gate of XX University))>rel(prompt=I want to find XX University, a3=The address is found for you, located at No. X, X Street, the detailed information of the address is as follows: GetInfo(West Gate of XX University)));
[0164] rel(prompt=I want to find XX University, a2=The address is found for you, located at No. X, X Street, the detailed information of the address is as follows: GetInfo(East Gate of XX University))>rel(prompt=I want to find XX University, a4=The address is found for you, located at No. X, X Street, the detailed information of the address is as follows: GetInfo(Teacher Building of XX University)));
[0165] rel(prompt=I want to find XX University, a2=The address is found for you, located at No. X, X Street, the detailed address information is as follows: GetInfo(East Gate of XX University))>rel(prompt=I want to find XX University, a5=The address is found for you, located at No. X, X Street, the detailed address information is as follows: GetInfo(Library of XX University)));
[0166] rel(prompt=I want to find XX University, a3=The address is found for you, located at No. X, X Street, the detailed information of the address is as follows: GetInfo(West Gate of XX University))>rel(prompt=I want to find XX University, a4=The address is found for you, located at No. X, X Street, the detailed information of the address is as follows: GetInfo(Teacher Building of XX University)));
[0167] rel(prompt=I want to find XX University, a3=The address is found for you, located at No. X, X Street, the detailed address information is as follows: GetInfo(West Gate of XX University))>rel(prompt=I want to find XX University, a5=The address is found for you, located at No. X, X Street, the detailed address information is as follows: GetInfo(Library of XX University)));
[0168] rel(prompt=I want to find XX University, a4=found the place for you, located at No. X, X Street, the detailed address information is as follows: GetInfo(XX University Teachers Building))>rel(prompt=I want to find XX University, a5=found the place for you, located at No. X, X Street, the detailed address information is as follows: GetInfo(XX University Library)).
[0169] In the above example, prompt is generated based on query and template, and ai is generated based on ri and template (that is, when i is 1, a1 is generated based on r1 and template).
[0170] When the template is used: "Navigate to [String]—FindPOI(POIName), located at No. X, X Street, there are N routes to get here, and under the current traffic conditions, the fastest route is as follows: Navi(POIName)", the situation is similar to the above example and will not be listed here one by one.
[0171] By automatically generating the second training set using the data recorded in the retrieval log, not only a lot of manual labeling costs are saved, but the massive click and skip (non-click) data in the retrieval log is a completely real reflection of user needs, and it truly reflects the distribution of user preferences for different results, thereby making the constructed second training set more in line with the actual needs of users.
[0172] The above embodiments explain how to train a target generative large language model from various aspects. In order to highlight the effect of the trained target generative large language model from the actual usage scenario as much as possible, the present disclosure also specifically provides a solution for using the trained target generative large language model to solve practical problems, such as Figure 6 A human-computer speech interaction method based on a generative large language model is shown, comprising the following steps:
[0173] Step 601: Acquire user input voice sent by the user in voice form;
[0174] This step is intended to be performed by the execution subject of the human-computer speech interaction method based on the generative large language model (for example, installed in Figure 1 The voice assistant application on the terminal devices 101, 102, and 103 shown in the figure obtains the user input voice issued by the user in the form of voice.
[0175] Step 602: inputting the user input text corresponding to the user input speech as input data into a preset target generative large language model;
[0176] On the basis of step 601, this step aims to have the above-mentioned execution subject input the user input text corresponding to the user input voice as input data into the preset target generative large language model, so as to call the target generative large language model to process the user input text.
[0177] Step 603: receiving the output text returned by the target generative large language model;
[0178] On the basis of step 602, this step is intended to receive the output text returned by the target generative large language model by the above-mentioned execution subject, wherein the output text is generated based on the response information obtained after executing the interface call instruction. That is, the target generative large language model starts to generate a text sequence after receiving the input user input text, and will directly generate the corresponding reply text according to the knowledge contained in the large model parameters when there is no need to generate the interface call instruction, and will automatically generate the interface call instruction and execute it to obtain the returned call result when it encounters the need to call the corresponding service interface, and will return the output text generated based on the generated reply text and the call result to the voice assistant. That is, the generation and execution of the interface call instruction (API and its corresponding parameters) are automatically completed in the process of generating the output text by the target generative large language model.
[0179] Take "Z1, located at Y street in X place, the route with the least traffic lights is as follows: Navi (Z1, least traffic lights)" as an example. After executing the interface call instruction, you can get output text such as "Z1, located at Y street in X place, the route with the least traffic lights is: 1) first pass through road 1...; 2) then pass through road 2...; 3) arrive at Z1". That is, "Navi (Z1, least traffic lights)" in the above example does not really exist in the output text. The content that exists in the output text should be "1) first pass through road 1...; 2) then pass through road 2...; 3) arrive at Z1" obtained after calling Navi (Z1, least traffic lights). If it contains multiple interface call instructions, the execution order of each interface call instruction also needs to be considered.
[0180] It should be noted that if you want to include other formats (such as images, hypertext containing links, etc.) based on the output text information, you can also expand the format set of supported output results so that you can return multi-format output information including text format.
[0181] Step 604: Convert the output text into a machine reply speech in speech form.
[0182] Based on step 603, this step aims to convert the output text into a machine reply voice in voice form by the above-mentioned execution subject, so as to make a voice response to the user input voice initiated by the user through the voice assistant.
[0183] Specifically, the voice assistant that serves as the executor of this embodiment and returns a machine reply voice to the user's input voice may specifically include: a map voice assistant from a map application, a voice assistant from a mobile application, and a home voice assistant from a smart terminal device (such as a smart speaker, a smart refrigerator, a smart wearable device, etc.), so as to meet the user's human-computer interaction needs in all scenarios.
[0184] The human-computer voice interaction method based on the generative large language model provided in this embodiment is specifically aimed at the scenario where the voice assistant acts as the executor. The target generative large language model trained according to the above training scheme is applied to the human-computer voice interaction scenario. After the voice assistant inputs the user input text corresponding to the user input voice into the target generative large language model, the voice assistant generates the corresponding result with the help of the capabilities of the target generative large language model, and automatically generates the interface call instruction and executes it to obtain the returned call result when encountering the need to call the service interface, and returns the output text generated based on the generated reply text and the call result to the voice assistant, so that the voice assistant converts it into a machine reply voice and returns it to the user to complete the human-computer voice interaction, thereby improving the human-computer voice interaction experience.
[0185] In order to prevent the target generative large language model from outputting the same format of output results for user input texts with different expressions, the generated output texts can also be adjusted to different expressions that express the same meaning.
[0186] One expression method can be: adjusting the generated output text to a random expression method that expresses the same meaning, that is, randomly selecting an expression method from the expression library for expression adjustment each time the output is performed. The expression methods can be divided into: lively type, ordinary type, concise type, comprehensive type, etc.;
[0187] Another way of expression may be: adjusting the generated output text to express the same meaning and the same expression as the user input text, that is, making the output text use the same expression as the user input text to enhance the user's experience of the output text.
[0188] To further deepen the understanding of the solution provided by the present disclosure, the following will also be Figure 7 A schematic diagram of a human-computer voice interaction process for a specific example is shown below:
[0189] 1) The voice assistant receives the user's input voice and obtains the user's input text through voice-to-text technology: "Is my car restricted today?";
[0190] 2) The voice assistant inputs “Is my car restricted today?” into the pre-trained target generative language model;
[0191] 3) The target generative large language model first generates an interface call instruction of GetNum(UserID) to obtain the license plate number according to the current user's ID, and obtains the return value of the last digit of the license plate: 9;
[0192] 4) The target generative language model continues to generate the GetTR(City, Date, Number) interface call instruction to return the restriction information based on the three parameters of city, date, and the last digit of the user's license plate, and obtains the return value of "[(5,0), False]", which means that the last digits of the restriction today in the current location (for example, Beijing) are 5 and 0, while the last digit of the user's license plate is 9, which does not fall within the restriction requirements;
[0193] 5) The voice assistant obtains the output text generated based on the execution result: Your car’s license plate number ends in 9. Today, Beijing restricts license plates ending in 5 and 0. Your car is not restricted.
[0194] 6) The voice assistant converts it into speech and issues the corresponding voice output: "The last digit of your car's license plate number is 9. Today, Beijing has restricted license plates ending in 5 and 0. Your car is not restricted."
[0195] Further references Figure 8 and Fig. 9 As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a generative large language model training device and an embodiment of a human-computer speech interaction device based on a generative large language model. Figure 2 Corresponding to the embodiment of the generative large language model training method shown in FIG, the embodiment of the human-computer voice interaction device based on the generative large language model is Figure 6 The above device can be applied to various electronic devices.
[0196] like Figure 8As shown, the generative large language model training device 800 of this embodiment may include: a first training set construction unit 801, a supervised fine-tuning training unit 802, a second training set construction unit 803, a reward model training unit 804, and a reinforcement learning training unit 805. Among them, the first training set construction unit 801 is configured to construct a first training set based on the user input text and the matching output result containing the interface call instruction; wherein the user input text is obtained by converting the user input voice, and the service interface called by the interface call instruction corresponds to the functional usage intention expressed by the user input text; the supervised fine-tuning training unit 802 is configured to use the first training set to perform supervised fine-tuning training on the pre-trained first generative large language model to obtain a second generative large language model; the second training set construction unit 803 is configured to construct a second training set based on the user preference ranking and preset template set between the same user input text and different candidate outputs; the reward model training unit 804 is configured to use the second training set to perform supervised training on the pre-trained third generative large language model to obtain a reward model; the reinforcement learning training unit 805 is configured to train the second generative large language model in a reinforcement learning manner based on the score returned by the reward model to obtain a target generative large language model.
[0197] In this embodiment, in the generative large language model training device 800, the specific processing of the first training set construction unit 801, the supervised fine-tuning training unit 802, the second training set construction unit 803, the reward model training unit 804, and the reinforcement learning training unit 805 and the technical effects thereof can be referred to respectively. Figure 2 The relevant descriptions of steps 201 - 205 in the corresponding embodiment are not repeated here.
[0198] In some optional implementations of this embodiment, the first training set construction unit 801 may include:
[0199] The effective machine response determination subunit is configured to obtain a human-machine dialogue sequence and determine an effective machine response that successfully responds to a user input text in the human-machine dialogue sequence; wherein the user input text is obtained by converting a user input voice;
[0200] The interface call instruction determination subunit is configured to determine a matching interface call instruction according to the function called when generating a valid machine reply;
[0201] The output result generating subunit is configured to replace part or all of the valid machine replies that can be returned by executing the interface call instruction with the corresponding interface call instruction to obtain the output result;
[0202] The first training set construction subunit is configured to construct a first training set based on sample pairs consisting of user input text and matching output results.
[0203] In some optional implementations of this embodiment, the first training set construction subunit may be further configured to:
[0204] Generate a new human-computer dialogue sequence based on user input text and matching output results;
[0205] The first user input text and the first output result in the new human-computer dialogue sequence are taken as the starting sample pair;
[0206] All dialogue contents and non-first output results before the new human-computer dialogue sequence are taken as non-starting sample pairs;
[0207] A first training set is constructed based on the starting sample pairs and non-starting samples.
[0208] In some optional implementations of the present embodiment, under a supervised fine-tuning training method, for new language units representing service interfaces that do not appear in the first generative large language model, parameter sampling of features of the new language units is initialized according to the multivariate normal distribution of features of existing language units.
[0209] In some optional implementations of this embodiment, the second training set construction unit 803 may be further configured to:
[0210] Get search terms from search logs;
[0211] Confirm all search results returned for the same search term from the search log, and determine the cumulative number of clicks on each search result within a time window;
[0212] Generate multiple sample pairs with the same search term and each search result, and determine the ranking information between the corresponding different sample pairs according to the accumulated number of clicks corresponding to the different search results;
[0213] A second training set is constructed based on each sample pair sorted by user preference according to the sorting information and each preset template recording the corresponding relationship between the input text and the corresponding interface calling instruction.
[0214] This embodiment exists as an apparatus embodiment corresponding to the above-mentioned method embodiment. The generative large language model training apparatus provided by this embodiment, since the first training set is constructed by the user input text (obtained by converting the user input voice) and the output result containing the interface call instruction expressing the corresponding function usage intention, the pre-trained first generative large language model is fine-tuned in a supervised manner through the first training set, so that the trained second generative large language model has the ability to rewrite the user input text into a matching output result containing the interface call instruction, and the pre-trained third generative large language model is supervisedly trained by the second training set constructed by the user preference ranking between the same user input text and different candidate outputs, so that the trained reward model has the ability to perform quality scoring for different candidates generated by the generative large language model for the user input text, so that under the training of reinforcement learning based on human feedback, the target generative large language model finally obtained not only has the ability to rewrite the user input text into a matching output result containing the interface call instruction, but also has the ability to output results that better meet user needs. That is, through the above training scheme, the trained target generative large language model has the ability to deeply understand user needs and construct corresponding interface call instructions to query and return accurate answers. It can not only generate natural language output based on natural language input and the knowledge contained in the large model parameters, but also call the corresponding functions with the help of application program interfaces that provide professional capabilities to more effectively solve user needs. Under the influence of the reward model, the returned results will be more in line with the actual needs and expectations of users.
[0215] like Fig. 9 As shown, the human-machine speech interaction device 900 based on the generative large language model of this embodiment may include: a user input speech acquisition unit 901, a model calling unit 902, an output text receiving unit 903, and a machine reply speech generation unit 904. Among them, the user input speech acquisition unit 901 is configured to acquire the user input speech issued by the user in the form of speech; the model calling unit 902 is configured to input the user input text corresponding to the user input speech as input data into the preset target generative large language model; the output text receiving unit 903 is configured to receive the output text returned by the target generative large language model; wherein the output text is generated based on the response information obtained after executing the interface calling instruction; the machine reply speech generation unit 904 is configured to convert the output text into a machine reply speech in the form of speech.
[0216] In this embodiment, in the human-machine speech interaction device 900 based on the generative large language model, the specific processing of the user input speech acquisition unit 901, the model calling unit 902, the output text receiving unit 903, and the machine reply speech generation unit 904 and the technical effects brought by them can correspond to Figure 6 The relevant descriptions in the illustrated method embodiment will not be repeated here.
[0217] In some optional implementations of this embodiment, the human-computer speech interaction device 900 based on the generative large language model may further include:
[0218] The expression adjustment unit is configured to adjust the output text into different expressions that express the same meaning.
[0219] In some optional implementations of this embodiment, the expression adjustment unit may be further configured to:
[0220] Adjust the output text to a random expression that expresses the same meaning.
[0221] In some optional implementations of this embodiment, the expression adjustment unit may be further configured to:
[0222] Adjust the output text to express the same meaning as the user input text.
[0223] In some optional implementations of this embodiment, the voice assistant that returns a machine reply voice to the user input voice includes: a map voice assistant from a map application, a voice assistant from a mobile application, and a home voice assistant from a smart terminal device.
[0224] This embodiment exists as an apparatus embodiment corresponding to the above-mentioned method embodiment. The human-computer voice interaction solution based on the generative large language model provided by this embodiment is specifically for the scenario in which the voice assistant acts as the executor. The target generative large language model trained according to the above-mentioned training scheme is applied to the human-computer voice interaction scenario. After the voice assistant inputs the user input text corresponding to the user input voice into the target generative large language model, the voice assistant generates the corresponding result with the help of the capabilities of the target generative large language model, and automatically calls the service interface where it is necessary to call the service interface and fills the result according to the return value, so as to return the finally generated output text to the voice assistant, so that the voice assistant can then convert it into a machine reply voice and return it to the user to complete the human-computer voice interaction, thereby improving the human-computer voice interaction experience.
[0225] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, which includes: 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 so that when the at least one processor executes, the generative large language model training method described in any of the above embodiments and / or the human-computer speech interaction method based on the generative large language model can be implemented.
[0226] According to an embodiment of the present disclosure, the present disclosure also provides a readable storage medium, which stores computer instructions, and the computer instructions are used to enable a computer to implement the generative large language model training method described in any of the above embodiments and / or the human-computer speech interaction method based on the generative large language model when executed.
[0227] The embodiments of the present disclosure provide a computer program product, which, when executed by a processor, can implement the generative large language model training method and / or the human-computer speech interaction method based on the generative large language model described in any of the above embodiments.
[0228] Fig.10 A schematic block diagram of an example electronic device 1000 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, 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.
[0229] like Fig.10 As shown, the device 1000 includes a computing unit 1001, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1002 or a computer program loaded from a storage unit 1008 into a random access memory (RAM) 1003. In the RAM 1003, various programs and data required for the operation of the device 1000 can also be stored. The computing unit 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.
[0230] A number of components in the device 1000 are connected to the I / O interface 1005, including: an input unit 1006, such as a keyboard, a mouse, etc.; an output unit 1007, such as various types of displays, speakers, etc.; a storage unit 1008, such as a disk, an optical disk, etc.; and a communication unit 1009, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1009 allows the device 1000 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0231] The computing unit 1001 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1001 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 1001 performs the various methods and processes described above, such as a generative large language model training method and / or a human-computer voice interaction method based on a generative large language model. For example, in some embodiments, a generative large language model training method and / or a human-computer voice interaction method based on a generative large language model may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 1008. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 1000 via ROM 1002 and / or communication unit 1009. When the computer program is loaded into RAM 1003 and executed by the computing unit 1001, one or more steps of the generative large language model training method and / or the human-computer speech interaction method based on the generative large language model described above may be performed. Alternatively, in other embodiments, the computing unit 1001 may be configured to execute the generative large language model training method and / or the human-computer speech interaction method based on the generative large language model by any other appropriate means (e.g., by means of firmware).
[0232] 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), load 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.
[0233] 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.
[0234] 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.
[0235] 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).
[0236] The systems and techniques described herein may be implemented in a computing system that includes back-end 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 front-end 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 back-end components, middleware components, or front-end components. The components of the system may 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), and the Internet.
[0237] 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 between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the 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.
[0238] In the generative large language model training scheme provided by the embodiment of the present disclosure, since the first training set is constructed by the user input text (obtained by converting the user input speech) and the output result containing the interface call instruction expressing the corresponding function usage intention, the first training set is used to perform supervised fine-tuning training on the pre-trained first generative large language model, so that the trained second generative large language model has the ability to rewrite the user input text into a matching output result containing the interface call instruction, and the second training set constructed by the user preference ranking between the same user input text and different candidate outputs is used to perform supervised training on the pre-trained third generative large language model, so that the trained reward model has the ability to perform quality scoring for different candidates generated by the generative large language model for the user input text, so that under the training of reinforcement learning based on human feedback, the target generative large language model finally obtained not only has the ability to rewrite the user input text into a matching output result containing the interface call instruction, but also has the ability to output results that better meet user needs. That is, through the above training scheme, the trained target generative large language model has the ability to deeply understand user needs and construct corresponding interface call instructions to query and return accurate answers. It can not only generate natural language output based on natural language input and the knowledge contained in the large model parameters, but also call the corresponding functions with the help of application program interfaces that provide professional capabilities to more effectively solve user needs. Under the influence of the reward model, the returned results will be more in line with the actual needs and expectations of users.
[0239] Based on the beneficial effects of the generative large language model training scheme provided in the above-mentioned embodiments, the human-computer voice interaction scheme based on the generative large language model provided in the embodiments of the present disclosure is specifically aimed at the scenario in which the voice assistant acts as the executor, and the target generative large language model trained according to the above-mentioned training scheme is applied to the human-computer voice interaction scenario, so that after the voice assistant inputs the user input text corresponding to the user input voice into the target generative large language model, the voice assistant generates the corresponding result with the help of the capabilities of the target generative large language model, and automatically generates the interface call instruction and executes it to obtain the returned call result when encountering the need to call the service interface, and returns the output text generated based on the generated reply text and the call result to the voice assistant, so that the voice assistant converts it into a machine reply voice and returns it to the user to complete the human-computer voice interaction, thereby improving the human-computer voice interaction experience.
[0240] 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 recorded in this disclosure can be executed 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.
[0241] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A generative large language model training method, comprising: Acquire a human-computer dialogue sequence, and determine a valid machine reply that successfully responds to a user input text in the human-computer dialogue sequence, wherein the user input text is converted from a user input voice; determine a matching interface call instruction according to a function called when generating the valid machine reply; replace part or all of the replies in the valid machine reply that can be returned by executing the interface call instruction with the corresponding interface call instruction to obtain an output result; generate a new human-computer dialogue sequence according to the user input text and the matching output result; Taking the first user input text and the first output result in the new human-computer dialogue sequence as a starting sample pair; All dialogue contents before the non-first output result in the new human-computer dialogue sequence and the non-first output result are used as non-starting sample pairs; a first training set is constructed based on the starting sample pairs and the non-starting samples, wherein the service interface called by the interface calling instruction corresponds to the functional usage intention expressed by the user input text; Using the first training set to perform supervised fine-tuning training on the pre-trained first generative large language model, a second generative large language model is obtained; in the supervised fine-tuning training mode, the features of the new language unit representing the service interface that does not appear in the first generative large language model are initialized by parameter sampling according to the multivariate normal distribution of the features of the existing language units; Constructing a second training set based on user preference rankings between the same user input text and different candidate outputs and a preset template set, wherein the candidate output is an output that matches the user input text, and the preset template set includes preset templates that record the corresponding relationship between the input text and the corresponding interface call instruction; The second training set is used to perform supervised training on the pre-trained third generative large language model to obtain a reward model; The second generative large language model is trained in a reinforcement learning manner based on the score returned by the reward model to obtain a target generative large language model.
2. The method according to claim 1, wherein: The second training set is constructed based on the user preference ranking between the same user input text and different candidate outputs and the preset template set, including: Get search terms from search logs; Confirming all search results returned for the same search term from the search log, and determining the cumulative number of clicks on each search result within a time window; Generate multiple sample pairs with the same search term and each search result, and determine the ranking information between the corresponding different sample pairs according to the accumulated number of clicks corresponding to the different search results; A second training set is constructed based on each sample pair sorted by user preference according to the sorting information and each preset template recording the correspondence between the input text and the corresponding output text containing the interface call instruction; wherein the preset template set is composed of each of the preset templates.
3. A human-computer speech interaction method based on a generative large language model, comprising: Get the user input voice issued by the user in voice form; Inputting the user input text corresponding to the user input speech as input data into a target generative large language model; wherein the target generative large language model is obtained based on the generative large language model training method according to claim 1 or 2; Receiving output text returned by the target generative large language model; wherein the output text is generated based on response information obtained after executing the interface call instruction; The output text is converted into a machine reply speech in speech form.
4. The method according to claim 3, further comprising: The output text is adjusted to different expressions that express the same meaning.
5. The method according to claim 4, wherein: The step of adjusting the output text to different expressions expressing the same meaning includes: The output text is adjusted to a random expression that expresses the same meaning.
6. The method according to claim 4, wherein: The step of adjusting the output text to different expressions expressing the same meaning includes: The output text is adjusted to express the same meaning and in the same expression as the user input text.
7. The method according to any one of claims 3 to 6, wherein: The voice assistants that return the machine reply voice to the user input voice include: a map voice assistant from a map application, a navigation voice assistant from a navigation application, and a home voice assistant from a smart terminal device.
8. A generative large language model training device, comprising: The first training set construction unit is configured to obtain a human-computer dialogue sequence, and determine a valid machine reply that successfully responds to a user input text in the human-computer dialogue sequence, wherein the user input text is converted from a user input voice; determine a matching interface call instruction according to a function called when generating the valid machine reply; replace part or all of the replies in the valid machine reply that can be returned by executing the interface call instruction with the corresponding interface call instruction to obtain an output result; and generate a new human-computer dialogue sequence according to the user input text and the matching output result; Taking the first user input text and the first output result in the new human-computer dialogue sequence as a starting sample pair; All dialogue contents before the non-first output result in the new human-computer dialogue sequence and the non-first output result are used as non-starting sample pairs; a first training set is constructed based on the starting sample pairs and the non-starting samples, wherein the service interface called by the interface calling instruction corresponds to the functional usage intention expressed by the user input text; The supervised fine-tuning training unit is configured to perform supervised fine-tuning training on the pre-trained first generative large language model using the first training set to obtain a second generative large language model; in the supervised fine-tuning training mode, the features of the new language unit representing the service interface that does not appear in the first generative large language model are initialized by parameter sampling according to the multivariate normal distribution of the features of the existing language units; A second training set construction unit is configured to construct a second training set based on a user preference ranking between the same user input text and different candidate outputs and a preset template set, wherein the candidate output is an output matching the user input text, and the preset template set includes preset templates recording a corresponding relationship between the input text and the corresponding interface call instruction; A reward model training unit is configured to perform supervised training on the pre-trained third generative large language model using the second training set to obtain a reward model; The reinforcement learning training unit is configured to train the second generative large language model in a reinforcement learning manner based on the score returned by the reward model to obtain a target generative large language model.
9. The device according to claim 8, wherein: The second training set construction unit is further configured to: Get search terms from search logs; Confirming all search results returned for the same search term from the search log, and determining the cumulative number of clicks on each search result within a time window; Generate multiple sample pairs with the same search term and each search result, and determine the ranking information between the corresponding different sample pairs according to the accumulated number of clicks corresponding to the different search results; A second training set is constructed based on each sample pair sorted by user preference according to the sorting information and each preset template recording the correspondence between the input text and the corresponding output text containing the interface call instruction; wherein the preset template set is composed of each of the preset templates.
10. A human-computer speech interaction device based on a generative large language model, comprising: A user input voice acquisition unit is configured to acquire a user input voice issued by a user in the form of voice; A model calling unit is configured to input the user input text corresponding to the user input voice as input data into a preset target generative large language model; wherein the target generative large language model is obtained based on the generative large language model training device according to claim 8 or 9; An output text receiving unit is configured to receive an output text returned by the target generative large language model; wherein the output text is generated based on response information obtained after executing the interface call instruction; The machine reply speech generating unit is configured to convert the output text into a machine reply speech in speech form.
11. The apparatus according to claim 10, further comprising: The expression adjustment unit is configured to adjust the output text into different expressions that express the same meaning.
12. The device according to claim 11, wherein: The expression adjustment unit is further configured to: The output text is adjusted to a random expression that expresses the same meaning.
13. The device according to claim 11, wherein: The expression adjustment unit is further configured to: The output text is adjusted to express the same meaning and in the same expression as the user input text.
14. The device according to any one of claims 10 to 13, wherein: The voice assistants that return the machine reply voice to the user input voice include: a map voice assistant from a map application, a navigation voice assistant from a navigation application, and a home voice assistant from a smart terminal device.
15. An electronic device, comprising: at least one processor; as well as a memory communicatively connected 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 so that the at least one processor can execute the generative large language model training method described in claim 1 or 2 and / or the human-computer speech interaction method based on the generative large language model described in any one of claims 3-7.
16. A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute the generative large language model training method described in claim 1 or 2 and / or the human-computer speech interaction method based on the generative large language model described in any one of claims 3-7.
17. A computer program product, comprising a computer program, which, when executed by a processor, implements the steps of the generative large language model training method according to claim 1 or 2 and / or the steps of the human-computer speech interaction method based on the generative large language model according to any one of claims 3-7.
