Question processing method and apparatus and computing device cluster
By iteratively filtering actions and generating prompt words that are most easily understood by LLM, the problem of LLM's inference results is solved, and the effect of improving the accuracy of LLM's inference results is achieved.
Patent Information
- Application Number
- PCT/CN2024/102021
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-09-28
- Filing Date
- 2024-06-27
- Publication Date
- 2025-04-03
AI Technical Summary
Large Language Models (LLM) may not be ideal in the case of insufficient training data, semantic ambiguity, or unclear problems, resulting in a decrease in accuracy.
By iteratively filtering multiple actions related to the prompt project, using the user input questions and the content obtained by executing the filtered actions for action screening, the prompt words that are easiest to be understood by the LLM and input them to the LLM to obtain more accurate answers.
By continuously enhancing and optimizing the problem, the prompt words finally input into the LLM are easier to understand, thereby improving the accuracy of the LLM inference results.
Smart Images

Figure CN2024102021_03042025_PF_FP_ABST
Abstract
Description
Problem handling method, device and computing device cluster
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on September 28, 2023, with application number 202311283213.5 and application name “A problem-solving method, device and computing device cluster”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of artificial intelligence (AI) technology, and in particular to a problem-solving method, apparatus, and computing device cluster. Background Art
[0003] With the development of AI technology, large language models (LLMs) have gradually entered people's lives and have brought many positive impacts and experiences to people's lives. Among them, LLM is a language model with extremely large-scale natural language processing capabilities. LLM has very powerful reasoning capabilities and can process and generate natural language text. LLM usually has billions or even trillions of parameters, so it can handle complex natural language understanding and generation tasks. Although LLM performs well on many natural language processing tasks, the reasoning results of LLM may be unsatisfactory in some cases (such as insufficient training data, semantic ambiguity, unclear questions, etc.). Therefore, how to improve the accuracy of LLM reasoning results is a technical problem that needs to be solved urgently.
[0004] Summary of the Invention
[0005] This application provides a problem-solving method, apparatus, computing device cluster, computer storage medium, and computer product that can improve the accuracy of LLM reasoning results.
[0006] In a first aspect, the present application provides a method for handling a question, comprising: obtaining a question input by a user; based on the question, iteratively filtering actions from a plurality of actions related to a prompt engineering, wherein, in a first round of iteration, the question is used to filter the action, and in any round of iteration except the first round of iteration, the question and the content obtained by executing the filtered action are used to filter the action; when the number of iterations reaches a threshold or the action filtered out in the current round of iteration is a termination action, the prompt word is input into a large language model to obtain an answer related to the question, the prompt word including the question and the content obtained by executing the action filtered out in each round of iteration. Exemplarily, prompt engineering is a project for developing and optimizing questions to obtain prompt words. Prompt engineering can be used to improve the ability of a large language model to handle complex task scenarios, such as question-answering and arithmetic reasoning. Exemplarily, the content obtained by executing the action can be used to improve the comprehensibility of the question. Exemplarily, multiple actions related to prompt engineering can include a termination action. The termination action can be used to end the iterative process.
[0007] In this way, actions are iteratively filtered from multiple actions, and each time an action is filtered, the problem and the content obtained by executing the filtered actions are used for filtering. This allows the problem and the content obtained by executing the actions to be continuously enhanced and optimized, so that the prompt words finally input into the LLM are the easiest for the LLM to understand, thereby improving the accuracy of the LLM reasoning results.
[0008] In one possible approach, actions are selected using the question and the content obtained from executing the selected actions. This includes determining the probability of an action being selected from a set of actions related to the prompt project based on the question and the content obtained from executing the selected actions; and selecting the action associated with the highest probability as the selected action. This allows the desired action to be selected in any subsequent iterations.
[0009] In one possible approach, using the question to select actions includes: determining the probability of an action being selected from a plurality of actions related to the prompt project based on the question; and selecting the action associated with the highest probability as the selected action. In this way, the desired action can be selected in the first round of iteration.
[0010] In one possible embodiment, the method further includes presenting a prompt word to the user, so that the user can intuitively feel the processing effect and choose whether to enable the function.
[0011] In one possible embodiment, before iteratively selecting actions from a plurality of actions related to the prompt project based on the question, the method further includes: determining whether a question enhancement optimization control is enabled. Thus, question enhancement optimization is performed only when the question enhancement optimization control is enabled, allowing the user to make their own selection.
[0012] In one possible approach, actions related to hint engineering include one or more of the following: introducing external knowledge, applying templates, or problem decomposition.
[0013] In the second aspect, the present application provides a question processing device, comprising: an acquisition module and a processing module. The acquisition module is used to obtain the question input by the user. The processing module is used to iteratively filter actions from multiple actions related to the prompt project based on the question, wherein, in the first round of iteration, the question is used to filter actions, and in any round of iteration except the first round of iteration, the question and the content obtained by executing the filtered actions are used to filter actions. The processing module is also used to input the prompt word into the large language model to obtain an answer related to the question when the number of iterations reaches a threshold or the action filtered out in the current round of iteration is a termination action. The prompt word includes the question and the content obtained by executing the actions filtered out in each round of iteration.
[0014] In one possible embodiment, when the processing module uses the question and the content obtained by performing the filtered actions to filter the actions, it is specifically used to: determine the probability of an action included in multiple actions related to the prompt project being selected based on the question and the content obtained by performing the filtered actions; and use the action associated with the highest probability as the filtered action.
[0015] In one possible embodiment, the processing module is further configured to present a prompt word to the user.
[0016] In a possible manner, before iteratively screening actions from a plurality of actions related to the prompt project based on the problem, the processing module is further configured to: determine whether a problem enhancement optimization control is in an on state.
[0017] In one possible approach, actions related to hint engineering include one or more of the following: introducing external knowledge, applying templates, or problem decomposition.
[0018] In a third aspect, the present application provides a computing device cluster comprising at least one computing device, each computing device comprising a processor and a memory; the processor of at least one computing device is used to execute instructions stored in the memory of at least one computing device, so that the computing device cluster performs the method described in the first aspect or any possible implementation of the first aspect.
[0019] In a fourth aspect, the present application provides a computer-readable storage medium comprising computer program instructions. When the computer program instructions are executed by a computing device, the computing device performs the method described in the first aspect or any possible implementation of the first aspect; alternatively, when the computer program instructions are executed by a computing device cluster, the computing device cluster performs the method described in the first aspect or any possible implementation of the first aspect. Exemplarily, the computing device cluster may include one or more computing devices.
[0020] In a fifth aspect, the present application provides a computer program product comprising instructions, which, when executed by a computing device, causes the computing device to perform the method described in the first aspect or any possible implementation of the first aspect; or, when executed by a computing device cluster, causes the computing device cluster to perform the method described in the first aspect or any possible implementation of the first aspect. Exemplarily, the computing device cluster may include one or more computing devices.
[0021] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The following is a brief introduction to the drawings required for describing the embodiments or prior art.
[0023] FIG1 is a schematic diagram of the architecture of an LLM-based question-answering system provided in an embodiment of the present application;
[0024] FIG2 is a schematic diagram of the working process of the question enhancement component shown in FIG1 ;
[0025] FIG3 is a schematic diagram of the deployment of various components in the LLM-based question-answering system shown in FIG1 ;
[0026] FIG4 is a schematic diagram of an upper interface of an electronic device provided in an embodiment of the present application;
[0027] FIG5 is a schematic diagram of the training process of the question enhancement component shown in FIG1 ;
[0028] FIG6 is a flow chart of a problem solving method provided in an embodiment of the present application;
[0029] FIG7 is a schematic diagram of the structure of a problem handling device provided in an embodiment of the present application;
[0030] FIG8 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application;
[0031] FIG9 is a schematic diagram of the structure of a computing device cluster provided in an embodiment of the present application;
[0032] FIG10 is a schematic diagram of the structure of another computing device cluster provided in an embodiment of the present application. DETAILED DESCRIPTION
[0033] The term "and / or" as used herein describes an association between related objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A exists alone, A and B exist simultaneously, or B exists alone. The symbol " / " as used herein indicates that the related objects are in an "or" relationship, for example, A / B means either A or B.
[0034] The terms "first" and "second" in this specification and claims are used to distinguish different objects rather than to describe a specific order of objects. For example, "first response message" and "second response message" are used to distinguish different response messages rather than to describe a specific order of response messages.
[0035] In the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.
[0036] In the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more, for example, multiple processing units means two or more processing units, etc.; multiple elements means two or more elements, etc.
[0037] Generally, in order to obtain more effective reasoning results, a series of processing can be performed on the problem input to the LLM. These processing actions include but are not limited to:
[0038] 1) Introducing external knowledge (search, knowledge base): Using search engines, vector knowledge bases, and other methods, we retrieve relevant expertise and combine it with the question to form a prompt, which is then input into the LLM to obtain the answer (i.e., the inference result). Because the data input into the LLM contains relevant expertise, this approach can improve the reliability of the expertise in the answer.
[0039] 2) Problem decomposition: For problems that are too long or too complex, which require strong reasoning skills, LLM cannot directly handle, the problem can be reasonably decomposed. Complex problems can be broken down into a series of simpler problems, which can then be solved step by step by LLM.
[0040] 3) Apply new templates to control the answer method: For some questions, you can use the characteristics of LLM to embed the questions into specific templates and require the output of LLM to meet specific requirements.
[0041] All of the above actions are related to prompt engineering, which is one of the best ways to use LLM to solve problems and obtain effective answers. However, during use, only one specific processing method can be used, and it relies entirely on manual settings, which means that LLM can only obtain effective reasoning results under specific types of questions. For example, prompt engineering is a project used to develop and optimize questions to obtain prompt words. Using prompt engineering can improve the ability of large language models to handle complex task scenarios, such as question answering and arithmetic reasoning.
[0042] In view of this, an embodiment of the present application provides a problem handling method, which can iteratively filter actions from multiple actions, and each time the action is filtered, the problem and the content obtained by executing the filtered actions are used for filtering. When the number of iterations reaches a threshold or the filtered action is a termination action, the prompt containing the problem and all the content obtained by executing the filtered actions can be input into the LLM for processing. In this way, by continuously enhancing and optimizing the problem, the problem is easier to be understood and processed by the LLM. Therefore, by subsequently processing the enhanced and optimized problem through the LLM, a better answer can be obtained.
[0043] The following first introduces the application scenario of the question processing method provided in the embodiment of the present application, wherein the question processing method can be applied to the question-answering scenario based on LLM.
[0044] For example, Figure 1 shows a schematic diagram of the architecture of an LLM-based question-answering system provided in an embodiment of the present application. As shown in Figure 1 , the LLM-based question-answering system 100 may include: a client 110 , a question enhancement component 120 , an action space 130 , and an LLM 140 .
[0045] The client 110 is mainly responsible for receiving the question (question or query) input by the user and transmitting the question to the question enhancement component 120, as well as receiving the reasoning result (i.e., the answer) from the LLM 140 and presenting the reasoning result to the user. The client 110 can be a desktop application, a mobile application, a web application, or a web-based application. In this embodiment, the user can enter a question on the client 110. After the user completes the input and triggers the information search task on the client 110, the client 110 can transmit the question entered by the user to the question enhancement component 120. Exemplarily, after completing the input, the user can click a button on the client 110 for executing the information search task. For example, when the client 110 is a web application, the user can click the "enter" button on the keyboard to trigger the information search task.
[0046] The question enhancement component 120 is primarily used to enhance and optimize the question received from the client 110 using the actions stored in the action space 130 to obtain a prompt. The prompt includes the question and content used to improve the comprehensibility of the question. The content that improves the comprehensibility of the question can be understood as content that can help the LLM 140 better understand the question. Furthermore, the question enhancement component 120 can also transmit the obtained prompt to the LLM 140, which then processes the prompt to obtain an inference result. A detailed description of the question enhancement component 120 is provided below.
[0047] Action space 130 is primarily used to store various pre-built actions related to prompt engineering, such as introducing external knowledge (search, knowledge base), decomposing questions, or applying new templates to control answer methods, in order to obtain content that improves the comprehensibility of questions. For example, the actions in action space 130 can be understood as operations performed on questions or prompts. Furthermore, actions related to prompt engineering can also include termination actions. This termination action can be used to end the screening process.
[0048] The LLM 140 is mainly used to process the prompt output by the question enhancement component 120 to obtain an inference result related to the question input by the user.
[0049] In this embodiment, the question enhancement component 120 may include: an encoding module 121, a strategy planning module 122, and a strategy execution module 123. The encoding module 121 may be used to encode the question to obtain a feature vector of the question. Furthermore, the encoding module 121 may also be used to encode the prompt obtained by the strategy execution module 123 performing the target action to obtain a feature vector of the prompt. Exemplarily, the encoding module 121 may be, but is not limited to, BERT (bidirectional encoder representation from transformers).
[0050] The strategy planning module 122 is primarily responsible for processing the feature vector output by the encoding module 121 to select a target action from the action space 130. For example, after processing the feature vector, the strategy planning module 122 can obtain the probability of each action being selected in the action space 130 and select the action associated with the highest probability as the target action. In some embodiments, the strategy planning module 122 can be, but is not limited to, a neural network (NN) classifier such as a multilayer perceptron (MLP).
[0051] The strategy execution module 123 is primarily used to execute the target action selected by the strategy planning model 122 to obtain a prompt. When the target action is not a terminating action, the strategy execution module 123 can execute the target action, obtain content used to indicate the comprehensibility of the question, and concatenate or combine the content with the question to generate a new prompt. The strategy execution module 123 can then transmit the latest prompt it has generated to the encoding module 121. The encoding module 121 can then encode the prompt generated by the strategy execution module 123 and transmit the encoded prompt's feature vector to the strategy planning module 122. The strategy planning module 122 can then process the prompt's feature vector to again select a target action from the action space 130 and transmit the target action to the strategy execution module 123. When the target action is a terminating action, the strategy execution module 123 can input the prompt obtained from its previous execution of the target action into the LLM 140. In addition, when the number of times the strategy planning module 122 screens actions reaches a preset threshold, the strategy execution module 123 may also transmit the prompt it generates to LLM140 after it executes the target action. In some embodiments, the strategy execution module 123 may be, but is not limited to, NN. It should be understood that the prompt transmitted to LLM140 by the strategy execution module 123 includes the content obtained after executing each action for improving the comprehensibility of the question, as well as the question input by the user. For example, when the strategy execution module 123 executes two actions and transmits its latest generated prompt to LLM140, and the content obtained by executing the first action for improving the comprehensibility of the question is knowledge1, and the content obtained by executing the second action for improving the comprehensibility of the question is knowledge2, then the prompt transmitted to LLM140 is [knowledge1+knowledge2+question].
[0052] Thus, the question enhancement component 120 can perform multiple enhancements and optimizations on the question input by the user, so that the prompt input to the LLM 140 is the easiest for the LLM to understand. This ensures that the inference result of the LLM 140 matches the question, thereby improving the accuracy of the inference result.
[0053] For ease of understanding, the working process of the question enhancement component 120 is described in detail below.
[0054] For example, Figure 2 shows a schematic diagram of the working process of the question enhancement component shown in Figure 1. As shown in Figure 2, the working process of the question enhancement component 120 may include the following steps:
[0055] S201. Obtain a question input by a user, and encode the question to obtain a feature vector of the question.
[0056] In this embodiment, after a user completes inputting a question on an electronic device such as a mobile phone or computer and confirms the query for an answer related to the question, the question enhancement component 120 can obtain the user's input question. Next, the question enhancement component 120 can use its encoding module 121 to encode the question and obtain a feature vector of the question.
[0057] S202: Based on the feature vector of the problem, select the first target action to be executed from the action space.
[0058] In this embodiment, the question enhancement component 120 may input the feature vector of the question into the strategy planning module 122 therein to obtain the probability of each action being selected in the action space 130. Then, the question enhancement component 120 may select the action associated with the highest probability as the first target action.
[0059] S203: Determine whether the first target action is a termination action.
[0060] In this embodiment, when the first target action is a termination action, it indicates that the LLM can well understand the problem without performing enhanced optimization on the problem. Therefore, the problem can be directly output to the LLM, that is, S204 is executed. When the first target action is not a termination action, it indicates that enhanced optimization is required for the problem to be well understood by the LLM. Therefore, the first target action can be executed, that is, S205 is executed.
[0061] S204. Output the problem to LLM.
[0062] In this embodiment, when the first target action is a termination action, the question enhancement component 120 may input the question into the LLM 140 .
[0063] S205: Execute the first target action to obtain the first prompt.
[0064] In this embodiment, when the first target action is not a termination action, the question enhancement component 120 can execute the first target action through the policy execution module 123 therein to obtain content related to the first target action and that can improve the comprehensibility of the question; and combine the content with the question to obtain the first prompt. The first prompt contains the question and the content obtained by executing the first target action. For example, when the first target action is to decompose the question, executing the first target action can be to decompose the question to obtain a series of relatively simple question combinations. Among them, these simple question combinations and the original question constitute the prompt. When the first target action is to use a search engine to retrieve professional knowledge related to the question, executing the first target action can be to use a search engine to retrieve professional knowledge related to the question, and splice the retrieved data with the question to obtain a prompt. When the first target action is to apply a new template to control the answer method, executing the first target action can be to embed the question into a specific template to obtain a prompt.
[0065] S206. Encode the i-th prompt to obtain a feature vector of the i-th prompt, where the initial value of i is 1.
[0066] In this embodiment, after obtaining the i-th prompt, the question enhancement component 120 may encode the i-th prompt to obtain a feature vector of the i-th prompt, where the initial value of i is 1.
[0067] S207 : Based on the feature vector of the i-th prompt, select a second target action to be executed from the action space.
[0068] In this embodiment, the question enhancement component 120 may input the feature vector of the i-th prompt into the strategy planning module 122 therein to obtain the probability of each action being selected in the action space 130. Then, the question enhancement component 120 may select the action associated with the highest probability as the second target action.
[0069] S208: Determine whether the second target action is a termination action.
[0070] In this embodiment, when the second target action is a termination action, it indicates that the i-th prompt has been well understood by the LLM. Therefore, the i-th prompt can be directly output to the LLM, that is, executing S211. If the second target action is not a termination action, the difference between i and the preset number of iterations N can be compared to determine whether the preset number of iterations has been reached, that is, executing S209.
[0071] S209: Determine whether the value of i is less than the number of iterations N.
[0072] In this embodiment, when the value of i is less than the number of iterations N, optimization of the i-th prompt can continue, and thus the second target action can be performed, i.e., S210 can be executed. When the value of i is equal to the number of iterations N, it indicates that the maximum number of iterations has been reached, and optimization of the i-th prompt can be terminated. The i-th prompt is then output to the LLM, i.e., S211 can be executed.
[0073] S210 , i=i+1, and execute the second target action to obtain the i-th prompt.
[0074] In this embodiment, when the value of i is less than the number of iterations N, i can be updated to i+1, and the second target action is executed to obtain content related to the second target action and that can improve the comprehensibility of the question. Then, the newly obtained content can be added to the previously obtained prompt to obtain a new prompt, and execution returns to 206.
[0075] S211. Output the i-th prompt to LLM.
[0076] In this embodiment, when the second target action is a termination action or the value of i is equal to the number of iterations N, the question enhancement component 120 may input the i-th prompt to the LLM 140 .
[0077] Thus, the question enhancement component 120 can enhance and optimize the question input by the user, so that the LLM 140 can better understand the question input by the user, thereby improving the accuracy of the reasoning result of the LLM 140.
[0078] It should be noted that the client 110 and the question enhancement component 120 shown in Figure 1 can both be configured on electronic devices such as mobile phones and computers. In addition, the question enhancement component 120 can also be configured on a server (such as a cloud server, etc.). The action space 130 and LLM140 can both be configured on a server (such as a cloud server, etc.), but are not limited to being configured on a server (such as a cloud server, etc.), and both can be configured on the same server or on different servers. For example, as shown in Figure 3 (A), the client 110 is configured on the end side 310, and the question enhancement component 120, the action space 130 and the LLM140 are all configured on the cloud side 320. As shown in Figure 3 (B), the client 110 and the question enhancement component 120 are both configured on the end side 310, and the action space 130 and the LLM140 are both configured on the cloud side 320. Among them, the end side 310 can be understood as the side of the electronic device used by the user, and the cloud side 320 can be understood as the server side.
[0079] In this embodiment, a conversation window may be displayed on the client 110 shown in FIG1 or 3 . A user may enter a question in this conversation window; at the same time, the client 110 may display the question-related reasoning results output by the LLM 140 in this conversation window. For example, as shown in FIG4(A), FIG4(A) shows a conversation window 41, which may display a question 411 entered by the user and a reasoning result 412 from the LLM. This conversation window 41 may include an input control 42, through which the user may enter a question. Furthermore, to facilitate the user's understanding of the question enhancement optimization effect of the question enhancement component 120, the client 110 may also present the user with a prompt input from the question enhancement component 120 to the LLM 140. For example, as shown in FIG4(B), in addition to the question 411 entered by the user and the reasoning result 412, the conversation window 41 also displays a prompt 413 input to the LLM 140. Prompt 413 may include content "knowledge1" to improve the comprehensibility of the question and the question "question" entered by the user. In this way, the user can intuitively observe the effect of the question enhancement component 120 on question enhancement optimization, and can then choose whether to enable the question enhancement component 120 according to their own needs. In some embodiments, the terminal side configured with the client 110 may be configured with, but is not limited to, a control for turning on or off the question enhancement component 120, so that the user can choose whether to enable the question enhancement component 120 according to their own needs.
[0080] The above is an introduction to the LLM-based question-answering system provided in the embodiments of this application. Before using the LLM-based question-answering system, the question enhancement component of the system can be trained. The following describes the process of training the question enhancement component.
[0081] For example, Figure 5 shows a schematic diagram of the training process of the question enhancement component in Figure 1. As shown in Figure 5, the training process may include the following steps:
[0082] S501: Process the training sample through the question enhancement component 120 to obtain a prompt.
[0083] In this embodiment, a training sample can be pre-constructed. The training sample can include a question. Then, the training sample can be input into the question enhancement component 120, so that the question enhancement component 120 processes the training sample to obtain a prompt.
[0084] Among them, when processing the training samples, the question enhancement component 120 can randomly sample actions from the action space 130 and execute the randomly sampled actions. When the randomly sampled action is a termination action or reaches a preset number of iterations, the latest prompt can be output. The processing process of S501 can be seen in the description of Figure 2. In addition, the biggest difference between the processing process of S501 and that of Figure 2 is that in Figure 2, after obtaining the probability of each action being selected, an action associated with the highest probability is used as the target action, while in S501, after obtaining the probability of each action being selected, an action is randomly selected as the target action based on these probabilities.
[0085] S502: Process the prompt through LLM140 to obtain an answer.
[0086] In this embodiment, after the prompt is obtained, the prompt can be processed by LLM140 to obtain the answer, that is, the inference result.
[0087] S503. The reward calculation component 510 processes the answer and the sample label of the training sample (i.e., the standard answer) to obtain a reward value.
[0088] In this embodiment, after obtaining the answer, the answer and the standard answer can be processed by the reward calculation component 510 to obtain a reward. For example, the similarity between the answer and the standard answer can be evaluated using a bilingual evaluation understudy (BLEU) tool to obtain a reward. Alternatively, the feature vectors of the two can be first calculated using a neural network algorithm, and then the feature vectors of the two can be calculated using a cosine similarity algorithm to obtain a reward. The more similar the answer is to the standard answer, the higher the reward.
[0089] In some embodiments, in addition to calculating the reward through the reward calculation component 510, the reward can also be determined manually. In this case, S503 can be changed to: presenting the answer to the user and generating a reward based on the user's judgment result between the answer and the standard answer.
[0090] S504 : Train the question enhancement component 110 with the goal of maximizing the reward.
[0091] In this embodiment, after obtaining the reward, the parameters in the question enhancement component 110 may be adjusted with the goal of maximizing the reward to train the question enhancement component 110 .
[0092] In this way, the training of the question enhancement component 110 is achieved.
[0093] The above is an introduction to the LLM-based question-answering system provided in the embodiment of the present application. Next, based on the above content, the question-solving method provided in the embodiment of the present application is introduced.
[0094] For example, FIG6 shows a flowchart of a problem-solving method provided by an embodiment of the present application. It is understood that the method can be executed by any device, equipment, platform, or device cluster with computing and processing capabilities. As shown in FIG6, the problem-solving method may include the following steps:
[0095] S601: Obtain a question input by a user.
[0096] S602. Based on the question, iteratively filter actions from multiple actions related to the prompt project. In the first round of iteration, the question is used to filter actions. In any round of iteration except the first round of iteration, the question and the content obtained by executing the filtered actions are used to filter actions.
[0097] In this embodiment, after receiving a question input by the user, actions can be iteratively selected from multiple actions related to the prompt project based on the question. In the first iteration, the question is used to select actions. In all subsequent iterations except the first, the question and the content obtained by executing the selected actions are used to select actions. For example, the resulting content can be used to improve the comprehensibility of the question. In some embodiments, after the first iteration, the question and the content obtained by executing the selected actions can be combined or concatenated in the current iteration. The result of the combination or concatenation is then encoded to generate a feature vector representing the result. The probability of selection of each action included in the multiple actions related to the prompt project can then be determined based on this feature vector. Finally, the action with the highest probability can be selected as the action selected in the current iteration. In this way, the desired action is selected. In the first iteration, the question can be encoded to generate a feature vector representing the question. The probability of selection of each action included in the multiple actions related to the prompt project can then be determined based on this feature vector. Finally, the action with the highest probability can be selected as the action selected in the first iteration. In this way, the required actions are screened out. For example, the multiple actions related to the prompt project may include a termination action. The termination action can be used to end the iterative process.
[0098] S603. When the number of iterations reaches a threshold or the action selected by the current iteration is a termination action, a prompt word is input into the large language model to obtain an answer related to the question. The prompt word includes the question and the content obtained by executing the actions selected by each iteration.
[0099] In this embodiment, when the number of iterations reaches a threshold or the action selected by the current round of iterations is a termination action, a prompt word can be input into the large language model to obtain an answer related to the question. The prompt word includes the question and the content obtained by executing the actions selected by each round of iterations. In some embodiments, the prompt word can be presented to the user so that the user is aware of the processing effect. Exemplarily, the prompt word can be displayed in the manner shown in (B) of Figure 4.
[0100] In this way, actions are iteratively filtered from multiple actions, and each time an action is filtered, the problem and the content obtained by executing the filtered actions are used for filtering. This allows the problem and the content obtained by executing the actions to be continuously enhanced and optimized, so that the prompt words finally input into the LLM are the easiest for the LLM to understand, thereby improving the accuracy of the LLM reasoning results.
[0101] In some embodiments, before S602, it may be determined whether the question enhancement optimization control is in an on state. When the question enhancement optimization control is in an on state, S602 is executed. For example, the question enhancement optimization control may be the question enhancement component 120 shown in FIG1 .
[0102] It is understood that the execution process of the steps shown in FIG6 can be, but is not limited to, the relevant description in FIG2 . In addition, the order of the sequence numbers of the steps in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. In addition, the various embodiments described above can be combined according to actual conditions, and the combined solutions are still within the scope of protection of this application.
[0103] Based on the method in the above embodiment, an embodiment of the present application provides a problem handling device.
[0104] Exemplarily, FIG7 shows a schematic structural diagram of a question processing device provided by an embodiment of the present application. As shown in FIG7 , the question processing device includes: an acquisition module 701 and a processing module 702. The acquisition module 701 is used to obtain a question input by a user. The processing module 702 is used to iteratively filter actions from a plurality of actions related to the prompt project based on the question, wherein, in the first round of iteration, the action is filtered using the question, and in any round of iteration except the first round of iteration, the action is filtered using the question and the content obtained by executing the filtered action. The processing module 702 is also used to input the prompt word into the large language model to obtain an answer related to the question when the number of iterations reaches a threshold or the action filtered out in the current round of iteration is a termination action. The prompt word includes the question and the content obtained by executing the action filtered out in each round of iteration.
[0105] In some embodiments, when the processing module 702 uses the question and the content obtained by executing the filtered actions to filter from multiple actions, it is specifically used to: determine the probability of an action included in multiple actions related to the prompt project being selected based on the question and the content obtained by executing the filtered actions; and use the action associated with the highest probability as the filtered action.
[0106] In some embodiments, the processing module 702 is further configured to present a prompt word to the user.
[0107] In some embodiments, before iteratively filtering actions from a plurality of actions related to the prompt project based on the problem, the processing module 702 is further configured to: determine whether a problem enhancement optimization control is in an on state.
[0108] In some embodiments, actions related to prompt engineering include one or more of the following: introducing external knowledge, applying templates, or problem decomposition.
[0109] In some embodiments, both the acquisition module 701 and the processing module 702 shown in FIG7 can be implemented via software or hardware. For example, the implementation of the acquisition module 701 will be described below using the acquisition module 701 as an example. Similarly, the implementation of the processing module 702 can refer to the implementation of the acquisition module 701.
[0110] As an example of a software functional unit, the acquisition module 701 may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Furthermore, the computing instance may be one or more. For example, the acquisition module 701 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed in the same region or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including one data center or multiple geographically close data centers. Typically, a region may include multiple AZs.
[0111] Similarly, multiple hosts / virtual machines / containers running the code can be distributed within the same virtual private cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Cross-region communication between two VPCs within the same region, or between VPCs in different regions, requires a communication gateway within each VPC to interconnect the VPCs.
[0112] As an example of a hardware functional unit, the acquisition module 701 may include at least one computing device, such as a server. Alternatively, the acquisition module 701 may be implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0113] The multiple computing devices included in acquisition module 701 can be distributed in the same region or in different regions. The multiple computing devices included in acquisition module 701 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in acquisition module 701 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of servers, ASICs, PLDs, CPLDs, FPGAs, GALs, and other computing devices.
[0114] It should be noted that, in other embodiments, the acquisition module 701 can be used to execute any step in the problem handling method described in the above embodiment, and the processing module 702 can also be used to execute any step in the problem handling method described in the above embodiment. In addition, the acquisition module 701 can also be combined with the processing module 702 to be responsible for executing any step in the problem handling method described in the above embodiment. In addition, the steps that the acquisition module 701 and the processing module 702 are responsible for implementing can also be specified as needed, and the acquisition module 701 and the processing module 702 respectively implement different steps in the problem handling method described in the above embodiment to realize all the functions of the problem handling device 700 shown in Figure 7.
[0115] This application also provides a computing device 800. As shown in Figure 8, computing device 800 includes a bus 802, a processor 804, a memory 806, and a communication interface 808. Processor 804, memory 806, and communication interface 808 communicate with each other via bus 802. Computing device 800 can be a server or a terminal device. It should be understood that this application does not limit the number of processors and memories in computing device 800.
[0116] Bus 802 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, among others. Buses may be classified as address buses, data buses, control buses, and the like. For ease of illustration, FIG8 illustrates a single bus line, but this does not imply a single bus or type of bus. Bus 804 may include a path for transmitting information between various components of computing device 800 (e.g., memory 806, processor 804, and communication interface 808).
[0117] The processor 804 may include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0118] The memory 806 may include volatile memory, such as random access memory (RAM). The processor 804 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).
[0119] Memory 806 stores executable program code, which processor 804 executes to implement the functions of acquisition module 701 and processing module 702 shown in FIG. 7 , thereby implementing the problem handling method described in the above embodiment. That is, memory 806 stores instructions for executing the problem handling method described in the above embodiment.
[0120] Alternatively, the memory 806 stores executable code, and the processor 804 executes the executable code to implement the functions of the problem handling device 700 shown in Figure 7, thereby implementing the problem handling method described in the above embodiment. In other words, the memory 806 stores instructions for executing the problem handling method described in the above embodiment.
[0121] The communication interface 803 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 800 and other devices or a communication network.
[0122] Embodiments of the present application also provide a computing device cluster. The computing device cluster includes at least one computing device. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smartphone.
[0123] As shown in Figure 9, the computing device cluster includes at least one computing device 800. The memory 806 in one or more computing devices 800 in the computing device cluster may store the same instructions for executing the problem handling method described in the above embodiment.
[0124] In some possible implementations, the memory 806 of one or more computing devices 800 in the computing device cluster may also store partial instructions for executing the problem-solving method described in the above embodiment. In other words, the combination of one or more computing devices 800 can jointly execute instructions for executing the problem-solving method described in the above embodiment.
[0125] It should be noted that the memory 806 in different computing devices 800 in the computing device cluster can store different instructions, each for executing part of the functions of the problem handling apparatus 700 shown in FIG7 . In other words, the instructions stored in the memory 806 in different computing devices 800 can implement the functions of one or more of the acquisition module 701 and the processing module 702.
[0126] In some possible implementations, one or more computing devices in a computing device cluster may be connected via a network. The network may be a wide area network (WAN) or a local area network (LAN), among others. FIG. 10 illustrates a possible implementation. As shown in FIG. 10 , two computing devices 800A and 800B are connected via a network. Specifically, the network is connected via a communication interface in each computing device. In this type of possible implementation, the memory 806 in the computing device 800A stores instructions for executing the functions of the acquisition module 701. Simultaneously, the memory 806 in the computing device 800B stores instructions for executing the functions of the processing module 702.
[0127] It should be understood that the functionality of the computing device 800A shown in FIG10 may also be implemented by multiple computing devices 800. Similarly, the functionality of the computing device 800B may also be implemented by multiple computing devices 800.
[0128] The present application also provides another computing device cluster. The connection relationship between the computing devices in this computing device cluster can be similar to the connection method of the computing device cluster described in Figures 9 and 10. However, the memory 806 in one or more computing devices 800 in this computing device cluster can store the same instructions for executing the method described in the above embodiment.
[0129] In some possible implementations, the memory 806 of one or more computing devices 800 in the computing device cluster may also store some instructions for executing the aforementioned problem-solving method. In other words, the combination of one or more computing devices 800 can jointly execute the instructions for executing the aforementioned problem-solving method.
[0130] Based on the method in the above embodiment, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is run on an electronic device, the electronic device executes the method described in the above embodiment. Exemplarily, the computer-readable storage medium can be any available medium that a computing device can store or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid-state drive), etc.
[0131] Based on the method in the above embodiment, an embodiment of the present application provides a computer program product containing instructions. When the computer program product is run on an electronic device, the electronic device executes the method in the above embodiment.
[0132] It is understood that the processor in the embodiments of the present application may be a central processing unit (CPU), or may be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. The general-purpose processor may be a microprocessor or any conventional processor.
[0133] The method steps in the embodiments of the present application can be implemented by hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, which can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC.
[0134] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted via the computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state drive (SSD)).
[0135] It will be understood that the various numerical numbers involved in the embodiments of the present application are merely distinctions for the convenience of description and are not intended to limit the scope of the embodiments of the present application.
[0136] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the protection scope of the technical solutions of the embodiments of the present application.
Claims
1. A problem solving method, characterized in that: The method comprises: Get user input questions; Based on the question, iteratively select actions from a plurality of actions related to the prompting project, wherein in a first round of iteration, the question is used to select actions, and in any round of iteration except the first round of iteration, the question and content obtained by executing the selected actions are used to select actions; When the number of iterations reaches a threshold or the action selected by the current round of iterations is a termination action, a prompt word is input into the large language model to obtain an answer related to the question, wherein the prompt word includes the question and the content obtained by executing the actions selected by each round of iterations.
2. The method according to claim 1, characterized in that Using the question and the content obtained by performing the filtered actions, filter actions are performed, including: Determining, based on the question and the content obtained by executing the selected actions, a probability of selecting an action included in the plurality of actions related to the prompting project; The actions associated with the highest probability are taken as the filtered actions.
3. The method according to claim 1 or 2, characterized in that: The method further comprises: The prompt word is presented to the user.
4. The method according to any one of claims 1 to 3, characterized in that: Before iteratively selecting actions from a plurality of actions related to prompt engineering based on the problem, it also includes: Make sure the Problem Enhanced Optimization control is turned on.
5. The method according to any one of claims 1 to 3, characterized in that: The actions related to the prompt project include one or more of the following: Introduce external knowledge, apply templates, or decompose problems.
6. A problem handling device, characterized in that: include: The acquisition module is used to obtain the questions input by the user; a processing module, configured to iteratively select actions from a plurality of actions related to the prompting project based on the question, wherein in a first round of iteration, the action is selected by using the question, and in any round of iteration except the first round of iteration, the action is selected by using the question and the content obtained by executing the selected actions; The processing module is further configured to input a prompt word into the large language model to obtain an answer related to the question when the number of iterations reaches a threshold or the action screened out in the current round of iterations is a termination action, wherein the prompt word includes the question and the content obtained by executing the actions screened out in each round of iterations.
7. The device according to claim 6, characterized in that When the processing module uses the question and the content obtained by executing the filtered actions to filter the actions, it is specifically used to: Determining, based on the question and the content obtained by executing the selected actions, a probability of selecting an action included in the plurality of actions related to the prompting project; The actions associated with the highest probability are taken as the filtered actions.
8. The device according to claim 6 or 7, characterized in that The processing module is further used for: The prompt word is presented to the user.
9. The device according to any one of claims 6 to 8, characterized in that: Before iteratively selecting actions from a plurality of actions related to the prompt project based on the question, the processing module is further used to: Make sure the Problem Enhanced Optimization control is turned on.
10. The device according to any one of claims 6 to 9, characterized in that: The actions related to the prompt project include one or more of the following: Introduce external knowledge, apply templates, or decompose problems.
11. A computing device cluster, characterized in that: comprising at least one computing device, each computing device comprising a processor and a memory; The processor of the at least one computing device is used to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the method according to any one of claims 1-5.
12. A computer-readable storage medium storing a computer program, wherein when the computer program is executed on an electronic device, the electronic device executes the method according to any one of claims 1 to 5.
13. A computer program product, characterized in that When the computer program product runs on an electronic device, the electronic device executes the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Problem processing method and device and computing device cluster
CN117390150A
Question answering method combining sequence model and knowledge graph
CN116127095A
Prompt information generation method and device, electronic equipment and storage medium
CN116484879A
Knowledge question and answer method, device and equipment and storage medium
CN116561278A
Aspect prompting framework for language modeling
US20230237277A1
Cited By
AD and MCI multi-dimensional knowledge discovery method and device
CN121561022A