Data processing method and device, computer equipment, storage medium and program product

By obtaining user question requests in edge devices, generating input data, and calling the method of real-time data verification language model output results, the intelligent attenuation problem caused by LLM training data hysteresis is solved, and the user experience is improved.

CN119831034APending Publication Date: 2025-04-15BEIJING VOLCANO ENGINE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411846170.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

Due to the hysteresis of the training data of the Large Language Model (LLM), the model update frequency is lower than the knowledge update frequency, resulting in the intelligence of the interactive agent being attenuated to a certain extent, requiring manual verification of the output results to reduce the user experience.

Method used

In an edge device, by obtaining the user's question request, generating input data, and inputting it into the language model, calling real-time data associated with the question request, verifying the output results of the language model, and finally displaying the verification output results to the user.

Benefits of technology

It improves the confidence of the output results, enhances the intelligence of the interactive agent, and thus improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119831034A_ABST
    Figure CN119831034A_ABST
Patent Text Reader

Abstract

The invention discloses a data processing method and device, computer equipment, a storage medium and a program product, and relates to the field of a data processing technology, a text generation technology, a large model technology and a large language model.The data processing method is applied to an edge device and comprises the steps that a question request of a target object is obtained, generating input data based on the question request; inputting the input data into a language model, and calling real-time data associated with the question request according to the language model; and verifying an output result of the language model based on the real-time data, and displaying the verified output result to the target object. According to the invention, the confidence of the output result is increased, the intelligent degree of the interaction agent is improved, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the fields of data processing technology, text generation technology, large model technology, and large language model technology, and specifically to data processing methods, devices, computer equipment, storage media, and program products. Background Art

[0002] With the development of Large Language Model (LLM) technology, more and more interactive agents are deployed on edge devices to give edge devices higher intelligence and improve the user experience of edge scenarios. Figure 1 The figure shows a schematic diagram of deploying an interactive agent to an edge terminal, where the interactive agent can be deployed to edge devices such as in-vehicle smart cockpits, smart speakers, mobile phones, wearable mobile smart devices, and home robots. Through human-computer interaction with the interactive agent in the edge device, the convenience of people's daily life is greatly improved. However, this also places high demands on the interactive agent's scene understanding ability, knowledge accuracy, and real-time processing of scene changes.

[0003] However, since the LLM training data itself has a certain hysteresis, the model update frequency is far less than the knowledge update frequency, and manual verification of the output results may be required, which causes the intelligence of the interactive agent to be attenuated to a certain extent, reducing the user experience. Summary of the invention

[0004] In view of this, the present disclosure provides a data processing method, apparatus, computer device, storage medium and program product to solve the problem that the output results of the interactive agent need to be manually verified, resulting in the intelligence of the interactive agent being attenuated to a certain extent.

[0005] In a first aspect, the present disclosure provides a data processing method, applied to an edge device, the method comprising:

[0006] Obtaining a question request from a target object, and generating input data based on the question request;

[0007] Inputting the input data into a language model, and calling real-time data associated with the question request according to the language model;

[0008] The output result of the language model is verified based on the real-time data, and the verified output result is displayed to the target object.

[0009] In a second aspect, the present disclosure provides a data processing device, the device comprising:

[0010] A generating module, configured to generate input data based on a question request from a target object after detecting the question request;

[0011] An input module, configured to input the input data into a language model and call real-time data associated with the data request according to the language model;

[0012] A verification module is used to verify the output result of the language model based on the real-time data, and present the verified output result to the target object.

[0013] In a third aspect, the present disclosure provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the data processing method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0014] In a fourth aspect, the present disclosure provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the data processing method of the first aspect or any corresponding embodiment thereof.

[0015] In a fifth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the data processing method of the first aspect or any corresponding embodiment thereof.

[0016] In the disclosed embodiment, after detecting the question request of the target object, input data is generated based on the question request, and the input data is input into the language model to call the real-time data associated with the data request according to the language model. Then, the output result of the language model is verified based on the real-time data, and the verified output result is displayed to the target object, thereby increasing the confidence of the output result, and at the same time improving the intelligence of the interactive agent, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the specific embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0018] Figure 1 is a schematic diagram of deploying the interaction agent into the edge terminal;

[0019] Figure 2 It is a schematic diagram of the business expert system verifying and correcting the output results of the large language model;

[0020] Figure 3 It is a schematic diagram of the interaction between the business expert system and the large language model;

