Reasoning application methods, systems, devices and media combining tool creation and evolution

By building a knowledge tree structure and tool evolution search mechanism and optimizing the toolset, we solved the problems of insufficient reusability and diversity in large language model reasoning methods, achieved more efficient and flexible reasoning capabilities, and adapted to complex reasoning tasks.

CN119623637BActive Publication Date: 2025-09-16UNIV OF SCI & TECH OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing tool-enhanced large language model inference methods suffer from poor reusability and limited tool set diversity for complex and changing problems, which limits their ability to handle a variety of new problems.

Method used

A knowledge tree structure is constructed through the knowledge-guided tool creation phase, and knowledge is extracted and an initial toolset is generated using a large language model. Combined with the mutation and crossover operations in the tool evolution search phase, the toolset is optimized to form a reusable and diverse toolset, which is seamlessly integrated into the reasoning process of the large language model.

Benefits of technology

It significantly improves the reusability and diversity of the tool, enhances the reasoning 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 CN119623637B_ABST
    Figure CN119623637B_ABST
Patent Text Reader

Abstract

The present invention discloses a reasoning application method, system, device and medium that combines tool creation and evolution, which uses a large language model 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, and corresponding optimization functions are designed in combination with evaluation indicators to achieve a balance between adaptive exploration and utilization, dynamically optimize the tool set, and continuously improve the diversity and adaptability of the tool set. In the reasoning application stage, a tool-enhanced intelligent body is constructed to achieve flexible calling of tools to solve complex reasoning problems. The present invention significantly improves the reusability and diversity of tools, enhances the reasoning accuracy and efficiency of large language models, and at the same time, the present invention 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.
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 a key task in the pursuit of general artificial intelligence. Its goal is to enable machines to understand natural language questions, learn and apply specialized knowledge to perform logical reasoning and complex calculations, and ultimately arrive at answers. This process requires machines to extract key information from the question, complete multi-step reasoning, and perform precise calculations. Therefore, the ability to automatically solve reasoning problems is considered a key benchmark for AI problem-solving capabilities and a major milestone on the road to general artificial intelligence, especially in challenging tasks such as mathematical reasoning, scientific problem-solving, and complex data analysis.

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

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

[0005] Deep learning-based automatic problem-solving methods primarily employ an encoder-decoder architecture, where the encoder automatically mines and understands the features of the question text, and the decoder constructs the solution expression. These methods primarily focus on two aspects: improving the encoder's semantic understanding capabilities and enhancing the decoder's reasoning capabilities. Various architectures, such as sequence-to-sequence, sequence-to-tree, and deductive reasoning, have been developed to enhance reasoning capabilities.

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

[0007] The thought chain reasoning method based on a large language model is an innovative approach for improving the ability to automatically solve reasoning problems. This method implements step-by-step reasoning by breaking the problem-solving process into multiple intermediate reasoning steps and generating corresponding intermediate reasoning results, rather than directly arriving at the final answer. This multi-step reasoning not only enhances the model's ability to solve complex reasoning tasks but also improves the interpretability and transparency of the reasoning process, making it highly versatile and scalable.

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

[0009] Program-assisted reasoning based on large language models combines natural language understanding with code generation, primarily designed to enhance the structured reasoning capabilities of large language models for precise computation. This approach not only relies on the model's language reasoning capabilities but also generates executable program code to perform specific computations and inferences, thereby improving the accuracy and effectiveness of automated reasoning.

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

[0011] Tool-enhanced large language model reasoning methods provide large language models with tools (APIs) that enable them to complete tasks beyond their own capabilities, significantly improving their problem-solving potential across multiple tasks. This type of method is mainly divided into two steps: a) Tool creation: Using 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 functionality, and forms a more general and flexible tool library (Python functions). b) Tool invocation. By invoking tools, large language models can perform data processing, complex calculations, and environmental interaction, which can expand the functionality of large language models and significantly enhance their ability to perform complex calculations and knowledge reasoning.

