Data processing method, interaction method, medium and equipment
By using functional description tensors instead of natural language text to describe application functions, and adjusting these tensors using large language models, the problem of cumbersome and low accuracy in the existing technology is solved, and more efficient and accurate application is achieved Function description and user request processing.
Patent Information
- Application Number
- CN202310920508.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-25
- Publication Date
- 2025-02-07
AI Technical Summary
In the prior art, natural language text describing application functions requires repeated modification and testing by developers, which is cumbersome and has poor accuracy, affecting the user experience.
Use functional description tensors (such as vectors, matrices, etc.) to describe the functions of the application, rather than using natural language text. The process of describing application functions is simplified and the accuracy of description is improved by adjusting functions based on training samples.
The process of application function description is simplified, the subjectivity of developers is avoided, and the accuracy of function description is improved, thereby improving the accuracy and user experience of LLM's target application recognition in user request processing.
Smart Images

Figure CN119396989A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a data processing method, an interaction method, a medium and a device. Background Art
[0002] A large language model (LLM) refers to a deep learning model trained with a large amount of text data. LLM can generate natural language text or understand the meaning of natural language text and perform related functions. In some LLM-based scenarios, an electronic device can register multiple applications to the LLM so that the LLM can call the applications through the calling interfaces of the multiple applications. After receiving a user request, the LLM client on the electronic device can input the user request and the function description text (i.e., natural language text describing the application functions) of multiple applications (such as plug-ins, etc.) registered with the LLM into the LLM. Then, the LLM performs reasoning based on the data input by the LLM client, determines the application to be called by the user request (hereinafter referred to as the target application), and calls the target application through the calling interface of the target application to implement the relevant functions.
[0003] For example, refer to Figure 1A , LLM has registered schedule plugin 1, recording plugin 2 and hotel plugin 3, which means that LLM can call schedule plugin 1, recording plugin 2 and hotel plugin 3 to implement related functions. Among them, the function description text 11 of schedule plugin 1 is "This plugin allows you to create and set event reminders to ensure that you will not miss important tasks, meetings or activities", the function description text 21 of recording plugin 2 is "This plugin allows you to collect the sound of the audio input device and obtain an audio file", and the function description text 31 of hotel plugin 3 is "This plugin allows you to book a hotel".
[0004] refer to Figure 1B , an LLM client (an application that can call LLM) is running in the electronic device, and an interface U1 of the LLM client is displayed. The user can enter a user request in the interface U1. For example, the user can enter a user request "I have a meeting at 4 o'clock tomorrow, please remind me." Figure 1AAs shown, after receiving the user request "I have a meeting at 4 o'clock tomorrow, please remind me", the LLM client can combine the user request, function description text 11, function description text 21, and function description text 31, and input them into LLM. LLM performs reasoning based on the data input by the LLM client, determines that the target application is schedule plug-in 1, and calls schedule plug-in 1 based on the calling interface of schedule plug-in 1 and establishes a reminder event at 4 o'clock tomorrow, and then sends the reasoning result "A reminder event at 4 o'clock tomorrow has been set for you" to the LLM client. After receiving the reasoning result, the LLM client can display the reasoning result.
[0005] However, in general, the natural language text describing the functions of the application is obtained through repeated manual modification and testing by developers, and the determination process is cumbersome. In addition, due to different language habits of different people, the way the function description text set by the developer describes the application function through natural language is usually different from the way the user describes the application function through natural language in the user request, resulting in poor accuracy of the target application determined by LLM, affecting the user experience. Summary of the invention
[0006] In view of this, the present application provides a data processing method, an interaction method, a medium and a device.
[0007] In a first aspect, the present application provides a data processing method for an electronic device, the method comprising: obtaining a first tensor and multiple training samples, wherein the first tensor indicates that a first application has a first function, and the training samples include text indicating a user request, and a label indicating whether the user request is used to call the first application; inputting the first tensor and the multiple training samples into a first model, and using the first model to adjust the first tensor to a second tensor based on the multiple training samples, wherein the second tensor indicates that the first application has a second function.
[0008] In an embodiment of the present application, the information used to describe the first application function is represented by a tensor obtained based on a training sample using a first model (such as the LLM described below) (such as the function description tensor described below). Instead of being represented by a function description text that needs to be repeatedly modified manually, the process is simple. In addition, by describing the function of the application through a tensor, it is also possible to avoid the subjectivity of developers describing the application function through natural language, and can provide the model with more accurate information describing the application function than the function description text.
[0009] In a possible implementation of the first aspect above, the first tensor and multiple training samples are input into the first model, and the first tensor is adjusted to the second tensor based on the multiple training samples using the first model, including: splicing the first tensor with the multiple training samples respectively to obtain multiple training data corresponding to the multiple training samples, wherein the training data is used to instruct the first model to adjust the first tensor based on the training samples in the training data; inputting the multiple training data into the first model; and adjusting the first tensor to the second tensor based on the input multiple training data using the first model.
[0010] In a possible implementation of the first aspect, the first model is a large language model.
[0011] In a possible implementation of the first aspect, the second function is at least partially different from the first function.
[0012] That is, when the first tensor and the second tensor are used to describe the function of the application, different tensors may indicate that the application has different functions.
[0013] In a possible implementation of the first aspect, the obtaining of the first tensor and multiple training samples includes: inputting the natural language text corresponding to the first function into the first model, and using the first model to infer the natural language text to obtain the first tensor.
[0014] In a possible implementation of the first aspect above, the method further includes: inputting the second tensor and the first user request into the first model to obtain a first inference result of the first model for the first user request, the first inference result indicating whether the first model calls or does not call the first application; when the user confirms that the first inference result is wrong, inputting the second tensor, the first user request, and the second inference result opposite to the first inference result into the first model, and using the first model to adjust the second tensor to a third tensor, wherein the third tensor indicates that the first application has a third function.
[0015] That is to say, when the electronic device infers the first user request based on the second tensor in the first model, if the first inference result obtained is wrong (indicating that the second tensor does not accurately describe the function of the first application), the second tensor can be adjusted based on the first user request and the correct inference result corresponding to the first user request (the inference result opposite to the first inference result) to obtain a third tensor. This is conducive to improving the accuracy of the third tensor in describing the function of the first application.
[0016] In a second aspect, an embodiment of the present application provides an interaction method, applied to an electronic device, the method comprising: receiving a second user request; inputting the second user request and multiple second tensors of multiple applications into a first model, wherein the multiple applications are applications that can be called by the first model, and the second tensors are used to describe the functions of the corresponding applications; using the first model, based on the second user request and the multiple second tensors, calling the second application corresponding to the second user request in the multiple applications to execute the function corresponding to the second user request.
[0017] In this method, the information describing the application function is the corresponding second tensor (such as the function description tensor mentioned below). Compared with the method of expressing the application function through function description text, it can more accurately represent the application function, which is conducive to improving the accuracy of the target application inferred by the first model.
[0018] Moreover, since the data volume of the tensor is much smaller than the data volume of the function description text expressed in natural language, and the first model has a limit on the data volume of the input data, compared with the method of describing the functions of the application through function description text, this method can increase the number of applications that can be called by the first model, thereby increasing the application scope of the first model.
[0019] In a possible implementation of the second aspect, the first model is used to call the second application corresponding to the second user request in multiple applications based on the second user request and multiple second tensors to execute the function corresponding to the second user request, including: splicing the second user request with the multiple tensors respectively to obtain multiple query requests corresponding to the multiple tensors, the query request is used to indicate the first model to determine whether the second user request is used to call the application corresponding to the tensor based on the second user request and the tensor in the query request; inputting the multiple query requests into the first model, and using the first model to determine the second application to be called by the second user request based on the multiple query requests; and using the first model to call the second application to execute the function corresponding to the second user request.
[0020] In a possible implementation of the second aspect, the method of using the first model to call a second application corresponding to a second user request in multiple applications based on a second user request and multiple second tensors to execute a function corresponding to the second user request includes: concatenating the second user request with multiple tensors to obtain a first query request corresponding to the multiple tensors, the first query request being used to indicate that the first model determines whether the second user request is used to call an application in multiple applications based on the second user request and multiple tensors; inputting the first query request into the first model, and using the first model to determine the second application to be called by the second user request based on the first query request; and using the first model to call the second application to execute the function corresponding to the second user request.
[0021] In a possible implementation of the second aspect above, the method also includes: when the user determines that the second application is not the application to be called by the second user request, using the first model based on the second user request and the second user request not to call the second application, adjusting the fifth tensor corresponding to the second application in the multiple tensors to the sixth tensor.
[0022] That is to say, when the electronic device infers the second user request based on the fifth tensor in the first model, if the inference result obtained is wrong (indicating that the fifth tensor does not accurately describe the function of the second application), the fifth tensor can be adjusted based on the second user request and the correct inference result corresponding to the second user request to obtain the sixth tensor. This is conducive to improving the accuracy of the sixth tensor describing the function of the second application, thereby improving the accuracy of the electronic device's inference of the user request after the second user request.
[0023] In a possible implementation of the second aspect, the first model is a large language model.
[0024] In a third aspect, the present application provides a readable storage medium, which includes instructions. When the instructions are executed by an electronic device, the electronic device implements the above-mentioned first aspect and any possible implementation of the above-mentioned first aspect, and / or the above-mentioned second aspect and any method provided by any possible implementation of the above-mentioned second aspect.
[0025] In a fourth aspect, the present application provides a device, which electronic device includes: a memory for storing instructions; a processor for executing instructions to enable the electronic device to implement the above-mentioned first aspect and any possible implementation of the above-mentioned first aspect, and / or the above-mentioned second aspect and any method provided by any possible implementation of the above-mentioned second aspect.
[0026] In a fifth aspect, the present application provides a program product, which, when running on an electronic device, enables the electronic device to implement the above-mentioned first aspect and any possible implementation of the above-mentioned first aspect, and / or any method provided by the above-mentioned second aspect and any possible implementation of the above-mentioned second aspect.
[0027] It should be understood that the beneficial effects of the third to fifth aspects can be referred to the description of the first and second aspects, and will not be elaborated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1A According to some embodiments of the present application, a process schematic diagram of an interaction method is shown;
[0029] Figure 1B According to some embodiments of the present application, a schematic diagram of an interface U1 of an LLM client is shown;
[0030] Figure 2A According to some embodiments of the present application, a schematic diagram of a process for a developer to determine a functional description text of an application is shown;
[0031] Figure 2B According to some embodiments of the present application, a schematic diagram of a process for a developer to determine a function description text 11 is shown;
[0032] Figure 3 According to some embodiments of the present application, a schematic diagram of a process of determining a function description tensor of a schedule plug-in 1 is shown;
[0033] Figure 4A According to some embodiments of the present application, a schematic diagram of concatenating training samples and function description tensors is shown;
[0034] Figure 4B According to some embodiments of the present application, another schematic diagram of concatenating training samples and function description tensors is shown;
[0035] Figure 4C According to some embodiments of the present application, a schematic diagram of extracting features from training data is shown;
[0036] Figure 5A According to some embodiments of the present application, a schematic diagram of an interface U2 of an LLM client is shown;
[0037] Figure 5B According to some embodiments of the present application, a schematic diagram of an interface U3 of an LLM client is shown;
[0038] Figure 6 According to some embodiments of the present application, a flow chart of a data processing method is shown;
[0039] Figure 7 According to some embodiments of the present application, another schematic diagram of a process of determining a function description tensor of a schedule plug-in 1 is shown;
[0040] Figure 8 According to some embodiments of the present application, a flow chart of an interaction method is shown;
[0041] Fig. 9A According to some embodiments of the present application, a schematic diagram of concatenating a user request and a function description tensor is shown;
[0042] Fig. 9B According to some embodiments of the present application, another schematic diagram of concatenating a user request and a function description tensor is shown;
[0043] Fig.10According to some embodiments of the present application, a schematic structural diagram of an electronic device 100 is shown. DETAILED DESCRIPTION
[0044] Illustrative embodiments of the present application include, but are not limited to, data processing methods, interactive methods, media, and devices.
[0045] It should be understood that the LLM in the embodiment of the present application can be any large language model, including but not limited to the chat generative pre-trained transformer (ChatGPT), Pangu large model, Wenxinyiyan model, etc., and is not limited here.
[0046] It should be understood that the method provided in the embodiments of the present application can be applicable to any electronic device that can call LLM, including but not limited to mobile phones, tablet computers, laptops, desktop computers, servers, smart home devices (such as smart TVs, smart speakers, whole-house smart devices, etc.), etc., without limitation here.
[0047] It should be understood that the application program (hereinafter referred to as the application) mentioned in the implementation of this application can be any computer program that can realize one or more specific functions. The application can be in the form of an application that can be independently installed and run in an electronic device, or a small program that depends on other applications or operating environments, or a plug-in. This application does not limit the specific form of the application. For ease of description, the following embodiments take the application as a plug-in as an example to introduce the technical solution of this application.
[0048] It should be understood that the LLM client is any application that can call LLM. The LLM client can be embedded in a web page, an application, or a service of an electronic device operating system. The specific form of the LLM client is not limited in the embodiment of the present application.
[0049] The technical solution of the present application is described below in conjunction with the accompanying drawings.
[0050] It should be understood that when the large language model receives a user request input by the user (such as text input by the user), it infers which application among the multiple applications the user request is intended to call based on the user request and the functional description texts of the multiple applications registered in the LLM. If the functional description text of the application is inaccurate, the large language model may incorrectly infer the user's intention, causing the LLM to miscall, miss, or mistakenly call the target application. For example, if the functional description text of the schedule plug-in 1 is "set an alarm" and the user request is "I have a meeting at 4 o'clock tomorrow, please remind me", the LLM may infer that the user request is not for calling the schedule plug-in 1, but the actual user request is for calling the schedule plug-in 1, resulting in a missed call.
[0051] Therefore, after developers determine a functional description text of the application, they need to use multiple test cases to test whether the functional description text can accurately describe the function of the application. If the functional description text cannot accurately describe the function of the application, the functional description text needs to be modified and tested again until the functional description text can accurately describe the function of the application.
[0052] Combine the following Figure 2A and Figure 2B This section describes the process of developers manually modifying and testing the functional description text of the application.
[0053] For example, Figure 2A According to some embodiments of the present application, a schematic diagram of a process for a developer to determine a functional description text of an application is shown; Figure 2B According to some embodiments of the present application, a schematic diagram of a process for a developer to determine the aforementioned function description text 11 is shown.
[0054] like Figure 2A As shown, the process of manually determining the functional description text of the application by the developer may include the following steps:
[0055] S2.1, the developer determines the first functional description text of the application.
[0056] Developers can first describe the functions of the application through natural language text to obtain the first function description text of the application.
[0057] It should be understood that the first function description text can be a natural language text used to describe the application function that is first determined by the developer in the process of determining the function description text of the application, or it can be a function description text that is modified by the developer from the previous function description text when the accuracy of the previous function description text does not meet the requirements.
[0058] For example, refer to Figure 2B For the schedule plug-in 1, the first function description text can be the function description text DT1 "Set an alarm" determined by the developer for the first time; it can also be the function description text DT2 "Event reminder" determined by the user for the second time; it can also be the function description text DT3 "This plug-in allows you to create and set event reminders to ensure that you do not miss important tasks, meetings or activities" determined by the user for the third time.
[0059] S2.2, the developer combines the first function description text with multiple test texts corresponding to the multiple test cases to obtain multiple test data corresponding to the multiple test cases.
[0060] After determining the first function description text, the developer may combine the first function description text with multiple test texts corresponding to multiple test cases to obtain multiple test data that can be used by LMM for reasoning, wherein each test data corresponds to a test case.
[0061] It should be understood that the test case includes a test text and a reference reasoning result. The test text is used to indicate a user request input by a user, such as a text input by a user, or a text corresponding to a voice input by a user; and the reference reasoning result is used to indicate whether the test text is used to call an application.
[0062] For example, refer to Figure 2B As shown in Table 1 below, the test cases for testing the schedule plug-in 1 may include test cases T1 to T7:
[0063] Table 1
[0064]
[0065] It should be understood that combining a test case with the first function description text is to combine the test text in the test case with the first function description text to obtain test data that can be recognized by LLM and used for reasoning. For example, for the function description text "set alarm" and the test case T1 in Table 1, the corresponding test data can be "determine whether to call the plug-in based on the function description text of the plug-in and the data entered by the user: set alarm; please help me set an alarm for 6 am".
[0066] S2.3, the LLM client sends multiple test data to the LLM.
[0067] After obtaining multiple test data, developers can use the LLM client to send the multiple test data to LLM.
[0068] It should be understood that the LLM client may send multiple test data to the LLM one by one, or may send multiple test data to the LLM together, which is not limited here.
[0069] S2.4, LLM performs reasoning on the multiple test data to obtain multiple test reasoning results corresponding to the multiple test data, and sends the multiple test reasoning results to the LLM client.
[0070] LLM performs reasoning on multiple test data, obtains multiple test reasoning results corresponding to the multiple test data (that is, test reasoning results corresponding to multiple test cases), and sends the reasoning results to the LLM client.
[0071] It should be understood that each test reasoning result is used to indicate whether the application is called during the reasoning process of the LLM based on the test text in the corresponding test data.
[0072] For example, for Figure 2B In the illustrated scenario, the seven test reasoning results sent by LLM to the LLM client are respectively used to indicate whether the schedule plug-in 1 is called during the reasoning process of LLM based on the test texts in test cases T1 to T7.
[0073] S2.5, the developer determines the accuracy of the LLM reasoning the test text in the test case using the first function description text based on the multiple test reasoning results received by the LLM client.
[0074] After obtaining multiple test reasoning results from the LLM client, the developer can view the multiple test results through the LLM client, and based on the proportion of test cases with the same test reasoning results and reference reasoning results among all test cases, determine the accuracy of LLM's reasoning on the test text in the test case using the first function description text, that is, the accuracy corresponding to the first function description text.
[0075] For example, for Figure 2B In the situation shown, when the first function description text is the aforementioned function description text DT1, the test reasoning results of the test cases T1, T3, T5, T6, and T7 are the same as the reference reasoning results, and the accuracy rate corresponding to the function description text DT1 is 5 / 7=71.4%.
[0076] For example, for Figure 2B In the situation shown, when the first function description text is the aforementioned function description text DT2, the test reasoning results of test cases T2, T3, T4, T5, and T6 are the same as the reference reasoning results, and the accuracy corresponding to the function description text DT2 is 5 / 7=71.4%.
[0077] For example, for Figure 2B In the situation shown, when the first function description text is the aforementioned function description text DT3, the test reasoning results of test cases T2, T3, T4, T5, T6, and T7 are the same as the reference reasoning results, and the accuracy rate corresponding to the function description text DT1 is 6 / 7=85.7%.
[0078] S2.6, the developer determines whether the accuracy is greater than the preset accuracy.
[0079] The developer determines whether the accuracy is greater than the preset accuracy. If the accuracy is greater than the preset accuracy, it means that the first function description text can accurately describe the function of the application, and go to step S2.8; if the accuracy is less than or equal to the preset accuracy, it means that the first function description text cannot accurately describe the function of the application, and go to step S2.7.
[0080] For example, assuming that the preset accuracy rate is 85%, for the situation shown in Figure 2, when the first function description text is the aforementioned function description text DT1, the accuracy rate is 71.4%<85%, and go to step S2.7; when the first function description text is the aforementioned function description text DT2, the accuracy rate is 71.4%<85%, and go to step S2.7; when the first function description text is the aforementioned function description text DT3, the accuracy rate is 85.7%<85%, and go to step S2.8.
[0081] S2.7, the developer modifies the first function description text into the second function description text and conducts the next round of testing.
[0082] When the accuracy is less than or equal to the preset accuracy, the developer modifies the first function description text into the second function description text, updates the first function description text into the second function description text and goes to step S2.1 for the next round of testing.
[0083] For example, for Figure 2B In the scenario shown, when the first function description text is the aforementioned function description text DT1, the developer modifies the function description text DT1 into the function description text DT2; when the first function description text is the aforementioned function description text DT2, the developer modifies the function description text DT2 into the function description text DT3.
[0084] S2.8, the developer uses the first function description text as the function description text of the application.
[0085] When the accuracy rate is greater than a preset accuracy rate, the developer uses the first function description text as the function description text of the application.
[0086] For example, in the situation shown in FIG. 2 , the developer determines the function description text DT3 as the function description text of the schedule plug-in 1 .
[0087] Based on the above Figure 2A and Figure 2B As can be seen from the process shown, describing the functions of the application through natural language text requires developers to constantly modify the function description text, and each time the function description text is modified, the developer needs to test through the aforementioned steps S2.1 to S2.8 until the accuracy of LLM's reasoning on the test text in the test case based on the function description text is greater than the preset accuracy, which is a cumbersome process. In addition, since the way developers describe the application functions through natural language is greatly influenced by the developers' subjective influence, it is usually different from the way users describe the application functions through natural language, which may result in incorrect reasoning results when the user request and function description text are input into LLM, such as missing calls, mis-calls or wrong calls to the application, affecting the user experience.
[0088] It should be understood that LLM can determine whether the user request is for calling based on the user request input into LLM and the functional description information of each application registered into LLM (information used to describe the functions of each application, which can be text or tensor), and call the target application to implement the function corresponding to the user request when it is determined that the user request is for calling the target application. LMM can also adjust the parameter according to the parameter input into LLM and the training sample corresponding to the parameter (each training sample includes features and labels), so that after the features in each training sample and the adjusted parameters are input into LLM, LLM can obtain the result indicated by the label in each training sample.
[0089] Based on this, in order to solve the problem that the process of determining the natural language text describing the application function is cumbersome and the precision is not high, the embodiment of the present application provides a data processing method. In this method, the function of the application is not described by the function description text, but by the function description tensor (such as vector, matrix, etc.). Since the function description tensor can be obtained by an electronic device using LLM, it does not need to be repeatedly modified manually, and the process is simple. In addition, by describing the function of the application through the function description tensor, it is also possible to avoid the subjectivity of the developer describing the application function through natural language, and can provide LLM with more accurate information describing the application function than the function description text.
[0090] In some embodiments, the function description tensor for the first application may be obtained by:
[0091] First, the electronic device can first obtain the natural language text describing the function of the first application, and perform feature extraction on the natural language text to obtain the initial value of the function description tensor. Secondly, the electronic device can splice the initial value of the function description tensor with multiple training samples to obtain multiple training data that can be recognized by LLM. Then, the electronic device can input multiple training data into LLM through the LLM client, and LLM adjusts the initial value of the function description tensor based on the multiple training data to obtain the function description tensor corresponding to the first application.
[0092] It should be understood that each training sample includes a feature and a label, wherein the feature refers to the user request and the label refers to whether the user request is used to call the first application.
[0093] It should be understood that one training data corresponds to one training sample. One training data includes at least the identifier of the function description tensor (or the specific value of the function description tensor), the characteristics of the training sample corresponding to the training data, and the label of the training sample corresponding to the training data. Exemplarily, the training data can be "Please determine whether to call the plug-in based on A and user description: B; C", where A is the identifier of the function description tensor or the specific value of the function description tensor, B is the characteristic of the training sample corresponding to the training data, and C is the label of the training sample corresponding to the training data.
[0094] It should be understood that the form of training data varies based on the specifications of LLM. The above-mentioned form of training data is only an example. In other embodiments, the function description tensor, the features of the training samples, and the labels of the training samples can also be combined into other forms of training data according to the specifications of LLM, which is not limited here.
[0095] Based on the above data processing method, an embodiment of the present application also provides an interaction method, in which, after receiving a user request, the electronic device can combine the user request and the function description tensor of each application registered to the LLM to obtain a query request, and input the query request into the LLM. The LLM can determine whether the user request is used to call the target application based on the query request, and if it is determined that the query request is used to call the target application, call the target application through the call interface corresponding to the target application to execute the corresponding function in the user request.
[0096] Since the functional description information of the application is represented by a functional description tensor, it can more accurately represent the function of the application compared to the functional description information represented by a functional description text, which is beneficial to improving the accuracy of the target application inferred by LLM.
[0097] In addition, since the data volume of the function description tensor is much smaller than the data volume of the function description text expressed in natural language, and LLM has restrictions on the amount of input data, compared with the method of describing the functions of the application through function description text, the interactive method provided in this application can increase the number of input function description tensors, thereby increasing the number of applications that LLM can call, and thereby increasing the application scope of LLM.
[0098] Next, taking the first application as the aforementioned schedule plug-in 1 as an example, the data processing method and interaction method provided by the embodiments of the present application are introduced.
[0099] For example, Figure 3 According to some embodiments of the present application, a schematic diagram of a process of determining a function description tensor of a schedule plug-in 1 is shown.
[0100] like Figure 3As shown, the electronic device can first obtain the initial value T0 of the function description tensor (it should be understood that T0 refers to a tensor) based on the natural language text describing the function of the schedule plug-in 1 (such as the aforementioned "set alarm").
[0101] Secondly, the electronic device can concatenate the initial value of the function description tensor and multiple training samples to obtain multiple training data corresponding to the multiple training samples (hereinafter referred to as training sets). Each training data in the training set includes at least a function description tensor, a feature of the training sample, and a label of the training sample, wherein the function description tensor can be an identifier of the function description tensor (e.g., token1) or the initial value of the function description tensor itself (e.g., T0).
[0102] For example, refer to Figure 4A , assuming that the feature of a training sample is "help me set an alarm for 8 am" and the label is "yes", then the training data corresponding to the training sample can be "determine whether to call the plug-in based on the plug-in description token1 and the user description: help me set an alarm for 8 am; yes". For another example, refer to Figure 4B For the training sample with the aforementioned feature of “help me set an alarm for 8 a.m.” and label of “yes”, its corresponding training data may also be “determine whether to call the plug-in based on the plug-in description T0 and the user description: help me set an alarm for 8 a.m.; yes”.
[0103] It should be understood that in other embodiments, the form of the training data may also be in other forms based on the specification of the LLM, which is not limited here.
[0104] Then, the electronic device can input the training data in the training set into the LLM, and the LLM can train the function description tensor according to the function description tensor, features and labels in each training data, and adjust the value of the function description tensor from T0 to T1.
[0105] It should be understood that, in the process of adjusting the function description tensor, LLM can first extract features from the training data, and then make adjustments based on the features of the obtained training data. In the feature extraction process, since the function description tensor can be directly used by LLM to adjust the function description tensor, it is not necessary to extract features from the function description tensor in the training data. Instead, feature extraction is performed on data other than the function description tensor in the training data, and then the extracted features are concatenated with the function description tensor to obtain the features of the training data.
[0106] For example, refer to Figure 4C ,for Figure 4AFor the training data shown in FIG. 14 , “Based on the plug-in description token1 and the user description, determine whether to call the plug-in: set an alarm for me at 8 a.m.; yes”, LLM can perform feature extraction on “Based on the plug-in description” to obtain feature E1 (it should be understood that E1 refers to one or more tensors), and perform feature extraction on “Based on the user description, determine whether to call the plug-in” to obtain feature E2 (it should be understood that E2 refers to one or more tensors), and then concatenate feature E1 and feature E2 with the function description tensor to obtain the feature “E1 T0 E2” of the training data (it should be understood that E1, T0, and E2 can be concatenated in different orders, which is not limited here), and perform training based on the feature “E1 T0 E2” to adjust the function description tensor of schedule plug-in 1.
[0107] After obtaining the function description tensor token1=T1 of schedule plug-in 1, schedule plug-in 1 can be registered in LLM so that LLM can call schedule plug-in 1 to implement related functions. After receiving the user request, the electronic device can input the user request and the function description tensor of the schedule plug-in into LLM to determine whether the user request is for calling schedule plug-in 1. And when it is determined that the user request is for calling schedule plug-in 1, LLM calls schedule plug-in 1 through the calling interface of schedule plug-in 1 to execute the function corresponding to the user request.
[0108] For example, continue to refer to Figure 3 , assuming that the user request is "I have a meeting at 4 o'clock tomorrow, please remind me", and the only plug-in registered to the LLM is the calendar plug-in 1, then the electronic device can assemble the user request with the function description tensor token1=T1 of the calendar plug-in 1 into a query request "determine whether to call the plug-in based on the plug-in description token1 and the user description: I have a meeting at 4 o'clock tomorrow, please remind me", and input the query request into the LLM. After receiving the query request, the LLM can perform reasoning based on the query request and the specific tensor T1 corresponding to token1, and output the reasoning result, such as calling the calendar plug-in 1 and establishing an event to remind the user at 4 o'clock tomorrow.
[0109] In some embodiments, the electronic device may also obtain user feedback information on the reasoning result, such as positive feedback information and negative feedback information, wherein the positive feedback information indicates that the reasoning result of the LLM is correct, and the negative feedback information indicates that the reasoning result of the LLM is wrong. In the case of obtaining negative feedback information, the electronic device may also add the user request and the result opposite to the reasoning result (for example, if the reasoning result is to call the schedule plug-in, then the result opposite to the reasoning result is not to call the schedule plug-in) to the training set to obtain an incremental training set. Then, the electronic device may iteratively train the function description tensor token1=T1 of the schedule plug-in 1 according to the incremental training set to further improve the accuracy of the function description tensor token1.
[0110] For example, refer to Figure 5A After LLM calls the schedule plug-in 1 and sets up an event to remind the user at 4 o'clock tomorrow, the LLM client in the electronic device can display the LLM reasoning result "A reminder event at 4 o'clock tomorrow has been set for you" in the interface U2, as well as the "Like" control U21 and the "Dislike" control U22. When it is detected that the user clicks the "Like" control U21, the electronic device can receive the user's positive feedback information without processing.
[0111] For example, refer to Figure 5B , if the LLM's reasoning result for the query request "Determine whether to call the plug-in based on the plug-in description token1 and the user description: I have a meeting at 4 o'clock tomorrow, please remind me", is not to call the schedule plug-in 1, and send the wrong result "I can attend with you" to the LLM client. The LLM client in the electronic device can display the LLM's reasoning result "I can attend with you" in the interface U3, as well as the "Like" control U31 and the "Dislike" control U32. When it is detected that the user clicks the "Dislike" control U32, the electronic device can add the user request "I have a meeting at 4 o'clock tomorrow, please remind me" and "Call plug-in" to the training set of schedule plug-in 1.
[0112] It should be understood that in other embodiments, the electronic device may also obtain user feedback information in other ways, which are not limited here.
[0113] Combine the following Figures 3 to 5B , introduce the technical solution of this application.
[0114] Figure 6 According to some embodiments of the present application, a flow chart of a data processing method is shown. The execution subject of the flow can be an electronic device, such as Figure 6 As shown, the process includes the following steps:
[0115] S601: Obtain a first tensor based on a natural language text describing a first application function.
[0116] The electronic device can obtain a first tensor based on the natural language text describing the function of the first application, where the first tensor is the initial value of the function description tensor of the first application.
[0117] In some embodiments, the electronic device may extract features from the natural language text describing the first application function to obtain a first tensor. Figure 3 In the illustrated scenario, the first application is a schedule plug-in 1 , and the electronic device can perform feature extraction on the natural language text “set alarm” describing the function of the schedule plug-in 1 , and use the obtained feature T0 as the first tensor.
[0118] In some embodiments, the electronic device may also randomly initialize the first tensor instead of obtaining the first tensor based on describing the first application function.
[0119] In other embodiments, the electronic device may also input a natural language text describing the first application function into the LLM, and the LLM may infer the natural language text to obtain the first tensor.
[0120] For example, refer to Figure 7 , compared to Figure 3 In the illustrated embodiment, the initial value of the function description tensor of the schedule plug-in 1 is obtained by LLM reasoning, rather than by feature extraction of the natural language text describing the function of the schedule plug-in 1. The electronic device can convert the natural language text "Set an alarm" that describes the function of the schedule plug-in 1 into an instruction "Convert user description into a tensor: Set an alarm" that can be recognized and reasoned by the LLM. The electronic device can then send "Convert user description into a tensor: Set an alarm" to the LLM, and the LLM converts "Set an alarm" into a first tensor. In this way, since the first tensor is obtained by LLM reasoning, it can be more in line with the reasoning logic of the LLM, and when the LLM infers whether the user requests to call the first application based on the function description tensor of the first application, the accuracy of the reasoning can be improved.
[0121] In some embodiments, if the LLM does not have the function of converting natural language text into a tensor, additional training can be performed on the LLM so that the LLM has the function of converting natural language text into a tensor. Exemplarily, the electronic device can train the LLM based on the natural language text X1, the natural language text X2 (the natural language text X2 is the following of the natural language text X1), and the tensor corresponding to the natural language text X1 with a contextual relationship, so that the LLM can convert the input natural language text into a tensor. The electronic device can splice the natural language text X1, the tensor corresponding to the natural language text X1 (assuming it is E3), and the natural language text X2 into a training request that the LLM can recognize (for example, spliced into "X1 E3 X2"), and input the training request into the LLM, so that the LLM can output the tensor E3 corresponding to the natural language text X1 in response to the training request. In this way, after multiple sets of training requests are input into the LLM, the LLM can obtain the tensor corresponding to the natural language text according to the input natural language text.
[0122] It should be understood that in other embodiments, the electronic device may also train the LLM in other ways so that the LLM can convert the input natural language text into a corresponding tensor, which is not limited here.
[0123] It should be understood that when the LLM converts the natural language text describing the first application function into the first tensor, the order (also called dimension) of the first tensor can also be specified in the instruction sent to the LLM to limit the size of the first tensor. It should be understood that the first tensor can be a tensor of any order, such as a first-order tensor (such as a vector), a second-order tensor (such as a matrix), etc., which is not limited here.
[0124] S602: Concatenate the first tensor with the multiple training samples to obtain a training set, where the training set includes multiple training data corresponding to the multiple training samples.
[0125] After obtaining the first tensor, the electronic device concatenates the first tensor with multiple training samples to obtain multiple training data corresponding to the multiple training samples. The multiple training data can be called a training set.
[0126] It should be understood that one training data corresponds to one training sample. One training data includes at least a first tensor (or the identifier of a function description tensor), the characteristics of the training sample corresponding to the training data, and the label of the training sample corresponding to the training data. Exemplarily, the training data may be "Please determine whether to call the plug-in based on A and user description: B; C", where A is the identifier of the function description tensor or the specific value of the first tensor, B is the characteristic of the training sample corresponding to the training data, and C is the label of the training sample corresponding to the training data.
[0127] It should be understood that the form of training data varies based on the specifications of LLM. The above-mentioned form of training data is only an example. In other embodiments, the function description tensor, the features of the training samples, and the labels of the training samples can also be combined into other forms of training data according to the specifications of LLM, which is not limited here.
[0128] For example, for Figure 3 In the case shown, the function description tensor of schedule plugin 1 is identified by token1, and the specific value of the first tensor is T0. Figure 4A , assuming that the feature of a training sample is "help me set an alarm for 8 am" and the label is "yes", then the training data corresponding to the training sample can be "determine whether to call the plug-in based on the plug-in description token1 and the user description: help me set an alarm for 8 am; yes". For another example, refer to Figure 4B For the training sample with the aforementioned feature of “help me set an alarm for 8 a.m.” and label of “yes”, its corresponding training data may also be “determine whether to call the plug-in based on the plug-in description T0 and the user description: help me set an alarm for 8 a.m.; yes”.
[0129] S603: Input multiple training data into the LLM, and the LLM trains the first tensor based on the multiple training data to obtain a second tensor.
[0130] After obtaining the multiple training data, the electronic device inputs the multiple training data into the LLM, and the LLM trains the first tensor based on the multiple training data and the second tensor.
[0131] In some embodiments, the electronic device may input multiple training data into the LLM one by one through the calling interface of the LLM, and the LLM may adjust the first tensor based on the input training data to obtain the second tensor.
[0132] It should be understood that when LLM inputs training data into LLM one by one, after LLM adjusts the first tensor based on one training data (the adjusted tensor is called an intermediate tensor), LLM trains and adjusts the first tensor based on the next training data. For example, assuming that the first tensor is T0, LLM first adjusts T0 to T0' based on one training data. When LLM trains the first tensor based on the next training data, it can be trained based on the first tensor being T0', and the first tensor can be adjusted to T0" based on T0' and the training data.
[0133] In some embodiments, the electronic device may also use the calling interface of the LLM to input multiple training data into the LLM at one time, and the LLM adjusts the first tensor based on the input multiple training data to obtain the second tensor.
[0134] S604: Determine that the second tensor is a function description tensor of the first application.
[0135] The electronic device determines the second tensor obtained by LLM as the function description tensor of the first application.
[0136] Based on the above method, the electronic device can obtain the function description tensor corresponding to the first application through LLM. Compared with the function description text method, the operation is convenient and the accuracy is higher.
[0137] It should be understood that the function description tensor of any application that can be registered to LLM and called by LLM can be obtained by the aforementioned data processing method, which will not be elaborated here.
[0138] It should be understood that the function description tensor of each application can be trained based on the aforementioned steps S601 to S604. After obtaining the function description tensor of each application, the part of the application can be registered to LLM, so that LLM can call the corresponding application according to the user request to execute the function corresponding to the user request.
[0139] For example, Figure 8 According to some embodiments of the present application, a flow chart of an interaction method is shown, such as Figure 8 As shown, the process includes the following steps:
[0140] S801: The LLM client registers at least one application with the LLM.
[0141] The LLM client can register at least one application with the LLM to provide the LLM with a calling interface for each application.
[0142] In some embodiments, when registering at least one application with the LLM, the LLM client may also send the functional description tensor of the at least one application to the LLM, and the LLM will store it. For example, assuming that the at least one application includes a schedule plug-in 1, a recording plug-in 2, and a hotel plug-in 3, the identifier of the functional description tensor of the schedule plug-in 1 is token1, and the specific value is T1, the identifier of the functional description tensor of the recording plug-in 2 is token2, and the specific value is T2, and the identifier of the functional description tensor of the hotel plug-in 3 is token3, and the specific value is T3. The LLM client can send token1=T1, token2=T2, and token3=T3 to the LLM, and the LLM will store token1=T1, token2=T2, and token3=T3 in the prompt information (prompt) of the LLM.
[0143] S802: The LLM client receives a user request input by a user, and concatenates the user request with a function description tensor of at least one application to obtain a query request corresponding to the user request.
[0144] The LLM client receives a user request input by a user, and concatenates the user request with a functional description tensor of at least one application to obtain a query request that can be recognized by the LLM and used for reasoning.
[0145] In some embodiments, the LLM client may concatenate the user request with the function description tensor of each application (eg, the identifier of the function description tensor) to obtain multiple query requests corresponding to the user request. Fig. 9A, assuming that the applications registered to LLM include schedule plugin 1, recording plugin 2, and hotel plugin 3, the function description tensor token 1 of schedule plugin 1 = T1, the function description tensor token 2 of recording plugin 2 = T2, and the function description tensor token 3 of hotel plugin 3 = T3. The user request is "I have a meeting at 4 o'clock tomorrow, please remind me", then the query request corresponding to the user request may include the query request corresponding to schedule plugin 1 "determine whether to call the plugin according to plugin description token 1: I have a meeting at 4 o'clock tomorrow, please remind me", the query request corresponding to recording plugin 2 "determine whether to call the plugin according to plugin description token 2: I have a meeting at 4 o'clock tomorrow, please remind me", and the query request corresponding to hotel plugin 3 "determine whether to call the plugin according to plugin description token 3: I have a meeting at 4 o'clock tomorrow, please remind me".
[0146] In some embodiments, the LLM client may also concatenate the user request and the function description tensor of at least one application into one query request to reduce the number of times the LLM client sends query requests to the LLM. Fig. 9B Assuming that the applications registered to LLM include the aforementioned schedule plug-in 1, recording plug-in 2, and hotel plug-in 3, it should be understood that the query request corresponding to the user request "I have a meeting at 4 o'clock tomorrow, please remind me" can be "determine whether to call the plug-in based on the plug-in description token1, token2, and token3. If called, which one to call: I have a meeting at 4 o'clock tomorrow, please remind me".
[0147] It should be understood that the form in which the LLM client concatenates the user request with the functional description tensor of at least one application varies according to different LLM specifications.
[0148] It should be understood that, in some embodiments, the identifier of the function description tensor of each application in the query request may also be a specific value of the function description tensor, which is not limited here.
[0149] It should be understood that the user request may be input in the form of text or voice, which is not limited here.
[0150] S803: The LLM client sends a query request to the LLM.
[0151] After receiving the query request corresponding to the user request, the LLM client sends the query request to the LLM through the LLM calling interface.
[0152] In some embodiments, if there are multiple query requests corresponding to the user request, the LLM client may send the query requests to the LLM one by one, or may send multiple query requests at a time, which is not limited here.
[0153] S804: The LLM performs reasoning based on the query request and the functional description tensor of at least one application to determine the target application to be called by the query request.
[0154] After receiving the query request, LLM can infer the function description tensor of at least one application in the query request to determine the target application to be called by the query request (that is, the application to be called by the user request).
[0155] For example, for the aforementioned query request "determine whether to call a plug-in based on plug-in descriptions token1, token2, and token3, and if so, which one to call: I have a meeting at 4 o'clock tomorrow, please remind me", LLM can determine that the target application is schedule plug-in 1.
[0156] It should be understood that in some embodiments, when the LLM determines that the query request does not call any application, the LLM may not process it.
[0157] S805: LLM calls the target application to execute the function corresponding to the user request, and sends the inference result to the LLM client.
[0158] After determining the target application to be called by the query request, LLM calls the target application to execute the function corresponding to the user request and sends the inference result to the LLM client.
[0159] It should be understood that the inference result is used to indicate whether the LLM has called the target application and what the target application is.
[0160] For example, for the aforementioned query request "Determine whether to call the plug-in based on the plug-in description token1, token2, and token3, and if called, which one to call: I have a meeting at 4 o'clock tomorrow, please remind me", and the target application (schedule plug-in 1), LLM can call schedule plug-in 1 to add a reminder event at 4 o'clock tomorrow, and send the inference result indicating LLM calling schedule plug-in 1 to add a reminder event at 4 o'clock tomorrow to the LLM client.
[0161] S806: The LLM client displays the inference result.
[0162] After receiving the inference results sent by LLM, the LLM client can display the inference results.
[0163] For example, referring to the aforementioned Figure 5A , the LLM client can display the prompt message "A reminder event for tomorrow's 4 o'clock has been set for you."
[0164] S807: The LLM client obtains and sends the user's feedback information on the reasoning result to the LLM.
[0165] After displaying the inference result, the LLM client can obtain user feedback information on the inference result, and the feedback information is used to indicate whether the inference result is correct.
[0166] For example, refer to Figure 5A The interface U2 displayed by the LLM client includes a "Like" control U21 and a "Dislike" control U22. When the user confirms that the inference result is normal, the user can click the "Like" control U21. When the LLM client detects that the user clicks the "Like" control U21, it can obtain positive feedback information from the user (indicating that the inference result is correct).
[0167] For example, refer to Figure 5B , if the reasoning result of LLM for the query request corresponding to the user's request "I have a meeting at 4 o'clock tomorrow, please remind me", is not to call the schedule plug-in 1, and send the wrong result "I can attend with you" to the LLM client. The LLM client in the electronic device can display the LLM's reasoning result "I can attend with you" in the interface U3, as well as the "thumbs-up" control U31 and the "thumbs-up" control U32. When the user confirms that the reasoning result is wrong, the user can click the "thumbs-up" control U32. When the LLM client detects that the user clicks the "thumbs-up" control U32, it can obtain the user's negative feedback information (indicating that the reasoning result is incorrect).
[0168] It should be understood that in other embodiments, the LLM client may also obtain user feedback information on the reasoning result in other ways, which are not limited here.
[0169] S808: In response to the feedback information being negative feedback, the LLM adjusts the function description tensor of the target application based on the user request and the result opposite to the reasoning result.
[0170] For example, for Figure 5B In the case shown, LLM can add the user request "I have a meeting at 4 o'clock tomorrow, please remind me" (as the feature of the training sample) and "call plug-in" (as the label of the training sample) to the training set of schedule plug-in 1 to obtain an incremental training set, and adjust the function description tensor token1=T1 of schedule plug-in 1 based on the incremental training set to obtain token1=T4. The process of LLM adjusting the function description tensor token1=T1 of schedule plug-in 1 based on the incremental training set to obtain token1=T4 can be referred to Figure 6 The embodiments shown are not limited here.
[0171] In some embodiments, after adjusting the function description tensor of the target application, the LLM may update the function description tensor of the target application recorded in the LLM client to the adjusted function description tensor, so that the next time the LLM client registers the target application with the LLM, it can register with the updated function description tensor. It should be understood that if the function description tensor of the target application is stored in other devices or applications, the LLM may also update the function description tensor corresponding to the target application stored in other devices or applications.
[0172] In some embodiments, after adjusting the function description tensor of the target application, the LLM can also update the adjusted function description tensor to the LLM, so that when the LLM reasons about the subsequent input user request, it can reason about whether the user request is used to call the target application based on the adjusted function description tensor, which is beneficial to improving the accuracy of LLM reasoning.
[0173] In this way, the function description tensor of each application registered in the LLM can be adjusted by utilizing the user request and the inference result of the LLM on the user request, which is beneficial to further improve the accuracy of the function description tensor in describing the application function.
[0174] Based on the above method, LLM infers user requests based on the function description tensor of the application. Since the function description tensor can more accurately describe the function of the application, the accuracy of the target application determined by LLM can be improved. In addition, since the amount of data in the function description tensor is much smaller than the function description text expressed in natural language text, it is beneficial to increase the amount of data that can be input into LLM, thereby increasing the number of applications that LLM can call, and then increasing the application scope of LLM. In addition, based on the user's feedback information being a negative feedback user request and the LLM's inference result on the user request, the function description tensor of each application registered in LLM can be adjusted, which is beneficial to further improve the accuracy of the function description tensor in describing the application function.
[0175] An embodiment of the present application also provides a computer program product, which, when executed on a device, can enable the device to implement the interaction method and data processing method provided in the aforementioned embodiments.
[0176] An embodiment of the present application also provides a readable storage medium, which stores instructions. When the instructions are executed by a device, the device implements the interaction method and data processing method provided by the aforementioned embodiments.
[0177] Furthermore, the present application also provides an electronic device 100. The electronic device 100 can be used to implement the data processing method and interaction method provided in each embodiment, and can also be used to deploy the aforementioned LLM client and / or large language model.
[0178] Fig.10 According to some embodiments of the present application, a schematic structural diagram of an electronic device 100 is shown.
[0179] like Fig.10 As shown, the electronic device 100 may include one or more processors 101, a system memory 102, a non-volatile memory (NVM) 103, an input / output (I / O) device 104, a communication interface 105, and a system control logic 106 for coupling the processor 101, the system memory 102, the non-volatile memory 103, the input / output (I / O) device 104 and the communication interface 105. Among them:
[0180] The processor 101 may include one or more processing units, for example: the processor 101 may include a central processing unit (CPU), an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units can be independent devices or integrated in one or more processors. In some embodiments, the processor 101 can be used to execute relevant instructions to implement the data processing method and / or interaction method provided in the embodiment of the present application. For example, the processor 101 can be used to execute instructions for training and adjusting the function description tensor of the application through LLM; it can also be used to execute the target application of the user request based on the user request and the function description tensor of each application using LLM, and call the target application through the calling interface of the target application to execute the function corresponding to the user request.
[0181] The system memory 102 is a volatile memory, such as a random-access memory (RAM), a double data rate synchronous dynamic random access memory (DDR SDRAM), etc. The system memory is used to temporarily store data and / or instructions. For example, in some embodiments, the system memory 102 can be used to temporarily store instructions of the LLM and the LLM client, and can also be used to store function description tensors of various applications.
[0182] The non-volatile memory 103 may include one or more tangible, non-transitory computer-readable media for storing data and / or instructions. In some embodiments, the non-volatile memory 103 may include any suitable non-volatile memory such as flash memory and / or any suitable non-volatile storage device, such as a hard disk drive (HDD), a compact disc (CD), a digital versatile disc (DVD), a solid-state drive (SSD), etc. In some embodiments, the non-volatile memory 103 may also be a removable storage medium, such as a secure digital (SD) memory card, etc. In other embodiments, the non-volatile memory 103 may be used for permanent LLM, LLM client instructions, and may also be used to store functional description tensors of various applications, etc.
[0183] In particular, the system memory 102 and the non-volatile memory 103 may respectively include: a temporary copy and a permanent copy of the instruction 107. The instruction 107 may include: an instruction that, when executed by at least one of the processors 101, enables the electronic device 100 to implement the data processing method and the interaction method provided by the embodiments of the present application.
[0184] The input / output (I / O) device 104 may include an input device and an output device. The input device is used to input data to the electronic device 100. For example, the input device may include a keyboard, a microphone, etc., for inputting a user request in the form of text or a user request in the form of voice to the electronic device 100. The output device is used to output data in the electronic device 100. For example, the output device may include a display screen, etc., for displaying the user interface of the LLM client.
[0185] The communication interface 105 may include a transceiver for providing a wired or wireless communication interface for the electronic device 100, and then communicating with any other suitable device through one or more networks. In some embodiments, the electronic device 100 can establish a communication connection with other electronic devices through the communication interface 105. For example, the electronic device 100 deploying the LLM client can send a query request corresponding to a user request and send training data to the electronic device deploying the LLM through the communication interface 105, and receive inference results, application function description vectors, etc. from the electronic device deploying the LLM.
[0186] System control logic 106 may include any suitable interface controller to provide any suitable interface with other modules of electronic device 100. For example, in some embodiments, system control logic 106 may include one or more memory controllers to provide interfaces to system memory 102 and non-volatile memory 103.
[0187] In some embodiments, at least one of the processors 101 may be packaged together with the logic of one or more controllers for the system control logic 106 to form a system in package (SiP). In other embodiments, at least one of the processors 101 may also be integrated with the logic of one or more controllers for the system control logic 106 on the same chip to form a system-on-chip (SoC).
[0188] It should be understood that the electronic device 100 can be any electronic device, including but not limited to laptop computers, desktop computers, tablet computers, mobile phones, wearable devices, head-mounted displays, servers, mobile email devices, portable music players, reader devices, smart home devices, etc., without limitation here.
[0189] It should be understood that the structure of the electronic device 100 shown in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0190] In the accompanying drawings, some structural or method features may be shown in a specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order may not be required. Instead, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the illustrative drawings. In addition, the inclusion of structural or method features in a particular figure does not mean that such features are required in all embodiments, and in some embodiments, these features may not be included or may be combined with other features.
[0191] It should be noted that in the examples and description of this patent, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "includes" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "includes one" do not exclude the existence of other identical elements in the process, method, article or device including the elements.
Claims
1. A data processing method, applied to an electronic device, characterized in that: include: Obtaining a first tensor and a plurality of training samples, wherein the first tensor indicates that the first application has a first function, and the training samples include text indicating a user request and a label indicating whether the user request is used to call the first application; The first tensor and the multiple training samples are input into a first model, and the first model is used to adjust the first tensor into a second tensor based on the multiple training samples, wherein the second tensor indicates that the first application has a second function.
2. The method according to claim 1, characterized in that The step of inputting the first tensor and the plurality of training samples into a first model, and adjusting the first tensor into a second tensor based on the plurality of training samples by using the first model, comprises: Concatenating the first tensor with the multiple training samples respectively to obtain multiple training data corresponding to the multiple training samples, wherein the training data is used to instruct the first model to adjust the first tensor based on the training samples in the training data; Inputting the plurality of training data into the first model; The first tensor is adjusted into the second tensor by using the first model based on the plurality of input training data.
3. The method according to claim 1, characterized in that The first model is a large language model.
4. The method according to claim 1, characterized in that: The second functionality is at least partially different from the first functionality.
5. The method according to any one of claims 1 to 4, characterized in that The obtaining of a first tensor and a plurality of training samples includes: The natural language text corresponding to the first function is input into the first model, and the first model is used to infer the natural language text to obtain the first tensor.
6. The method according to any one of claims 1 to 5, characterized in that Also includes: Inputting the second tensor and the first user request into a first model to obtain a first inference result of the first model on the first user request, wherein the first inference result indicates whether the first model calls or does not call the first application; When the user confirms that the first inference result is wrong, the second tensor, the first user request, and a second inference result opposite to the first inference result are input into the first model, and the second tensor is adjusted to a third tensor using the first model, wherein the third tensor indicates that the first application has a third function.
7. An interactive method, applied to an electronic device, characterized in that: include: receiving a second user request; Inputting the second user request and a plurality of second tensors applied by a plurality of applications into the first model, wherein the plurality of applications are applications that can be called by the first model, and the second tensors are used to describe functions of the corresponding applications; The first model is used to call a second application corresponding to the second user request from among the multiple application programs based on the second user request and the multiple second tensors to execute a function corresponding to the second user request.
8. The method according to claim 7, characterized in that The using the first model to call a second application corresponding to the second user request among the multiple applications to execute a function corresponding to the second user request based on the second user request and the multiple second tensors includes: splicing the second user request with the multiple tensors respectively to obtain multiple query requests corresponding to the multiple tensors, wherein the query requests are used to instruct the first model to determine whether the second user request is used to call the application corresponding to the tensor based on the second user request and the tensor in the query request; Inputting the multiple query requests into the first model, and using the first model to determine the second application to be called by the second user request based on the multiple query requests; The second application is called by using the first model to execute a function corresponding to the second user request.
9. The method according to claim 7, characterized in that: The using the first model to call a second application corresponding to the second user request among the multiple applications to execute a function corresponding to the second user request based on the second user request and the multiple second tensors includes: splicing the second user request with the multiple tensors to obtain a first query request corresponding to the multiple tensors, wherein the first query request is used to instruct the first model to determine whether the second user request is used to call an application in the multiple application programs based on the second user request and the multiple tensors; Inputting the first query request into the first model, and using the first model to determine the second application to be called by the second user request based on the first query request; The second application is called by using the first model to execute a function corresponding to the second user request.
10. The method according to claim 8 or 9, characterized in that: The method further comprises: When the user determines that the second application is not the application to be called by the second user request, the first model is used to adjust the fifth tensor corresponding to the second application in the multiple tensors to the sixth tensor based on the second user request and the second user request does not call the second application.
11. The method according to claim 7, characterized in that The first model is a large language model.
12. A readable storage medium, characterized in that: The readable storage medium includes instructions, and when the instructions are executed by an electronic device, the electronic device implements the method according to any one of claims 1 to 11.
13. An electronic device, characterized in that: include: A memory for storing instructions; A processor, configured to execute the instructions so that the electronic device implements the method according to any one of claims 1 to 11.
Citation Information
Cited By
Task execution method and device based on pseudo code, storage medium and equipment
CN120540751A
A task execution method, device, storage medium and equipment based on pseudocode
CN120540751B