[0021] Figure 4 The business expert system uses parsing tools to make interface judgments and command line tools to obtain information;

[0022] Figure 5 is a flowchart of a data processing method according to an embodiment of the present disclosure;

[0023] Figure 6 It is a schematic diagram of language model acquiring real-time data;

[0024] Figure 7 It is a schematic diagram of constructing corresponding training samples for system tools;

[0025] Figure 8 It is a processing flow diagram of the data backflow system;

[0026] Fig. 9 It is the convergence of fine-tuning the language model based on the edge smart car smart cockpit scenario;

[0027] Fig.10 It is a schematic diagram for generating a list of system tools;

[0028] Fig.11 is a structural block diagram of a data processing device according to an embodiment of the present disclosure;

[0029] Fig.12 It is a schematic diagram of the hardware structure of the computer device of the embodiment of the present disclosure. DETAILED DESCRIPTION

[0030] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.

[0031] In conjunction with the application scenarios on which the execution of the data processing method depends, the application scenarios are described here.

[0032] With the development of LLM technology, more and more interactive agents are deployed to edge devices to give edge devices higher intelligence and improve the user experience of edge scenarios. Figure 1The figure shows a schematic diagram of deploying an interactive agent to an edge terminal, where the interactive agent can be deployed to edge devices such as in-vehicle smart cockpits, smart speakers, mobile phones, wearable mobile smart devices, and home robots. Through human-computer interaction with the interactive agent in the edge device, the convenience of people's daily life is greatly improved. However, this also places high demands on the interactive agent's scene understanding ability, knowledge accuracy, and real-time processing of scene changes.

[0033] However, since the LLM training data itself has a certain hysteresis, the model update frequency is far less than the knowledge update frequency, and manual verification of the output results may be required, which will cause the intelligence of the interactive agent to be attenuated to a certain extent.

[0034] An example of an error due to message delay is shown below:

[0035] User: Please tell me how to get to Huanglong Gymnasium from the Central Library?

[0036] Assistant: Please take bus No. 1024 at the Central Library bus stop and get off at Huanglong Sports Center. The whole journey takes 20 minutes. I wish you a pleasant journey.

[0037] Here, since the current bus number 256 has been changed to bus number 1024, the answer given by the model will be wrong due to the delay of the message, resulting in an incorrect answer from the LLM.

[0038] Specifically, by Figure 1 It can be seen that in the interactive agent, the business expert system can be used to obtain real-time information to verify and correct the output results of the LLM to improve the confidence of the output results. However, processing the output results requires the business expert system to have complete data analysis capabilities, which undoubtedly requires a large number of business logic rules to be written manually. The ability to analyze data directly affects the effect of the interactive agent. If the data analysis capability of the business expert system cannot meet the needs, the intelligence of the interactive agent will be attenuated to a certain extent, and as time goes by, new business logic rules need to be continuously added, which will make the entire system more and more complicated and the maintenance cost will become higher and higher.

[0039] Here, if Figure 2The figure shows a schematic diagram of the business expert system verifying and correcting the output results of the LLM. Considering the lag in knowledge update and the limitation of model parameters, all decisions cannot be made solely by relying on the LLM on the edge device. Therefore, a business expert system can be built as a business support to allow the LLM to interact with the knowledge system. On the one hand, the LLM can control the business data flow and guide the expert knowledge system to make business decisions and actions; on the other hand, the changes in the business scenario are fed back to the LLM in real time, so that the output of the LLM contains business information, thereby creating greater business value.

[0040] For example, after the output of LLM is corrected by the expert knowledge system, the correct real-time information is obtained by calling the system interface, and then fed back to LLM for output. The example is as follows:

[0041] User input: Please tell me how to get from the Central Library to Huanglong Gymnasium?

[0042] LLM output: Please take bus No. 256 at the Central Library bus stop and get off at Huanglong Gymnasium. The whole journey takes 20 minutes. I wish you a pleasant journey.

[0043] #256 has been replaced by 1024, information is delayed, and the answer is wrong.

[0044] Business expert system verification: The check interface is called to detect key information and it is found that 256 times have been replaced with 1024 ways, which is fed back to the LLM.

[0045] LLM output again: Please take bus No. 1024 at the Central Library bus stop and get off at Huanglong Gymnasium. The whole journey takes 20 minutes. I wish you a pleasant journey.

