A problem processing method, apparatus, device, and storage medium
Patent Information
- Application Number
- CN202410007035.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-02
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2044-01-02
AI Technical Summary
[0004]在利用思维树逐步处理问题时,每个步骤都是选择较优的处理结果,直接舍弃较差的处理结果,从而导致在后续步骤中还会再次产生之前较差的处理结果,进而增加了不必要的计算量以及增加了重复的错误处理链路的产生,降低了问题处理效率
[0024]通过基于预训练语言模型、待处理的目标问题描述信息、思维树中的当前处理层对应的当前处理步骤描述信息、历史处理层对应的正例处理结果链路和历史处理层对应的负例处理结果进行当前处理层的步骤处理,确定当前处理层对应的多个当前处理结果;基于预训练语言模型对每个当前处理结果进行评估,确定每个当前处理结果对应的当前评估结果;基于当前处理结果对应的当前评估结果,确定当前处理层对应的正例处理结果和负例处理结果,在当前处理层满足预设迭代停止条件时,停止处理层的迭代处理,并基于当前处理层对应的正例处理结果确定目标问题对应的目标答案。通过保留历史处理层对应的负例处理结果,并在当前处理层的步骤处理过程中考虑到了历史处理层已经产生的负例处理结果,从而可以避免在当前处理结果中产生之前的负例处理结果,进而降低了不必要的计算量,减少了重复的错误处理链路的产生,提高了问题处理效率。
Smart Images