[0012] Among the aforementioned automated solution methods, tool-enhanced large language model reasoning methods have demonstrated strong 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 face two main 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 resulting toolsets are too narrow, limiting the application of tool enhancement to a wider range of problems. Therefore, through experiments and analysis, tool-enhanced large language model reasoning methods still have a gap with human-level artificial intelligence. This is mainly because they ignore the importance of domain knowledge for the creation of reusable tools and flexible tool calls, resulting in limited 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 capabilities 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 purpose of the present invention is achieved through the following technical solutions:

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

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

[0018] Tool Evolution Search Phase: Execute tool evaluation, obtain evaluation results for each tool, and construct an optimization function. Then, enter the Tool Evolution Phase. In this phase, combine the evaluation results to select tools that meet the requirements. These selected tools are upgraded through mutation operations. Then, through crossover operations, combine different tools to obtain new tools. These different tools include the selected tools and the upgraded tools. Continuously iterate tool evaluation and tool evolution, and combine the optimization function to obtain an optimized toolset.

[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 data sets used for reasoning tasks, extract knowledge from the data sets 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 for each tool, and construct an optimization function. After that, the tool evolution phase begins. During this phase, the evaluation results are combined to select tools that meet the requirements. These selected tools are upgraded through mutation operations. Finally, different tools are combined through crossover operations to obtain new tools. These different tools include selected tools and upgraded tools. Tool evaluation and tool evolution are continuously iterated, and the optimized toolset is obtained by combining the optimization function.

[0023] The reasoning application module is used to build tool-enhanced intelligent agents and seamlessly integrate the optimized tool set 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 aforementioned 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 body is constructed, and a tool interface is designed to achieve seamless integration of the toolset and the large language model, so as to achieve 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 following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any 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 for 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 it 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 in 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 accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0037] First, the following terms may be used in this article:

[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 includes both “X” or “Y” and “X and Y”.

[0039] The terms "include," "comprises," "contains," "has," or other similar expressions should be interpreted as non-exclusive. For example, "including certain technical features (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 manufactured articles, etc.) should be interpreted as including not only the technical features explicitly listed, but also other technical features known in the art that are not explicitly listed.

[0040] The term "consisting of" excludes any technical features not explicitly listed. If used in a claim, this term renders the claim closed, excluding any technical features other than those explicitly listed, except for conventional impurities associated with them. If this term appears only in a clause of a claim, it limits only the elements explicitly listed in that clause; elements listed in other clauses are not excluded from the claim as a whole.

[0041] The following describes in detail the inference application method, system, device, and medium for combining tool creation and evolution provided by the present invention. Any information not described in detail in the embodiments of the present invention is prior art known to those skilled in the art. Where specific conditions are not specified in the embodiments of the present invention, the procedures were performed in accordance with conventional conditions in the art or the conditions recommended by the manufacturer. Instruments used in the embodiments of the present invention, where the manufacturer is not specified, are all commercially available conventional products.

[0042] Example 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: Create knowledge-guided tools.

[0045] This step belongs to the knowledge-guided tool creation phase. In this phase, the dataset used for the reasoning task is collected, knowledge is extracted from the dataset 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 in mathematics, science, and tables can be collected from the internet. These datasets include natural language questions and solutions (i.e., answers computed based on intermediate reasoning steps). Inspired by the cognitive laws of how humans learn and apply knowledge, an innovative "Problem-Knowledge-Tool" paradigm is constructed, conceptualizing tools as a form of executable domain knowledge. Then, based on prompt engineering using a large language model, knowledge is abstracted from the collected questions, constructing a three-layer knowledge tree structure consisting of 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 foundational knowledge concepts (e.g., calculus), ensuring their universality and reusability while also enhancing their effectiveness across a variety of reasoning tasks.

[0047] Step 2: Tool evolution search.

[0048] This step belongs to the tool evolution search stage. In this stage: tool evaluation is performed, the evaluation results of each tool are obtained, and an optimization function is constructed; then, the tool evolution stage is entered. In the tool evolution stage, the evaluation results are combined to screen out tools that meet the requirements. The screened tools are upgraded through mutation operations, and then different tools are combined through crossover operations to obtain new tools. The different tools include the screened tools and the upgraded tools. The tool evaluation and tool evolution are continuously iterated, and the optimized toolset is obtained in combination with the optimization function.

[0049] Specifically, this phase draws on biological evolution theory to design a comprehensive tool evolution mechanism to achieve adaptive optimization of the toolset. First, a tool selection operation is designed to simulate the process of natural selection, retaining high-performing tools. Second, mutation operations are used to upgrade existing tools and explore new functional possibilities. Third, crossover operations are introduced to combine the best features of different tools to create new, potentially more powerful tools. To evaluate tool performance, multi-dimensional evaluation metrics are developed, including but not limited to reusability, coverage, and task accuracy. Based on these metrics, an optimization function is designed to guide the dynamic evolution of the toolset, striking a balance between exploring new tools and leveraging existing ones. Through repeated iterative optimization, the system can continuously update existing tools while discovering new ones, 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 phase. In this phase, a tool-enhanced agent is built, seamlessly integrating the optimized toolset into the reasoning process of the large language model. This integration enables the large language model to flexibly call on various tools to solve complex reasoning problems. First, an intelligent tool selection strategy (Intelligent Tool Selection Strategy) based on the problem and knowledge tree is designed to ensure that the most appropriate tool is selected during the reasoning process. Second, the tool combination is adjusted in real time based on the intermediate results of the reasoning and the complexity of the problem, improving the flexibility and accuracy of reasoning. Finally, the logic used by the tools is tracked through the knowledge tree structure to achieve interpretability 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 an innovative problem-knowledge-tool paradigm and a three-layer knowledge tree structure, combined with a tool evolution search mechanism and tool-enhancing agents, 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, capable of handling 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 system's decision-making process 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 robotics, 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 capabilities 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 below with reference to specific embodiments.

[0056] 1. Problem definition and formalization.

[0057] The goal of the automatic reasoning problem solving task is to perform logical reasoning based on text-based reasoning problems, generate intermediate reasoning processes and final answers. In this 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 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 Call T on * 2) Toolset diversity: The toolset created can cover a wide range of tasks. * 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: This stage improves reusability by generating an initial toolset T from a three-level domain knowledge tree KT. 2) Tool evolution search stage: This stage enhances diversity by iteratively expanding and optimizing T, ultimately generating a final toolset T. * .