[0046] Specifically, the interaction between the business expert system and LLM is as follows: Figure 3 As shown in the figure, the parsing tool system_parser analyzes and verifies the output of LLM, and gives a judgment on whether information acquisition is needed and which interface to use for acquisition. The command line tool system_getinfo calls the local interface to acquire information based on the information parsed by the parser, and assembles the new output. The specific method of using system_parser to make interface judgments and using system_getinfo to acquire information is as follows: Figure 4 shown.

[0047] Based on this, the embodiment of the present disclosure provides a data processing method, which is applied to an edge device, and specifically includes: after detecting a question request from a target object, generating input data based on the question request, and inputting the input data into a language model, so as to call real-time data associated with the data request according to the language model. Then, the output result of the language model is verified based on the real-time data, and the verified output result is displayed to the target object, thereby increasing the confidence of the output result, while improving the intelligence of the interactive agent, thereby improving the user experience.

[0048] According to an embodiment of the present disclosure, a data processing method embodiment 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.

[0049] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0050] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.

[0051] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0052] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0053] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.

[0054] According to an embodiment of the present disclosure, a data processing method embodiment 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.

[0055] In this embodiment, a data processing method is provided, which can be used in the above-mentioned edge terminals, such as vehicle-mounted smart cockpits, smart speakers, mobile phones, wearable mobile smart devices, and home robots, etc. Figure 5 is a flow chart of a data processing method according to an embodiment of the present disclosure, such as Figure 5 As shown, the process includes the following steps:

[0056] Step S501: obtaining a question request from a target object, and generating input data based on the question request.

[0057] In the disclosed embodiment, the target object may be a user interacting with the edge device, and the user may interact with the interactive agent in the form of asking questions so that the language model in the interactive agent can answer the user's question. Here, the question request may identify user voice data, text data input by the user into the edge device, etc. The type of the question request is not specifically limited here, and is subject to what can be implemented.

[0058] After the edge device obtains the question request, it can generate input data based on the question request, wherein the input data can be data that can be understood by the language model. For example, when the language model is the above-mentioned LLM, the input data can be a prompt header (i.e., the prompt header of the LLM).

[0059] Step S502: input the input data into the language model, and call the real-time data associated with the question request according to the language model.

[0060] In an embodiment of the present disclosure, an interaction tool list may be defined in the input data so that the language model calls real-time data associated with a data request, wherein the interaction tool list includes a data interface that may be used to interact with the system to obtain real-time data.

[0061] For example, when the question request is "What will the weather be like tomorrow?", the language model can determine the system associated with the question request, that is, the weather system, and then interact with the weather system through the data interface to obtain real-time weather data.

[0062] Step S503: verify the output result of the language model based on the real-time data, and display the verified output result to the target object.

[0063] In the embodiment of the present disclosure, the language model may be instructed to directly generate output results based on the acquired real-time data. However, considering that there may be a situation where the edge device cannot interact with the system for data, for example, due to network fluctuations, when the real-time data acquisition time may be delayed, the output results may be first generated based on the language model of the edge device, and the output results of the language model may be verified based on the acquired real-time data. The specific verification example is as follows:

[0064] For example, the user inputs: Please tell me how to get from the Central Library to Huanglong Gymnasium?

[0065] LLM output: Please take bus No. 256 at the Central Library bus stop and get off at Huanglong Gymnasium. The whole journey takes 20 minutes. I wish you a pleasant journey.

[0066] Verification based on real-time information: 256 times have been replaced by 1024, information is delayed, and the answer is wrong.

[0067] Correction is performed based on the verification results: the check interface is called to detect key information and it is found that 256 has been replaced with 1024, which is fed back to the LLM.

[0068] LLM output again: Please take bus No. 1024 at the Central Library bus stop and get off at Huanglong Gymnasium. The whole journey takes 20 minutes. I wish you a pleasant journey.

[0069] It can be seen from the above description that in the embodiment of the present disclosure, after detecting the question request of the target object, input data is generated based on the question request, and the input data is input into the language model to call the real-time data associated with the data request according to the language model. Then, the output result of the language model is verified based on the real-time data, and the verified output result is displayed to the target object, thereby increasing the confidence of the output result, while improving the intelligence of the interactive agent, thereby improving the user experience.

[0070] In some optional implementations, the above step S501, generating input data based on the question request, includes:

[0071] Step S5011, based on the business scenario corresponding to the question request, determine the data interface corresponding to the language model.

[0072] Step S5012: Generate input data according to the data interface and the question request.

