A problem processing method, apparatus and computing device cluster
Patent Information
- Application Number
- CN202311283213.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-28
- Publication Date
- 2026-09-29
- Estimated Expiration
- 2043-09-28
AI Technical Summary
尽管LLM在许多自然语言处理任务上表现出色,但LLM在某些情况下(比如:训练数据不足、语义歧义、问题不明确等)的推理结果可能会出现不理想的情况
[0019]可以理解的是,上述第二方面至第五方面的有益效果可以参见上述第一方面中的相关描述,在此不再赘述。
Smart Images

Figure CN117390150B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence (AI) technology, and in particular to a problem-solving method, apparatus, and cluster of computing devices. Background Technology
[0002] With the development of AI technology, large language models (LLMs) have gradually entered people's lives, bringing many positive impacts and benefits. LLMs are language models with extremely large-scale natural language processing capabilities. They possess very powerful reasoning abilities and can process and generate natural language text. LLMs typically have billions or even trillions of parameters, thus enabling them to handle complex natural language understanding and generation tasks. Although LLMs perform excellently on many natural language processing tasks, their inference results may be unsatisfactory in certain situations (such as insufficient training data, semantic ambiguity, or unclear questions). Therefore, improving the accuracy of LLM inference results is a pressing technical problem that needs to be solved. Summary of the Invention
[0003] This application provides a problem-solving method, apparatus, computing device cluster, computer storage medium, and computer product that can improve the accuracy of LLM inference results.
[0004] Firstly, this application provides a problem-solving method, comprising: acquiring a problem input by a user; iteratively selecting actions from multiple actions related to prompt engineering based on the problem, wherein, in the first iteration, actions are selected using the problem; and in any iteration other than the first iteration, actions are selected using the problem and the content obtained from executing the selected actions; when the number of iterations reaches a threshold or the action selected in the current iteration is a termination action, a prompt word is input into a large language model to obtain an answer related to the problem, wherein the prompt word includes the problem and the content obtained from executing the actions selected in each iteration. For example, prompt engineering is an engineering process used to develop and optimize problems to obtain prompt words. Prompt engineering can improve the ability of a large language model to handle complex task scenarios, such as question answering and arithmetic reasoning. For example, the content obtained from executing actions can be used to improve the comprehensibility of the problem. For example, multiple actions related to prompt engineering may include a termination action. The termination action can be used to end the iteration process.
[0005] In this way, by iteratively filtering actions from multiple actions, and by using the question and the content obtained from executing the already filtered actions each time, the questions and the content obtained from executing actions can be continuously enhanced and optimized. This makes the prompts input to the LLM the easiest for the LLM to understand, thereby improving the accuracy of the LLM inference results.
[0006] In one possible approach, actions are filtered using the content obtained from the question and the execution of the selected actions. This includes: determining the probability of selecting an action from among multiple actions related to the prompting process based on the content obtained from the question and the execution of the selected actions; and selecting the action with the highest probability as the selected action. In this way, the desired actions can be selected in any iteration after the first round.
[0007] One possible approach involves using a question-based selection process, which includes: determining the probability of selecting an action from among multiple actions related to the prompting process, based on the question; and selecting the action with the highest probability as the selected action. This allows the desired actions to be selected during the first iteration.
[0008] One possible approach includes presenting prompts to the user. This allows the user to intuitively perceive the processing effect, enabling them to choose whether to enable the feature.
[0009] In one possible approach, before iteratively filtering actions from multiple prompt-related actions based on the question, the process further includes: ensuring that the question enhancement optimization control is enabled. This way, question enhancement optimization is only performed when the control is enabled, allowing the user to make their own selections.
[0010] In one possible approach, actions related to prompting engineering include one or more of the following: introducing external knowledge, applying templates, or problem decomposition.
[0011] Secondly, this application provides a question processing apparatus, including an acquisition module and a processing module. The acquisition module is used to acquire a question input by a user. The processing module is used to iteratively filter actions from multiple actions related to prompting the question, wherein in the first iteration, the action is filtered using the question; in any iteration other than the first iteration, the action is filtered using the question and the content obtained from performing the filtered actions. The processing module is further used to input prompt words into a large language model when the number of iterations reaches a threshold or when the action selected in the current iteration is a termination action, to obtain an answer related to the question, wherein the prompt words include the question and the content obtained from performing the actions selected in each iteration.
[0012] In one possible approach, when the processing module filters actions using the content obtained from the question and the execution of the filtered actions, it specifically: determines the probability of selecting an action among multiple actions related to the prompt project based on the content obtained from the question and the execution of the filtered actions; and selects the action with the highest probability as the filtered action.
[0013] In one possible approach, the processing module is also used to: present prompts to the user.
[0014] In one possible approach, before the processing module iteratively filters actions from multiple actions related to the prompting process based on the issue, it is also used to: determine if the issue enhancement optimization control is enabled.
[0015] In one possible approach, actions related to prompting engineering include one or more of the following: introducing external knowledge, applying templates, or problem decomposition.
[0016] Thirdly, this application provides a computing device cluster, including at least one computing device, each computing device including 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 performs the method described in the first aspect or any possible implementation of the first aspect.
[0017] Fourthly, this application provides a computer-readable storage medium including computer program instructions, which, when executed by a computing device, perform the method described in the first aspect or any possible implementation thereof; or, when executed by a cluster of computing devices, the cluster of computing devices performs the method described in the first aspect or any possible implementation thereof. Exemplarily, the cluster of computing devices may include one or more computing devices.
[0018] Fifthly, this application provides a computer program product containing instructions that, when executed by a computing device, cause the computing device to perform the method described in the first aspect or any possible implementation thereof; or, when executed by a cluster of computing devices, cause the cluster of computing devices to perform the method described in the first aspect or any possible implementation thereof. Exemplarily, a cluster of computing devices may include one or more computing devices.
[0019] It is understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description
[0020] Figure 1This is a schematic diagram of the architecture of a question-answering system based on LLM provided in an embodiment of this application;
[0021] Figure 2 yes Figure 1 The diagram shown illustrates the working process of the problem enhancement component.
[0022] Figure 3 yes Figure 1 The diagram shows the deployment of each component in an LLM-based question-answering system.
[0023] Figure 4 This is a schematic diagram of an interface on an electronic device provided in an embodiment of this application;
[0024] Figure 5 Yes Figure 1 The diagram illustrates the training process of the problem enhancement component shown.
[0025] Figure 6 This is a flowchart illustrating a problem-solving method provided in an embodiment of this application;
[0026] Figure 7 This is a schematic diagram of the structure of a problem-solving device provided in an embodiment of this application;
[0027] Figure 8 This is a schematic diagram of the structure of a computing device provided in an embodiment of this application;
[0028] Figure 9 This is a schematic diagram of the structure of a computing device cluster provided in an embodiment of this application;
[0029] Figure 10 This is a schematic diagram of another computing device cluster structure provided in an embodiment of this application. Detailed Implementation
[0030] In this article, the term "and / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. The symbol " / " in this article indicates that the related objects are in an "or" relationship; for example, A / B means A or B.
[0031] The terms "first" and "second," etc., used in the specification and claims herein are used to distinguish different objects, not to describe a specific order of objects. For example, "first response message" and "second response message," etc., are used to distinguish different response messages, not to describe a specific order of response messages.
[0032] In the embodiments of this application, the terms "exemplary" or "for example" are used to indicate that something is an example, illustration, or description. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design. Specifically, the use of the terms "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0033] In the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more, for example, multiple processing units means two or more processing units, multiple elements means two or more elements, etc.
[0034] Generally, to obtain more effective reasoning results, a series of processes can be performed on the problem input into the LLM. These processes include, but are not limited to:
[0035] 1) Introducing external knowledge (search, knowledge base): Utilizing search engines, vector knowledge bases, etc., retrieve professional knowledge related to the question and combine it with the question to form prompts input into the LLM to obtain the answer (i.e., the reasoning result). Since the data input into the LLM contains professional knowledge related to the question, this method can improve the reliability of the professional domain knowledge involved in the answer;
[0036] 2) Problem decomposition: For problems that are too long or too complex, considering that LLM cannot directly handle such problems that require strong reasoning ability, the problem can be reasonably decomposed into a series of simpler problems and solved step by step by LLM.
[0037] 3) Use new templates to control the answering method: For some questions, the features of LLM can be used to embed the question into a specific template, requiring the LLM output to meet specific requirements.
[0038] The actions described above are all related to prompting engineering, which is one of the best ways to solve problems and obtain effective answers using LLM. However, only one specific processing method can be used in practice, and it relies entirely on manual settings. This means that LLM can only obtain effective reasoning results for specific types of questions. For example, prompting engineering is used to develop and optimize the question to obtain prompts. Prompting engineering can improve the ability of large language models to handle complex task scenarios, such as question answering and arithmetic reasoning.
[0039] In view of this, embodiments of this application provide a problem-solving method. This method iteratively filters actions from multiple actions, and each time an action is filtered, it uses the problem and the content obtained from executing the filtered actions for filtering. When the number of iterations reaches a threshold or the filtered action is a termination action, a prompt containing the problem and all the content obtained from executing the filtered actions can be input into the LLM for processing. In this way, by continuously enhancing and optimizing the problem, the problem becomes easier for the LLM to understand and process. Therefore, subsequent processing of the enhanced and optimized problem by the LLM can yield better solutions.
[0040] The application scenarios of the problem-solving method provided in this application embodiment will be introduced below. This problem-solving method can be applied to LLM-based question-answering scenarios.
[0041] For example, Figure 1 This diagram illustrates the architecture of an LLM-based question-answering system according to an embodiment of this application. Figure 1 As shown, 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.
[0042] Client 110 is primarily responsible for receiving user-inputted questions (questions or queries) and transmitting them to the question enhancement component 120. It also receives the reasoning results (i.e., answers) from the LLM 140 and presents them to the user. Client 110 can be a desktop application, mobile application, web application, or web-based application. In this embodiment, the user can input a question on client 110. After the user completes the input and triggers an information search task on client 110, client 110 can transmit the user-inputted question to the question enhancement component 120. For example, after completing the input, the user can click a button on client 110 to execute the information search task; for instance, when client 110 is a web application, the user can click the "enter" key on the keyboard to trigger the information search task.
[0043] The question enhancement component 120 primarily utilizes actions stored in the action space 130 to enhance and optimize the question obtained from the client 110, thereby generating a prompt. The prompt includes the question and content designed to improve its comprehensibility. This comprehensibility-enhancing content can be understood as information that helps the LLM 140 better understand the question. Additionally, the question enhancement component 120 can also transmit the obtained prompt to the LLM 140 for processing, resulting in a reasoning outcome. A detailed description of the question enhancement component 120 is provided below.
[0044] Action space 130 is primarily used to store various pre-built actions related to prompting engineering, such as introducing external knowledge (search, knowledge base), question decomposition, or applying new templates to control the answer method, to obtain content used to improve the comprehensibility of the question. For example, actions in action space 130 can be understood as operations performed on the question or prompt. Additionally, actions related to prompting engineering may also include termination actions. These termination actions can be used to end the filtering process.
[0045] The LLM140 is primarily used to process the prompt output by the question enhancement component 120 to obtain inference results related to the user-input question.
[0046] In this embodiment, the question enhancement component 120 may include an encoding module 121, a policy planning module 122, and a policy execution module 123. The encoding module 121 can be used to encode the question to obtain its feature vector. Additionally, the encoding module 121 can also be used to encode the prompt obtained by the policy execution module 123 performing the target action to obtain the prompt's feature vector. For example, the encoding module 121 may be, but is not limited to, BERT (bidirectional encoder representation from transformers).
[0047] The strategy planning module 122 is mainly used to process 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 in the action space 130 being selected, and select the action 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).
[0048] The strategy execution module 123 is mainly used to execute the target actions selected by the strategy planning model 122 to obtain a prompt. When the target action is not a termination action, the strategy execution module 123 can execute the target action to obtain content that enhances the comprehensibility of the question, and then concatenate or combine this content with the question to generate a new prompt. The strategy execution module 123 can then transmit its latest prompt to the encoding module 121. Next, the encoding module 121 can encode the prompt generated by the strategy execution module 123 and transmit the feature vector of the encoded prompt to the strategy planning module 122. The strategy planning module 122 can then process the feature vector of the prompt to select another target action from the action space 130 and transmit this target action to the strategy execution module 123. When the target action is a termination action, the strategy execution module 123 can input the prompt obtained from the previous execution of the target action into the LLM 140. Additionally, when the number of times the strategy planning module 122 filters actions reaches a preset threshold, the strategy execution module 123 can also transmit its generated prompt to the LLM 140 after executing the target action. In some embodiments, the strategy execution module 123 may be, but is not limited to, an NN. It should be understood that the prompt transmitted by the strategy execution module 123 to the LLM 140 includes content obtained after executing each action to improve the understandability 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 the LLM 140, and the content obtained from executing the first action to improve the understandability of the question is knowledge1, and the content obtained from executing the second action to improve the understandability of the question is knowledge2, then the prompt transmitted to the LLM 140 is [knowledge1 + knowledge2 + question].
[0049] Therefore, the question enhancement component 120 can perform multiple enhancements and optimizations on the user-input question, ensuring that the prompt input to the LLM140 is most easily understood by the LLM. This guarantees a high degree of matching between the LLM140's inference results and the question, improving the accuracy of the inference results.
[0050] To facilitate understanding, the working process of the problem enhancement component 120 will be described in detail below.
[0051] For example, Figure 2 It shows Figure 1 The diagram illustrates the working process of the problem-enhancing component. (See attached diagram.) Figure 2 As shown, the operation of the problem enhancement component 120 may include the following steps:
[0052] S201. Obtain the user's input question and encode the question to obtain the feature vector of the question.
[0053] In this embodiment, after a user completes the input of a question on an electronic device such as a mobile phone or computer and confirms the search for answers related to the question, the question enhancement component 120 can obtain the question input by the user. Then, the question enhancement component 120 can use its internal encoding module 121 to encode the question to obtain the feature vector of the question.
[0054] S202. Based on the feature vector of the problem, select the first target action to be executed from the action space.
[0055] In this embodiment, the problem enhancement component 120 can input the feature vector of the problem into its policy planning module 122 to obtain the probability that each action in the action space 130 can be selected. Then, the problem enhancement component 120 can take the action associated with the highest probability as the first target action.
[0056] S203. Determine whether the first target action is a termination action.
[0057] In this embodiment, when the first target action is a termination action, it indicates that the LLM can understand the problem well without needing to enhance or optimize it. Therefore, the problem can be directly output to the LLM, i.e., S204 is executed. When the first target action is not a termination action, it indicates that the problem needs to be enhanced or optimized for the LLM to understand it well. Therefore, the first target action can be executed, i.e., S205 is executed.
[0058] S204, Output problem to LLM.
[0059] In this embodiment, when the first target action is a termination action, the problem enhancement component 120 can input the problem to the LLM 140.
[0060] S205. Execute the first target action and obtain the first prompt.
[0061] 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 its internal strategy execution module 123 to obtain content related to the first target action and improving the comprehensibility of the question; and combine this content with the question to obtain the first prompt. The first prompt contains the question and the content obtained from 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 simpler question combinations. These simple question combinations and the original question constitute the prompt. When the first target action is to retrieve professional knowledge related to the question using a search engine, executing the first target action can be to use a search engine to retrieve professional knowledge related to the question and concatenate the retrieved data with the question to obtain the 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 the prompt.
[0062] S206. Encode the i-th prompt to obtain the feature vector of the i-th prompt, with the initial value of i being 1.
[0063] In this embodiment, after obtaining the i-th prompt, the question enhancement component 120 can encode the i-th prompt to obtain the feature vector of the i-th prompt. The initial value of i is 1.
[0064] S207. Based on the feature vector of the i-th prompt, select the second target action to be executed from the action space.
[0065] In this embodiment, the question enhancement component 120 can input the feature vector of the i-th prompt into its policy planning module 122 to obtain the probability that each action in the action space 130 can be selected. Then, the question enhancement component 120 can take the action associated with the highest probability as the second target action.
[0066] S208. Determine whether the second target action is a termination action.
[0067] In this embodiment, when the second target action is a termination action, it indicates that the i-th prompt can be well understood by the LLM. Therefore, the i-th prompt can be directly output to the LLM, i.e., S211 is executed. When the second target action is not a termination action, the size of i and the preset iteration number N can be compared to determine whether the preset iteration number has been reached, i.e., S209 is executed.
[0068] S209. Determine if the value of i is less than the iteration number N.
[0069] In this embodiment, when the value of i is less than the iteration count N, it indicates that the optimization of the i-th prompt can continue, so the second objective action can be executed, i.e., S210. When the value of i is equal to the iteration count N, it indicates that the maximum number of iterations has been reached, at which point the optimization of the i-th prompt can be terminated, and the i-th prompt is output to the LLM, i.e., S211 is executed.
[0070] S210, i = i + 1, and execute the second target action to obtain the i-th prompt.
[0071] In this embodiment, when the value of i is less than the iteration number N, i can be updated to i+1, and the second objective action can be executed to obtain content related to the second objective action and improving the understandability of the problem. Then, the latest obtained content can be added to the previously obtained prompt to obtain a new prompt, and execution 206 can be returned.
[0072] S211, Output the i-th prompt to LLM.
[0073] In this embodiment, when the second target action is a termination action or the value of i is equal to the iteration number N, the problem enhancement component 120 can input the i-th prompt to the LLM140.
[0074] Therefore, the question enhancement component 120 can enhance and optimize the question input by the user, so that the LLM140 can better understand the question input by the user, thereby improving the accuracy of the inference results of the LLM140.
[0075] It should be noted that, Figure 1 The client 110 and issue enhancement component 120 shown can both be configured on electronic devices such as mobile phones and computers. Additionally, issue enhancement component 120 can also be configured on a server (such as a cloud server). Action space 130 and LLM 140 can both be configured on servers (such as cloud servers), and both can be configured on the same server or on different servers. For example, as... Figure 3 As shown in (A), the client 110 is configured on the edge 310, while the problem enhancement component 120, action space 130, and LLM 140 are all configured on the cloud side 320. Figure 3 As shown in (B), both the client 110 and the issue enhancement component 120 are configured on the edge 310, while the action space 130 and LLM 140 are configured on the cloud 320. The edge 310 can be understood as the side of the electronic device used by the user, and the cloud 320 can be understood as the server side.
[0076] In this embodiment, Figure 1 A session window can be displayed on client 110 as shown in Figure 3. The user can enter a question in this session window; simultaneously, client 110 can display the reasoning results related to the question output by LLM140 in this session window. For example, as... Figure 4 As shown in (A), Figure 4 (A) shows a session window 41 in which the user-input question 411 and the LLM inference result 412 can be displayed. The session window 41 may include an input control 42 through which the user inputs the question. Additionally, to facilitate the user's understanding of the effect of the question enhancement component 120 on question enhancement optimization, the client 110 may also present the user with a prompt indicating that the question enhancement component 120 is input to the LLM 140. For example, as... Figure 4 In (B), in addition to displaying the user-inputted question 411 and reasoning result 412 in the session window 41, a prompt 413 input to the LLM 140 is also displayed. The prompt 413 may include "knowledge1" to improve question understandability and the user-inputted question. This allows the user to visually observe the effect of the question enhancement component 120 on question enhancement optimization, and then choose whether to enable the question enhancement component 120 according to their own needs. In some embodiments, the client-side configured with the client 110 may, but is not limited to, have a control to enable or disable the question enhancement component 120, allowing the user to choose whether to enable the question enhancement component 120 based on their own needs.
[0077] The above is a description of 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 process of training the question enhancement component is described below.
[0078] For example, Figure 5 It shows Figure 1 A schematic diagram illustrating the training process of the problem enhancement component. (For example...) Figure 5 As shown, the training process may include the following steps:
[0079] S501. The training samples are processed by the question enhancement component 120 to obtain the prompt.
[0080] In this embodiment, training samples can be pre-constructed. These training samples may contain questions. Then, the training samples can be input into the question enhancement component 120 to process them and obtain a prompt.
[0081] The question enhancement component 120, when processing training samples, 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 a preset number of iterations is reached, the latest prompt can be output. The processing procedure of S501 can be found in [reference needed]. Figure 2 The description in [the document / section] is also relevant. Furthermore, the processing procedure of S501 is similar to... Figure 2 The biggest difference is: Figure 2 In step S501, after obtaining the probability of each action being selected, the action with the highest probability is selected as the target action. In step S501, after obtaining the probability of each action being selected, an action is randomly selected as the target action based on these probabilities.
[0082] S502. Process the prompt using LLM140 to obtain the answer.
[0083] In this embodiment, after obtaining the prompt, it can be processed by the LLM140 to obtain the answer, that is, the reasoning result.
[0084] S503. The reward calculation component 510 processes the sample labels (i.e., standard answers) of the answer and training samples to obtain the reward value.
[0085] In this embodiment, after obtaining the answer, the reward calculation component 510 can process the answer and the standard answer 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 both can be calculated first using a neural network (NN) or similar algorithm, and then the feature vectors 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.
[0086] 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 the reward based on the received user's judgment of the answer and the standard answer.
[0087] S504. Train the problem enhancement component 110 with the goal of maximizing the reward.
[0088] In this embodiment, after obtaining the reward, the parameters in the problem enhancement component 110 can be adjusted with the goal of maximizing the reward in order to train the problem enhancement component 110.
[0089] This completes the training of the problem enhancement component 110.
[0090] The above is a description of the LLM-based question-answering system provided in the embodiments of this application. Next, based on the above content, the problem-solving method provided in the embodiments of this application will be described.
[0091] For example, Figure 6 This diagram illustrates a flowchart of a problem-solving method provided in an embodiment of this application. It is understood that this method can be executed by any device, equipment, platform, or cluster of devices with computing and processing capabilities. Figure 6 As shown, the problem-solving method may include the following steps:
[0092] S601, Problem of obtaining user input.
[0093] S602. Based on the problem, iteratively select actions from multiple actions related to the prompting project. In the first iteration, actions are selected using the problem. In any iteration other than the first iteration, actions are selected using the problem and the content obtained from executing the selected actions.
[0094] In this embodiment, after obtaining the user's input question, actions can be iteratively filtered from multiple actions related to the prompting process based on the question. Specifically, in the first iteration, actions are filtered using the question. In any iteration other than the first, actions are filtered using the question and the content obtained from performing the filtered actions. For example, the obtained content can be used to improve the comprehensibility of the question. In some embodiments, after the first iteration, in the current iteration, the question and the content obtained from performing the filtered actions can be combined or concatenated. Then, the combined or concatenated result is encoded to obtain a feature vector that represents the result. Next, the probability of selecting each action among the multiple prompting process-related actions can be determined using this feature vector. Finally, the action with the highest probability can be selected as the action in the current iteration. This way, the required actions are filtered out. In the first iteration, the question can be encoded to obtain a feature vector that represents the question. Then, the probability of selecting each action among the multiple prompting process-related actions can be determined using this feature vector. Finally, the action with the highest probability can be selected as the action in the first iteration. This filters out the desired actions. For example, a termination action may be included among multiple actions related to the prompting process. This termination action can be used to end the iteration process.
[0095] S603. When the number of iterations reaches the threshold or the action selected in the current iteration is the termination action, input the prompt word into the large language model to obtain the answer related to the question. The prompt word includes the question and the content obtained by performing the action selected in each iteration.
[0096] In this embodiment, when the number of iterations reaches a threshold or the action selected in the current iteration 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 performing the action selected in each iteration. In some embodiments, the prompt word can be presented to the user so that the user is aware of the processing effect. For example, it can be done through... Figure 4 The prompt word is displayed in the manner shown in (B).
[0097] In this way, by iteratively filtering actions from multiple actions, and by using the question and the content obtained from executing the already filtered actions each time, the questions and the content obtained from executing actions can be continuously enhanced and optimized. This makes the prompts input to the LLM the easiest for the LLM to understand, thereby improving the accuracy of the LLM inference results.
[0098] In some embodiments, before S602, it can be determined whether the issue enhancement and optimization control is enabled. S602 is executed only when the issue enhancement and optimization control is enabled. For example, the issue enhancement and optimization control can be as described above. Figure 1 The problem enhancement component 120 shown is illustrated.
[0099] Understandable Figure 6 The execution process of the steps shown can be, but is not limited to, the aforementioned procedures. Figure 2 The relevant descriptions in the text are provided. Furthermore, the sequence numbers of the steps in the above embodiments do 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 this application. Additionally, the various embodiments described above can be combined according to actual circumstances, and the combined solutions are still within the protection scope of this application.
[0100] Based on the methods in the above embodiments, this application provides a problem-solving apparatus.
[0101] For example, Figure 7 A schematic diagram of the structure of a problem-solving apparatus provided in an embodiment of this application is shown. Figure 7 As shown, the problem processing device includes an acquisition module 701 and a processing module 702. The acquisition module 701 is used to acquire the question input by the user. The processing module 702 is used to iteratively filter actions from multiple actions related to the prompting process based on the question. Specifically, in the first iteration, actions are filtered using the question; in any iteration other than the first iteration, actions are filtered using the question and the content obtained from performing the filtered actions. The processing module 702 is also used to input prompt words into a large language model when the number of iterations reaches a threshold or when the action selected in the current iteration is a termination action, to obtain an answer related to the question. The prompt words include the question and the content obtained from performing the actions selected in each iteration.
[0102] In some embodiments, when the processing module 702 filters from multiple actions using the content obtained from the question and the execution of the filtered actions, it is specifically used to: determine the probability of selecting an action among multiple actions related to the prompting project based on the content obtained from the question and the execution of the filtered actions; and select the action with the highest probability as the filtered action.
[0103] In some embodiments, the processing module 702 is further configured to: present prompt words to the user.
[0104] In some embodiments, before the processing module 702 iteratively filters actions from multiple actions related to the prompting project based on the question, it is further configured to: determine that the question enhancement optimization control is enabled.
[0105] In some embodiments, actions related to prompting engineering include one or more of the following: introducing external knowledge, applying templates, or problem decomposition.
[0106] In some embodiments, Figure 7 Both the acquisition module 701 and the processing module 702 shown can be implemented in software or in hardware. For example, the implementation of the acquisition module 701 will be described below. Similarly, the implementation of the processing module 702 can refer to the implementation of the acquisition module 701.
[0107] As an example of a software functional unit, 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, or a container. Further, the aforementioned computing instance may be one or more. For example, 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 within the same region or in different regions. Further, the multiple hosts / virtual machines / containers used to run the code may be distributed within the same availability zone (AZ) or in different AZs, each AZ including one or more geographically proximate data centers. Typically, a region may include multiple AZs.
[0108] Similarly, multiple hosts / virtual machines / containers used to run this code can be distributed within the same Virtual Private Cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Communication between two VPCs within the same region, as well as between VPCs in different regions, requires a communication gateway to be set up within each VPC to enable interconnection between VPCs.
[0109] 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 also be a device implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be implemented using a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), generic array logic (GAL), or any combination thereof.
[0110] The multiple computing devices included in the acquisition module 701 can be distributed in the same region or in different regions. Similarly, the multiple computing devices included in the acquisition module 701 can be distributed in the same Availability Zone (AZ) or in different AZs. Likewise, the multiple computing devices included in the acquisition module 701 can be distributed in the same Virtual Private Cloud (VPC) or in multiple VPCs. These multiple computing devices can be any combination of computing devices such as servers, ASICs, PLDs, CPLDs, FPGAs, and GALs.
[0111] 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 embodiments, and the processing module 702 can also be used to execute any step in the problem-handling method described in the above embodiments. Furthermore, 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 embodiments. In addition, the steps implemented by the acquisition module 701 and the processing module 702 can also be specified as needed, and different steps in the problem-handling method described in the above embodiments can be implemented by the acquisition module 701 and the processing module 702 respectively. Figure 7 The problem handling device 700 shown has all the functions.
[0112] This application also provides a computing device 800. For example... Figure 8 As shown, the computing device 800 includes a bus 802, a processor 804, a memory 806, and a communication interface 808. The processor 804, the memory 806, and the communication interface 808 communicate with each other via the bus 802. The 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 the computing device 800.
[0113] The 802 bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, Figure 8 The bus 804 may be represented by a single line, but this does not mean that there is only one bus or one type of bus. The bus 804 may include a path for transmitting information between various components of the computing device 800 (e.g., memory 806, processor 804, communication interface 808).
[0114] 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).
[0115] 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).
[0116] The memory 806 stores executable program code, and the processor 804 executes the executable program code to implement the aforementioned functions respectively. Figure 7 The functions of the acquisition module 701 and processing module 702 shown are implemented to realize the problem-solving method described in the above embodiments. That is, the memory 806 stores instructions for executing the problem-solving method described in the above embodiments.
[0117] Alternatively, the memory 806 stores executable code, and the processor 804 executes the executable code to implement the aforementioned functions respectively. Figure 7 The problem-handling device 700 shown in the diagram performs the functions of the problem-handling method described in the above embodiments. That is, the memory 806 stores instructions for executing the problem-handling method described in the above embodiments.
[0118] The communication interface 803 uses transceiver modules, such as, but not limited to, network interface cards and transceivers, to enable communication between the computing device 800 and other devices or communication networks.
[0119] This application also provides 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.
[0120] like Figure 9 As shown, the computing device cluster includes at least one computing device 800. The memory 806 of one or more computing devices 800 in the computing device cluster may store the same instructions for executing the problem-solving method described in the above embodiments.
[0121] 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 embodiments. In other words, a combination of one or more computing devices 800 can jointly execute instructions for executing the problem-solving method described in the above embodiments.
[0122] It should be noted that the memory 806 in different computing devices 800 within the computing device cluster can store different instructions, each used to execute the aforementioned instructions. Figure 7 This illustrates some of the functions of the problem processing device 700. Specifically, the instructions stored in the memory 806 of different computing devices 800 can implement the functions of one or more modules in the acquisition module 701 and processing module 702.
[0123] In some possible implementations, one or more computing devices in a computing device cluster can be connected via a network. This network can be a wide area network (WAN) or a local area network (LAN), etc. Figure 10 One possible implementation is shown. For example... Figure 10 As shown, two computing devices 800A and 800B are connected via a network. Specifically, they are connected to the network through communication interfaces in each computing device. In this possible implementation, the memory 806 in computing device 800A stores instructions for executing the functions of the acquisition module 701. Simultaneously, the memory 806 in computing device 800B stores instructions for executing the functions of the processing module 702.
[0124] It should be understood that Figure 10The functions of the computing device 800A shown can also be performed by multiple computing devices 800. Similarly, the functions of the computing device 800B can also be performed by multiple computing devices 800.
[0125] This application also provides another computing device cluster. The connection relationships between the computing devices in this computing device cluster can be similarly referred to... Figure 9 and Figure 10 The connection method of the computing device cluster is different in that the memory 806 of one or more computing devices 800 in the computing device cluster can store the same instructions for executing the methods in the above embodiments.
[0126] 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 aforementioned problem-solving method. In other words, a combination of one or more computing devices 800 can jointly execute the instructions for executing the aforementioned problem-solving method.
[0127] Based on the methods in the above embodiments, this application provides a computer-readable storage medium storing a computer program. When the computer program is run on an electronic device, it causes the electronic device to perform the methods described in the above embodiments. 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 (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive).
[0128] Based on the methods in the above embodiments, this application provides a computer program product containing instructions that, when run on an electronic device, cause the electronic device to execute the methods in the above embodiments.
[0129] It is understood that the processor in the embodiments of this application can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. A general-purpose processor can be a microprocessor or any conventional processor.
[0130] The method steps in the embodiments of this application can be implemented in hardware or by a processor executing software instructions. The software instructions can consist 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, portable hard disks, CD-ROMs, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor, enabling the processor to read information from 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 reside in an ASIC.
[0131] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially 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, all or part of the processes or functions described in the embodiments of this application are generated. 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 through 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 wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. 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 integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0132] It is understood that the various numerical designations used in the embodiments of this application are merely for descriptive convenience and are not intended to limit the scope of the embodiments of this application.
[0133] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the protection scope of the technical solutions of the embodiments of this application.
Claims
1. A problem-solving method, characterized in that, The method includes: The problem of obtaining user input; Based on the aforementioned problem, actions are iteratively selected from multiple actions related to the prompting process. In the first iteration, actions are selected using the aforementioned problem. In any iteration other than the first iteration, actions are selected using the aforementioned problem and the content obtained from performing the selected actions. If the number of iterations reaches a threshold or the action selected in 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 action selected in each iteration.
2. The method according to claim 1, characterized in that, The content filtering action, obtained by using the aforementioned question and performing the already filtered actions, includes: Based on the question and the content obtained from performing the filtered actions, determine the probability of selecting an action among the multiple actions related to the prompting project; Actions with the highest probability are selected as the chosen actions.
3. The method according to claim 1, characterized in that, The method further includes: The prompt word is presented to the user.
4. The method according to claim 1, characterized in that, Before iteratively filtering actions from multiple actions related to prompting engineering based on the aforementioned problem, the process also includes: The issue enhancement and optimization controls are confirmed to be enabled.
5. The method according to any one of claims 1-3, characterized in that, The actions related to the prompting process include one or more of the following: Introduce external knowledge, apply templates, or break down the problem.
6. A problem-solving device, characterized in that, include: The acquisition module is used to acquire user input for questions; The processing module is used to iteratively filter actions from multiple actions related to the prompting project based on the question. In the first round of iteration, the question is used to filter actions. In any round of iteration other than the first round of iteration, the question and the content obtained by performing the filtered actions are used to filter actions. The processing module is further configured to input prompt words into the large language model when the number of iterations reaches a threshold or when the action selected in the current iteration is a termination action, so as to obtain an answer related to the question. The prompt words include the question and the content obtained by executing the action selected in each iteration.
7. The apparatus according to claim 6, characterized in that, When the processing module uses the question and the content obtained from executing the filtered actions to perform the filtering action, it is specifically used for: Based on the question and the content obtained from performing the filtered actions, determine the probability of selecting an action among the multiple actions related to the prompting project; Actions with the highest probability are selected as the chosen actions.
8. The apparatus according to claim 6, characterized in that, The processing module is further configured to: The prompt word is presented to the user.
9. The apparatus according to claim 6, characterized in that, Before iteratively filtering actions from multiple actions related to the prompting process based on the problem, the processing module is also used to: The issue enhancement and optimization controls are confirmed to be enabled.
10. The apparatus according to any one of claims 6-9, characterized in that, The actions related to the prompting process include one or more of the following: Introduce external knowledge, apply templates, or break down the problem.
11. A computing device cluster, characterized in that, It includes at least one computing device, each computing device including a processor and memory; The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device to cause the cluster of computing devices to perform the method as described in any one of claims 1-5.
12. A computer-readable storage medium storing a computer program that, when run on an electronic device, causes the electronic device to perform the method as described in any one of claims 1-5.
13. A computer program product, characterized in that, When the computer program product is run on an electronic device, it causes the electronic device to perform the method as described in any one of claims 1-5.
Citation Information
Patent Citations
Dialogue generation method, deep learning model training method, device and equipment
CN116303962A
Automated intelligent content generation
WO2022159196A1