[0059] 2. Data Collection and Evaluation Indicators

[0060] 1. Data collection.

[0061] This invention uses broadly defined math, science, and tabular reasoning questions as input datasets. Questions must include the question text, intermediate reasoning procedures, and numerical answers. Examples of such data include the open-source competition-level math dataset (MATH) released by the University of California, Berkeley; the university science exam dataset (SCIBENCH) released by the University of California, Los Angeles, which includes questions from subjects such as physics, mathematics, and chemistry; and the tabular reasoning word problems (TabMWP) released by the University of California, Los Angeles. Alternatively, input datasets can be obtained by web crawling, offline collection of university textbook assignments, subject exam 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 tool set; tool usage frequency (Freq), which calculates the average number of calls for each tool in the tool set, reflecting the practicality of the tool; tool set size (T-size), that is, the number of functional tools, reflecting the diversity of the tool set. 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 this embodiment of the present invention, a knowledge-based tool creation and evolution (KTCE) framework is proposed to address two major issues in existing tool creation methods: first, the neglect of the importance of abstract knowledge in tool development and the failure to establish a clear connection between tools and knowledge, which makes tools difficult to apply to new problems; second, the over-reliance on constructing static tools for specific problems, neglecting tool combination and extension, which limits the adaptability and diversity of the toolset. To address these challenges, the KTCE framework adopts a two-phase approach to automatically create a reusable and diverse toolset to enhance the reasoning capabilities of large language models (LLMs). In the knowledge-guided tool creation phase, the framework constructs an initial toolset based on abstract knowledge, ensuring a close connection between tools and underlying knowledge. Subsequently, in the tool evolution search phase, the diversity and adaptability of the toolset are improved by combining, optimizing, and extending existing tools. Furthermore, the present invention designs a knowledge-augmented reasoning agent (KA) that leverages the generated toolset to solve complex problems, further enhancing the reasoning capabilities of LLMs. Through this approach, the KTCE framework not only improves tool reusability 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 interconnected. Therefore, the present invention establishes a "problem-knowledge-tool" paradigm that goes beyond existing approaches by creating tools based on the underlying knowledge rather than the problem itself. 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 the algebra in the triple corresponds to the topic, the 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∪KP, 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 levels of information can be: topic (such as "algebra"), concept (such as "proportion") and key point (such as "length ratio...").