[0073] In the embodiments of the present disclosure, taking into account that the edge device may face different business scenarios when in use, for example, business scenario 1 may be for users to ask about the weather, and business scenario 2 may be for users to ask about the distance. Therefore, corresponding data interfaces may be set for different business scenarios to obtain real-time data from the system that matches the business scenario.

[0074] Therefore, when generating the above input data, various data interfaces can be described in the input data so that the language model can determine the business scenario according to the user's question request and obtain real-time data based on the data interface corresponding to the business scenario.

[0075] Specifically, the above step S5012 generates input data according to the data interface and the question request, including:

[0076] Step a1: construct system objects based on the question request.

[0077] Step a2: Generate session content based on the system object and the target object, and generate input data according to the session content.

[0078] In the disclosed embodiment, the system object is the system role. When the dialogue system is started, the system role can be used to provide a list of the above-mentioned interactive tools in JSON format, and use the list as input information of the system to inform the language model of the list of tools that can be used in the current scenario. In the process of training the language model, the system role can construct a scenario dialogue for each function in the list to improve the model's ability to retrieve tool functions according to the scenario. In addition, the target object is the user role.

[0079] After the system object is constructed, the above step a2 can be executed to generate respective conversation contents for the system object and the target object, so as to generate input data of the language model, i.e., the prompt header, according to the conversation contents. The specific process includes the following:

[0080] (1) Based on the system object, generate first session content including interface information of the data interface.

[0081] (2) Based on the target object, generate a second conversation content including a question request.

[0082] (3) Determine input data based on the first conversation content and the second conversation content.

[0083] In the embodiment of the present disclosure, the interface information may be used to indicate description information of the data interface. When generating the first session content, the first session content may be generated based on the prompt information and the description information of the data interface.

[0084] For example, if the user's question content is "What is the sales data of product X on August 1, 2024?", the first conversation content generated based on the data interface involved in the question content and the corresponding interface information is as follows:

[0085]

[0086] It should be understood that the first session content may also include other data interfaces supported by the edge device, which are not shown one by one in the example.

[0087] Based on the above question content "What is the sales data of product X on 2024.08.01", the second session content generated can be: user: What is the sales data of product X on 20240801?

[0088] In the disclosed embodiment, a matching data interface can be determined based on the business scenario corresponding to the request, and input data can be generated according to the data interface and the question request, so that the language model can select the real-time data to be obtained according to the input data, such as Figure 6 The figure shows a schematic diagram of language model obtaining real-time data. Figure 6 It can be seen that the language model does not need to call real-time data through the business expert system, and does not need to write a large number of business rules for the business expert system (these rules are used to parse the output of the model and update the output of the model by calling the data interface to obtain information). This also avoids the need to continuously add new rules as business scenarios continue to develop and change, so as to avoid making the entire system more and more complex and the maintenance cost higher and higher, thereby preventing the intelligent question and answer from gradually degenerating into manual operations.

[0089] In some optional implementations, the above step S503, verifying the output result of the language model based on real-time data, includes:

[0090] Step S5031, construct a tool object and a model object of a language model.

[0091] Step S5032: Based on the model object, the target data interface called by the question request in the data interface is displayed, and based on the tool object, the real-time data called based on the target data interface is displayed.

[0092] Step S5033, when the output result does not match the real-time data, the output result is adjusted based on the real-time data, and the output result is displayed according to the model object.

[0093] In the embodiments of the present disclosure, the tool object is the tool role, which is used to display the return value after the system tool calls the data interface, and the data format is JSON. Additionally, during the training of the language model, it is necessary to construct appropriate inputs and outputs for each tool and include them in the conversation samples of the tool role to enhance the model's ability to reason based on context and tool outputs. Additionally, the model object is the above-mentioned Assistant.

[0094] Here, the target data interface matching the business scenario can be determined through the dialogue system, and the target data interface can be displayed through the Assistant role. Taking the above-mentioned question content "What is the sales data of product X on August 1, 2024" as an example, the conversation content displayed by the Assistant role is as follows:

[0095] Assistant: The interface sales data can be called, {"name":"get_ product X_sales_by_date","params":["20240801"]}.

[0096] Next, the real-time data called by the target data interface can be displayed in JSON format through the above tool role, and the conversation content displayed by the tool role and the Assistant role is as follows:

[0097] tool:{"number":999}.

