Tool creation and evolution combined reasoning application method, system, equipment and medium

By combining tool creation and evolution methods, dynamically optimizing the tool set, the problem of inference limitations in large language models on complex problems is solved, the high reusability and diversity of tools is achieved, and the reasoning ability and system adaptability are enhanced.

CN119623637AActive Publication Date: 2025-03-14UNIV OF SCI & TECH OF CHINA

Patent Information

Application Number
CN202411713760.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-27
Publication Date
2025-03-14
Estimated Expiration
2044-11-27

AI Technical Summary

Technical Problem

The tool-enhanced large language model has limited reasoning on complex and changing problems, mainly due to the poor reusability of tools and limited functional diversity, which ignores the importance of domain knowledge to tool creation and call.

Method used

Using a method that combines tool creation and evolution, we extract knowledge from the data set through the knowledge-guided tool creation stage and build a knowledge tree structure to generate an initial tool set; in the tool evolution search stage, we dynamically optimize the tool set through tool evaluation, selection, variation and cross-operation to ensure its diversity and adaptability.

Benefits of technology

It significantly improves the reusability and diversity of tools, enhances the inference accuracy and efficiency of large language models, improves the interpretability and adaptability of the system, and has good cross-domain application potential.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119623637A_ABST
    Figure CN119623637A_ABST
Patent Text Reader

Abstract

The invention discloses a reasoning application method, system, equipment and medium combining tool creation and evolution, knowledge is abstracted from a collected data set by using a large language model, a knowledge tree structure is constructed, a series of tools are induced based on the knowledge tree structure, and the universality and reusability of the tools are ensured. In the tool evolution search stage, a complete tool evolution mechanism is designed, and a corresponding optimization function is designed in combination with an evaluation index, so that the balance of adaptive exploration and utilization is realized, a tool set is dynamically optimized, and the diversity and adaptability of the tool set are continuously improved. In the reasoning application stage, a tool enhancement agent is constructed, and the tool is flexibly called to solve the complex reasoning problem. According to the method, the reusability and diversity of a tool are remarkably improved, the reasoning accuracy and efficiency of a large language model are enhanced, meanwhile, the interpretability and adaptability of a system are improved, good cross-domain application potential is achieved, and a certain basis is provided for enhancing the complex reasoning ability of artificial intelligence.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of natural language processing technology, and in particular to a reasoning application method, system, device and medium combining tool creation and evolution. Background Art

[0002] Automatically solving reasoning problems is an important task in exploring general artificial intelligence. Its goal is to enable machines to understand natural language problems, learn and apply professional knowledge to perform logical reasoning and complex calculations, and finally get answers. This process requires the machine to obtain key information from the problem, complete multi-step reasoning and precise calculations. Therefore, the ability to automatically solve reasoning problems is regarded as a key benchmark for artificial intelligence's problem-solving ability and a major milestone towards general artificial intelligence, especially in difficult tasks such as mathematical reasoning, scientific problem solving, and complex data analysis.

[0003] At present, there are mainly the following methods for automatically solving reasoning problems:

[0004] (1) Automatic solution method based on deep learning.

[0005] Automatic problem-solving methods based on deep learning mainly use an encoder-decoder structure, where the encoder automatically mines and understands the features of the question text, and then uses the decoder to construct a solution expression. This type of method mainly develops from two aspects: improving the semantic understanding ability of the encoder and improving the reasoning ability of the decoder. Different architectures such as sequence-to-sequence, sequence-to-tree, and deductive reasoning have been developed to improve reasoning capabilities.

[0006] (2) Thought chain reasoning method based on large language model.

[0007] The thought chain reasoning method based on a large language model is an innovative method for improving the ability to automatically solve reasoning problems. This method achieves step-by-step reasoning by breaking down the problem-solving process into multiple intermediate reasoning steps and generating corresponding intermediate reasoning results, rather than directly deriving the final answer. This multi-step reasoning not only enhances the model's ability in complex reasoning tasks, but also improves the interpretability and transparency of the reasoning process, and has high versatility and scalability.

[0008] (3) Program-assisted reasoning method based on large language model.

[0009] The program-assisted reasoning method based on the large language model is a reasoning method that combines natural language understanding and code generation. It is mainly used to enhance the structured reasoning ability of the large language model for precise calculation. This method not only relies on the language reasoning ability of the model, but also generates executable program code to complete specific calculation and derivation tasks, thereby improving the accuracy and effectiveness of automatic solution of reasoning problems.

[0010] (4) Tool-enhanced large language model reasoning method.

[0011] Tool-enhanced large language model reasoning methods provide tools (APIs) for large language models, enabling them to complete tasks beyond their own capabilities, significantly improving their problem-solving potential in multiple tasks. This type of method is mainly divided into two steps: a) Tool creation: Use large language models to automatically create high-quality tools to address the scarcity of reasoning tools and the high cost of manual creation. This method analyzes multiple problems and solutions, extracts and abstracts common functions, and forms a more general and flexible tool library (Python functions). b) Tool calling. By calling tools, large language models can perform data processing, complex calculations, and environmental interactions, which can expand the functionality of large language models and significantly enhance their ability to perform complex calculations and knowledge reasoning.

