Complex problem analysis method based on few-sample prompt learning, medium, device and program product

By decomposing complex problems into sub-task sequences and dynamically adjusting them, using few sample prompt learning and large model tools, the inefficiency and hallucination problems of large language models in handling complex problems are solved, and efficient analysis and answers without labeling data are achieved .

CN119292770APending Publication Date: 2025-01-1010TH RES INST OF CETC
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411307721.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-19
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

Large language models cannot directly analyze and have hallucinations when dealing with complex problems, and the implementation of React framework requires labeling data for fine-tuning, resulting in inefficiency.

Method used

Using a method based on few-sample prompt learning, complex problems are broken down into sub-task sequences, and the sub-tasks are completed through a large model through selecting the appropriate tool from the tool library, and subsequent tasks are dynamically adjusted to achieve the final answer.

Benefits of technology

Without training, dynamic decomposition and planning of complex problems is achieved, which improves the understanding and execution capabilities of large models, reduces hallucinations, and avoids the dependence of labeled data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119292770A_ABST
    Figure CN119292770A_ABST
Patent Text Reader

Abstract

The invention provides a complex problem analysis method based on few-sample prompt learning, a medium, a device and a program product, and the method comprises the steps: (1) complex problem task decomposition: employing a large model prompt project and a few-sample learning technology, taking a complex problem of a user as an input, and outputting a corresponding subtask sequence; (2) subtask execution: for each subtask in the subtask sequence, selecting an appropriate tool from a tool library by using a large model, generating a use mode of the tool, and calling the tool to complete the subtask; and according to the completion result of the subtasks, the subsequent subtasks are continuously adjusted, so that the subsequent subtasks are supplemented and perfected. Through the single decomposition and multiple adjustment, the complex questions can be planned according to needs and dynamically adjusted without training, and finally reasonable answering of the complex questions of the user is completed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of text processing and analysis, and in particular to a complex problem analysis method, medium, device and program product based on few-sample prompt learning. Background Art

[0002] With the development of deep learning and natural language processing, large language models have played an increasingly important role in various fields. Despite this, it still has certain limitations. First, it cannot directly analyze and process complex problems, and second, there are hallucinations. Complex problems refer to problems that cannot be answered through one processing. For complex problems, they can usually be divided into multiple meta-questions that can be answered through one processing. By answering multiple meta-questions, the user's complex questions are finally answered. Large model hallucination refers to the phenomenon that the content generated by the large model is inconsistent with the facts of the real world or with the user input. The hallucination cannot be eliminated but can only be alleviated. Generally speaking, hallucinations can be alleviated by calling reliable tools that specialize in certain types of tasks. In order to make full use of the understanding and execution capabilities of large models to handle complex problems, some frameworks have been proposed, such as React. The React framework collaboratively considers the reasoning and execution capabilities of large models and can obtain information by reasoning and taking actions. Since there are many different solution paths even for the same task, React usually requires labeled data for fine-tuning in order to land in the field. Summary of the invention

[0003] The present invention aims to provide a complex problem analysis method, medium, device and program product based on few-sample prompt learning to overcome the disadvantage that React landing application requires labeled data for large model fine-tuning.

[0004] The present invention provides a complex problem analysis method based on few-sample prompt learning, comprising:

[0005] Complex problem task decomposition: Using large model prompt engineering and few-shot learning technology, the user's complex problem is taken as input and the corresponding sub-task sequence is output;

[0006] Subtask execution: For each subtask in the subtask sequence, use the big model to select the appropriate tool from the tool library, generate the method of using the tool and call the tool to complete the subtask; and according to the completion results of the subtask, continuously adjust the subsequent subtasks to achieve the supplement and improvement of the subsequent subtasks.

[0007] Furthermore, a task decomposition example library is constructed to complete the task decomposition of complex problems.

[0008] Furthermore, the construction task decomposition example library includes

[0009] Collect problem and problem decomposition data to form data pairs (Q, Sub-Tasks), where Q represents the problem and Sub-Tasks represents the sub-task sequence corresponding to the problem;

[0010] For each question Q, use the text embedding model to convert it into a semantic representation vector V;

[0011] Store the vector V corresponding to each question Q in the database;