[0098] Next, the output result can be verified based on the real-time data. If the output result of the language model does not update the sales data corresponding to product X on August 1, 2024, then the output result can be adjusted based on the obtained real-time data. If the output result matches the real-time data, no adjustment is made.

[0099] Here, the adjusted output result can be as follows:

[0100] Assistant: According to the latest news, the sales data of product X on August 1, 2024 is 999.

[0101] In the embodiments of the present disclosure, when the output result of the language model does not match the obtained real-time data, the output result can be corrected based on the real-time data, thereby improving the confidence of the output result and further improving the user experience.

[0102] In some alternative embodiments, the above Figure 5 corresponding embodiments further include:

[0103] Step S504: obtaining a training sample corresponding to the data interface, wherein the training sample is used to instruct the language model to obtain data corresponding to the data interface.

[0104] Step S505: Optimize model parameters of the language model based on the training samples.

[0105] In the embodiment of the present disclosure, considering that different data interfaces may correspond to different business scenarios, corresponding training samples can be constructed for system tools corresponding to each data interface based on the dialogue system, such as Figure 7 It is a schematic diagram of constructing corresponding training samples for system tools, wherein the system tools include: tool-A to tool-X.

[0106] When constructing training samples for the system tool, a target number of positive samples and negative samples may be constructed, for example, 20 positive and negative samples each, wherein the positive samples may be sample data related to the real-time data, and the negative samples may be sample data unrelated to the real-time data.

[0107] Here we take the data interface get_sales for obtaining sales in real time as an example, and the constructed positive samples are as follows:

[0108] #We have developed an interface for obtaining sales in real time, named get_sales. The following is a positive sample user: How does today's transaction volume compare to yesterday?

[0109] Assistant: You can call the interface to get today and yesterday's sales data. The parameters are ["today", "yesterday"]

[0110] tool:{"today":123,"yesterday":100}

[0111] Assistant: There are 23 more orders today than yesterday.

[0112] In addition, the negative samples constructed for the above data interface get_sales are as follows:

[0113] #We have developed an interface for obtaining sales in real time, named get_sales. The following is a negative sample user: Today's transaction volume is not bad, I hope it will be better tomorrow!

[0114] Assistant: Yes, tomorrow will be better.

[0115] In the embodiments of the present disclosure, considering that the business scenarios corresponding to different data interfaces may be different, corresponding training samples can be constructed for the system tools corresponding to each data interface based on the dialogue system, thereby improving the language model's ability to understand vertical scenarios.

[0116] In some optional implementations, the above step S505, optimizing the model parameters of the language model based on the training sample, includes:

[0117] Step S5051: Set a target label for the output result displayed by the model object in the training sample.

[0118] Step S5052: Optimize at least some relevant parameters in the language model according to the training samples and the target labels.

[0119] In the disclosed embodiment, the above-mentioned dialogue system can be used to construct a scenario dialogue for the language model, so as to generate a fine-tuning code according to the scenario dialogue through a fine-tuning script. As can be seen from the above, the scenario dialogue includes tool roles, user, Assistant and system roles, among which the tool role and the system role are objects that are additionally added to the scenario dialogue to facilitate the language model to call the data interface and obtain the real-time data returned by the business expert system. Here, in the fine-tuning code, the output results displayed by the Assistant can be marked by the target label (i.e., the valid token_id) to fine-tune the parameters related to the output results in the language model according to the fine-tuning code.

[0120] It should be understood that invalid tags, i.e. invalid token_id, can be set for the conversation content of other objects in the fine-tuning code. Since the real-time data returned by the tool role is based on the value returned by the business expert system, no language model is required for prediction. Therefore, an invalid tag is also set for the real-time data returned by the tool role. The following is an example of the fine-tuning code:

[0121] #Tokenize the role prefix

[0122] role_ids=tokenizer(role).input_ids

[0123] #Tokenize the conversation sentence content

[0124] sentence_ids=tokenizer(sentence).input_ids

[0125] input_ids=[im_start]+role_ids+nl_tokens+sentence_ids+[im_end]+nl_tokens

[0126] if role=='ai':

[0127] #The role part of the dialogue sentence is invalid, the rest is valid

[0128] target=[im_start]+[IGNORE_TOKEN_ID]*len(role_ids)+\input_ids[role_ids+1:-2]+[im_end]+nl_tokens

[0129] else:

[0130] #Set all dialogue sentences to invalid token_id

[0131] target=[im_start]+[IGNORE_TOKEN_ID]*(len(input_ids)-3)+[im_end]+nl_tokens