[0072] (3) Tool creation.

[0073] After constructing 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" (used to calculate the sum and product of roots). Based on this, the present invention creates atomic tools for each basic topic-concept domain at the key point level, forming an initial tool set T. This approach ensures a close connection between the tools and the basic knowledge, improving the reusability of the tools. The resulting 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 not only facilitates the efficient management of large-scale tool sets, but also maintains the inherent structure of domain knowledge. The structured toolset 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 also facilitates 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 toolset to continue to evolve with the development of domain knowledge, maintaining its practicality and advancement.

[0078] In summary, the knowledge-guided tool creation method of this invention not only improves tool reusability but also enhances the diversity and adaptability of the toolset. By structuring domain knowledge and directly mapping it to the toolset, this invention lays a solid foundation for subsequent tool evolution and complex problem solving, and opens new possibilities for improving the application 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 have defects. For example, the "vietas_formu_from_coeff" function may lack the handling of the case "a=0". These problems may cause the accuracy of LLM 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 dataset D train The LLMs are used to simulate this evolutionary process to increase the diversity of the initial population and improve the actual inference 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 phase. The metrics and optimization functions used together reflect the adaptability of the tools and toolset 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 in k for We generate Python solutions to the sampled problems in [1]. By executing these solutions, we obtain the accuracy of each program, as well as the usage and accuracy of each tool. We then use multiple metrics to quantify performance.

[0085] Specifically, for each tool f k , combined with tool call frequency (f k Number of times called), 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 number of problems that use T to reason about D. train 2) Task Accuracy (TA): measures the accuracy of reasoning using T. 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] This paper utilizes large language models to implement three key mechanisms similar to biological evolution: selection, crossover, and mutation. These operations are applied to the tool set T based on metrics and feedback obtained during the tool evaluation phase. Each operation is executed using 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 a large language model combined with 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 useful signal, and therefore it may be removed.

[0093] (2.2) Variation: 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 these to improve adaptability. For example, in the tool "vietas_formu_from_coeff", error handling for edge cases, such as handling "a = 0", may be added.

[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 filtered or upgraded tools) or existing tools are combined (upgraded or filtered tools) to solve problems 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 evolutionary process, the optimization function L serves 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 criterion is met, and the optimized tool set T is finally obtained.* .

[0097] The evolutionary search phase of our 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 a large language model.

[0100] Specifically, the tool-enhanced agent utilizes T * The tools in generate 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-enhanced agent operates through an innovative structured approach, which includes three key stages: tool retrieval, solution generation, and execution and result formatting. In the tool retrieval stage, the tool-enhanced agent identifies the topic-concept pairs related to the input problem and extracts them from the T * Access a target toolset, which consists of one or more tools. The solution generation phase leverages 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 standardized answers.

[0104] The tool-enhanced intelligent agent constructed by the present invention utilizes an optimized tool set T * and historical data H, converting problem input into standardized answers, significantly improving problem-solving capabilities. This structured approach not only improves efficiency but also enhances the interpretability and reliability of solutions. By directly accessing relevant tools and leveraging historical experience, the augmented intelligent agent 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, making it easy to integrate new tools or optimize existing tools, continuously improving problem-solving capabilities. This flexibility enables the augmented intelligent agent to handle a variety of complex mathematical reasoning tasks and play an important role in practical applications.

[0105] In summary, the augmented agent in this invention, as a core component, effectively leverages an optimized toolset and historical experience to achieve efficient and accurate mathematical problem solving. It demonstrates the innovative potential of combining large language models with specialized tools, contributing to the development of 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 the calling of 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] Taking into account Figures 3 to 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 basic knowledge, so they are not described in detail.

[0108] Through the description of the above embodiments, those skilled in the art will clearly understand that the above embodiments can be implemented through software or by using software plus a necessary general-purpose hardware platform. Based on this understanding, the technical solutions of the above embodiments can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, a USB flash drive, a mobile hard disk, etc.) and includes a number of instructions for causing a computer device (such as a personal computer, a server, or a network device) to execute the methods described in the various embodiments of the present invention.