[0012] Among the above-mentioned automated solution methods, the tool-enhanced large language model reasoning method has demonstrated powerful capabilities in many reasoning tasks. However, research has found that such automatically created tools are usually simple abstractions of specific problems or ideas, and they mainly face two problems: 1) Poor reusability of tools: These tools are specific to specific problems and have difficulty handling a variety of new problems. 2) Limited diversity of toolsets: The functions of the formed toolsets are too narrow, which limits the application of tool enhancement to a wider range of problems. Therefore, through experiments and analysis, the tool-enhanced large language model reasoning method still has a gap with human-level artificial intelligence, mainly because they ignore the importance of domain knowledge for the creation of reusable tools and flexible tool calls, resulting in the limitation of the reasoning of tool-enhanced large language models on complex and changing problems.

[0013] In view of this, the present invention is proposed. Summary of the invention

[0014] The purpose of the present invention is to provide a reasoning application method, system, device and medium that combines tool creation and evolution, which can enhance the complex reasoning ability of large language models, thereby providing the application effect of large language models in difficult tasks such as mathematical reasoning, scientific problem solving and complex data analysis.

[0015] The objective of the present invention is achieved through the following technical solutions:

[0016] A method for applying reasoning that combines tool creation and evolution, comprising:

[0017] Knowledge-guided tool creation phase: Collect the data set used for reasoning tasks, extract knowledge from the data set based on the big language model, and construct it into a knowledge tree structure; Based on the constructed knowledge tree structure, use the big language model to obtain the initial tool set;

[0018] Tool evolution search phase: perform tool evaluation, obtain evaluation results of each tool, and build an optimization function; then enter the tool evolution phase, in which tools that meet the requirements are screened out based on the evaluation results, and the screened tools are upgraded through mutation operations. Then, different tools are combined through crossover operations to obtain new tools. The different tools include the screened tools and the upgraded tools. Tool evaluation and tool evolution are continuously iterated, and the optimized toolset is obtained in combination with the optimization function;

[0019] Reasoning application phase: Build tools to enhance the intelligent agent and seamlessly integrate the optimized toolset into the reasoning process of the large language model.

[0020] A reasoning application system combining tool creation and evolution, comprising:

[0021] The knowledge-guided tool creation module is used to collect the data set used for the reasoning task, extract knowledge from the data set based on the large language model, and construct it into a knowledge tree structure; based on the constructed knowledge tree structure, the large language model is used to obtain the initial tool set;

[0022] The tool evolution search module is used to perform tool evaluation, obtain evaluation results of each tool, and construct an optimization function; then, enter the tool evolution stage, in which tools that meet the requirements are screened out in combination with the evaluation results, and the screened tools are upgraded through mutation operations. Then, different tools are combined through crossover operations to obtain new tools. The different tools include the screened tools and the upgraded tools. Tool evaluation and tool evolution are continuously iterated, and the optimized tool set is obtained in combination with the optimization function;

[0023] The reasoning application module is used to build tool-enhanced agents and seamlessly integrate the optimized toolset into the reasoning process of large language models.

[0024] A processing device, comprising: one or more processors; a memory for storing one or more programs;

[0025] When the one or more programs are executed by the one or more processors, the one or more processors implement the aforementioned method.

[0026] A readable storage medium stores a computer program, which implements the above method when the computer program is executed by a processor.

[0027] It can be seen from the technical solution provided by the present invention that a large language model is used to abstract knowledge from the collected data set, construct a knowledge tree structure, and induce a series of tools based on this, ensuring the versatility and reusability of the tools. A complete tool evolution mechanism is designed in the tool evolution search stage, including selection, mutation and crossover operations, and corresponding optimization functions are designed in combination with evaluation indicators to achieve a balance between adaptive exploration and utilization, dynamically optimize the toolset, and continuously improve the diversity and adaptability of the toolset. In the reasoning application stage, a tool-enhanced intelligent agent is constructed, and a tool interface is designed to achieve seamless integration of the toolset and the large language model, so as to realize flexible calling of tools to solve complex reasoning problems. The present invention significantly improves the reusability and diversity of the tools, enhances the reasoning accuracy and efficiency of the large language model, and at the same time, improves the interpretability and adaptability of the system, has good cross-domain application potential, and provides a certain foundation for enhancing the complex reasoning capabilities of artificial intelligence. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0029] Figure 1 A flowchart of a method for combining tool creation and evolution for reasoning application provided by an embodiment of the present invention;

[0030] Figure 2 A schematic diagram of a knowledge-based tool creation and evolution framework provided by an embodiment of the present invention;

[0031] Figure 3 A schematic diagram of the code of the initialization tool set T provided in an embodiment of the present invention;

[0032] Figure 4 A schematic diagram of the relevant codes of the LLM-based tool evolution provided in an embodiment of the present invention;

[0033] Figure 5 A schematic diagram of a mathematical reasoning problem and a tool for solving the problem provided by an embodiment of the present invention;

[0034] Figure 6 A schematic diagram of a reasoning application system combining tool creation and evolution provided by an embodiment of the present invention;