[0132] Among them, target is the target sequence, in which im_start and im_end are special markers used to indicate the beginning and end of the input sequence, IGNORE_TOKEN_ID is an invalid tag, (len(input_ids)-3)+[im_end] is the valid part, and nl_tokens is a line break character.

[0133] In the disclosed embodiment, the output results containing prediction content in the fine-tuning code can be marked so that the prediction-related parameters in the language model can be fine-tuned according to the marked results, thereby reducing the computational cost and enabling the language model to better adapt to the data distribution and requirements of specific tasks, thereby improving the performance of the language model on prediction tasks.

[0134] In some optional implementations, the above step S5052, optimizing at least some relevant parameters in the language model according to the training samples and the target label, includes:

[0135] Based on the training samples, adjust the relevant parameters corresponding to the target label in the language model until the output result of the language model meets the confidence condition.

[0136] In the disclosed embodiment, the relevant parameters corresponding to the target label in the language model can be adjusted based on the fine-tuning algorithm until the output result of the language model meets the confidence condition. Here, the fine-tuning algorithm can fully update the input and output layers and randomly update the intermediate processing layers to adjust the relevant parameters.

[0137] Specifically, first, the LORA branch can be constructed for all pre-trained weights of the generative language model, where the downsampling matrix A is initialized with a normal distribution N(0,0.1) and the upsampling matrix B is initialized with 0. Here, the downsampling coefficient depends on the specifications of the selected pre-trained model, and the scaling factor scale = 0.25 is generally considered. Then, the weight parameters of the pre-trained model can be frozen, and only the weights of the LORA branch are updated during training.

[0138] When updating the weights of the LORA branch, the LORA parameters of the Embedding layer can be input and updated during the fine-tuning process, because the parameters of the Embedding layer have a great influence on the effect. At the same time, the LORA parameters of the linear layer that can output the output are always updated during the fine-tuning process, and the parameters of the tail linear layer have a great influence on the effect. Here, since the fine-tuning data uses high-density training data that is highly relevant to the business scenario, a Transformer Block can be randomly selected every 100 steps to update the LORA parameters.

[0139] It should be understood that other fine-tuning algorithms may be used when fine-tuning the language model. The present disclosure does not specifically limit the type of fine-tuning algorithm, which is based on what can be implemented.

[0140] In addition, as the business is constantly adjusted, the update of business data is inevitable from the perspective of time axis. Therefore, the language model in the interactive agent needs to be corrected and updated regularly. Here, the model can be optimized by using new data and bad cases, which is the best choice to improve the model effect.

[0141] Specifically, the language model can be optimized regularly through the data feedback system. When the interactive agent is deployed online, a data feedback system is designed to collect negative feedback from users, re-label the data based on the negative feedback, fine-tune the model, and regularly update the online model to improve the performance and usability of the interactive agent.

[0142] Here, if Figure 8The figure shows a processing flow diagram of the data backflow system, where the dataset is the starting point of the input data and is used to train the model; relabeling is a processing step that can perform some form of conversion or labeling on the data so that the interactive agent can process it; the Finetune step usually refers to further adjustments on the trained model to improve its performance on specific tasks; the interactive agent is responsible for processing data and making decisions; outputs are the results of the interactive agent processing, that is, the output results; Data Center: a center for storing and managing data, involving data processing and analysis.

[0143] In the process of data reflow, starting from the "data set", after the "re-labeling" process, it is sent to the "Finetune" stage. The data processed by "Finetune" enters the "interactive agent", and the interactive agent makes decisions based on this data. The decision results of the interactive agent are divided into two situations: "Good" and "Bad". If it is a "good" situation, it is directly output to the final result. If it is a "bad" situation, it will be sent to the "data center". In the "data center", there are two processing methods according to different situations: "Ignore" or return to the "re-labeling" stage to continue processing.

[0144] For example, if Fig. 9 The figure shows the convergence of fine-tuning the language model based on the edge smart car smart cockpit scenario. In this figure, a dataset containing 14,000 data items is constructed in combination with open source datasets, of which the training set contains 6,000 data items and the test set contains 8,000 data items.

[0145] Specifically, the indicator data of the interaction between the language model and the system before and after the above fine-tuning algorithm is shown in the following table:

[0146]

[0147]

