Dialogue robot learning method and device, vehicle, medium and product
By using the summary fragment collection assisted large language model in the dialogue robot, the problem of insufficient comprehension capabilities of the vehicle dialogue robot is solved, significantly improving the accuracy and user experience of the response.
Patent Information
- Application Number
- CN202411926492.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-04-18
AI Technical Summary
Due to the low comprehension ability of existing vehicle dialogue robots, it is difficult to accurately understand the user's voice commands, resulting in delayed reply and poor user experience.
By receiving the user's voice text, obtaining a collection of summarized fragments, and inputting it into the first major language model for analysis, summarizing the user's voice and reply results through the second major language model, and updating the collection of summarized fragments, thereby assisting the first major language model to improve its comprehension ability.
By summarizing the aid of the collection of fragments, the first language model can more accurately understand the user's intentions and improve the response accuracy and user experience of the conversation robot.
Smart Images

Figure CN119849627A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of human-machine dialogue, and in particular to a dialogue robot learning method, device, vehicle, medium and product. Background Art
[0002] Large Language Model (LLM) is an artificial intelligence algorithm based on deep learning. It can model natural language text by training a large amount of text data, learning the grammar, semantics and context information of the language. This model has a wide range of applications in the field of natural language processing, including but not limited to text generation, text classification, machine translation, sentiment analysis, etc. At present, many in-vehicle conversational robots use large language models to respond to users' voice commands. For example, when a user says "open the window", the conversational robot analyzes and infers the user's intention through the large language model, and then responds "OK, open the window for you now". However, because different regions and different users have different expression habits, users often say different words and speech order, which leads to the conversational robot often not understanding the user's meaning. In addition, the poor understanding ability also leads to a long waiting time for the conversational robot to reply, which often seriously affects the user experience. Therefore, how to enhance the language understanding ability of the large language model is a key issue. Summary of the invention
[0003] In view of this, the present invention provides a conversational robot learning method, device, vehicle, medium and product to solve the problem of low comprehension ability of the conversational robot.
[0004] In a first aspect, the present invention provides a conversational robot learning method, the method comprising: receiving user voice text; obtaining a summary segment set, the summary segment set being empty during a first conversation; inputting the user voice text and the summary segment set into a first large language model, and obtaining a reply result by inference; summarizing the user voice text and the reply result through a second large language model to obtain a second summary segment; and updating the summary segment set using the second summary segment.
[0005] According to the above technical means, the user's expression habits are summarized through the dialogue between the user and the dialogue robot, and the summarized content is stored as a summary fragment. In each user dialogue, the first language model will comprehensively analyze the user's intention based on the user's current voice text and the previously obtained summary fragment set, so as to give a corresponding reply. The summary fragment set is used to assist the first language model in understanding the user's commands, thereby improving the dialogue robot's understanding ability and thus improving the accuracy of the dialogue robot's replies.
[0006] In some optional implementations, inputting the user speech text and the summary segment set into the first largest language model includes: encoding the user speech text and the summary segment set to obtain an input code; and inputting the input code into the first largest language model.
[0007] In some optional implementations, the user voice text and the summary segment set are encoded, including: converting the user voice text into an instruction code through an embedding layer; mapping the text in the summary segment set to a preset feature space based on a mapping model to obtain a summary code; and concatenating the instruction code and the summary code in the summary segment set to obtain an input code.
[0008] In some optional embodiments, splicing the instruction code and the summary code in the summary fragment set includes: adjusting the dimension of the summary code according to the dimension of the instruction code so that the summary code has the same number of matrix rows or the same number of matrix columns as the instruction code; splicing the instruction code and the summary code according to the same dimension.
[0009] In some optional embodiments, the method further includes: determining a reply error between a user's expected reply and a reply result; determining a summary error between a user's expected summary and a second summary segment; adjusting the first largest language model according to the reply error, and adjusting the second largest language model and the mapping model according to the summary error.
[0010] According to the above technical means, the embodiment of the present invention improves the input layer of the first large language model and provides a mapping model for text encoding. The input layer of the first large language model includes two parts, one part is to convert the user's voice text into instruction code, which is an essential module for each large language model, and the other part, the present invention converts the summary fragment in text form into a coding form through a mapping model, thereby obtaining the numerical information in the summary fragment set, that is, the summary code. Then, the present invention splices the summary code and the instruction code together according to the matrix dimension as the input code, and inputs the whole into the first large language model, so that the first large language model no longer performs inference based on the user's voice and summary text, but uses the input code as a whole as the input feature of the model to identify the user's intention. Since the user often has an expected response to the issued instruction, the user's expected response can be used as a feature label of the input code during the conversation, and the model parameters of the large language model are supervised for training. In the process of continuous dialogue between users and robots, the parameters of the large language model involved are constantly fine-tuned. Through this improvement, the dialogue between users and robots is no longer based on the fixed reasoning ability of the large language model to infer the user's intentions, but the model reasoning ability is continuously improved during the dialogue process, so that the model parameters of the large language model are increasingly adapted to the user's expression habits. After a period of time, even if no summary segments are added, the large language model can still recognize the user's voice commands well, which significantly improves the understanding ability of the dialogue robot.
[0011] In some optional implementations, adjusting the first largest language model according to the response error, and adjusting the second largest language model and the mapping model according to the summary error, includes: fixing parameters of the first largest language model and the second largest language model, and adjusting the parameters of the mapping model according to the summary error; fixing the adjusted parameters of the mapping model, and adjusting the parameters of the second largest language model according to the summary error; synchronizing the adjusted parameters of the second largest language model to the first largest language model; adjusting the parameters of the first largest language model according to the response error; synchronizing the adjusted parameters of the first largest language model to the second largest language model; and returning to the step of fixing the parameters of the first largest language model and the second largest language model, and adjusting the parameters of the mapping model according to the summary error.
[0012] According to the above technical means, the model training process consists of three parts, namely, training the mapping model separately, training the first language model separately, and training the second language model separately. It is known that the first language model and the second language model have relatively excellent reasoning ability, so in the initial training stage, the parameters of the two language models can be fixed unchanged, and only the mapping model parameters can be updated, so as to quickly realize the ability to accurately convert the summary fragment into the summary code. Afterwards, the parameters of the mapping model can be fixed unchanged, and only the parameters of the two language models can be updated, so as to enhance the reasoning ability of the large language model, so that the reasoning ability of the adjusted large language model and the user's expression habits are more adaptable. In addition, because the first language model and the second language model essentially perform reasoning tasks, the embodiment of the present invention synchronizes and shares the parameters of the two during the training process, so that the two language models essentially belong to a large language model, but they perform different tasks respectively, thereby comprehensively enhancing the reasoning ability of the large language model.
[0013] In some optional implementations, the method also includes: determining whether the amount of text in the summary segment set is greater than a preset threshold; when the amount of text is greater than the preset threshold, re-summarizing the text in the summary segment set through a second largest language model; and mapping the text in the re-summarized summary segment set through a mapping model to obtain a new summary code.
[0014] According to the above technical means, as the number of conversations increases, the summary fragments also gradually increase. A large number of summary fragments may be repeated. In order to avoid inputting too much data into the conversation model each time, which will lead to a decline in machine performance, the second largest language model is called to re-summarize the historical summary fragments whenever the summarized text exceeds the preset threshold, thereby reducing redundant data and improving the model's computing power.
[0015] In some optional implementations, the structure of the mapping model includes a first fully connected layer, an activation function, and a second fully connected layer.
[0016] In a second aspect, the present invention provides a conversational robot learning device, the device comprising: a receiving module for voice receiving user voice text; a summary information acquisition module for acquiring a summary segment set, the summary segment set being empty during a first conversation; a conversation module for inputting the user voice text and the summary segment set into a first large language model, and obtaining a reply result by inference; a conversation summarizing module for summarizing the user voice text and the reply result through a second large language model to obtain a second summary segment; and a summary information updating module for updating the summary segment set using the second summary segment.
[0017] In a third aspect, the present invention provides a vehicle, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0018] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to cause a computer to execute the method of the first aspect or any corresponding embodiment thereof.
[0019] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the method of the first aspect or any corresponding embodiment thereof.
[0020] The technical solution provided by the present invention has the following advantages:
[0021] (1) According to the above technical means, the user's expression habits are summarized through the dialogue between the user and the dialogue robot, and the summarized content is stored as a summary fragment. In each user dialogue, the first language model will comprehensively analyze the user's intention based on the user's current voice text and the previously obtained summary fragment set, and then give a corresponding reply. The summary fragment set assists the first language model in understanding the user's command, thereby improving the dialogue robot's understanding ability and thus improving the accuracy of the dialogue robot's reply.
[0022] (2) According to the above technical means, the embodiment of the present invention improves the input layer of the first large language model and provides a mapping model for text encoding. The input layer of the first large language model includes two parts. One part is to convert the user's voice text into instruction code, which is an essential module for each large language model. The other part, the present invention converts the summary fragment in text form into a code form through a mapping model, thereby obtaining the numerical information in the summary fragment set, that is, the summary code. Then, the present invention splices the summary code and the instruction code together according to the matrix dimension as the input code, and inputs the whole into the first large language model, so that the first large language model no longer performs inference based on the user's voice and summary text, but uses the input code as a whole as the input feature of the model to identify the user's intention. Since the user often has an expected response to the instruction, the user's expected response can be used as the feature label of the input code in the training data set to perform supervised training on the model parameters of the large language model. After inputting a large amount of training data into the robot, the parameters of the large language model involved are continuously fine-tuned. Through this improvement, the conversation between the user and the robot is no longer based on the fixed reasoning ability of the large language model to infer the user's intentions. Instead, the model reasoning ability is continuously improved through training, so that the model parameters of the large language model are increasingly adapted to the user's expression habits. After a period of training, even if no summary fragments are added, the large language model can still recognize the user's voice commands well in subsequent reasoning, which significantly improves the understanding ability of the conversational robot.
[0023] (3) According to the above technical means, the model training process consists of three parts, namely, training the mapping model separately, training the first language model separately, and training the second language model separately. It is known that the first language model and the second language model have relatively excellent reasoning ability, so in the initial stage, the parameters of the large language model can be fixed unchanged, and only the mapping model parameters can be updated, so as to quickly realize the ability to accurately convert the summary fragment into the summary code. Afterwards, the parameters of the mapping model can be fixed unchanged, and only the parameters of the two large language models can be updated, so as to enhance the reasoning ability of the large language model, so that the reasoning ability of the adjusted large language model and the user's expression habits are more compatible. In addition, because the first language model and the second language model essentially perform reasoning tasks, the embodiment of the present invention synchronizes and shares the parameters of the two during the training process, so that the two large language models essentially belong to a large language model, but they perform different tasks respectively, thereby comprehensively enhancing the reasoning ability of the large language model.
[0024] (4) According to the above technical means, as the number of conversations increases, the number of summary segments also gradually increases. A large number of summary segments may be repeated. In order to avoid excessive data input into the conversation model each time, which would lead to a decrease in machine performance, the second largest language model is called to re-summarize the historical summary segments whenever the summarized text exceeds the preset threshold, thereby reducing redundant data and improving the model's computing power. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0026] Figure 1 is a flow chart of a conversational robot learning method according to an embodiment of the present invention;
[0027] Figure 2 is a schematic diagram of the structure of a large language model according to an embodiment of the present invention;
[0028] Figure 3 is a schematic diagram of the structure of the improved second largest language model according to an embodiment of the present invention;
[0029] Figure 4 is a schematic diagram of the structure of the first language model improved according to an embodiment of the present invention;
[0030] Figure 5 is another flowchart of a conversational robot learning method according to an embodiment of the present invention;
[0031] Figure 6 is a structural schematic diagram of a conversational robot learning device according to an embodiment of the present invention;
[0032] Figure 7 Schematic diagram of the hardware structure of a vehicle according to an embodiment of the present invention. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0034] According to an embodiment of the present invention, an embodiment of a conversational robot learning method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0035] In this embodiment, a conversational robot learning method is provided. Figure 1 1 is a flow chart of a conversational robot learning method according to an embodiment of the present invention, and the flow chart includes the following steps:
[0036] Step S101, receiving user voice text;
[0037] Step S102, obtaining a summary segment set, where the summary segment set is empty during the first conversation;
[0038] Step S103, inputting the user's voice text and the summary segment set into the first language model, and inferring to obtain a reply result;
[0039] Step S104, summarizing the user voice text and the reply result by using the second largest language model to obtain a second summary segment;
[0040] Step S105: update the summary segment set using the second summary segment.
[0041] Specifically, the present invention proposes a memory-based conversational robot learning method, thereby improving the conversational robot's ability to understand user voices and improving the accuracy of responses. The present invention deploys two large language models, the first large language model is used for the conversational robot to interact with the user, and the second large language model is used to summarize and refine the conversation content between the user and the robot. In an embodiment of the present invention, the large language model can use currently mature products including but not limited to GPT-4o, Wenxin Yiyan, Qwen2.5, Baichuan, etc. The present invention is only used as an example and is not limited to this.
[0042] The second language model obtains the key information in the conversation process, and the text obtained by the summary can represent the user's speaking habits. The summary content is given to the first language model as a prompt text, so that the first language model knows the user's speaking habits. For example, the information shown in Table 1 is input into the second language model to obtain the output summary segment.
[0043] Table 1. Schematic diagram of information used to input the second largest language model
[0044]
[0045]
[0046] Through the conversation between the user and the conversation robot, the user's expression habits are summarized, and the summarized content is stored as the second summary segment in the summary segment set to obtain the conversation history segment. For each conversation between the user and the robot, the first language model will comprehensively analyze the user's intention based on the user's current voice text and the previously obtained summary segment set, and then give a corresponding response. Because there is no summary when the user and the robot have their first conversation, the summary segment set for the first conversation is empty.
[0047] One feasible implementation method is to give the summary content of the second largest language model as a prompt word to the first largest language model, so that the first largest language model knows the user's speaking habits. Every time the user has a conversation with the dialogue robot, the text summarized by the second largest language model will be input into the first largest language model together with the text converted from the user's voice as a text command. The first large language model will infer based on the text spoken by the user and the previously summarized user habits to predict the user's intention of this command.
[0048] The present invention assists the first language model in understanding the user's commands by summarizing the segment set, thereby improving the understanding ability of the dialogue robot and thus improving the accuracy of the dialogue robot's response.
[0049] In some optional implementations, step S103 includes:
[0050] Step a1, encoding the user's voice text and the summary segment set to obtain an input code;
[0051] Step a2, inputting the input code into the first language model.
[0052] In some optional implementations, step a1 includes:
[0053] Step b1, converting the user's voice text into instruction code through an embedding layer;
[0054] Step b2, mapping the text in the summary segment set to a preset feature space based on the mapping model to obtain a summary code;
[0055] Step b3, concatenating the instruction code and the summary code in the summary segment set to obtain the input code.
[0056] In some optional implementations, step b3 includes:
[0057] Step c1, adjusting the dimension of the summary code according to the dimension of the instruction code so that the summary code has the same number of matrix rows or the same number of matrix columns as the instruction code;
[0058] Step c2, concatenate the instruction code and the summary code according to the same dimension.
[0059] In some optional implementations, a conversational robot learning method provided by the present invention further includes:
[0060] Step d1, determining the response error between the user's expected response and the response result;
[0061] Step d2, determining a summary error between the user's expected summary and the second summary segment;
[0062] Step d3, adjusting the first largest language model according to the reply error, and adjusting the second largest language model and the mapping model according to the summary error.
[0063] Specifically, the embodiment of the present invention takes into account that the summary content of the second largest language model described in the above embodiment is given as a prompt word to the first largest language model. Each time the user has a conversation with the dialogue robot, the text summarized by the second largest language model will be input into the first largest language model as a text command together with the text converted from the user's voice. This is a feasible way, which can improve the first large language model's ability to understand the user's voice to a certain extent. However, the essence of this method is still to use text data for reasoning, but it turns one text into two texts, and the first largest language model is asked to understand the two texts separately, and then the user's intention is comprehensively judged based on the understanding of the two texts by the first largest language model. Under the condition that the reasoning ability of the first largest language model remains unchanged, the uncertainty is still large, and the adaptation degree of the first large language model and the user is not high enough, resulting in insufficient understanding of the user's voice. In other words, this method does not change the parameters of the first largest language model. Under the condition that the first largest language model cannot understand the user's voice, another text is provided to the first largest language model, so that the first largest language model understands the other text and then understands the user's voice, so the output result still has a high risk of randomness.
[0064] In order to further improve the ability of the large language model to understand user instructions, the improved scheme proposed in the embodiment of the present invention is to encode the user voice text and the summary fragment set, use the processed input encoding as the model feature, and then input the data into the first large language model in the encoded form, so as to perform supervised training on the model, which can achieve the effect of improving the model's reasoning ability.
[0065] In a specific implementation, the embodiment of the present invention improves the model structure of the first large language model and the second large language model, and adjusts the input end of the first large language model and the output end of the second large language model respectively, so that during the conversation with the user, the large language model can be trained in real time and the model parameters can be changed, thereby improving the model's understanding ability.
[0066] like Figure 2 As shown, it is a general structural diagram of a large language model. Before adjusting the first large language model and the second large language model, both the first large language model and the second large language model can be used. Figure 2 The model structure shown in the figure. The Embedding layer is an embedding layer used to convert text into a high-dimensional vector representation, such as converting user voice text into instruction encoding. Norm is a data preprocessing layer, such as for normalization to ensure the stability and efficiency of model training. Self-Attention is a self-attention layer used to process the three vectors Q, K, and V. The FFM layer is a data analysis layer used for feature analysis. The Linear layer is a fully connected layer used for dimensional mapping, mapping the output to the dimension of the dictionary size, and used to obtain the distribution of inference words. Softmax is an activation function, and finally the vector is reversed to obtain the inference text.
[0067] For the second largest language model, after obtaining the summary segment, the embodiment of the present invention adds the following at the end of the second largest language model: Figure 3 In the mapping model MLP shown, the second summary segment outputted by the second largest language model each time will be stored in the summary segment set, and the text in the summary segment set will be mapped to the preset feature space through the mapping model MLP to obtain the summary code. For example, in an embodiment of the present invention, the structure of the mapping model MLP adopts the first fully connected layer Linear1, the activation function relu and the second fully connected layer Linear2 connected in series, which has a simple structure and is easy to converge during the training process. At the same time, it will not increase too many model parameters and increase the hardware cost, and can also realize the mapping of the summarized text into an implicit representation form to obtain the summary code.
[0068] Because the input code needs to concatenate the summary code and the instruction code, if the two can be connected at the first position, more feature information can be saved. In order to facilitate the concatenation of the summary code and the instruction code at the first position, the summary code must meet the same condition as the instruction code dimension. Assume that the summary code is X∈R a*d , where d is equal to the dimension of the instruction code, and a is much smaller than the length of all text vectors in the summary segment set. Therefore, when outputting the summary code, the prompt word is required to process the second largest language model. For example, a word-element tokens are used to summarize the following memory segment: {history}. Based on this, the mapping model MLP can be used to generate a*d dimension summary codes, and the summary codes are adjusted to the same number of matrix rows or the same number of matrix columns as the instruction code. Then, the instruction code and the summary code are concatenated head to tail according to the same dimension.
[0069] Afterwards, for example Figure 4As shown, when the first language model processes the user's instruction, the embodiment of the present invention concatenates the converted instruction code and the summary code to obtain the input code, thereby improving the input end of the first language model. For example, the specific concatenation method is to first use the Embedding layer to obtain the instruction code of the user's voice text, which is recorded as Q∈R l *d , where l is the number of instruction encoding tokens, which is used to represent the dimension of instruction encoding. Then, the summary encoding X is linked to the instruction encoding Q as I∈R (a+l)*d , and the input code I is obtained, and the input code I is used as the input of the first language model. In summary, the fusion of the summary code and the first language model is realized.
[0070] The purpose of processing the first large language model and the second large language model by the embodiment of the present invention is to prepare for the subsequent training of the large language model.
[0071] Afterwards, in the training phase, a large number of training data sets are provided. The data in the training data sets serve as the voice commands spoken by the user. During the conversation between the user and the robot, each voice spoken by the user should contain the content that the user expects the robot to reply to. Similarly, the content summarized by the second largest language model each time also contains the results that the user expects to be summarized. Therefore, the user's expected reply and the user's expected summary can be used as labels for supervised training of the model.
[0072] There is a response error between the user's expected response and the response result of the first language model, and it is determined that there is a summary error between the user's expected summary and the second summary segment output by the second language model. Therefore, the model parameters of the first language model can be adjusted according to the response error, and the model parameters of the second language model and the mapping model can be adjusted according to the summary error to achieve model training.
[0073] According to the above technical means, the embodiment of the present invention improves the input layer of the first large language model and provides a mapping model for text encoding. The input layer of the first large language model includes two parts, one part is to convert the user's voice text into instruction code, which is an essential module for each large language model, and the other part, the present invention converts the summary fragment in text form into a coding form through a mapping model, thereby obtaining the numerical information in the summary fragment set, that is, the summary code. Then, the present invention splices the summary code and the instruction code together according to the matrix dimension as the input code, and inputs the whole into the first large language model, so that the first large language model no longer performs inference based on the user's voice and summary text, but uses the input code as a whole as the input feature of the model to identify the user's intention. Since the user often has an expected response to the issued instruction, the user's expected response can be used as a feature label of the input code during the conversation, and the model parameters of the large language model are supervised for training. During the continuous dialogue between the user and the robot, the parameters of the large language model are constantly fine-tuned. Through this improvement, the dialogue between the user and the robot is no longer based on the fixed reasoning ability of the large language model to infer the user's intentions, but the model reasoning ability is continuously improved during the dialogue process, so that the model parameters of the large language model are increasingly adapted to the user's expression habits. After a period of time, even if the summary segment is no longer added to the first large language model, the large language model can still recognize the user's voice commands well. The first large language model's perception of the user's voice alone has been improved, thereby significantly improving the dialogue robot's understanding ability.
[0074] In some optional implementations, the above step d3 includes:
[0075] Step e1, fixing the parameters of the first language model and the second language model, and adjusting the parameters of the mapping model according to the summary error;
[0076] Step e2, fixing the parameters of the adjusted mapping model, and adjusting the parameters of the second largest language model according to the summary error;
[0077] Step e3, synchronizing the adjusted parameters of the second largest language model to the first largest language model;
[0078] Step e4, adjusting the parameters of the first language model according to the response error;
[0079] Step e5, synchronizing the adjusted parameters of the first largest language model to the second largest language model;
[0080] Step e6, returning to the step of fixing the parameters of the first largest language model and the second largest language model, and adjusting the parameters of the mapping model according to the summary error.
[0081] Specifically, the model training process of the embodiment of the present invention consists of three parts, namely, training the mapping model alone, training the first language model alone, and training the second language model alone. It is known that the first language model and the second language model have relatively good reasoning capabilities, so in the initial stage, the parameters of the two language models can be fixed unchanged, and only the mapping model parameters are updated, that is, only the first language model and the second language model are trained. Figure 3 The mapping model MLP in the example is used to quickly realize the ability to accurately convert summary fragments into summary codes. After that, the parameters of the mapping model can be fixed unchanged, and only the parameters of the two large language models are updated, thereby enhancing the reasoning ability of the large language model, so that the reasoning ability of the adjusted large language model and the user's expression habits are more compatible. Specifically, the CausalLM method can be used to update the model parameters. In addition, because the first large language model and the second large language model essentially perform reasoning tasks, the embodiment of the present invention synchronizes and shares the parameters of the two during the training process, so that the two large language models essentially belong to a large language model, but perform different tasks respectively, thereby comprehensively enhancing the reasoning ability of the large language model. Finally, the above training process can be executed cyclically using a large number of training data sets, so as to continuously fine-tune the model parameters of the mapping model, the first large language model and the second large language model, so that the large language model itself is more compatible with the user's expression habits. As the training time increases, the first large language model becomes less and less dependent on the summary fragments of the second large language model, which significantly improves the dialogue robot's ability to understand user expressions.
[0082] Through the technical solution provided by the embodiment of the present invention, in the reasoning stage, the memory fragments of different users or different types of users can be summarized separately, and different summary contents can be input into the first large language model according to the users to achieve different dialogue results for different users. Different from the different results at the reply level, the semantic level modification can be achieved through the summary fragments here. For example, user A expresses "I'm so hot", and according to his summary fragment, the in-vehicle dialogue robot can be made to execute "turn on the air conditioner". User B expresses "I'm so hot", and according to his summary fragment, the dialogue robot can be made to execute "open the car window", realizing the ability of the dialogue system to respond to different people. In addition, the mapping model can also be turned on during the low-frequency access stage of users, such as late at night when resources are idle, and the summary fragments of the user's historical time are pre-encoded as implicit codes using the mapping model to save the user's implicit codes and avoid occupying the machine's computing resources, thereby not affecting the processing speed of the large language model when it usually dialogues with users.
[0083] In some optional implementations, the conversational robot learning method provided by the present invention further includes:
[0084] Step f1, determining whether the amount of text in the summary segment set is greater than a preset threshold;
[0085] Step f2: when the amount of text is greater than a preset threshold, re-summarize the text in the summary segment set using the second largest language model;
[0086] Step f3, mapping the text in the re-summarized summary segment set through the mapping model to obtain a new summary code.
[0087] Specifically, as the number of conversations increases, the number of summary fragments also gradually increases, and there may be repeated or mergeable memory fragments. In order to avoid excessive data input into the conversation model each time, which may lead to a decrease in machine performance, the present invention sets a preset threshold to judge the number of texts in the summary fragment set, such as Figure 5 As shown, whenever the summarized text exceeds the preset threshold, the second largest language model is called again to re-summarize the historical summary fragments and merge the memory fragments, thereby reducing redundant data and improving the model's computing power.
[0088] In this embodiment, a conversational robot learning device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0089] This embodiment provides a conversational robot learning device, such as Figure 6 As shown, including:
[0090] The voice receiving module 601 is used to receive user voice text;
[0091] A summary information acquisition module 602 is used to acquire a summary segment set, where the summary segment set is empty during the first conversation;
[0092] The dialogue module 603 is used to input the user's voice text and the summary segment set into the first language model, and infer to obtain a reply result;
[0093] A conversation summarizing module 604 is used to summarize the user speech text and the reply result by using the second largest language model to obtain a second summary segment;
[0094] The summary information updating module 605 is configured to update the summary segment set using the second summary segment.
[0095] In some optional implementations, the dialogue module 603 includes:
[0096] The encoding processing unit is used to encode the user's voice text and the summary segment set to obtain an input code;
[0097] The input unit is used to input the input code into the first language model.
[0098] In some optional implementations, the encoding processing unit includes:
[0099] An instruction encoding unit, used for converting the user voice text into instruction encoding through an embedding layer;
[0100] A summary coding unit, used for mapping the text in the summary segment set to a preset feature space based on a mapping model to obtain a summary code;
[0101] The concatenation unit is used for concatenating the instruction code and the summary code in the summary segment set to obtain the input code.
[0102] In some optional embodiments, the splicing unit includes:
[0103] A dimension adjustment unit, used for adjusting the dimension of the summary code according to the dimension of the instruction code, so that the summary code has the same number of matrix rows or the same number of matrix columns as the instruction code;
[0104] The first concatenation unit is used to concatenate the instruction code and the summary code according to the same dimension.
[0105] In some optional embodiments, the device further comprises:
[0106] A reply error determination module, used to determine the reply error between the user's expected reply and the reply result;
[0107] A summary error determination module, used to determine a summary error between a user's expected summary and a second summary segment;
[0108] A model training module is used to adjust the first language model according to the reply error, and to adjust the second language model and the mapping model according to the summary error.
[0109] In some optional implementations, the model training module includes:
[0110] A mapping model training unit, used to fix parameters of the first language model and the second language model, and adjust the parameters of the mapping model according to the summary error;
[0111] a second language model training unit, for fixing parameters of the adjusted mapping model and adjusting parameters of the second language model according to the summary error;
[0112] A first parameter synchronization unit, used to synchronize the adjusted parameters of the second largest language model to the first largest language model;
[0113] A first language model training unit, used for adjusting parameters of the first language model according to the response error;
[0114] A second parameter synchronization unit, used to synchronize the adjusted parameters of the first largest language model to the second largest language model;
[0115] The cyclic training unit is used to return to the step of fixing the parameters of the first language model and the second language model, and adjusting the parameters of the mapping model according to the summary error.
[0116] In some optional embodiments, the device further comprises:
[0117] A quantity judgment module is used to judge whether the quantity of text in the summary segment set is greater than a preset threshold;
[0118] A re-summarization module is used to re-summarize the text in the summary segment set through the second largest language model when the amount of text is greater than a preset threshold;
[0119] The re-encoding module is used to map the text in the re-summarized text set through a mapping model to obtain a new summary code.
[0120] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0121] In this embodiment, a conversational robot learning device is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above-mentioned functions.
[0122] An embodiment of the present invention also provides a vehicle having the above-mentioned conversational robot learning device.
[0123] See also Figure 7 , Figure 7 is a schematic diagram of the structure of a vehicle provided by an optional embodiment of the present invention, such as Figure 7As shown, the vehicle includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the vehicle, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple vehicles can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 7 A processor 10 is taken as an example.
[0124] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0125] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.
[0126] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and applications required for at least one function; the data storage area may store data created according to the use of the vehicle, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the vehicle via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0127] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0128] The vehicle further includes a communication interface 30 for the vehicle to communicate with other devices or a communication network.
[0129] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0130] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0131] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A conversational robot learning method, characterized in that: The method comprises: Receive user voice text; Obtain a summary segment set, wherein the summary segment set is empty during the first conversation; Inputting the user voice text and the summary segment set into a first language model, and inferring to obtain a reply result; Summarizing the user voice text and the reply result by using a second language model to obtain a second summary segment; The summary segment set is updated using the second summary segment.
2. The method according to claim 1, characterized in that The step of inputting the user speech text and the summary segment set into a first language model comprises: Encoding the user voice text and the summary segment set to obtain an input code; The input code is input into the first language model.
3. The method according to claim 2, characterized in that The encoding process of the user voice text and the summary segment set includes: Converting the user voice text into instruction code through an embedding layer; Mapping the text in the summary segment set to a preset feature space based on a mapping model to obtain a summary code; The instruction code and the summary code in the summary segment set are concatenated to obtain the input code.
4. The method according to claim 3, characterized in that: The step of concatenating the instruction code and the summary code in the summary segment set includes: Adjusting the dimension of the summary code according to the dimension of the instruction code so that the summary code has the same number of matrix rows or the same number of matrix columns as the instruction code; The instruction code and the summary code are concatenated according to the same dimension.
5. The method according to claim 3 or 4, characterized in that: The method further comprises: Determining a response error between a user's expected response and the response result; determining a summary error between the user's desired summary and the second summary segment; The first large language model is adjusted according to the reply error, and the second large language model and the mapping model are adjusted according to the summary error.
6. The method according to claim 5, characterized in that The adjusting the first large language model according to the reply error, and adjusting the second large language model and the mapping model according to the summary error, comprises: Fixing parameters of the first largest language model and the second largest language model, and adjusting parameters of the mapping model according to the summary error; Fixing the parameters of the adjusted mapping model, and adjusting the parameters of the second largest language model according to the summary error; Synchronizing the adjusted parameters of the second largest language model to the first largest language model; adjusting parameters of the first language model according to the response error; Synchronizing the adjusted parameters of the first largest language model to the second largest language model; The step of fixing the parameters of the first large language model and the second large language model and adjusting the parameters of the mapping model according to the summary error is returned.
7. The method according to claim 3, characterized in that The method further comprises: Determining whether the amount of text in the summary segment set is greater than a preset threshold; When the amount of the text is greater than the preset threshold, re-summarizing the text in the summary segment set by using the second largest language model; The text in the re-summarized summary segment set is mapped through the mapping model to obtain a new summary code.
8. The method according to claim 7, characterized in that The structure of the mapping model includes a first fully connected layer, an activation function and a second fully connected layer.
9. A conversational robot learning device, characterized in that: The device comprises: A voice receiving module, used to receive user voice text; A summary information acquisition module, used to acquire a summary segment set, wherein the summary segment set is empty during the first conversation; A dialogue module, used for inputting the user voice text and the summary segment set into a first language model, and inferring to obtain a reply result; A dialogue summarizing module, used for summarizing the user voice text and the reply result by using a second language model to obtain a second summary segment; A summary information updating module is used to update the summary segment set using the second summary segment.
10. A vehicle, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method according to any one of claims 1 to 8 by executing the computer instructions.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method according to any one of claims 1 to 8.
12. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the method according to any one of claims 1 to 8.