[0012] Store the sub-task sequence Sub-Tasks corresponding to each question Q in the database;

[0013] The database storing the vector V and sub-task sequence Sub-Tasks corresponding to each question Q is the task decomposition example library.

[0014] Furthermore, the complex problem task decomposition includes:

[0015] S101: For the user input question Q, use the text embedding model to convert it into a vector V Q ;

[0016] S102: With vector V Q As input, search in the task decomposition example library and take the top N questions with similarity and their corresponding task decomposition processes;

[0017] S103: The user input question Q and the N questions retrieved in step S102 and their corresponding task decomposition processes are used as context to construct a task decomposition prompt;

[0018] S104: Calling the large model to complete the task decomposition of the complex problem based on the task decomposition prompt.

[0019] Furthermore, a tool library is constructed to complete the subtask execution.

[0020] Furthermore, the construction of the tool library includes: preparing tools for executing tasks according to actual needs; each tool needs to at least include a tool name, a tool function description, and a tool usage parameter description.

[0021] Furthermore, the subtask execution includes:

[0022] S201: using the subtask to be executed and the tool description in the tool library as context to construct tool selection and calling prompts;

[0023] S202: calling the large model to complete tool selection and generate tool usage parameters;

[0024] S203: calling a tool to obtain subtask execution results;

[0025] S204: using the large model to determine whether it is necessary to continue to execute the subsequent subtask, if it is not necessary to continue to execute the subtask, answer in advance and terminate the subsequent subtask, otherwise continue to execute the subsequent subtask;

[0026] S205: using the large model to determine whether the next subtask needs to be adjusted and modified according to the execution result of the current subtask, and replacing the atomic task with the adjusted or modified subtask;

[0027] S206: Repeat steps S201 to S205 until all subtasks are completed and the answer to the user's question is finally obtained.

[0028] The present invention also provides a computer terminal storage medium storing computer terminal executable instructions, wherein the computer terminal executable instructions are used to execute the above-mentioned complex problem analysis method based on few-sample prompt learning.

[0029] The present invention also provides a computing device, comprising:

[0030] At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the above-mentioned complex problem analysis method based on few-sample prompt learning.

[0031] The present invention also provides a computer program product, which implements the above-mentioned complex problem analysis method based on few-sample prompt learning when the computer program is executed by a processor.

[0032] In summary, due to the adoption of the above technical solution, the beneficial effects of the present invention are:

[0033] The present invention makes full use of large-model prompt learning and few-sample learning technology to build a task decomposition example library. By retrieving task decomposition examples similar to user questions as prompt contexts, complex problems can be decomposed on demand without the need for training to form a sequence of complex problem subtasks. For each subtask, the large model can automatically select available tools to complete the task. In order to overcome the shortcoming of lack of dynamic changes in task decomposition caused by the one-time completion of subtask sequence generation, the present invention introduces a multiple adjustment mechanism that can dynamically adjust subsequent tasks according to the execution of previous tasks. Through the above-mentioned single decomposition and multiple adjustments, the present invention realizes on-demand planning and dynamic adjustment of complex problems without the need for training, and ultimately completes reasonable answers to users' complex questions. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 Flow chart of a complex problem analysis method based on few-sample prompt learning in an embodiment of the present invention.

[0035] Figure 2 This is an example schematic diagram of a complex problem analysis method based on few-sample prompt learning in an embodiment of the present invention. DETAILED DESCRIPTION

[0036] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.

[0037] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0038] Example

[0039] In order to overcome the shortcoming that React landing applications need labeled data for large model fine-tuning, the basic idea of ​​implementing the complex problem analysis method based on few-sample prompt learning is: first, use large model prompt engineering technology and few-sample learning technology to decompose the complex problems input by users into several subtasks; then for each subtask, select and use the tools in the tool library to complete the subtask; at the same time, according to the execution results of the task, continuously optimize and adjust the subsequent tasks. By completing each subtask, the analysis and solution of the user's complex problems can be achieved.

[0040] like Figure 1 As shown, a complex problem analysis method based on few-sample prompt learning provided by an embodiment of the present invention mainly includes two parts:

[0041] (1) Task decomposition of complex problems:

[0042] The task decomposition of complex problems takes the user's complex problems as input and outputs the corresponding subtask sequence; each subtask in the subtask sequence is a meta-task, that is, the execution result of the task can be directly obtained using the provided task processing tools.

[0043] In this embodiment, large model prompt engineering and few-sample learning technology are used to achieve the decomposition of complex tasks. For the user's complex problems, semantic search is used to find problems similar to the user's problems, and these problems and their decomposition methods are used together with the complex problems input by the user as context to build task decomposition prompts, obtain the sub-task sequence corresponding to the complex problem, and achieve the decomposition of the complex problem.

[0044] (2) Subtask execution:

[0045] Subtask execution means that for each subtask in the subtask sequence, the large model is used to select the appropriate tool from the tool library, generate the method of using the tool, and call the tool to complete the subtask; in addition, according to the completion results of the subtask, the subsequent subtasks are continuously adjusted to achieve the supplement and improvement of the subsequent subtasks.

[0046] In order to realize the task decomposition and subtask execution of complex problems, it is necessary to build a task decomposition example library and a tool library respectively.

[0047] 1. Build a task decomposition example library:

[0048] (1) Collect questions and problem decomposition data to form data pairs (Q, Sub-Tasks), where Q represents the question and Sub-Tasks represents the sub-task sequence corresponding to the question. Problem collection can be carried out in two ways: one is to prepare the question and then manually decompose the question; the other is to prepare the question and then let the big model directly decompose the question, and finally make manual adjustments and confirmations;

[0049] (2) For each question Q, use a text embedding model, such as BGE, to convert it into a semantic representation vector V;

[0050] (3) storing the vector V corresponding to each question Q in a database, such as the Milvus database;

[0051] (4) Store the sub-task sequence Sub-Tasks corresponding to each question Q into the database;

[0052] (5) The database storing the vector V and sub-task sequence Sub-Tasks corresponding to each problem Q is the task decomposition example library.

[0053] 2. Build tool library:

[0054] Prepare tools for performing tasks according to actual needs. Common tools include various search tools and mathematical calculation tools in the form of program functions or REST interfaces. Each tool must at least include the tool name, tool function description, tool usage parameter description, etc. The following introduces a simplest text search tool in json format.

[0055]

[0056]

[0057] After completing the construction of the task decomposition example library and tool library, you can carry out complex problem task decomposition and subtask execution to achieve complex problem analysis. Figure 2 The specific implementation process of the complex problem analysis method based on few-sample prompt learning is demonstrated.

[0058] S100, complex problem task decomposition:

[0059] S101: For the user input question Q, use the text embedding model to convert it into a vector V Q ;

[0060] S102: With vector V Q As input, search in the task decomposition example library and take the top 5 similarity-ranked questions and their corresponding task decomposition processes;

[0061] S103: The user input question Q and the five questions retrieved in step S102 and their corresponding task decomposition processes are used as context to construct a task decomposition prompt;

[0062] S104: Calling the large model to complete the task decomposition of the complex problem based on the task decomposition prompt.

[0063] S200, subtask execution:

[0064] S201: using the subtask to be executed and the tool description in the tool library as context to construct tool selection and calling prompts;

[0065] S202: calling the large model to complete tool selection and generate tool usage parameters;

[0066] S203: calling a tool to obtain subtask execution results;

[0067] S204: Use the large model to determine whether it is necessary to continue to execute the subsequent subtasks (if it is impossible to solve the user's question based on the results of the completed subtasks or the user's question can be answered based on the results of the completed subtasks, then it is not necessary to continue to execute the subsequent subtasks). If it is not necessary to continue to execute the subtasks, answer in advance and terminate the subsequent subtasks, otherwise continue to execute the subsequent subtasks;

[0068] S205: using the large model to determine whether the next subtask needs to be adjusted and modified according to the execution result of the current subtask, and replacing the atomic task with the adjusted or modified subtask;

[0069] S206: Repeat steps S201 to S205 until all subtasks are completed and the answer to the user's question is finally obtained.