[0148] Among them, P is the number of samples that contain the current user's functional requirements in the functions provided by the system, referred to as positive samples; the number of samples that do not contain the current user's functional requirements in the functions provided by the system, referred to as negative samples; TP (True Positive) is the number of positive samples whose prediction results contain correct function call information; TN (True Negative): the number of negative samples whose prediction results do not contain function call information; FN (False Negative) is the number of positive samples whose prediction results do not contain correct function call information; FP (False Positive) is the number of negative samples whose prediction results contain function call information; N-Recall (Negative Recall) is the negative sample recall rate, calculated as N-Recall = TN / (TN+FP); N-Precision (Negative Precision) is the negative sample precision rate, calculated as N-Precision = TN / (TN+FP); P-Recall (Positive Recall) is the positive sample recall rate, calculated as P-Recall = TP / (TP+FN); P-Precision (Positive Precision) is the positive sample precision, calculated as P-Precision = TP / (TP+FN); Accuracy is the overall accuracy of the test set, calculated as Accuracy = (TP+TN) / (TP+TN+FP+FN). Therefore, according to the above table and Fig. 9 It can be seen that the above fine-tuning algorithm improves the performance of the language model.

[0149] In the disclosed embodiment, the output results containing prediction content in the fine-tuning code can be marked so that the prediction-related parameters in the language model can be fine-tuned according to the marked results, thereby reducing the computational cost and enabling the language model to better adapt to the data distribution and requirements of specific tasks, thereby improving the performance of the language model on prediction tasks.

[0150] In some optional embodiments, the above Figure 5 The corresponding embodiment also includes:

[0151] Step S11, analyzing based on the application scenario of the edge device to obtain a data type that matches the application scenario.

[0152] Step S12: establishing an association relationship between the data interface corresponding to the data type and the language model, so that the language model calls the real-time data associated with the data request based on the data interface.

[0153] In the embodiments of the present disclosure, considering that edge devices are usually designed for specific vertical scenarios, they need to have professional scenario understanding capabilities. Therefore, the system tools that may be involved in the edge devices can be organized into a system tool list through the business expert system and injected into the language model.

[0154] Specifically, Fig.10 The figure shows a schematic diagram of generating a system tool list, in which function abstraction can be used to abstract the core functions corresponding to the business scenario to obtain a data interface.

[0155] In the embodiments of the present disclosure, considering that edge devices are usually designed for specific vertical scenarios, the system tools that may be involved in the edge devices can be organized into a system tool list and injected into the language model to improve the language model's ability to understand vertical scenarios.

[0156] In summary, in the disclosed embodiment, after detecting the question request of the target object, input data is generated based on the question request, and the input data is input into the language model to call the real-time data associated with the data request according to the language model. Then, the output result of the language model is verified based on the real-time data, and the verified output result is displayed to the target object, thereby increasing the confidence of the output result, and at the same time improving the intelligence of the interactive agent, thereby improving the user experience.

[0157] In the present embodiment, a data processing 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 of 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 conceived.

[0158] This embodiment provides a data processing device, such as Fig.11 As shown, including:

[0159] A generating module 1101 is used to generate input data based on the question request after detecting the question request of the target object;

[0160] An input module 1102, for inputting input data into a language model and calling real-time data associated with a data request according to the language model;

[0161] The verification module 1103 is used to verify the output result of the language model based on real-time data, and display the verified output result to the target object.

[0162] In some optional implementations, the generating module 1101 is further configured to:

[0163] Determine the data interface corresponding to the language model based on the business scenario corresponding to the question request;

[0164] Generate input data based on the data interface and question request.

[0165] In some optional implementations, the generating module 1101 is further configured to:

[0166] Based on the question request, build the system object;

[0167] Based on the system object and the target object, the session content is generated, and the input data is generated according to the session content.

[0168] In some optional implementations, the generating module 1101 is further configured to:

[0169] Based on the system object, generating a first session content including interface information of the data interface;

[0170] Based on the target object, generating a second conversation content including a question request;

[0171] Input data is determined based on the first conversation content and the second conversation content.

[0172] In some optional implementations, the verification module 1103 is further configured to:

[0173] Build tool objects and model objects of language models;

[0174] Based on the model object, the target data interface called by the question request in the data interface is displayed, and based on the tool object, the real-time data called based on the target data interface is displayed;

[0175] When the output result does not match the real-time data, the output result is adjusted based on the real-time data and displayed according to the model object.

[0176] In some optional embodiments, the device is also used for:

[0177] Obtaining a training sample corresponding to the data interface, wherein the training sample is used to instruct the language model to obtain data corresponding to the data interface;