[0035] Figure 7 A schematic diagram of a processing device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0036] The following is a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of the present invention.

[0037] First, the terms that may be used in this article are explained as follows:

[0038] The term “and / or” means that either or both of them can be realized at the same time. For example, X and / or Y means both “X” or “Y” and “X and Y”.

[0039] The terms "include", "comprises", "contains", "has" or other descriptions with similar semantics should be interpreted as non-exclusive inclusion. For example, including certain technical feature elements (such as raw materials, components, ingredients, carriers, dosage forms, materials, dimensions, parts, components, mechanisms, devices, steps, procedures, methods, reaction conditions, processing conditions, parameters, algorithms, signals, data, products or products, etc.) should be interpreted as including not only certain technical feature elements explicitly listed, but also other technical feature elements known in the art that are not explicitly listed.

[0040] The term "consisting of..." means excluding any technical feature elements not explicitly listed. If this term is used in a claim, it will make the claim closed, so that it does not contain technical feature elements other than the technical feature elements explicitly listed, except for the conventional impurities related to them. If this term only appears in a clause of a claim, it only limits the elements explicitly listed in the clause, and the elements recorded in other clauses are not excluded from the overall claim.

[0041] The following is a detailed description of a method, system, device and medium for combining tool creation and evolution provided by the present invention. The contents not described in detail in the embodiments of the present invention belong to the prior art known to professional and technical personnel in the field. If no specific conditions are specified in the embodiments of the present invention, the conventional conditions in the field or the conditions recommended by the manufacturer are followed. The instruments used in the embodiments of the present invention, if the manufacturer is not specified, are all conventional products that can be purchased commercially.

[0042] Embodiment 1

[0043] The embodiment of the present invention provides a method for reasoning application that combines tool creation and evolution, which can automatically build a reusable and diverse reasoning tool set using domain knowledge, effectively enhancing the ability of large language models to solve complex reasoning problems, such as Figure 1 As shown, it mainly includes the following steps:

[0044] Step 1: Knowledge-guided tool creation.

[0045] This step belongs to the knowledge-guided tool creation stage. In this stage, the data set used for the reasoning task is collected, knowledge is extracted from the data set based on the large language model, and constructed into a knowledge tree structure; based on the constructed knowledge tree structure, the large language model is used to obtain the initial tool set.

[0046] Specifically, widely used datasets for complex reasoning tasks such as mathematics, science, and tables can be collected from the Internet, including problems and solutions in natural language form (i.e., answers calculated based on intermediate reasoning steps). Inspired by the cognitive laws of human learning and applying knowledge, an innovative "Problem-Knowledge-Tool Paradigm" is constructed to conceptualize tools as a form of executable domain knowledge. Then, based on the prompt engineering of the large language model, knowledge is abstracted from the collected problems to construct a three-layer knowledge tree structure containing topics, concepts, and key points. This hierarchical knowledge representation provides structured guidance for subsequent tool creation. Based on the constructed knowledge tree structure, a series of atomic tools are induced using the large language model to form an initial tool set. These atomic tools are closely integrated with basic knowledge concepts (e.g., calculus, etc.), ensuring their versatility and reusability, while also enhancing their effectiveness in various reasoning tasks.

[0047] Step 2: Tool evolution search.

[0048] This step belongs to the tool evolution search stage. In this stage: perform tool evaluation, obtain evaluation results of each tool, and build an optimization function; then enter the tool evolution stage. In the tool evolution stage, combine the evaluation results to screen out tools that meet the requirements, upgrade the screened tools through mutation operations, and then combine different tools through crossover operations to obtain new tools. The different tools include screened tools and upgraded tools. Continuously iterate tool evaluation and tool evolution, and combine the optimization function to obtain an optimized toolset.

[0049] Specifically, this phase draws on the theory of biological evolution to design a complete tool evolution mechanism to achieve adaptive optimization of the toolset. First, the natural selection process is simulated to design tool selection operations to retain tools with excellent performance. Second, through mutation operations, existing tools are upgraded to explore new functional possibilities. Third, crossover operations are introduced to combine the excellent features of different tools to create new and potentially more powerful tools. In order to evaluate the performance of the tools, multi-dimensional evaluation metrics are developed, including but not limited to reusability, coverage, task accuracy, etc. Based on these metrics, optimization functions are designed to guide the dynamic evolution of the toolset and strike a balance between exploring new tools and utilizing existing tools. Through repeated iterative optimization, the system can continuously update existing tools and discover new tools, thereby continuously improving the diversity of the toolset and its adaptability to new problems.

[0050] Step 3: Reasoning and application.

[0051] This step belongs to the reasoning application stage. In this stage, a tool-enhanced agent is built to seamlessly integrate the optimized tool set into the reasoning process of the large language model. In this way, this integration enables the large language model to flexibly call various tools to solve complex reasoning problems. First, an intelligent tool selection strategy based on questions and knowledge trees is designed to ensure that the most appropriate tool is selected during the reasoning process. Secondly, the tool combination is adjusted in real time according to the intermediate results of reasoning and the complexity of the problem to improve the flexibility and accuracy of reasoning. Finally, the logic used by the tool is tracked through the knowledge tree structure to achieve the explainability of the reasoning process.