[0109] Example 2

[0110] The present invention also provides a reasoning application system that combines 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 data sets used for reasoning tasks, extract knowledge from the data sets 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 for each tool, and construct an optimization function. After that, the tool evolution phase begins. During this phase, the evaluation results are combined to select tools that meet the requirements. These selected tools are upgraded through mutation operations. Finally, different tools are combined through crossover operations to obtain new tools. These different tools include selected tools and upgraded tools. Tool evaluation and tool evolution are continuously iterated, and the optimized toolset is obtained by combining the optimization function.

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

[0114] Those skilled in the art will clearly understand that for the convenience and brevity 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] Example 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 method provided by the aforementioned embodiment.

[0117] Furthermore, the processing device further 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 can be a touch screen, image acquisition device, physical button or mouse;

[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] Example 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 embodiments of the present invention, the computer-readable storage medium may be provided in the aforementioned processing device, for example, as a memory in the processing device. Alternatively, the computer-readable storage medium may be a USB flash drive, a removable hard drive, a read-only memory (ROM), a magnetic disk, or an optical disk, among other media capable of storing program code.

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

Claims

1. A method for reasoning application combining tool creation and evolution, characterized in that: include: Knowledge-guided tool creation phase: Collect the dataset used for reasoning tasks, extract knowledge from the dataset based on the large language model, and construct it into a knowledge tree structure; Based on the constructed knowledge tree structure, an initial tool set is obtained using a large language model; Tool Evolution Search Phase: Execute tool evaluation, obtain evaluation results for each tool, and construct an optimization function. Then, enter the Tool Evolution Phase. In this phase, combine the evaluation results to select tools that meet the requirements. These selected tools are upgraded through mutation operations. Then, through crossover operations, combine different tools to obtain new tools. These different tools include the selected tools and the upgraded tools. Continuously iterate tool evaluation and tool evolution, and combine the optimization function to obtain an optimized toolset. Reasoning application phase: Build tools to enhance the intelligent agent and seamlessly integrate the optimized toolset into the reasoning process of large language models; The step 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 dataset, expressed as: K = {(topic, concept, key point)}, where 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 sets of topics, concepts, and key points, respectively. 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 the subtasks of each topic-concept pair, all tools form the initial toolset T, which is expressed as: 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 The solution, that is, the corresponding tool; 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 dataset problem subset, for The number of questions in Score the effectiveness of the tool.

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

3. The method for combining tool creation and evolution according to claim 1, characterized in that: In the tool evolution phase, the evaluation results are combined to select tools that meet the requirements. The selected tools are upgraded through mutation operations. Then, through crossover operations, different tools are combined to obtain new tools, including: Tool screening is performed by prompting large language models combined with evaluation results and runtime information; Prompt large language models 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.

4. The method for applying reasoning by combining tool creation and evolution according to claim 1, characterized in that: The tool-enhanced agent build process seamlessly integrates the optimized toolset into the reasoning process of large language models, including: The optimized toolset is denoted as T * , the tools built to enhance the intelligent agent to utilize T * The tools in generate the corresponding solution for the input problem, which is expressed as: A=M(p;T * ,H) 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-enhanced agent's large language model; M is the tool-enhanced agent's problem-solving process, including: identifying the topic-concept pairs related to the input question and * Access the target toolset, use the large language model to generate corresponding code, directly call the target toolset, execute the generated code and format the results.

5. A reasoning application system combining tool creation and evolution, characterized in that: The method for implementing any one of claims 1 to 4 comprises: The knowledge-guided tool creation module is used to collect data sets used for reasoning tasks, extract knowledge from the data sets 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 for each tool, and construct an optimization function. After that, the tool evolution phase begins. During this phase, the evaluation results are combined to select tools that meet the requirements. These selected tools are upgraded through mutation operations. Finally, different tools are combined through crossover operations to obtain new tools. These different tools include selected tools and upgraded tools. Tool evaluation and tool evolution are continuously iterated, and the optimized toolset is obtained by combining the optimization function. The reasoning application module is used to build tool-enhanced intelligent agents and seamlessly integrate the optimized tool set into the reasoning process of large language models.

6. 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 4.

7. 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 4 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