Vehicle-mounted semantic standardization method, device, equipment, medium and product
By using pre-trained large language models and paired vehicle-controlled command text samples for training, the problem of difficulty in taking into account accuracy and automation in vehicle-mounted semantic standardization is solved, and efficient and automated semantic standardization conversion is achieved.
Patent Information
- Application Number
- CN202411609995.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2025-02-28
AI Technical Summary
The prior art is difficult to take into account high accuracy and high automation in vehicle semantic standardization, and the model training threshold is high. Users need to manually adjust the data samples to vector form, which increases complexity and knowledge reserve requirements.
The pre-trained large language model is adopted to generate text-style training samples by pairing the original vehicle control commands and standard vehicle control commands, and directly conducting model training, which lowers the threshold for model training, and improves training efficiency and accuracy by adjusting model parameters.
It realizes high accuracy and automation of vehicle semantic standardization, simplifies the model training process, reduces the requirements for user knowledge reserves, and improves training efficiency.
Smart Images

Figure CN119536732A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of vehicle control technology, and in particular to a vehicle-mounted semantic standardization method, device, equipment, medium and product. Background Art
[0002] With the rapid development of artificial intelligence and natural language processing technologies, more and more application systems need to be able to understand and process data from different third parties. These data usually contain a variety of non-standard semantic representations, which brings great challenges to cross-platform data exchange. For example, the data format defined by the car company for the vehicle control command "open the window" is format A. If the car company's self-developed in-vehicle application issues the "open the window" command to the vehicle, the vehicle can understand the semantics and execute it. However, vehicles often install third-party applications, and third-party applications may also perform some control on the vehicle. However, the data format defined by the third-party application for the vehicle control command "open the window" is format B. Because it is different from the standard format defined by the vehicle itself, the vehicle cannot understand the true meaning of the third-party application command and cannot accurately respond to the command. In order to solve this problem, standard format conversion of in-vehicle data is required to convert the data format of the third-party application command into the standard data format defined by the car company. Most current solutions rely on complex configuration rules and manual coding, requiring users to manually configure some rules to match two different data formats according to data semantics. The machine maps one data format to another by reading the rules configured by the user. Although this solution has acceptable accuracy, it is time-consuming and labor-intensive, and lacks flexibility and adaptability. Some other solutions use traditional neural network models, using the data formats before and after conversion as data samples to train the neural network model, and then use the trained model to perform standard data conversion. Although this solves the problem of manual configuration rules to a certain extent, the current solution requires users to manually adjust data samples in text or character form to digital vector form, and then use them as model samples to train the model. How to choose the right formula or coding to convert text samples into vectors is also a relatively complex process, which requires a high level of user knowledge and is difficult to train the model, resulting in low accuracy in vehicle semantic standardization. Summary of the invention
[0003] In view of this, the present invention provides a vehicle-mounted semantic standardization method, device, equipment, medium and product to solve the problem that high accuracy and high automation level of vehicle-mounted semantic standardization cannot be taken into account at the same time.
[0004] In a first aspect, the present invention provides a vehicle-mounted semantic standardization method, the method comprising: obtaining a pre-trained large language model, the large language model being pre-trained through a variety of different paired data samples, the paired data samples comprising original vehicle control commands and standard vehicle control commands, the original vehicle control commands being obtained from a third-party application; obtaining a target original vehicle control command; obtaining a format template for representing a target standard vehicle control command; composing a prompt word according to the target original vehicle control command and the format template; inputting the target original vehicle control command and the prompt word into the large language model, and outputting a converted target standard vehicle control command through the large language model.
[0005] According to the above-mentioned technical means, the present invention is based on the ability of the large language model to directly understand the meaning of the text, and directly pairs the original vehicle control command with the standard vehicle control command to generate text-style training samples, which are then input into the large language model for training, thereby lowering the threshold for model training and improving training efficiency and training accuracy. In subsequent applications, it is only necessary to input the target original vehicle control command and the prompt words composed of the format template into the large language model at the same time to complete the standard conversion of the target original vehicle control command, taking into account the high accuracy and high degree of automation of vehicle-mounted semantic standardization.
[0006] In some optional implementations, the step of training the large language model includes: defining standard vehicle control commands corresponding to multiple vehicle control semantics; obtaining original vehicle control commands representing each vehicle control semantics; pairing the original vehicle control commands with the standard vehicle control commands one by one according to the same vehicle control semantics to obtain paired data samples representing multiple vehicle control semantics; obtaining a basic version of the large language model; configuring the training parameters of the basic version of the large language model; inputting the paired data samples into the basic version of the large language model for training to obtain a trained large language model.
[0007] According to the above-mentioned technical means, the present invention generates text-style training samples by pairing original vehicle control commands with standard vehicle control commands, adjusts training parameters, and directly trains a large language model based on text data without the need to perform vector conversion on the data, thereby significantly reducing the training difficulty of the standard semantic conversion model and improving training efficiency.
[0008] In some optional implementations, configuring the training parameters of the basic version of the large language model includes: adjusting the randomness parameter, kernel sampling parameter, topic freshness parameter and frequency penalty parameter of the large language model, wherein the randomness parameter is used to define the randomness of the model output result, the kernel sampling parameter is used to define the range of the model output result, the topic freshness parameter is used to define the degree of diversion of the model output result, and the frequency penalty parameter is used to define the word repetition of the model output result.
[0009] In some optional implementations, the randomness parameter, kernel sampling parameter, topic freshness parameter and frequency penalty parameter of the large language model are adjusted, including: adjusting the randomness parameter to be less than 0.5; adjusting the kernel sampling parameter to be less than 0.5; adjusting the topic freshness parameter to be less than -1; and adjusting the frequency penalty parameter to be in the interval [-2, 2].
[0010] According to the above-mentioned technical means, the present invention controls the stability and low randomness of the output results of the large language model by adjusting the randomness parameters, kernel sampling parameters, topic freshness parameters and frequency penalty parameters of the large language model, and further ensures that the model output results are standard data semantics, so as to significantly improve the accuracy of vehicle-mounted semantic standardization.
[0011] In some optional implementations, the paired data samples are input into a basic version of a large language model for training, including: mounting a parameter model for the large language model, the parameter model being used to couple with the parameters in the large language model; inputting the original vehicle control commands in the paired data samples into the basic version of the large language model, and outputting predicted vehicle control commands; adjusting the parameter model according to a field error between the predicted vehicle control command and the standard vehicle control command; and using the large language model after the parameter model is adjusted as the trained large language model.
[0012] According to the above technical means, the present invention couples a small parameter model with a large language model, adjusts the parameters of the small parameter model according to the output results of the training, instead of adjusting all the parameters of the large language model, and adds a low-rank matrix to the existing weight matrix of the large language model. The model can be effectively adjusted with a small increase in computational burden, thereby significantly improving training efficiency.
[0013] In some optional embodiments, the parameter model is adjusted according to the field error between the predicted vehicle control command and the standard vehicle control command, including: adding a correction word to the prompt word according to the field error; and re-inputting the prompt word with the correction word added into the basic version of the large language model for training to adjust the parameter model.
[0014] In some optional implementations, correction words are added to the prompt words based on the field errors, including: when the field error includes extra fields, adding correction words indicating removal of extra fields to the prompt words; when the field error includes missing fields, adding correction words indicating addition of missing fields to the prompt words; when the field error includes incorrect field format, adding correction words to the prompt words to replace the incorrect field format with the correct field format.
[0015] According to the above-mentioned technical means, the present invention obtains the field error between the predicted vehicle control commands and the standard vehicle control commands output by the comparison model, and adjusts the large language model based on the field error. During the adjustment, there is no need to configure the adjustment rules of the vector parameters. By means of the ability of the large language model to understand semantics, the large language model can be directly informed through semantics to modify the preset fields during the next training. This further reduces the training threshold of the model and improves the automation capability of vehicle-mounted semantic standardization.
[0016] In a second aspect, a vehicle-mounted semantic standardization device includes: a large language model acquisition module, used to acquire a pre-trained large language model, the large language model is pre-trained through a variety of different paired data samples, the paired data samples include original vehicle control commands and standard vehicle control commands, the original vehicle control commands are acquired from a third-party application; a command acquisition module to be converted, used to acquire a target original vehicle control command; a standard template acquisition module, used to acquire a format template for representing the target standard vehicle control command; a prompt word generation module, used to compose a prompt word according to the target original vehicle control command and the format template; a conversion module, used to input the target original vehicle control command and the prompt word into the large language model, and output the converted target standard vehicle control command through the large language model.
[0017] In a third aspect, the present invention provides a computer device, 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 vehicle, the vehicle comprising the computer device provided in the third aspect.
[0020] The technical solution provided by the present invention has the following advantages:
[0021] (1) According to the above technical means, the present invention directly pairs the original vehicle control command with the standard vehicle control command based on the ability of the large language model to directly understand the meaning of the text to generate text-style training samples, which are then input into the large language model for training, thereby lowering the threshold for model training and improving training efficiency and training accuracy. In subsequent applications, it is only necessary to input the target original vehicle control command and the prompt words composed of the format template into the large language model at the same time to complete the standard conversion of the target original vehicle control command, thereby taking into account the high accuracy and high degree of automation of vehicle-mounted semantic standardization.
[0022] (2) According to the above technical means, the present invention generates text-style training samples by pairing original vehicle control commands with standard vehicle control commands, adjusts training parameters, and directly trains a large language model based on text data without the need to perform vector conversion on the data, thereby significantly reducing the training difficulty of the standard semantic conversion model and improving the training efficiency.
[0023] (3) According to the above technical means, the present invention controls the stability and low randomness of the output results of the large language model by adjusting the randomness parameters, kernel sampling parameters, topic freshness parameters and frequency penalty parameters of the large language model, and further ensures that the model output results are standard data semantics, so as to significantly improve the accuracy of vehicle-mounted semantic standardization.
[0024] (4) According to the above technical means, the present invention couples a small parameter model with a large language model, and adjusts the parameters of the small parameter model according to the output results of the training, rather than adjusting all the parameters of the large language model. By adding a low-rank matrix to the existing weight matrix of the large language model, the model can be effectively adjusted with a small increase in computational burden, thereby significantly improving the training efficiency.
[0025] (5) According to the above technical means, the present invention obtains the field error between the predicted vehicle control command and the standard vehicle control command output by the comparison model, and adjusts the large language model based on the field error. During the adjustment, there is no need to configure the adjustment rules of the vector parameters. By relying on the ability of the large language model to understand semantics, the large language model can be directly informed through semantics to modify the preset fields during the next training, thereby further reducing the training threshold of the model and improving the automation capability of vehicle-mounted semantic standardization. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] 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.
[0027] Figure 1 is a flow chart of a vehicle-mounted semantic standardization method according to an embodiment of the present invention;
[0028] Figure 2 is another flowchart of a vehicle-mounted semantic standardization method according to an embodiment of the present invention;
[0029] Figure 3 is another flowchart of a vehicle-mounted semantic standardization method according to an embodiment of the present invention;
[0030] Figure 4 is a structural schematic diagram of a vehicle-mounted semantic standardization device according to an embodiment of the present invention;
[0031] Figure 5 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0032] 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.
[0033] According to an embodiment of the present invention, an embodiment of an in-vehicle semantic standardization 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.
[0034] In this embodiment, a vehicle-mounted semantic standardization method is provided. Figure 1 is a flow chart of a vehicle-mounted semantic standardization method according to an embodiment of the present invention, the process comprising the following steps:
[0035] Step S101, obtaining a pre-trained large language model, the large language model is obtained by pre-training a variety of different paired data samples, the paired data samples include original vehicle control commands and standard vehicle control commands, the original vehicle control commands are obtained from a third-party application.
[0036] Specifically, the embodiment of the present invention improves the problems of high difficulty in vehicle semantic standardization training and low standardization accuracy through a large language model. Among them, a large language model refers to a deep learning model trained with a large amount of text data, which can generate natural language text or understand the meaning of language text. The large language model can handle a variety of natural language tasks, such as text classification, question and answer, dialogue, etc., and is an important way to artificial intelligence. At present, some commonly used large language models include but are not limited to OpenAI's GPT-4, Ali's qwen-72b-chat, Baidu's Wenxin Yiyan, etc. The special ability of this type of large language model is to be able to directly understand the semantics of the text input by the user, and then perform some processing and operations according to the meaning of the text. Therefore, the embodiment of the present invention can define some standard vehicle control commands, and obtain some original vehicle control commands from third-party applications, and pair them in pairs according to the same meaning of the commands to obtain paired data samples. The paired data samples do not need to be converted into vector form according to certain formulas or rules, and can be directly input into the large language model in text form. The large language model can understand the semantics of the paired data samples, and then adjust its own model parameters by itself.
[0037] Step S102, obtaining the target original vehicle control command;
[0038] Step S103, obtaining a format template for representing a target standard vehicle control command;
[0039] Step S104, composing a prompt word according to the target original vehicle control command and the format template;
[0040] Step S105 , inputting the target original vehicle control command and the prompt word into the large language model, and outputting the converted target standard vehicle control command through the large language model.
[0041] Specifically, the large language model can be put into use after pre-training. During use, for any target original vehicle control command issued by a third-party application, according to the semantic understanding ability of the large language model, a format template for representing the target standard vehicle control command is obtained. The format template is used to tell the large language model which format the target original vehicle control command needs to be converted into. The format template only needs to define the standard vehicle control command format, and does not need to specifically limit the parameter values of the vehicle control command. Afterwards, the target original vehicle control command and the format template are used to form a prompt word, which is used to prompt the large language model to convert the target original vehicle control command into the style of the template.
[0042] For example, taking the vehicle control command in JSON format as an example, the prompt word may be: "Convert the following original JSON data into standard semantic JSON: standard semantic template: ${standard semantic template}, original semantic data ${original semantic}".
[0043] Among them, ${standard semantic template} is replaced with the user-defined standard template, and ${original semantics} is replaced with a specific third-party original vehicle control command.
[0044] Finally, the target original vehicle control command and prompt words are input into the large language model at the same time. The target original vehicle control command is used as the data to be converted, and the prompt words are used as instructions to allow the large language model to understand the task it is to perform, thereby using the trained model's ability to understand the semantics of vehicle control commands and templates to output the converted target standard vehicle control commands.
[0045] Through the technical solution provided by the embodiment of the present invention, based on the ability of the large language model to directly understand the meaning of the text, the original vehicle control command and the standard vehicle control command are directly paired to generate text-style training samples, and then the text data and the prompt words are simultaneously input into the large language model for training. The text data is the data that needs to be converted, and the large language model can directly understand its meaning without the need for vector conversion. The prompt words directly inform the large language model of the training tasks that need to be performed. After the large language model understands the meaning of the prompt words, it can make the large model automatically select the appropriate parameter adjustment method, and there is no need for vector conversion. Through the above training method, the threshold of model training is lowered, and the training efficiency and training accuracy are improved. In subsequent applications, it is only necessary to input the target original vehicle control command and the prompt words composed of the format template into the large language model at the same time to complete the standard conversion of the target original vehicle control command. The large language model has a complex structure and more accurate training, taking into account the high accuracy and high automation of vehicle-mounted semantic standardization.
[0046] In some optional embodiments, Figure 2 As shown, the steps for training a large language model include:
[0047] Step a1, defining standard vehicle control commands corresponding to various vehicle control semantics;
[0048] Specifically, before model training, sufficient training sample data needs to be prepared, where the data used as training sample labels are standard vehicle control commands, that is, the standard data format that users want. Vehicle control semantics refers to the meaning of commands that perform different functions, where different vehicle control semantics may correspond to different standard formats. For example, the standard formats corresponding to window control commands, throttle control commands, and wiper control commands may be different, so it is necessary to define standard vehicle control commands for various vehicle control semantics.
[0049] For example, the semantics of a vehicle control command to open a car window is standardized into the following JSON format:
[0050] {
[0051] "Domain":"intelligent_car_control",
[0052] "Intent":"car_window_control",
[0053] "Query":"Open the car window",
[0054] "Slots":[
[0055] {
[0056] "name":"Car window"
[0057] }
[0058] ],
[0059] "Command":{
[0060] "Name":"Command: / / Tinnove.Device.Open",
[0061] "Param":{
[0062] "Name":"Car Window"
[0063] }
[0064] }
[0065] }
[0066] In the above standard semantic JSON data, the definitions of each field are as follows:
[0067] Domain-domain identifier;
[0068] Intent-intent identifier;
[0069] Query-user input data;
[0070] Slots-semantic slots;
[0071] Command-command object;
[0072] Command.Name – command name;
[0073] Command.Param - command parameters;
[0074] The present invention is only taken as an example and is not limited thereto.
[0075] Step a2, obtaining the original vehicle control commands representing the semantics of each vehicle control.
[0076] Specifically, after defining the standard vehicle control commands, it is also necessary to obtain the corresponding original vehicle control commands from the third-party application for each vehicle control semantic, that is, the data format before conversion.
[0077] For example:
[0078] {
[0079] "slots":{
[0080] "name":"window"
[0081] }
[0082] "service":"carControl",
[0083] "text":"Open the car window",
[0084] "operation":"OPEN"
[0085] }
[0086] The fields of the original semantics are explained as follows:
[0087] slots: semantic slots;
[0088] service: business identifier;
[0089] text: user input;
[0090] operation: semantic business operation identifier.
[0091] Step a3, pairing the original vehicle control commands with the standard vehicle control commands one by one according to the same vehicle control semantics, to obtain paired data samples representing multiple vehicle control semantics.
[0092] Specifically, the original vehicle control commands and standard vehicle control commands of the same vehicle control semantics are then paired one by one to generate paired data samples. It should be noted that if a third-party application has only one original vehicle control command for a vehicle control semantics, then only one paired data sample is generated for the vehicle control semantics; if multiple third-party applications have different original vehicle control commands for the vehicle control semantics, then multiple paired data samples can be generated for the vehicle control semantics.
[0093] In addition, this embodiment cleans and organizes the collected data to ensure that the data quality meets the requirements.
[0094] Step a4: Obtain the basic version of the large language model.
[0095] Step a5: configure the training parameters of the basic version of the large language model.
[0096] Step a6: input the paired data samples into the basic version of the large language model for training to obtain a trained large language model.
[0097] Specifically, after the training data is accurately completed, the embodiment of the present invention first obtains the basic version of the large language model before training, and prepares the required hardware resources and software environment, such as the basic version of GPT-4, qwen-72b-chat, etc. Then configure the training parameters of the basic version of the large language model. The training parameters are crucial for the training of the model. Good training parameters can significantly improve the model training efficiency and training accuracy. The configured training parameters include but are not limited to the learning rate, batch size, number of training rounds, etc.
[0098] Finally, the large language model is fine-tuned using the organized annotated data, and the model performance is evaluated using an independent validation data set. Necessary parameter adjustments or retraining are performed based on the results. When the training is completed, the fine-tuned large language model can be deployed in the production environment for actual semantic standardization tasks. In addition to adjusting the model parameters during the initial training process, the embodiment of the present invention can also regularly collect new data and user feedback, continuously improve and update the large language model, and ensure the reliability of the large language model.
[0099] According to the above-mentioned technical means, the present invention generates text-style training samples by pairing original vehicle control commands with standard vehicle control commands, adjusts training parameters, and directly trains a large language model based on text data without the need to perform vector conversion on the data, thereby significantly reducing the training difficulty of the standard semantic conversion model and improving training efficiency.
[0100] In some optional implementations, the above step a5 includes:
[0101] Step a51, adjust the randomness parameter, kernel sampling parameter, topic freshness parameter and frequency penalty parameter of the large language model, wherein the randomness parameter is used to define the randomness of the model output result, the kernel sampling parameter is used to define the range of the model output result, the topic freshness parameter is used to define the degree of diversion of the model output result, and the frequency penalty parameter is used to define the word repetition of the model output result.
[0102] Specifically, some large language models provide parameter adjustment functions, but the application and method of parameter adjustment are not widely used. Adjusting different parameters for different training tasks can actually significantly improve the performance of the model. In the embodiment of the present invention, the adjusted parameters include but are not limited to randomness parameters, kernel sampling parameters, topic freshness parameters, and frequency penalty parameters.
[0103] The adjustable range of the randomness parameter is 0 to 1. The larger the value, the more random the output, and the smaller the value, the more consistent the output.
[0104] The adjustable range of the kernel sampling parameter is 0 to 1, which is used to limit the range of the output results. For example, if it is set to 0.1, the top 10% most likely model output results are considered.
[0105] Among them, the adjustable range of the topic freshness parameter is -2 to 2. The higher the value, the more likely the replies output by the model can be shifted to other topics.
[0106] The adjustable range of the frequency penalty parameter is -2 to 2, which affects the degree of repeated appearance of words in the output results. The larger the value, the rarer and more biased the words used; the smaller the value, the greater the probability of repeated words. If it is set to the lowest value, the same word or character will be repeated all the time.
[0107] Based on this, considering that the embodiment of the present invention needs to achieve the task of vehicle control command standardization, it is hoped that the final output result is unique and stable, so the randomness parameter should be as small as possible, and the core sampling parameter should be small. The topic freshness parameter also needs to be small. If the training task is a storytelling, brainstorming or other tasks, stronger divergent thinking is required, and semantic standardization obviously hopes that the output will remain the same. The frequency penalty parameter needs to be moderate. The two extreme cases of too many and too few repeated words in the standardized vehicle control commands will affect the accuracy of the standard semantics.
[0108] Therefore, in an optional embodiment, the optimal parameter adjustment range determined by the present invention is as follows:
[0109] Adjust the randomness parameter to less than 0.5;
[0110] Adjust the kernel sampling parameter to less than 0.5;
[0111] Adjust the topic freshness parameter to less than -1;
[0112] Adjust the frequency penalty parameter in the interval [-2, 2].
[0113] Based on this, through the technical solution provided by the embodiment of the present invention, by adjusting the randomness parameters, kernel sampling parameters, topic freshness parameters and frequency penalty parameters of the large language model, the stability and low randomness of the output results of the large language model are controlled, and the model output results are further ensured to be standard data semantics, so as to significantly improve the accuracy of vehicle-mounted semantic standardization.
[0114] In some optional implementations, the above step a6 includes:
[0115] Step b1, mounting a parameter model on the large language model, where the parameter model is used to couple with the parameters in the large language model;
[0116] Step b2, inputting the original vehicle control command in the paired data sample into the large language model of the basic version, and outputting the predicted vehicle control command;
[0117] Step b3, adjusting the parameter model according to the field error between the predicted vehicle control command and the standard vehicle control command;
[0118] Step b4, using the large language model after the parameter model is adjusted as the trained large language model.
[0119] Specifically, when training a large language model, the training can be completed by adjusting the model parameters through the preset model input data set and output data set. The related technology adopts more training methods to adjust the full parameters of the model, but because the large language model is large in size and has a large number of parameters, the training efficiency is extremely low. Based on this, when training a large language model, an embodiment of the present invention mounts a parameter model for the large language model. The parameter model can be coupled with the parameters in the large language model, such as addition, subtraction, multiplication, division and other calculations, thereby affecting the result output of the large language model. The parameter model mounted in the embodiment of the present invention is relatively small, and can be regarded as adding a low-rank matrix to the existing weight matrix of the large language model.
[0120] During training, the embodiment of the present invention outputs a predicted vehicle control command by the large language model, and then compares the predicted vehicle control command with the standard vehicle control command. If the fields are exactly the same, it indicates that the training is successful. If a field error occurs, the mounted parameter model needs to be adjusted until the predicted vehicle control command output by the large language model is completely consistent with the standard vehicle control command.
[0121] Through the technical solution provided by the embodiment of the present invention, the small parameter model and the large language model are coupled, and the parameters of the small parameter model are adjusted according to the output results of the training instead of adjusting all the parameters of the large language model. By adding a low-rank matrix to the existing weight matrix of the large language model, the model can be effectively adjusted with a small increase in computational burden, thereby significantly improving training efficiency.
[0122] In some optional embodiments, Figure 3 As shown, the above step b3 includes:
[0123] Step c1, adding a correction word to the prompt word according to the field error;
[0124] Step c2, re-inputting the basic version of the large language model with the prompt words added with the correction words for training to adjust the parameter model.
[0125] Specifically, the embodiment of the present invention fine-tunes the model based on the training prompt words during the training process and the subsequent model update process. For example, during a training process, the user finds through comparison that the predicted vehicle control command output by the large language model has one more field than the standard vehicle control command. At this time, the user can enter the correction word "Please do not add xxx field" in the prompt word, and then re-enter the modified prompt word and the original vehicle control command into the large language model for training, and the model parameters can be fine-tuned.
[0126] The present invention obtains the field error between the predicted vehicle control commands and the standard vehicle control commands output by the model, and adjusts the large language model based on the field error. When adjusting, there is no need to configure the adjustment rules of the vector parameters, and there is no need to calculate the convergence indicators of traditional model training such as the loss function when adjusting the parameters. With the help of the large language model's ability to understand semantics, the large language model can be directly informed through semantics to modify the preset fields during the next training, which further reduces the training threshold of the model and improves the automation capability of vehicle-mounted semantic standardization.
[0127] In some optional implementations, the above step c1 includes:
[0128] Step d1, when the field error includes a redundant field, adding a correction word indicating removal of the redundant field to the prompt word;
[0129] Step d2, when the field error includes a missing field, adding a correction word indicating the addition of the missing field to the prompt word;
[0130] Step d3: When the field error includes an incorrect field format, a correction word is added to the prompt word to replace the incorrect field format with a correct field format.
[0131] Specifically, the embodiments of the present invention mainly include three situations for adding correction words. First, when the compared field error indicates that the predicted vehicle control command has extra fields compared to the standard vehicle control command, the present embodiment adds correction words indicating the removal of extra fields in the prompt words, such as "Please do not add xxx field"; second, when the compared field error indicates that the predicted vehicle control command lacks certain fields in the standard vehicle control command, the present embodiment adds correction words indicating the addition of missing fields in the prompt words, such as "Please add xxx field"; third, when the compared field error indicates that certain fields in the predicted vehicle control command and the standard vehicle control command have the same position but inconsistent forms, the present embodiment adds correction words to the prompt words to replace the incorrect field format with the correct field format, such as "Please replace xxx field with XXX field".
[0132] Based on the technical solution provided in the embodiment of the present invention, training fine-tuning solutions are provided for the three situations of missing fields, redundant fields and field errors. Retraining is performed by adding, deleting and replacing corresponding correction words, and the parameters of the parameter model are adjusted. With the help of the ability of the large language model to understand semantics, the large language model is directly informed through semantics to modify the preset fields during the next training, which further lowers the training threshold of the model and improves the automation capability of vehicle-mounted semantic standardization.
[0133] In this embodiment, a vehicle-mounted semantic standardization device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and will not be repeated here. As used below, the term "module" can be a combination of software and / or hardware that implements 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.
[0134] This embodiment provides a vehicle-mounted semantic standardization device, such as Figure 4 As shown, including:
[0135] A large language model acquisition module 401 is used to acquire a pre-trained large language model, where the large language model is pre-trained through a variety of different paired data samples, where the paired data samples include original vehicle control commands and standard vehicle control commands, where the original vehicle control commands are acquired from a third-party application;
[0136] The to-be-converted command acquisition module 402 is used to acquire the target original vehicle control command;
[0137] The standard template acquisition module 403 is used to acquire a format template for representing a target standard vehicle control command;
[0138] A prompt word generating module 404, used to compose prompt words according to the target original vehicle control command and the format template;
[0139] The conversion module 405 is used to input the target original vehicle control command and the prompt word into the large language model, and output the converted target standard vehicle control command through the large language model.
[0140] In some optional implementations, a large language model training module is also included, specifically including:
[0141] Standard command definition unit, used to define standard vehicle control commands corresponding to various vehicle control semantics;
[0142] An original command acquisition unit, used to acquire original vehicle control commands representing various vehicle control semantics;
[0143] A pairing unit, used for pairing the original vehicle control command with the standard vehicle control command one by one according to the same vehicle control semantics, to obtain paired data samples representing multiple vehicle control semantics;
[0144] A basic model acquisition unit, used to acquire a basic version of a large language model;
[0145] The training parameter configuration unit is used to configure the training parameters of the basic version of the large language model;
[0146] The training unit is used to input the paired data samples into the basic version of the large language model for training to obtain a trained large language model.
[0147] In some optional implementations, the training parameter configuration unit includes:
[0148] The configuration subunit is used to adjust the randomness parameter, kernel sampling parameter, topic freshness parameter and frequency penalty parameter of the large language model. The randomness parameter is used to define the randomness of the model output results, the kernel sampling parameter is used to define the range of the model output results, the topic freshness parameter is used to define the degree of diversion of the model output results, and the frequency penalty parameter is used to define the word repetition of the model output results. The randomness parameter is adjusted to be less than 0.5; the kernel sampling parameter is adjusted to be less than 0.5; the topic freshness parameter is adjusted to be less than -1; and the frequency penalty parameter is adjusted to be in the interval [-2, 2].
[0149] In some optional implementations, the training unit includes:
[0150] A parameter model mounting unit is used to mount a parameter model for a large language model, and the parameter model is used to couple with parameters in the large language model;
[0151] A data input unit, used for inputting the original vehicle control command in the paired data sample into the large language model of the basic version, and outputting the predicted vehicle control command;
[0152] A parameter model adjustment unit, used for adjusting the parameter model according to a field error between the predicted vehicle control command and the standard vehicle control command;
[0153] The model output unit is used to use the large language model after the parameter model is adjusted as the trained large language model.
[0154] In some optional implementations, the parameter model adjustment unit includes:
[0155] A correction word adding unit, used for adding a correction word to the prompt word according to a field error;
[0156] The retraining unit is used to re-input the basic version of the large language model with the prompt words added with the correction words for training, so as to adjust the parameter model.
[0157] In some optional implementations, the correction word adding unit includes:
[0158] A redundant field adding unit, used for adding a correction word indicating removal of redundant fields to the prompt word when the field error includes redundant fields;
[0159] A missing field adding unit, used for adding a correction word indicating adding a missing field to the prompt word when the field error includes a missing field;
[0160] The error field replacement unit is used to add a correction word to replace the incorrect field format with a correct field format in the prompt word when the field error includes an incorrect field format.
[0161] 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.
[0162] The in-vehicle semantic standardization device in this embodiment 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 functions.
[0163] The embodiment of the present invention also provides a computer device having the above Figure 4 The in-vehicle semantic standardization device shown.
[0164] See also Figure 5 , Figure 5 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 5 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. 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 the instructions executed in the computer device, including instructions stored in or on the memory to display the 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 computer devices 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 5 A processor 10 is taken as an example.
[0165] 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.
[0166] 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.
[0167] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, 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 computer device 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.
[0168] 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.
[0169] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0170] The present invention also provides a vehicle, which includes the computer device of the above-mentioned embodiment, for example, the vehicle's on-board computer includes the processor and memory of the above-mentioned computer device, which correspond to the vehicle controller and the vehicle memory respectively, so that the method provided by the above-mentioned method embodiment can be executed on the vehicle.
[0171] 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.
[0172] 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.
[0173] 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 vehicle-mounted semantic standardization method, characterized in that: The method comprises: Obtaining a pre-trained large language model, where the large language model is pre-trained through a plurality of different paired data samples, where the paired data samples include original vehicle control commands and standard vehicle control commands, where the original vehicle control commands are obtained from a third-party application; Get the target original vehicle control command; Obtain a format template for representing a target standard vehicle control command; composing a prompt word according to the target original vehicle control command and the format template; The target original vehicle control command and the prompt word are input into the large language model, and the converted target standard vehicle control command is output through the large language model.
2. The method according to claim 1, characterized in that The step of training the large language model comprises: Define standard vehicle control commands corresponding to various vehicle control semantics; Obtaining original vehicle control commands representing the semantics of each vehicle control; Pairing the original vehicle control commands with the standard vehicle control commands one by one according to the same vehicle control semantics to obtain the paired data samples representing multiple vehicle control semantics; Get the basic version of the large language model; Configuring training parameters of the large language model of the basic version; The paired data samples are input into the large language model of the basic version for training to obtain a trained large language model.
3. The method according to claim 2, characterized in that The configuring the training parameters of the large language model of the basic version includes: Adjust the randomness parameter, kernel sampling parameter, topic freshness parameter and frequency penalty parameter of the large language model, wherein the randomness parameter is used to define the randomness of the model output result, the kernel sampling parameter is used to define the range of the model output result, the topic freshness parameter is used to define the degree of diversion of the model output result, and the frequency penalty parameter is used to define the word repetition of the model output result.
4. The method according to claim 3, characterized in that The step of adjusting the randomness parameter, kernel sampling parameter, topic freshness parameter and frequency penalty parameter of the large language model includes: Adjust the randomness parameter to less than 0.5; Adjust the nuclear sampling parameter to less than 0.5; Adjust the topic freshness parameter to be less than -1; The frequency penalty parameter is adjusted within the interval [-2, 2].
5. The method according to claim 2, characterized in that: The step of inputting the paired data samples into the large language model of the basic version for training comprises: Mounting a parameter model on the large language model, wherein the parameter model is used to couple with parameters in the large language model; Inputting the original vehicle control command in the paired data sample into the large language model of the basic version, and outputting a predicted vehicle control command; adjusting the parameter model according to a field error between the predicted vehicle control command and the standard vehicle control command; The large language model after the parameter model is adjusted is used as the trained large language model.
6. The method according to claim 5, characterized in that The adjusting the parameter model according to the field error between the predicted vehicle control command and the standard vehicle control command includes: Adding a correction word to the prompt word according to the field error; The prompt words with the correction words added are re-inputted into the large language model of the basic version for training, so as to adjust the parameter model.
7. The method according to claim 6, characterized in that The adding a correction word to the prompt word according to the field error comprises: When the field error includes a redundant field, adding a correction word indicating removal of the redundant field to the prompt word; When the field error includes a missing field, adding a correction word indicating the addition of the missing field to the prompt word; When the field error includes an incorrect field format, a correction word is added to the prompt word to replace the incorrect field format with a correct field format.
8. A vehicle-mounted semantic standardization device, characterized in that: The device comprises: A large language model acquisition module, used to acquire a pre-trained large language model, wherein the large language model is pre-trained through a plurality of different paired data samples, wherein the paired data samples include original vehicle control commands and standard vehicle control commands, wherein the original vehicle control commands are acquired from a third-party application; The module for obtaining commands to be converted is used to obtain the target original vehicle control commands; A standard template acquisition module, used to acquire a format template for representing a target standard vehicle control command; A prompt word generating module, used for forming a prompt word according to the target original vehicle control command and the format template; The conversion module is used to input the target original vehicle control command and the prompt word into the large language model, and output the converted target standard vehicle control command through the large language model.
9. A computer device, 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 7 by executing the computer instructions.
10. 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 7.
11. A vehicle, characterized in that: The vehicle comprises the computer device provided in claim 9.
Citation Information
Cited By
Standard draft auditing and correcting method and device, electronic equipment and storage medium
CN121257491A
Data generation method and device, electronic equipment and storage medium
CN121935261A