[0052] The above solution provided by the embodiment of the present invention mainly achieves the following beneficial effects:

[0053] (1) Through the innovative problem-knowledge-tool paradigm and three-layer knowledge tree structure, combined with the tool evolution search mechanism and tool-enhanced intelligent agent, the reusability and diversity of tools are significantly improved, thereby enhancing the reasoning accuracy and efficiency of large language models. This approach uses domain prior knowledge to guide tool creation, making the generated tools more general and flexible, and able to cope with a wide range of reasoning tasks. At the same time, dynamic evolution and intelligent selection strategies enable the system to continuously optimize the toolset and adapt to emerging problem types and domain knowledge, providing an effective solution for enhancing the complex reasoning capabilities of large language models.

[0054] (2) The method not only improves the performance of the reasoning system (large language model), but also enhances its interpretability and adaptability. The knowledge tree structure and tool creation process provide a clear logical framework for the reasoning process, making the decision-making process of the system more transparent and traceable. In addition, the method of the present invention has good cross-domain application potential and can be extended to various complex reasoning tasks, such as scientific computing, financial analysis, intelligent robots and other fields, providing reasoning tools for intelligent decision-making in these fields. It has broad application prospects and provides a certain foundation for enhancing the complex reasoning ability of artificial intelligence. .

[0055] In order to more clearly demonstrate the technical solution and technical effects provided by the present invention, the method provided by the embodiment of the present invention is described in detail with reference to specific embodiments below.

[0056] 1. Problem definition and formalization.

[0057] The goal of the automatic reasoning problem solving task is to perform logical reasoning based on the reasoning problem in text form, generate the intermediate reasoning process and the final answer. In the embodiment of the present invention, the problem of creating and evolving reasoning tools guided by domain knowledge is defined as follows: Given a reasoning task containing a training data set where p i represents the input problem (e.g., “A person walked 300 meters in 10 minutes…”), s i Denotes the corresponding solution (e.g., “cal_distance…”). The present invention aims to solve the problem of train Create a toolset T * (For example, Python functions can be considered as tools) to support large language models on the test set D test In this process, the present invention has two main goals: 1) Tool reusability: the created tool can solve a class of problems rather than a specific instance. This can be achieved by test Calling T * 2) Toolset diversity: The toolset created can cover a wide range of tasks. This can be measured by T * Can be solved Dtest It is reflected by the proportion of problems in the questionnaire.

[0058] To achieve these goals, the present invention adopts a two-stage framework: 1) Knowledge-guided tool creation stage: Improve reusability by generating an initial toolset T from a three-layer domain knowledge tree KT. 2) Tool evolution search stage: Enhance diversity by iteratively expanding and optimizing T, and finally generate the final toolset T. * .

[0059] 2. Data Collection and Evaluation Indicators

[0060] 1. Data collection.

[0061] The present invention uses mathematics, science, and tabular reasoning questions in a broad sense as input data sets, and the questions need to include the question text, the intermediate reasoning process, and the numerical answer. Examples of such data are the open source competition-level mathematics data set (MATH) released by the University of California, Berkeley; the university science test data set (SCIBENCH) released by the University of California, Los Angeles, which includes questions in subjects such as physics, mathematics, and chemistry; and the tabular reasoning word problems (TabMWP) released by the University of California, Los Angeles. In addition, the input data set can also be obtained by web crawling or offline collection of university textbook homework, subject test question sets, or Internet crawling.

[0062] 2. Evaluation indicators.

[0063] The present invention uses a variety of evaluation indicators to comprehensively evaluate the model performance and tool set effect. The main indicators include: answer accuracy (Acc), which is used to evaluate the reasoning ability of the model and calculates the ratio of the number of correct answers to the total number of questions; task coverage (Cov), which indicates the proportion of problems solved using tools, reflecting the scope of application of the toolset; tool usage frequency (Freq), which calculates the average number of calls for each tool in the toolset, reflecting the practicality of the tool; toolset size (T-size), that is, the number of functional tools, reflects the diversity of the toolset. These indicators cover a variety of answer types such as integers, multiple-choice questions, Boolean values, mathematical expressions, and lists, and can comprehensively evaluate the reasoning ability of large language models under different question formats. By comprehensively analyzing these indicators, the model performance, tool set effect, and the overall effectiveness of the method of the present invention can be comprehensively evaluated.

[0064] 3. Introduction of the plan.

[0065] In the embodiment of the present invention, a knowledge-based tool creation and evolution (KTCE) framework is proposed to solve two major problems in existing tool creation methods: first, the importance of abstract knowledge in tool development is ignored, and a clear connection between tools and knowledge is not established, which makes it difficult for tools to be applied to new problems; second, excessive reliance on specific problems to build static tools, ignoring the combination and extension of tools, and limiting the adaptability and diversity of toolsets. To address these challenges, the KTCE framework adopts a two-stage approach to automatically create a reusable and diverse toolset to enhance the reasoning ability of large language models (LLMs). In the knowledge-guided tool creation phase, the framework builds an initial toolset based on abstract knowledge to ensure a close connection between tools and basic knowledge. Subsequently, in the tool evolution search phase, the diversity and adaptability of the toolset are improved by combining, optimizing and extending existing tools. In addition, the present invention designs a knowledge-enhanced reasoning agent (KA), which uses the generated toolset to solve complex problems and further enhances the reasoning ability of LLMs. In this way, the KTCE framework not only improves the reusability of tools, but also enhances the diversity of toolsets, thereby more effectively supporting the application of LLMs in various reasoning tasks.