[0178] Based on the training samples, the model parameters of the language model are optimized.

[0179] In some optional embodiments, the device is also used for:

[0180] Set the target label for the output displayed by the model object in the training sample;

[0181] At least some relevant parameters in the language model are optimized according to the training samples and the target labels.

[0182] In some optional embodiments, the device is also used for:

[0183] Based on the training samples, adjust the relevant parameters corresponding to the target label in the language model until the output result of the language model meets the confidence condition.

[0184] In some optional embodiments, the device is also used for:

[0185] Analyze the application scenarios of edge devices to obtain data types that match the application scenarios;

[0186] An association relationship between a data interface corresponding to a data type and a language model is established so that the language model calls real-time data associated with a data request based on the data interface.

[0187] 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.

[0188] The data processing 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.

[0189] The present disclosure also provides a computer device having the above Fig.11 The data processing device shown.

[0190] See also Fig.12 , Fig.12 is a schematic diagram of a computer device provided by an optional embodiment of the present disclosure, such as Fig.12 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). Fig.12 A processor 10 is taken as an example.

[0191] 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.

[0192] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0193] 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.

[0194] 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.

[0195] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.

[0196] The embodiments of the present disclosure also provide a computer-readable storage medium. The above-mentioned method according to the embodiments of the present disclosure 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 and downloaded through a network, 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 drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. 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.

[0197] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0198] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.

[0199] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0200] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0201] 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.

[0202] Although the embodiments of the present disclosure 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 disclosure, and such modifications and variations are all within the scope defined by the accompanying description.

Claims

1. A data processing method, characterized in that: Applied to an edge device, the method comprises: Obtaining a question request from a target object, and generating input data based on the question request; Inputting the input data into a language model, and calling real-time data associated with the question request according to the language model; The output result of the language model is verified based on the real-time data, and the verified output result is displayed to the target object.

2. The method according to claim 1, characterized in that The step of generating input data based on the question request includes: Based on the business scenario corresponding to the question request, determine the data interface corresponding to the language model; Input data is generated according to the data interface and the question request.

3. The method according to claim 2, characterized in that The step of generating input data according to the data interface and the question request includes: Based on the question request, construct a system object; Based on the system object and the target object, a session content is generated, and input data is generated according to the session content.

4. The method according to claim 3, characterized in that The generating of the session content based on the system object and the target object, and generating the input data according to the session content, includes: Based on the system object, generating a first session content including interface information of the data interface; Based on the target object, generating a second conversation content including the question request; The input data is determined based on the first conversation content and the second conversation content.

5. The method according to claim 2, characterized in that: The verifying the output result of the language model based on the real-time data includes: Constructing a tool object and a model object of the language model; Based on the model object, display the target data interface called by the question request in the data interface, and based on the tool object, display the real-time data called based on the target data interface; When the output result does not match the real-time data, the output result is adjusted based on the real-time data, and the output result is displayed according to the model object.

6. The method according to claim 2, characterized in that The method further comprises: Acquire a training sample corresponding to the data interface, wherein the training sample is used to instruct the language model to acquire data corresponding to the data interface; Based on the training samples, model parameters of the language model are optimized.

7. The method according to claim 6, characterized in that The optimizing the model parameters of the language model based on the training sample includes: Setting a target label for an output result displayed by a model object in the training sample; At least some relevant parameters in the language model are optimized according to the training sample and the target label.

8. The method according to claim 7, characterized in that Optimizing at least some relevant parameters in the language model according to the training sample and the target label includes: Based on the training sample, relevant parameters corresponding to the target label in the language model are adjusted until an output result of the language model meets a confidence condition.

9. The method according to claim 1, characterized in that: The method further comprises: Analyze the application scenario of the edge device to obtain a data type that matches the application scenario; An association relationship is established between the data interface corresponding to the data type and the language model, so that the language model calls the real-time data associated with the data request based on the data interface.

10. A data processing device, characterized in that: The device comprises: A generating module, configured to generate input data based on a question request from a target object after detecting the question request; An input module, configured to input the input data into a language model and call real-time data associated with the data request according to the language model; A verification module is used to verify the output result of the language model based on the real-time data, and present the verified output result to the target object.

11. 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 data processing method according to any one of claims 1 to 9 by executing the computer instructions.

12. 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 data processing method according to any one of claims 1 to 9.

13. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the data processing method according to any one of claims 1 to 9.