Figure CN117808005B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to computer technology, and more particularly to a problem-solving method, apparatus, device, and storage medium. Background Technology
[0002] With the rapid development of computer technology, more and more language model reasoning frameworks are being developed to solve problems in business. For example, the Tree of Thoughts (TOT) framework can be used to solve problems step by step based on reasoning.
[0003] However, in the process of realizing this invention, the inventors discovered at least the following problems in the prior art:
[0004] When using mind trees to solve problems step by step, each step selects the better result and discards the worse result. This can lead to the recurrence of the worse result in subsequent steps, increasing unnecessary computation and creating redundant error handling loops, thus reducing problem-solving efficiency. Summary of the Invention
[0005] This invention provides a problem-solving method, apparatus, device, and storage medium to reduce unnecessary computation and minimize repetitive error-handling steps, thereby improving problem-solving efficiency.
[0006] In a first aspect, embodiments of the present invention provide a problem-solving method, including:
[0007] Obtain the description information of the target problem to be processed and the description information of the processing steps corresponding to each processing layer in the mind tree used to process the target problem;
[0008] Based on the pre-trained language model, the target problem description information, the current processing step description information corresponding to the current processing layer, the positive example processing result link corresponding to the historical processing layer, and the negative example processing result corresponding to the historical processing layer, the current processing layer's step processing is performed to determine multiple current processing results corresponding to the current processing layer.
[0009] Each current processing result is evaluated based on the pre-trained language model, and the current evaluation result corresponding to each current processing result is determined.
[0010] Based on the current evaluation result corresponding to the current processing result, determine the positive example processing result and the negative example processing result corresponding to the current processing layer;
[0011] If the current processing layer meets the preset iteration stop condition, then the iteration processing of the processing layer is stopped, and the target answer corresponding to the target problem is determined based on the positive example processing result corresponding to the current processing layer.
[0012] Secondly, embodiments of the present invention also provide a problem-solving apparatus, comprising:
[0013] The description information acquisition module is used to acquire the description information of the target problem to be processed and the description information of the processing steps corresponding to each processing layer in the mind tree used to process the target problem.
[0014] The step processing module is used to perform step processing of the current processing layer based on the pre-trained language model, the target problem description information, the current processing step description information corresponding to the current processing layer, the positive example processing result link corresponding to the historical processing layer, and the negative example processing result corresponding to the historical processing layer, and to determine multiple current processing results corresponding to the current processing layer.
[0015] The processing result evaluation module is used to evaluate each current processing result based on the pre-trained language model and determine the current evaluation result corresponding to each current processing result;
[0016] The positive and negative example result determination module is used to determine the positive and negative example processing results corresponding to the current processing layer based on the current evaluation result corresponding to the current processing result.
[0017] The target answer determination module is used to stop the iterative processing of the current processing layer if the current processing layer meets the preset iteration stop condition, and determine the target answer corresponding to the target question based on the positive example processing result corresponding to the current processing layer.
[0018] Thirdly, embodiments of the present invention also provide an electronic device, the electronic device comprising:
[0019] One or more processors;
[0020] Memory, used to store one or more programs;
[0021] When the one or more programs are executed by the one or more processors, the one or more processors implement the problem-solving method as provided in any embodiment of the present invention.
[0022] Fourthly, embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the problem-solving method as provided in any embodiment of the present invention.
[0023] One embodiment of the above invention has the following advantages or beneficial effects:
[0024] This approach utilizes a pre-trained language model, a description of the target problem, descriptions of current processing steps within the current processing layer of the mind tree, and the positive and negative example processing results from previous processing layers. This process determines multiple current processing results for the current processing layer. Each current processing result is evaluated using the pre-trained language model, resulting in a current evaluation result. Based on these current evaluation results, the positive and negative example processing results for the current processing layer are determined. When the current processing layer meets a preset iteration stopping condition, the iteration stops, and the target answer for the target problem is determined based on the positive example processing results. By retaining the negative example processing results from previous processing layers and considering these results during the current processing layer's steps, the approach avoids generating previous negative example processing results in the current processing layer. This reduces unnecessary computation, minimizes redundant error processing paths, and improves problem-solving efficiency. Attached Figure Description
[0025] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0026] Figure 1 This is a flowchart of a problem-solving method provided in one embodiment of the present invention;
[0027] Figure 2 This is an example of a problem-solving process according to an embodiment of the present invention;
[0028] Figure 3 This is a flowchart of another problem-solving method provided in one embodiment of the present invention;
[0029] Figure 4 This is a flowchart of another problem-solving method provided in one embodiment of the present invention;
[0030] Figure 5 This is a schematic diagram of the structure of a problem-solving device provided in one embodiment of the present invention;
[0031] Figure 6 This is a schematic diagram of the structure of an electronic device provided in one embodiment of the present invention. Detailed Implementation
[0032] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present invention, and not all of the structures.
[0033] Figure 1 This is a flowchart illustrating a problem-solving method according to one embodiment of the present invention. This embodiment is applicable to problem-solving based on a mind tree framework. The method can be executed by a problem-solving device, which can be implemented in software and / or hardware and integrated into an electronic device. Figure 1 As shown, the method specifically includes the following steps:
[0034] S110. Obtain the description information of the target problem to be processed and the description information of the processing steps corresponding to each processing layer in the mind tree used to process the target problem.
[0035] The target problem description can be a target problem described in natural language. The target problem is the reasoning and problem-solving task to be solved. For example, the target problem description could be: "Summarize and merge the following four paragraphs, the four paragraphs are…". Or, the target problem description could be: "How to perform an operation on the following four numbers, the result of which is 24, the four numbers are…". The mind tree can be a tree-like structure, a framework for solving the target problem layer by layer. The processing layers in the mind tree can refer to the thought steps for solving the target problem. Thinking can be a coherent sequence of language, serving as an intermediate step in problem-solving. Each processing layer corresponds one-to-one with the step-by-step processing steps for solving the target problem. For example, if the target problem is broken down into three thought steps, then the mind tree has three processing layers, arranged sequentially according to the order of these three thought steps, allowing the mind tree to reason and solve the problem step-by-step in that order. The processing step description can be a description in natural language of the thought steps that each processing layer needs to handle. The descriptions of the processing steps corresponding to different processing layers can be the same or different, depending on the specific business requirements.
[0036] Specifically, when users encounter a target problem that needs to be solved in a real business scenario, they can break down the target problem into thought processes, determine the thought steps after the breakdown, and input the description information of the target problem and the description information of the processing steps corresponding to each thought step. In this way, they can obtain the description information of the target problem and the description information of the processing steps corresponding to each processing layer in the thought tree used to solve the target problem.
[0037] S120. Based on the pre-trained language model, target problem description information, current processing step description information corresponding to the current processing layer, positive example processing result link corresponding to the historical processing layer, and negative example processing result corresponding to the historical processing layer, perform step processing of the current processing layer to determine multiple current processing results corresponding to the current processing layer.
[0038] In this context, a pre-trained language model can be a generative language model obtained by pre-training on a large amount of language data. For example, a pre-trained language model can refer to a Large Language Model (LLM). A LLM can generate natural language text and understand the meaning of language text. LLMs can be used to handle various natural language tasks. A LLM can be, but is not limited to, ChatGPT (Chat Generative Pre-trained Transformer).
[0039] In this context, the current processing layer refers to the thought process that needs to be processed at the current moment in the mind tree. The historical processing layer refers to thought processes that have been completed before the current moment. The processing result refers to the solution to the thought process. Positive example processing results refer to the best-performing correct processing result. Negative example processing results refer to the worst-performing incorrect processing result. Each processing layer has positive example processing results and negative example processing results. The positive example processing result chain corresponding to the historical processing layer can refer to a thought chain starting from the root node of the mind tree, sequentially connecting the positive example processing results from each historical processing layer. For example, see... Figure 2 When the current processing layer is the third processing layer, the positive example processing result chain corresponding to the previous processing layer can be: positive example processing result A → positive example processing result C, or positive example processing result B → positive example processing result D, etc. The number of positive example processing result chains increases with the processing of the processing layer. The current processing result can refer to the optional processing result of the thought step corresponding to the current processing layer.
[0040] Specifically, all negative example processing results corresponding to all historical processing layers can be obtained. For each positive example processing result link corresponding to a historical processing layer, negative example processing results can be introduced based on the target problem description information, the current processing step description information corresponding to the current processing layer, and the positive example processing result link. This provides information prompts to the pre-trained language model, enabling it to compare results with the introduced negative example processing results when generating the current processing result. This avoids generating the same or similar current processing result as the negative example processing result, thereby reducing unnecessary computation, reducing the generation of duplicate error processing links, and improving problem processing efficiency.
[0041] For example, S120 may include: generating first prompt information corresponding to each positive example processing result link based on the target problem description information, the current processing step description information corresponding to the current processing layer, each positive example processing result link corresponding to the historical processing layer, and the negative example processing result corresponding to the historical processing layer; performing step processing of the current processing layer based on the pre-trained language model and the first prompt information, and determining multiple current processing results corresponding to the current processing layer.
[0042] Specifically, for each positive example processing result chain corresponding to the historical processing layer, the target problem description information, the current processing step description information corresponding to the current processing layer, the positive example processing result chain, and all negative example processing results can be filled into the first prompt template to obtain the filled first prompt information. The first prompt template can be a pre-set template conforming to the format of thought-generated prompt information. For example, the first prompt template could be: "You need to complete a certain task. We will provide you with some unsatisfactory ideas, which you need to avoid as much as possible. The negative example is as follows: F. You can think about it step by step. Please generate your next thought first. The task input is as follows: XYZ." Here, F represents the negative example processing result, and XYZ represent the target problem description information, the current processing step description information corresponding to the current processing layer, and the positive example processing result chain, respectively.
[0043] After obtaining the first prompt information corresponding to the positive example processing result chain, the first prompt information can be repeatedly input into the pre-trained language model k times based on a preset number of results k. This allows the pre-trained language model to perform the current processing layer's step processing based on the input first prompt information each time, thereby obtaining k current processing results output by the pre-trained language model. Alternatively, the first prompt information and the preset number of results k can be simultaneously input into the pre-trained language model for the current processing layer's step processing, allowing the pre-trained language model to output k current processing results at once.
[0044] It should be noted that when the current processing layer is the first processing layer, since there is no historical processing layer (i.e., no link between negative and positive example processing results), the first prompt information can be directly generated based on the target problem description information and the current processing step description information corresponding to the current processing layer. Then, the first processing layer's steps are processed based on the pre-trained language model and the first prompt information to determine the k current processing results corresponding to the first processing layer. When the current processing layer is the second processing layer or subsequent processing layers, since there is a historical processing layer, the steps can be processed by introducing negative example processing results, as in step S120.
[0045] For example, see Figure 2Based on the pre-trained language model, target problem description information, and processing step description information corresponding to the first processing layer, the first processing layer performs step processing to determine k processing results corresponding to the first processing layer. Negative example processing results obtained from the first processing layer are introduced into the positive example processing results of the first processing layer. Therefore, in the second processing layer, the steps can be performed based on the pre-trained language model, target problem description information, processing step description information corresponding to the second processing layer, the chain of each positive example processing result corresponding to the first processing layer, and the introduced negative example processing results corresponding to the first processing layer, determining 2k processing results corresponding to the second processing layer. At this point, the processing results obtained in the second processing layer can minimize the occurrence of negative example processing results. Similarly, each processing layer is iteratively processed until a preset iteration stopping condition is met. It should be noted that k processing results are generated based on each positive example processing result in the previous processing layer, resulting in s×k current processing results for the current processing layer. s refers to the number of positive example processing results actually determined in the previous processing layer.
[0046] S130. Evaluate each current processing result based on the pre-trained language model and determine the current evaluation result corresponding to each current processing result.
[0047] The current evaluation result measures the likelihood that the current processing result will lead to an answer to the target question. This result can be represented by an evaluation score or a number of votes. A higher score or number of votes indicates a higher quality processing result, and that it is closer to the correct answer.
[0048] Specifically, the processing result path corresponding to each current processing result in the mind tree is obtained. This can be achieved by inputting the processing result path and the target problem description information corresponding to each current processing result as prompts into a pre-trained language model. The pre-trained language model matches the input processing result path and target problem description information, determines the current evaluation score that the processing result path is likely to solve the target problem, and outputs it, thus obtaining the current evaluation score corresponding to each current processing result output by the pre-trained language model. Alternatively, all processing result paths and target problem description information corresponding to all current processing results can be used as prompts and simultaneously input into the pre-trained language model for evaluation voting. The pre-trained language model casts its vote for the current processing result with the highest evaluation score each time. This voting is repeated multiple times, and the current number of votes corresponding to each current processing result is obtained as the current evaluation result.
[0049] S140. Based on the current evaluation result corresponding to the current processing result, determine the positive example processing result and the negative example processing result corresponding to the current processing layer.
[0050] Specifically, based on the current evaluation result corresponding to the current processing result, the current processing result is divided to determine the positive example processing result and the negative example processing result within the current processing result. The division process can be implemented in at least two of the following ways:
[0051] As one implementation, S140 may include: sorting the current processing results in descending order based on the current evaluation results to obtain a sequence of current processing results with progressively lower evaluation results; and determining the current processing results of the first preset number r of positive examples in the current processing result sequence as positive processing results, and the remaining current processing results as negative processing results. By using the preset number r of positive examples for filtering, each processing layer selects a fixed number r of positive processing results. The number of current processing results is r×k (where s = r), and the first r current processing results with the highest evaluation results are taken as the positive processing results corresponding to the current processing layer, while the remaining r×(k-1) current processing results are taken as the negative processing results corresponding to the current processing layer.
[0052] As another implementation, S140 may include: comparing the current evaluation result corresponding to each current processing result with a preset evaluation threshold, and determining the positive example processing result and the negative example processing result in the current processing result based on the comparison result.
[0053] Specifically, current processing results whose current evaluation result is greater than or equal to a preset evaluation threshold are determined as positive examples for the current processing layer, while current processing results whose current evaluation result is less than the preset evaluation threshold are determined as negative examples for the current processing layer. By using the preset evaluation threshold for filtering, the number of positive examples selected for each processing layer is not fixed; that is, it is not necessary to have r positive examples. Only current processing results greater than or equal to the preset evaluation threshold need to be selected. This reduces the probability of trial and error, increases the probability of reducing the number of iterations and computational cost, and thus increases the probability of obtaining the optimal solution, avoiding the situation of local optima.
[0054] S150. If the current processing layer meets the preset iteration stop condition, stop the iteration processing of the processing layer, and determine the target answer corresponding to the target problem based on the positive example processing result corresponding to the current processing layer.
[0055] The preset iteration stop condition can refer to a condition set in advance based on the business scenario to stop the iteration process. For example, the preset iteration stop condition could be that the number of iterations corresponding to the current processing layer is equal to the preset number of steps, or that the positive example processing result corresponding to the current processing layer meets the problem solution conditions.
[0056] Specifically, after the current processing layer completes its steps (i.e., obtains the positive and negative example results), it can be checked whether the current processing layer meets the preset iteration stopping condition. If it does not meet the preset iteration stopping condition, the next processing layer can be taken as the current processing layer according to the hierarchical relationship of the processing layers in the mind tree. The next processing layer is then processed by returning to the execution steps S120-S140 to determine the positive and negative example results corresponding to the next processing layer. This process is repeated iteratively to solve the target problem step by step. If the current processing layer meets the preset iteration stopping condition, it indicates that the target problem has been solved. At this point, the iteration processing of the processing layer can be stopped, and the evaluation results of the positive example processing results corresponding to the current processing layer can be compared. The positive example processing result with the highest evaluation result is determined as the target answer to the target problem.
[0057] It should be noted that when using the number of iteration steps as the preset iteration stopping condition, in the last iteration, that is, when processing the last processing layer, after determining the evaluation result of each processing result corresponding to the last processing layer using steps S120 and S130, the processing result with the highest evaluation result can be directly determined as the target answer corresponding to the target question, without having to filter the positive and negative examples of the processing results, thus further improving the problem processing efficiency.
[0058] The technical solution of this embodiment performs step processing of the current processing layer based on a pre-trained language model, the description information of the target problem to be processed, the description information of the current processing steps corresponding to the current processing layer in the mind tree, the positive example processing result chain corresponding to the historical processing layer, and the negative example processing result corresponding to the historical processing layer, thereby determining multiple current processing results corresponding to the current processing layer. Each current processing result is evaluated based on the pre-trained language model to determine the current evaluation result corresponding to each current processing result. Based on the current evaluation result corresponding to the current processing result, the positive example processing result and negative example processing result corresponding to the current processing layer are determined. When the current processing layer meets the preset iteration stopping condition, the iteration processing of the processing layer is stopped, and the target answer corresponding to the target problem is determined based on the positive example processing result corresponding to the current processing layer. By retaining the negative example processing results corresponding to the historical processing layers and considering the negative example processing results already generated by the historical processing layers during the step processing of the current processing layer, it is possible to avoid generating previous negative example processing results in the current processing result, thereby reducing unnecessary computation, reducing the generation of duplicate error processing chains, and improving problem processing efficiency.
[0059] Figure 3This is a flowchart of another problem-solving method provided by an embodiment of the present invention. Based on the above embodiments, this embodiment describes in detail the step of "generating a first prompt message corresponding to each positive example processing result link based on the target problem description information, the current processing step description information corresponding to the current processing layer, each positive example processing result link corresponding to the historical processing layer, and the negative example processing results corresponding to the historical processing layer." Explanations of terms that are the same as or corresponding to those in the above embodiments will not be repeated here.
[0060] See Figure 3 Another problem-solving method provided in this embodiment specifically includes the following steps:
[0061] S310. Obtain the description information of the target problem to be processed and the description information of the processing steps corresponding to each processing layer in the mind tree used to process the target problem.
[0062] S320. Sample the negative example processing results corresponding to the historical processing layer to determine the preset number of negative example processing results under each positive example processing result link corresponding to the historical processing layer.
[0063] The preset negative example count refers to the maximum number of negative example processing results that are allowed to be added in the prompt message. The negative example processing results of the preset negative example count under different positive example processing result chains can be the same or different.
[0064] Specifically, for each positive example processing result link corresponding to the historical processing layer, a predetermined number of negative example processing results can be randomly sampled from all negative example processing results corresponding to all historical processing layers as comparison negative examples for the generated result. Alternatively, the weight of the negative example processing result can be determined based on its generation time; the later the generation time, the greater the weight. A predetermined number of negative example processing results can then be sampled from all negative example processing results based on these weights. In this case, the later the generation time, the easier it is to sample them.
[0065] For example, if the current processing layer is the second processing layer and the historical processing layer is the first processing layer, and the first processing layer contains 2 positive processing results (A and B respectively) and 10 negative processing results, then for positive processing result A, 3 negative processing results are randomly sampled from the 10 negative processing results as the negative processing results introduced by positive processing result A. Similarly, for positive processing result B, 3 negative processing results are also randomly sampled from the 10 negative processing results as the negative processing results introduced by positive processing result B.
[0066] For example, S320 may include: determining the result similarity between every two negative example processing results corresponding to the historical processing layer; sampling the negative example processing results based on the result similarity to determine a preset number of negative example processing results under each positive example processing result link corresponding to the historical processing layer.
[0067] Specifically, the similarity between any two negative examples can be determined based on a similarity calculation formula, such as the cosine similarity formula. By comparing the similarity between each pair of negative examples, a predetermined number of the least similar negative examples are selected as the comparison negative examples for the generated results. By sampling a predetermined number of dissimilar negative examples as self-comparison negative examples, the comparison effect can be further improved, and the generation of identical or similar negative examples in the current processing results can be further avoided, thereby further improving the efficiency of problem processing.
[0068] S330. Based on the target problem description information, the current processing step description information corresponding to the current processing layer, the positive example processing result link corresponding to the historical processing layer, and the negative example processing results of a preset number of negative examples, generate the first prompt information.
[0069] Specifically, for each positive example processing result link corresponding to the historical processing layer, the target problem description information, the current processing step description information corresponding to the current processing layer, the positive example processing result link, and the negative example processing results of a sampled preset number of negative examples can be filled into the first prompt template to obtain the first prompt information corresponding to the filled positive example processing result link. By sampling the negative example processing results, the situation where the first prompt information is too long due to too many negative examples can be avoided, thereby ensuring the efficiency of step processing and improving the problem processing efficiency.
[0070] S340. Based on the pre-trained language model and the first prompt information, perform the step processing of the current processing layer and determine the multiple current processing results corresponding to the current processing layer.
[0071] S350. Evaluate each current processing result based on the pre-trained language model and determine the current evaluation result corresponding to each current processing result.
[0072] S360. Based on the current evaluation result corresponding to the current processing result, determine the positive example processing result and negative example processing result corresponding to the current processing layer.
[0073] S370. If the current processing layer meets the preset iteration stop condition, then stop the iteration processing of the processing layer, and determine the target answer corresponding to the target problem based on the positive example processing result corresponding to the current processing layer.
[0074] The technical solution of this embodiment samples the negative example processing results corresponding to the historical processing layer to determine the preset number of negative example processing results under each positive example processing result link corresponding to the historical processing layer. Based on the target problem description information, the current processing step description information corresponding to the current processing layer, each positive example processing result link corresponding to the historical processing layer, and the preset number of negative example processing results, a first prompt message of appropriate length can be generated. This avoids the situation where the first prompt message is too long due to too many negative examples, ensures the efficiency of step processing, and further improves the problem processing efficiency.
[0075] Figure 4 This is a flowchart of another problem-solving method provided by an embodiment of the present invention. Based on the above embodiments, this embodiment describes in detail the step of "evaluating each current processing result based on a pre-trained language model and determining the current evaluation result corresponding to each current processing result". Explanations of terms that are the same as or corresponding to those in the above embodiments will not be repeated here.
[0076] See Figure 4 Another problem-solving method provided in this embodiment specifically includes the following steps:
[0077] S410. Obtain the description information of the target problem to be processed and the description information of the processing steps corresponding to each processing layer in the mind tree used to process the target problem.
[0078] S420. Based on the pre-trained language model, target problem description information, current processing step description information corresponding to the current processing layer, positive example processing result chain corresponding to the historical processing layer, and negative example processing result corresponding to the historical processing layer, perform step processing of the current processing layer to determine multiple current processing results corresponding to the current processing layer.
[0079] S430. Based on the target problem description information, multiple candidate actions associated with the target problem, and the processing result link corresponding to each current processing result in the mind tree, generate second prompt information containing reasoning and decision-making processes.
[0080] Candidate actions can be pre-set actions that can be used during the reasoning and decision-making process. For example, candidate actions can be, but are not limited to, calling a calculator interface or a search engine. The ReAct (Reason Act) framework combines reasoning and decision-making. The solution process of the ReAct framework is: thinking, action selection, discovery, and then repeating these three steps until the final solution is obtained. The ReAct framework introduces external feedback to aid reasoning and decision-making. The processing result chain corresponding to the current processing result can refer to the chain of thought formed by the positive example processing results in the historical processing layer connected to the current processing result, starting from the root node of the thought tree. The second prompt information can be prompts introduced into the ReAct framework, so that subsequent evaluations can repeatedly perform reasoning and decision-making processes of thinking, action selection, and discovery, thereby improving the accuracy of the evaluation results.
[0081] Specifically, multiple candidate actions associated with the target problem can be obtained. For each current processing result, the target problem description information, multiple candidate actions, and the processing result chain corresponding to the current processing result are filled into the second prompt template to obtain the second prompt information corresponding to the current processing result. This allows the ReAct framework to be introduced into the second prompt information for reasoning and decision-making. The second prompt template can be a pre-set template conforming to the format of result evaluation prompt information. For example, the second prompt template could be: "You are given a task, and you need to evaluate whether the current input can complete the task. It can be in the following format: Problem: G; Thinking: You should keep thinking about how to solve the problem; Action: You should choose one from candidate actions A / B / C; Discovery: The result of the action; Thinking / Action / Discovery can be repeated N times; Thinking: Finally, you should know the final result; Final Answer: Output the final evaluation result for the original problem. Current Input: J." Here, G represents the target problem description information; A / B / C represent multiple candidate actions; and J represents the processing result chain corresponding to the current processing result.
[0082] S440. Evaluate based on the pre-trained language model and the second prompt information corresponding to each current processing result, and determine the current evaluation result corresponding to each current processing result.
[0083] Specifically, the second prompt information corresponding to each current processing result can be input into the pre-trained language model. The pre-trained language model evaluates the reasoning and decision-making based on the input second prompt information, thereby adding more feedback signals during the evaluation process and making the evaluation results more accurate. Compared with the evaluation method based solely on the pre-trained language model itself, this embodiment of the invention improves the accuracy of the processing result evaluation by incorporating reasoning and decision-making into the evaluation process by referencing the ReAct framework.
[0084] For example, S440 may include: based on a preset number of repeated inputs, simultaneously inputting the second prompt information corresponding to each current processing result into a pre-trained language model for evaluation and voting, and determining the current vote number corresponding to each current processing result; wherein, the pre-trained language model casts its vote for the current processing result with the highest evaluation each time.
[0085] Specifically, all second-level prompts corresponding to the current processing results are simultaneously input into a pre-trained language model for evaluation and voting. The pre-trained language model casts its vote for the current processing result with the highest evaluation each time. This voting process is repeated multiple times, with each iteration re-evaluating the optimal current processing result. Therefore, the number of votes can more accurately represent the evaluation results, further improving evaluation accuracy.
[0086] S450. Based on the current evaluation result corresponding to the current processing result, determine the positive example processing result and the negative example processing result corresponding to the current processing layer.
[0087] S460. If the current processing layer meets the preset iteration stop condition, stop the iteration processing of the processing layer, and determine the target answer corresponding to the target problem based on the positive example processing result corresponding to the current processing layer.
[0088] The technical solution of this embodiment generates second prompt information containing reasoning and decision-making processes based on the target problem description information, multiple candidate actions associated with the target problem, and the processing result link corresponding to each current processing result in the mind tree. It then evaluates the information based on the pre-trained language model and the second prompt information corresponding to each current processing result. This allows reasoning and decision-making to be incorporated into the evaluation process, making the evaluation more accurate and improving the accuracy of problem handling.
[0089] The following are embodiments of the problem-handling device provided in this invention. This device and the problem-handling methods in the above embodiments belong to the same inventive concept. For details not described in detail in the embodiments of the problem-handling device, please refer to the embodiments of the above problem-handling methods.
[0090] Figure 5 This is a schematic diagram of a problem-solving device provided in an embodiment of the present invention. This embodiment is applicable to situations where problems are solved based on a mind tree framework. Figure 5 As shown, the device specifically includes: a description information acquisition module 510, a step processing module 520, a processing result evaluation module 530, a positive and negative example result determination module 540, and a target answer determination module 550.
[0091] The system includes the following modules: a description information acquisition module 510, used to acquire the description information of the target problem to be processed and the description information of the processing steps corresponding to each processing layer in the mind tree used to process the target problem; a step processing module 520, used to perform step processing of the current processing layer based on the pre-trained language model, the target problem description information, the current processing step description information corresponding to the current processing layer, the positive example processing result chain corresponding to the historical processing layer, and the negative example processing result corresponding to the historical processing layer, to determine multiple current processing results corresponding to the current processing layer; a processing result evaluation module 530, used to evaluate each current processing result based on the pre-trained language model, to determine the current evaluation result corresponding to each current processing result; a positive and negative example result determination module 540, used to determine the positive example processing result and the negative example processing result corresponding to the current processing layer based on the current evaluation result corresponding to the current processing result; and a target answer determination module 550, used to stop the iterative processing of the processing layer if the current processing layer meets the preset iteration stop condition, and to determine the target answer corresponding to the target problem based on the positive example processing result corresponding to the current processing layer.
[0092] The technical solution of this embodiment performs step processing of the current processing layer based on a pre-trained language model, the description information of the target problem to be processed, the description information of the current processing steps corresponding to the current processing layer in the mind tree, the positive example processing result chain corresponding to the historical processing layer, and the negative example processing result corresponding to the historical processing layer, thereby determining multiple current processing results corresponding to the current processing layer. Each current processing result is evaluated based on the pre-trained language model to determine the current evaluation result corresponding to each current processing result. Based on the current evaluation result corresponding to the current processing result, the positive example processing result and negative example processing result corresponding to the current processing layer are determined. When the current processing layer meets the preset iteration stopping condition, the iteration processing of the processing layer is stopped, and the target answer corresponding to the target problem is determined based on the positive example processing result corresponding to the current processing layer. By retaining the negative example processing results corresponding to the historical processing layers and considering the negative example processing results already generated by the historical processing layers during the step processing of the current processing layer, it is possible to avoid generating previous negative example processing results in the current processing result, thereby reducing unnecessary computation, reducing the generation of duplicate error processing chains, and improving problem processing efficiency.
[0093] Optionally, the step processing module 520 includes:
[0094] The first prompt information generation unit is used to generate a first prompt information corresponding to each positive example processing result link based on the target problem description information, the current processing step description information corresponding to the current processing layer, each positive example processing result link corresponding to the historical processing layer and the negative example processing result corresponding to the historical processing layer.
[0095] The current processing result determination unit is used to perform step processing of the current processing layer based on the pre-trained language model and the first prompt information, and determine multiple current processing results corresponding to the current processing layer.
[0096] Optionally, the first prompt information generation unit includes:
[0097] The negative example processing result sampling subunit is used to sample the negative example processing results corresponding to the historical processing layer and determine the preset number of negative example processing results under each positive example processing result link corresponding to the historical processing layer.
[0098] The first prompt information generation subunit is used to generate the first prompt information based on the target problem description information, the current processing step description information corresponding to the current processing layer, the positive example processing result link corresponding to the historical processing layer, and the negative example processing results of the preset number of negative examples.
[0099] Optionally, the negative example processing result sampling subunit is specifically used for:
[0100] Determine the result similarity between every two negative example processing results corresponding to the historical processing layer; based on the result similarity, sample the negative example processing results to determine a preset number of negative example processing results under each positive example processing result link corresponding to the historical processing layer.
[0101] Optionally, the processing result evaluation module 530 includes:
[0102] The second prompt information generation unit is used to generate a second prompt information containing reasoning and decision-making processes based on the target problem description information, multiple candidate actions associated with the target problem, and the processing result link corresponding to each current processing result in the mind tree;
[0103] The processing result evaluation unit is used to evaluate based on the pre-trained language model and the second prompt information corresponding to each current processing result, and determine the current evaluation result corresponding to each current processing result.
[0104] Optionally, the processing result evaluation unit is specifically used for:
[0105] Based on a preset number of repeated inputs, the second prompt information corresponding to each current processing result is simultaneously input into the pre-trained language model for evaluation and voting to determine the current vote count for each current processing result; wherein, the pre-trained language model casts its vote for the current processing result with the highest evaluation each time.
[0106] Optionally, the positive / negative example result determination module 540 is specifically used for:
[0107] The current evaluation result corresponding to each current processing result is compared with the preset evaluation threshold, and the positive example processing result and negative example processing result in the current processing result are determined based on the comparison result.
[0108] The problem-handling device provided in the embodiments of the present invention can execute the problem-handling method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the problem-handling method.
[0109] It is worth noting that in the embodiments of the above-mentioned problem-solving device, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy distinction between each other and are not used to limit the scope of protection of the present invention.
[0110] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Figure 6 A block diagram is shown of an exemplary electronic device 12 suitable for implementing embodiments of the present invention. Figure 6 The electronic device 12 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.
[0111] like Figure 6 As shown, the electronic device 12 is represented in the form of a general-purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, system memory 28, and bus 18 connecting different system components (including system memory 28 and processing unit 16).
[0112] Bus 18 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. For example, these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.
[0113] Electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by electronic device 12, including volatile and non-volatile media, removable and non-removable media.
[0114] System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used to read and write non-removable, non-volatile magnetic media (… Figure 6 Not shown; usually referred to as a "hard drive"). Although Figure 6 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. System memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of the present invention.
[0115] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 42 typically perform the functions and / or methods described in the embodiments of the present invention.
[0116] Electronic device 12 can also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), and with one or more devices that enable a user to interact with electronic device 12, and / or with any device that enables electronic device 12 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed via input / output (I / O) interface 22. Furthermore, electronic device 12 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 20. As shown, network adapter 20 communicates with other modules of electronic device 12 via bus 18. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0117] Processing unit 16 executes various functional applications and data processing by running programs stored in system memory 28, such as implementing the steps of a problem-solving method provided in any embodiment of the present invention, the method including:
[0118] Obtain the description information of the target problem to be processed and the description information of the processing steps corresponding to each processing layer in the mind tree used to process the target problem;
[0119] Based on the pre-trained language model, the target problem description information, the current processing step description information corresponding to the current processing layer, the positive example processing result link corresponding to the historical processing layer, and the negative example processing result corresponding to the historical processing layer, the current processing layer's step processing is performed to determine multiple current processing results corresponding to the current processing layer.
[0120] Each current processing result is evaluated based on the pre-trained language model, and the current evaluation result corresponding to each current processing result is determined.
[0121] Based on the current evaluation result corresponding to the current processing result, determine the positive example processing result and the negative example processing result corresponding to the current processing layer;
[0122] If the current processing layer meets the preset iteration stop condition, then the iteration processing of the processing layer is stopped, and the target answer corresponding to the target problem is determined based on the positive example processing result corresponding to the current processing layer.
[0123] Of course, those skilled in the art will understand that the processor can also implement the technical solutions of the problem-solving methods provided in any embodiment of the present invention.
[0124] This embodiment provides a computer-readable storage medium storing a computer program thereon. When executed by a processor, the program implements the problem-solving method steps provided in any embodiment of the present invention, the method comprising:
[0125] Obtain the description information of the target problem to be processed and the description information of the processing steps corresponding to each processing layer in the mind tree used to process the target problem;
[0126] Based on the pre-trained language model, the target problem description information, the current processing step description information corresponding to the current processing layer, the positive example processing result link corresponding to the historical processing layer, and the negative example processing result corresponding to the historical processing layer, the current processing layer's step processing is performed to determine multiple current processing results corresponding to the current processing layer.
[0127] Each current processing result is evaluated based on the pre-trained language model, and the current evaluation result corresponding to each current processing result is determined.
[0128] Based on the current evaluation result corresponding to the current processing result, determine the positive example processing result and the negative example processing result corresponding to the current processing layer;
[0129] If the current processing layer meets the preset iteration stop condition, then the iteration processing of the processing layer is stopped, and the target answer corresponding to the target problem is determined based on the positive example processing result corresponding to the current processing layer.
[0130] The computer storage medium of this invention can be any combination of one or more computer-readable media. A computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. For example, a computer-readable storage medium can be, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0131] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.
[0132] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0133] Computer program code for performing the operations of this invention can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages—such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0134] Those skilled in the art will understand that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby allowing them to be stored in a storage device for execution by a computing device, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.
[0135] Note that the above description is merely a preferred embodiment of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of the present invention, the scope of which is determined by the scope of the appended claims.
Claims
1. A problem-solving method, characterized in that, include: Obtain the description information of the target problem to be processed and the description information of the processing steps corresponding to each processing layer in the mind tree used to process the target problem; Based on the pre-trained language model, the target problem description information, the current processing step description information corresponding to the current processing layer, the positive example processing result link corresponding to the historical processing layer, and the negative example processing result corresponding to the historical processing layer, the current processing layer's step processing is performed to determine multiple current processing results corresponding to the current processing layer. Each current processing result is evaluated based on the pre-trained language model, and the current evaluation result corresponding to each current processing result is determined. Based on the current evaluation result corresponding to the current processing result, determine the positive example processing result and the negative example processing result corresponding to the current processing layer; If the current processing layer meets the preset iteration stop condition, then the iteration processing of the processing layer is stopped, and the target answer corresponding to the target problem is determined based on the positive example processing result corresponding to the current processing layer.
2. The method according to claim 1, characterized in that, The current processing layer is processed based on a pre-trained language model, the target problem description information, the current processing step description information corresponding to the current processing layer, the positive example processing result chain corresponding to the historical processing layer, and the negative example processing result corresponding to the historical processing layer. Multiple current processing results corresponding to the current processing layer are determined, including: Based on the target problem description information, the current processing step description information corresponding to the current processing layer, the positive example processing result link corresponding to each historical processing layer, and the negative example processing result corresponding to the historical processing layer, a first prompt information corresponding to each positive example processing result link is generated. Based on the pre-trained language model and the first prompt information, the current processing layer is processed to determine multiple current processing results corresponding to the current processing layer.
3. The method according to claim 2, characterized in that, Based on the target problem description information, the current processing step description information corresponding to the current processing layer, the positive example processing result chain corresponding to each historical processing layer, and the negative example processing result corresponding to the historical processing layer, the first prompt information corresponding to each positive example processing result chain is generated, including: Sample the negative example processing results corresponding to the historical processing layer to determine the preset number of negative example processing results under each positive example processing result link corresponding to the historical processing layer. Based on the target problem description information, the current processing step description information corresponding to the current processing layer, the processing result chain of each positive example corresponding to the historical processing layer, and the negative example processing results of the preset number of negative examples, a first prompt message is generated.
4. The method according to claim 3, characterized in that, The step of sampling the negative example processing results corresponding to the historical processing layer to determine the preset number of negative example processing results under each positive example processing result link corresponding to the historical processing layer includes: Determine the similarity of results between every two negative examples processed in the historical processing layer; Based on the result similarity, the negative example processing results are sampled to determine the preset number of negative example processing results under each positive example processing result link corresponding to the historical processing layer.
5. The method according to claim 1, characterized in that, The step of evaluating each current processing result based on the pre-trained language model and determining the current evaluation result corresponding to each current processing result includes: Based on the target problem description information, multiple candidate actions associated with the target problem, and the processing result link corresponding to each current processing result in the mind tree, a second prompt information containing reasoning and decision-making processes is generated; The evaluation is performed based on the pre-trained language model and the second prompt information corresponding to each current processing result to determine the current evaluation result corresponding to each current processing result.
6. The method according to claim 5, characterized in that, The evaluation based on the pre-trained language model and the second prompt information corresponding to each current processing result, to determine the current evaluation result corresponding to each current processing result, includes: Based on a preset number of repeated inputs, the second prompt information corresponding to each current processing result is simultaneously input into the pre-trained language model for evaluation and voting to determine the current number of votes for each current processing result. In this process, the pre-trained language model casts its vote for the current processing result with the highest evaluation each time.
7. The method according to claim 1, characterized in that, The process of determining the positive and negative example processing results corresponding to the current processing layer based on the current evaluation result corresponding to the current processing result includes: The current evaluation result corresponding to each current processing result is compared with the preset evaluation threshold, and the positive example processing result and negative example processing result in the current processing result are determined based on the comparison result.
8. A problem-solving device, characterized in that, include: The description information acquisition module is used to acquire the description information of the target problem to be processed and the description information of the processing steps corresponding to each processing layer in the mind tree used to process the target problem. The step processing module is used to perform step processing of the current processing layer based on the pre-trained language model, the target problem description information, the current processing step description information corresponding to the current processing layer, the positive example processing result link corresponding to the historical processing layer, and the negative example processing result corresponding to the historical processing layer, and to determine multiple current processing results corresponding to the current processing layer. The processing result evaluation module is used to evaluate each current processing result based on the pre-trained language model and determine the current evaluation result corresponding to each current processing result; The positive and negative example result determination module is used to determine the positive and negative example processing results corresponding to the current processing layer based on the current evaluation result corresponding to the current processing result. The target answer determination module is used to stop the iterative processing of the current processing layer if the current processing layer meets the preset iteration stop condition, and determine the target answer corresponding to the target question based on the positive example processing result corresponding to the current processing layer.
9. An electronic device, characterized in that, The electronic device includes: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the problem-solving method as described in any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the problem-handling method as described in any one of claims 1-7.
Citation Information
Patent Citations
Method and system for efficiently searching a master database for a desired target without accessing the master database
US6119113A
System and method for performing automated system management
US7120559B1