[0066] 1. Creation of knowledge-guided tools.

[0067] The present invention recognizes that tools are essentially executable, abstracted knowledge. Although problems vary, the underlying knowledge is often interrelated. Therefore, the present invention establishes a "problem-knowledge-tool" paradigm that goes beyond existing approaches by creating tools based on underlying knowledge rather than the problems themselves. Figure 2 As shown in part (a), this stage realizes the creation of the toolset T through three steps: knowledge extraction, knowledge clustering and tool creation.

[0068] (1) Knowledge extraction.

[0069] The present invention regards the tool as abstract domain knowledge that encapsulates problem-solving methods, and converts concepts into executable operations. Specifically, a domain knowledge tree KT is first constructed. Based on the large language model, relevant knowledge is extracted from each sample in the data set, expressed as: K = {(topic, concept, key point)}, where K represents the extracted knowledge; for example, a triple may be ("algebra", "quadratic equation", "using... to solve equations"), where algebra in the triple corresponds to the topic, quadratic equation corresponds to the concept, and using... to solve equations corresponds to the key point. The extracted knowledge elements are used to construct a three-layer domain knowledge tree KT = T∪C∪KT, where T, C, and KP are the sets of topics, concepts, and key points, respectively.

[0070] (2) Knowledge clustering.

[0071] The present invention uses the K-means clustering method to group similar elements based on semantic representation: multiple concepts (such as "quadratic equation" and "function") are clustered into a topic (such as "algebra"), and multiple key points are clustered into a concept. The key point cluster in each topic-concept pair represents a unique subtask. This method can optimize the established three-layer domain knowledge tree and remove redundant information. For example, the optimized three-level information can be: topic (such as "algebra"), concept (such as "proportion") and key point (such as "length ratio...").

[0072] (3) Tool creation.

[0073] After building the knowledge tree, the present invention creates tools (atomic tools) for the subtasks in each topic-concept pair by prompting the large language model. This process generates functions such as "def vietas_formu_from_coeff" (for calculating the sum and product of roots). Based on this, the present invention creates atomic tools for each basic topic-concept field at the key point level and forms an initial tool set T. This method ensures a close connection between the tool and the basic knowledge, improves the reusability of the tool, and the final initial tool set T corresponds to KT, and the relevant structure is expressed as:

[0074]

[0075] Among them, C is the set of concepts, T′ is the set of topics, Theme i and concept c j The function set, M ij is the number of functions, each function f k ∈F ij Corresponding to the topic-concept pair (t i ,c j )'s subtask kp k This structure ensures that T directly reflects the organization of KP, with each topic-concept pair having its own set of functions, each corresponding to a subtask.

[0076] like Figure 3 As shown, a code example of the corresponding initialization tool set T is provided.

[0077] The above method provided by the embodiment of the present invention is not only convenient for efficient management of large-scale tool sets, but also maintains the inherent structure of domain knowledge. The structured tool set T reflects the knowledge tree KT through its hierarchical organization, covering various knowledge points in the task domain. By decomposing complex reasoning tasks into atomic tools based on key points, the method of the present invention realizes flexible problem-solving reasoning. In addition, this structured method is also convenient for the management and updating of tools. With the addition of new knowledge or the updating of existing knowledge, the corresponding tools can be easily added, modified or replaced without affecting the overall structure. This flexibility enables the tool set to continue to evolve with the development of domain knowledge, maintaining its practicality and advancement.

[0078] In general, the knowledge-guided tool creation method of the present invention not only improves the reusability of the tool, but also enhances the diversity and adaptability of the tool set. By structuring domain knowledge and directly mapping it to the tool set, the present invention lays a solid foundation for subsequent tool evolution and complex problem solving, and provides new possibilities for improving the application capabilities of large language models in various reasoning tasks.

[0079] 2. Tool evolution search.

[0080] like Figure 2 As shown in part (b), at this stage, the present invention completes the adaptive optimization of the initial toolset T through iterative tool evaluation and tool evolution, and finally obtains the optimized toolset T * .

[0081] Although the initial toolset T reflects the structure of domain knowledge, it may still have some limitations: 1) Lack of comprehensiveness: There may be a lack of specialized tools for subtasks that did not appear in the training set, limiting the versatility of the system. 2) Potential errors and deficiencies: Due to the inherent uncertainty of large language models (LLMs), the generated tools may be flawed. For example, the "vietas_formu_from_coeff" function may lack the case handling of "a=0". These problems may cause the accuracy of LLMs to be unstable in reasoning tasks. Static toolsets inevitably face these problems, so dynamic optimization of the toolset is required. However, unlike the vectorized parameters in deep learning models, tools are Python functions that cannot calculate gradients, which brings unique challenges. Inspired by evolutionary biology and genetic programming (GP), it can be observed that the mutation and crossover processes in biological evolution are very consistent with the toolset updates expected by the present invention.