[0070] In addition, in some embodiments, a computer terminal storage medium is proposed, which stores computer terminal executable instructions, and the computer terminal executable instructions are used to execute the complex problem analysis method based on few-sample prompt learning as described in the previous embodiment. Examples of computer storage media include magnetic storage media (e.g., floppy disks, hard disks, etc.), optical recording media (e.g., CD-ROMs, DVDs, etc.) or memories, such as memory cards, ROMs, or RAMs. Computer storage media can also be distributed on network-connected computer systems, such as application stores.

[0071] In addition, in some embodiments, a computing device is proposed, comprising: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the complex problem analysis method based on few-sample prompt learning as described in the above embodiments. Examples of computing devices include PCs, tablet computers, smart phones, or PDAs.

[0072] In addition, in some embodiments, a computer program product is proposed, and when the computer program is executed by a processor, the computer program implements the above-mentioned complex problem analysis method based on few-sample prompt learning.

[0073] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A complex problem analysis method based on few-sample prompt learning, characterized in that: include: Complex problem task decomposition: Using large model prompt engineering and few-shot learning technology, the user's complex problem is taken as input and the corresponding sub-task sequence is output; Subtask execution: For each subtask in the subtask sequence, use the big model to select the appropriate tool from the tool library, generate the tool usage, and call the tool to complete the subtask; And according to the completion results of the subtasks, the subsequent subtasks are continuously adjusted to supplement and improve the subsequent subtasks.

2. The complex problem analysis method based on few-sample prompt learning according to claim 1 is characterized in that: Build a task decomposition example library to complete the task decomposition of complex problems.

3. The complex problem analysis method based on few-sample prompt learning according to claim 2 is characterized in that: The construction task decomposition example library includes Collect problem and problem decomposition data to form data pairs (Q, Sub-Tasks), where Q represents the problem and Sub-Tasks represents the sub-task sequence corresponding to the problem; For each question Q, use the text embedding model to convert it into a semantic representation vector V; Store the vector V corresponding to each question Q in the database; Store the sub-task sequence Sub-Tasks corresponding to each question Q in the database; The database storing the vector V and sub-task sequence Sub-Tasks corresponding to each question Q is the task decomposition example library.

4. The complex problem analysis method based on few-sample prompt learning according to claim 3 is characterized in that: The complex problem task decomposition includes: S101: For the user input question Q, use the text embedding model to convert it into a vector V Q ; S102: With vector V Q As input, search in the task decomposition example library and take the top N questions with similarity and their corresponding task decomposition processes; S103: The user input question Q and the N questions retrieved in step S102 and their corresponding task decomposition processes are used as context to construct a task decomposition prompt; S104: Calling the large model to complete the task decomposition of the complex problem based on the task decomposition prompt.

5. The complex problem analysis method based on few-sample prompt learning according to claim 1, characterized in that: Build a tool library to complete subtask execution.

6. The complex problem analysis method based on few-sample prompt learning according to claim 5, characterized in that: The construction of the tool library includes: preparing tools for executing tasks according to actual needs; each tool must at least include a tool name, a tool function description, and a tool usage parameter description.

7. The complex problem analysis method based on few-sample prompt learning according to claim 6, characterized in that: The subtask execution includes: S201: using the subtask to be executed and the tool description in the tool library as context to construct tool selection and calling prompts; S202: calling the large model to complete tool selection and generate tool usage parameters; S203: calling a tool to obtain subtask execution results; S204: using the large model to determine whether it is necessary to continue to execute the subsequent subtask, if it is not necessary to continue to execute the subtask, answer in advance and terminate the subsequent subtask, otherwise continue to execute the subsequent subtask; S205: using the large model to determine whether the next subtask needs to be adjusted and modified according to the execution result of the current subtask, and replacing the atomic task with the adjusted or modified subtask; S206: Repeat steps S201 to S205 until all subtasks are completed and the answer to the user's question is finally obtained.

8. A computer terminal storage medium storing computer terminal executable instructions, characterized in that: The computer terminal executable instructions are used to execute the complex problem analysis method based on few-sample prompt learning as described in any one of claims 1-7.

9. A computing device, characterized in that: include: at least one processor; And a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the complex problem analysis method based on few-sample prompt learning as described in any one of claims 1-7.

10. A computer program product, characterized in that When the computer program is executed by a processor, the complex problem analysis method based on few-sample prompt learning as described in any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Intelligent agent framework based on large language model

    CN119476505A