[0082] Based on this insight, this paper proposes an evolutionary search method to simulate this optimization process in a non-gradient way. The main goal of this stage is to further improve the diversity of the tool set. Specifically, the tool f in T kconceptualized as individuals, the tool set T as the initial population, and the data set D train The LLMs are used to simulate this evolutionary process to increase the diversity of the initial population and improve the actual reasoning performance. Tool evaluation and tool evolution (simulating selection, crossover and mutation in evolutionary operations) are performed iteratively, with the former guiding the latter and controlling the iterative process. Finally, the optimized tool set T can be obtained. * .

[0083] (1) Tool evaluation.

[0084] In the tool evaluation phase, the population T is evaluated in the environment D train This evaluation provides insights into the performance of the toolset and lays the foundation for the subsequent tool evolution stage. The metrics and optimization functions used together reflect the fitness of the tools and toolsets to the problem-solving environment, similar to the fitness of individuals and populations in biological evolution. The evaluation process first evaluates each topic-concept pair (t i ,c j ) ij , using LLM by calling F ij f k for We generate Python solutions to the sampled problems in . By executing these solutions, we obtain the accuracy of each program as well as the usage and accuracy of each tool. Then, we use multiple metrics to quantify the performance.

[0085] Specifically, for each tool f k , combined with the tool call frequency (f k The number of times the tool is called), the frequency of successful tool calls Calculating tool effectiveness scores As the tool evaluation result, it is expressed as:

[0086]

[0087] At the toolset level, we evaluate: 1) Toolset coverage (TC): This indicates the proportion of problems that use T to reason, i.e., the proportion of problems that use T to reason about D train 2) Task Accuracy (TA): measures the accuracy of reasoning using T. In order to effectively guide the optimization process, an optimization function L is introduced, which integrates three main goals: tool reusability, tool set diversity, and ensuring reasoning accuracy. The optimization function is expressed as:

[0088]

[0089] Where n is the number of tools (i.e., the size of the toolset), K is the expected size, and α, β, γ, and δ are weight coefficients. Representation and subject-concept pair (t i ,c j ) corresponding to the subset of training dataset questions, for The number of questions in .

[0090] (2) Tool evolution.

[0091] The present invention uses a large language model to implement three key mechanisms similar to biological evolution: selection, crossover, and mutation. These operations are applied to the tool set T based on the indicators and feedback obtained in the tool evaluation phase. Each operation is performed through carefully designed prompts, enabling the large language model to generate updated tools.

[0092] (2.1) Selection: To improve the reusability of the toolset, tool screening (i.e., retaining valid tools and removing invalid ones) is performed by prompting the large language model to combine evaluation results and runtime information; for example, if the tool “form_qua_from_roots” is rarely called during the evaluation process, resulting in a low effectiveness score, this indicates that its presence is more noise than a useful signal, and it may be removed.

[0093] (2.2) Mutation: To ensure the inference accuracy of the tool set, the large language model is prompted to upgrade the selected tools by adjusting parameters, expanding functions, improving error handling, or a combination of one or more methods to improve adaptability. For example, in the tool "vietas_formu_from_coeff", error handling for edge cases may be added, such as handling the case of "a=0".

[0094] (2.3) Crossover: To expand the diversity of the toolset, new tools are generated based on selection or mutation (i.e., new tools are generated using the selected tools or upgraded tools) or existing tools (upgraded or selected tools) are combined to solve problems that are not currently covered. For example, by combining two existing tools "solve_qua_equation" and "vietas_formu_from_coeff", a more powerful new tool "solve_and_verify_qua" can be created.

[0095] like Figure 4 As shown, relevant code examples for LLM-based tool evolution are provided.

[0096] Throughout the evolution process, the optimization function L is used as a guiding indicator. The goal is to minimize L by balancing tool availability, tool set coverage, and accuracy. If L does not decrease, a rollback mechanism is implemented. This process continues until the stopping criteria are met, and the optimized toolset T is finally obtained.* .

[0097] The evolutionary search phase of the present invention addresses the limitations of the initial tool set through iterative optimization driven by a large language model. It mimics biological evolution and efficiently explores the solution space to improve diversity and accuracy.

[0098] 3. Reasoning application.

[0099] After completing the two-stage process, the present invention obtains the final optimized tool set T * To achieve practical reasoning, this paper proposes a tool-augmented agent, namely the new KTCE-augmented agent (KA), which seamlessly integrates the optimized toolset into the reasoning process of the large language model.

[0100] Specifically, the tool-augmented agent built utilizes T * The tool in generates the corresponding solution for the input problem, which is expressed as:

[0101] A=M(p;T * ,H)

[0102] Where A is the solution, p is the input problem, and T * is the optimized toolset, H represents the historical usage and error experience of the tool-augmented agent, and M is the problem-solving process of the tool-augmented agent.

[0103] The tool-augmented agent operates through an innovative structured approach, including three key stages: tool retrieval, solution generation, and execution and result formatting. In the tool retrieval stage, the tool-augmented agent identifies topic-concept pairs related to the input problem to extract the solution from the T * Access the target toolset, which contains one or more tools. The solution generation phase uses a large language model to generate code (e.g., Python code) that directly calls the target toolset. Finally, the generated code is executed and the results are formatted into a standardized answer.

[0104] The tool-enhanced agent constructed by the present invention utilizes an optimized tool set T * and historical data H, converting the problem input into a standardized answer, significantly improving the problem-solving ability. This structured approach not only improves efficiency, but also enhances the interpretability and reliability of the solution. By directly accessing relevant tools and leveraging historical experience, the augmented intelligent body can generate solutions more quickly and accurately, while the standardized output format facilitates subsequent evaluation and analysis. The present invention has significant adaptability and scalability, and can easily integrate new tools or optimize existing tools to continuously improve problem-solving capabilities. This flexibility enables the augmented intelligent body to cope with a variety of complex mathematical reasoning tasks and play an important role in practical applications.

[0105] In summary, the invention uses an augmented agent as a core component to achieve efficient and accurate mathematical problem solving by effectively utilizing an optimized tool set and historical experience. It demonstrates the innovative potential of combining large language models with specialized tools, and makes certain contributions to more complex AI reasoning systems in the future.

[0106] like Figure 5 As shown, it is a schematic diagram of a mathematical reasoning problem and calling tools to solve the problem. The left part is the existing solution, and the right part is the solution of the present invention. The tools of the existing solution are all temporary functions and cannot be reused, while the tools established by the present invention can be reused.

[0107] Considering Figure 3 to Figure 5 The tools provided in the examples shown are all in the form of Python functions. Those skilled in the art can understand the meaning of each Python function based on their own basic knowledge, so they are not elaborated here.

[0108] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above embodiments can be implemented by software, or by means of software plus necessary general hardware platforms. Based on such understanding, the technical solutions of the above embodiments can be embodied in the form of software products, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), including several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0109] Embodiment 2

[0110] The present invention also provides a reasoning application system combining tool creation and evolution, which is mainly used to implement the method provided in the above embodiment, such as Figure 6 As shown, the system mainly includes:

[0111] The knowledge-guided tool creation module is used to collect the data set used for the reasoning task, extract knowledge from the data set based on the large language model, and construct it into a knowledge tree structure; based on the constructed knowledge tree structure, the large language model is used to obtain the initial tool set;

[0112] The tool evolution search module is used to perform tool evaluation, obtain evaluation results of each tool, and construct an optimization function; then, enter the tool evolution stage, in which tools that meet the requirements are screened out in combination with the evaluation results, and the screened tools are upgraded through mutation operations. Then, different tools are combined through crossover operations to obtain new tools. The different tools include the screened tools and the upgraded tools. Tool evaluation and tool evolution are continuously iterated, and the optimized tool set is obtained in combination with the optimization function;

[0113] The reasoning application module is used to build tool-enhanced agents and seamlessly integrate the optimized toolset into the reasoning process of large language models.

[0114] Technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the system can be divided into different functional modules to complete all or part of the functions described above.

[0115] Embodiment 3

[0116] The present invention also provides a processing device, such as Figure 7 As shown, it mainly includes: one or more processors; a memory for storing one or more programs; wherein, when the one or more programs are executed by the one or more processors, the one or more processors implement the methods provided in the aforementioned embodiments.

[0117] Furthermore, the processing device also includes at least one input device and at least one output device; in the processing device, the processor, memory, input device, and output device are connected via a bus.

[0118] In the embodiment of the present invention, the specific types of the memory, input device and output device are not limited; for example:

[0119] The input device may be a touch screen, an image acquisition device, a physical button or a mouse, etc.;

[0120] The output device may be a display terminal;

[0121] The memory may be a random access memory (RAM) or a non-volatile memory, such as a disk memory.

[0122] Embodiment 4

[0123] The present invention also provides a readable storage medium storing a computer program, which implements the method provided in the above embodiment when the computer program is executed by a processor.

[0124] In the embodiment of the present invention, the readable storage medium is a computer-readable storage medium and can be set in the aforementioned processing device, for example, as a memory in the processing device. In addition, the readable storage medium can also be a U disk, a mobile hard disk, a read-only memory (ROM), a disk or an optical disk, etc., which can store program codes.

[0125] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A method for combining tool creation and evolution inference application, characterized in that: include: Knowledge-guided tool creation phase: Collect the data set used for reasoning tasks, extract knowledge from the data set based on the large language model, and construct it into a knowledge tree structure; Based on the constructed knowledge tree structure, an initial toolset is obtained using a large language model; Tool evolution search phase: perform tool evaluation, obtain evaluation results of each tool, and build an optimization function; then enter the tool evolution phase, in which tools that meet the requirements are screened out based on the evaluation results, and the screened tools are upgraded through mutation operations. Then, different tools are combined through crossover operations to obtain new tools. The different tools include the screened tools and the upgraded tools. Tool evaluation and tool evolution are continuously iterated, and the optimized toolset is obtained in combination with the optimization function; Reasoning application phase: Build tools to enhance the intelligent agent and seamlessly integrate the optimized toolset into the reasoning process of the large language model.

2. The method of combining tool creation and evolution according to claim 1, characterized in that: The method of extracting knowledge from a data set based on a large language model and constructing a knowledge tree structure includes: Based on the large language model, relevant knowledge is extracted from each sample in the data set, expressed as: K = {(topic, concept, key point 0}, K represents the extracted knowledge; The extracted knowledge elements are used to construct a three-layer domain knowledge tree KT=T∪C∪KP, where T, C, and KP are the collections of topics, concepts, and key points, respectively.

3. The method of combining tool creation and evolution according to claim 2, characterized in that: The initial tool set obtained by using a large language model based on the constructed knowledge tree structure includes: When constructing the knowledge tree structure, a clustering algorithm is used to group knowledge elements, that is, multiple concepts are clustered into a topic, multiple key points are clustered into a concept, and the key point cluster in each topic-concept pair represents a subtask; By prompting the large language model to create tools for each subtask of the topic-concept pair, all tools constitute the initial toolset T, which is expressed as: Among them, C is the set of concepts, T′ is the set of topics, and F ij Theme i and concept c j A set of functions, each function f k ∈F ij Corresponding to the topic-concept pair (t i ,c j )'s subtask kp k The solution is the corresponding tool.

4. A method for combining tool creation and evolution according to claim 1 or 3, characterized in that: The execution tool evaluation and obtaining the evaluation results of each tool include: For each tool f k , combined with the tool call frequency Frequency of successful tool calls Calculating tool effectiveness scores As the tool evaluation result, it is expressed as:

5. The method of combining tool creation and evolution according to claim 3, characterized in that: The optimization function is expressed as: Where n is the number of tools, K is the expected size, TC is the toolset coverage, TA is the task accuracy, α, β, γ, δ are weight coefficients, Representation and subject-concept pair (t i , c j ) corresponding to the dataset problem subset, for The number of questions in .

6. The method of combining tool creation and evolution according to claim 1, characterized in that: In the tool evolution stage, the evaluation results are combined to select the tools that meet the requirements. The selected tools are upgraded through mutation operations. Then, different tools are combined through crossover operations to obtain new tools including: Tool screening by prompting large language models combined with evaluation results and runtime information; Prompt the large language model to upgrade the selected tools by adjusting parameters, expanding functions, improving error handling, or a combination of one or more methods; Through cross-operation, new tools are generated using the filtered tools or upgraded tools, or the upgraded or filtered tools are combined into new tools.

7. The method of combining tool creation and evolution according to claim 1, characterized in that: The tool-enhanced agent that seamlessly integrates the optimized toolset into the reasoning process of the large language model includes: The optimized toolset is denoted as T*. The constructed tool-augmented agent uses the tools in T* to generate the corresponding solution for the input problem, which can be expressed as: A=M(p;T*,H) Where A is the solution, p is the input problem, T* is the optimized toolset, H represents the historical usage and error experience of the tool-augmented agent's large language model; M is the problem-solving process of the tool-augmented agent, including: identifying topic-concept pairs related to the input problem to access the target toolset from T*, using the large language model to generate corresponding code, directly calling the target toolset, executing the generated code and formatting the results.

8. A reasoning application system combining tool creation and evolution, characterized in that: include: The knowledge-guided tool creation module is used to collect the data set used for the reasoning task, extract knowledge from the data set based on the large language model, and construct it into a knowledge tree structure; based on the constructed knowledge tree structure, the large language model is used to obtain the initial tool set; The tool evolution search module is used to perform tool evaluation, obtain evaluation results of each tool, and construct an optimization function; then, enter the tool evolution stage, in which tools that meet the requirements are screened out in combination with the evaluation results, and the screened tools are upgraded through mutation operations. Then, different tools are combined through crossover operations to obtain new tools. The different tools include the screened tools and the upgraded tools. Tool evaluation and tool evolution are continuously iterated, and the optimized tool set is obtained in combination with the optimization function; The reasoning application module is used to build tool-enhanced agents and seamlessly integrate the optimized toolset into the reasoning process of large language models.

9. A processing device, characterized in that: include: one or more processors; A memory for storing 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 method according to any one of claims 1 to 7.

10. A readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Large-model-oriented universal tool collaboration and refined learning system and method

    CN116594768A

  • Tobacco enterprise intelligent information question and answer method based on knowledge graph and large language model

    CN117216227A

  • AI agent task tool selection method and device based on optimization algorithm

    CN118964815A

  • Composite symbolic and non-symbolic artificial intelligence system for advanced reasoning and semantic search

    US20240386015A1

Cited By

  • Computing device, method, computer storage medium and program product for optimizing chemical reaction conditions

    CN120412780A

  • Computing device, method, computer storage medium and program product for optimizing chemical reaction conditions

    CN120412780B

  • Large model active tool calling method and system based on multi-step reasoning

    CN120430423A