Adaptive reasoning method and system based on dynamic thinking network and iterative routing agent
By using an adaptive reasoning method based on dynamic thinking networks and iterative routing agents, the problem of low computational resource allocation efficiency in complex reasoning tasks of large language models is solved, achieving adaptive computational resource allocation and accuracy improvement, and is applicable to a variety of large language models.
Patent Information
- Application Number
- CN202511870042.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-12
- Publication Date
- 2026-02-17
- Estimated Expiration
- 2045-12-12
AI Technical Summary
Existing large language models are inefficient in allocating computational resources when dealing with complex reasoning tasks, and cannot dynamically adjust according to the complexity of the problem, resulting in wasted computational resources and low reasoning efficiency.
An adaptive reasoning method based on dynamic thinking networks and iterative routing agents is adopted. A lightweight complexity classifier dynamically selects the direct solution or recursive decomposition path, and combined with recursive problem decomposition and multi-granularity answer synthesis, adaptive allocation of computing resources is achieved.
It achieves dynamic adjustment of inference strategies based on problem complexity, significantly improving computational efficiency, reducing computational overhead by 8-12%, increasing the accuracy of complex inference tasks by 38.0%, and supporting universal adaptation to various large language models.
Smart Images

Figure CN121303366B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence, specifically to an adaptive reasoning method and system based on dynamic thinking networks and iterative routing agents. Background Technology
[0002] In recent years, large language models have demonstrated outstanding capabilities in natural language understanding and generation tasks, and have made significant progress in complex cognitive tasks such as mathematical reasoning and logical reasoning. Traditional reasoning methods mainly rely on end-to-end direct generation or fixed multi-step reasoning paradigms. Among them, the thought chain technique effectively improves the model's performance on complex problems by explicitly generating intermediate reasoning steps. However, such methods adopt a uniform processing flow, forcing multi-step reasoning for all problems, resulting in unnecessary computational overhead when dealing with simple problems. When faced with truly complex multi-step reasoning problems, the fixed reasoning depth may limit the full development of the solution process.
[0003] To overcome the limitations of reasoning chains, researchers have proposed extended methods such as tree-based reasoning and self-consistent reasoning chains. Tree-based reasoning enhances the model's exploratory ability and fault tolerance by maintaining multiple candidate reasoning paths; self-consistent reasoning chains improve the reliability of results by sampling multiple reasoning paths and voting to select the final answer. Nevertheless, these methods are essentially still static reasoning frameworks, where the reasoning structure (such as the width and depth of the tree) is fixed before reasoning and cannot be dynamically adjusted according to the actual complexity of the input problem. This "one-size-fits-all" approach leads to inefficient allocation of computational resources: simple problems are forced to undergo lengthy reasoning processes, while complex problems may not be fully solved due to resource constraints.
[0004] More recent work has attempted to introduce multi-agent verification or graph-structured reasoning to enhance the flexibility of the reasoning process. However, these methods still largely rely on predefined heuristics or fixed patterns for task decomposition strategies, lacking fine-grained awareness of the inherent complexity of the problem. Especially when dealing with sets of problems of mixed complexity, existing methods struggle to optimize computational efficiency while maintaining high accuracy. Therefore, developing a reasoning framework that can adaptively adjust reasoning strategies and dynamically allocate computational resources based on problem complexity has become a key technical challenge for improving the practicality and cost-effectiveness of large language models. Summary of the Invention
[0005] This invention proposes an adaptive reasoning method and system based on dynamic thinking networks and iterative routing agents, breaking through the computational efficiency bottleneck of traditional static reasoning frameworks. The reasoning process is dynamically optimized through three core innovations: (1) Complexity-aware routing mechanism: a lightweight binary classifier is constructed to dynamically select direct solution or recursive decomposition path based on the semantic features of the problem; (2) Hierarchical task decomposition: a recursive problem decomposition strategy is adopted to transform complex problems into a semantically coherent sequence of sub-problems; (3) Multi-granularity answer synthesis: the logical completeness of the final answer is ensured through bottom-up answer aggregation and consistency verification.
[0006] To achieve the above objectives, the present invention provides the following technical solution:
[0007] An adaptive reasoning method based on dynamic thinking networks and iterative routing agents includes:
[0008] Step 1: Input the question and initialize;
[0009] Step 2: Perform complexity classification and routing decision;
[0010] Step 3: Solve the branches directly, perform direct reasoning for simple problems and cache the results;
[0011] Step 4: Recursively decompose branches to break down complex problems into multi-level subtasks.
[0012] Step 5: Perform intelligent termination judgment. During the recursive processing, monitor two termination conditions in real time.
[0013] Step 6: Aggregate, validate, and finally output the sub-answers.
[0014] Further, step 1 includes:
[0015] Step 1.1: Receive the original question input from the user. And perform preprocessing and formatting;
[0016] Step 1.2: Initialize and initialize the recursive processing stack. The original problem Push the initial task onto the stack, i.e. ,in, The standard push operation on the execution stack includes:
[0017] First, create and initialize an empty stack structure that manages pending tasks in a last-in-first-out manner. Then, the original problem is... The complete information is stored in the top space of the stack, and the stack pointer is updated to point to the original problem. At the same time, the task is marked as "pending", its recursion depth identifier and parent task reference are recorded, and finally it is confirmed that the recursive processing stack has been correctly initialized.
[0018] Further, step 2 includes:
[0019] Step 2.1, from the stack The current task pops up. ;
[0020] Step 2.2, using a lightweight complexity classifier right Perform binary classification to determine if it belongs to the simple problem category. or complex problem class Lightweight classifier The construction based on the pre-trained BERT model involves the following process: given the token representation of the input sequence... ,in, This indicates that the question text will be displayed. Converted into a vector representation of a series of tokens, each The hidden representation is obtained through a BERT encoder, corresponding to the embedding vector of a token. ,in, This represents the context-aware hidden state sequence output by the BERT encoder; the hidden state corresponding to [CLS] is taken. The predicted probability distribution is obtained through a linear classification layer and a softmax function. ,in and These are learnable parameters;
[0021] Step 2.3, based on a lightweight complexity classifier The given results are used to make a routing decision: route to the direct solution branch or the recursive decomposition branch.
[0022] Furthermore, step 2.2 also includes:
[0023] This lightweight and complex classifier The model training uses the standard cross-entropy loss function:
[0024] ,
[0025] in, This represents the classification loss, and log(·) represents the log function. This is the true label of the i-th sample, where 0 represents simple and 1 represents complex. It is the probability that the model predicts it to be a complex class. It is the training batch size.
[0026] Further, step 3 includes:
[0027] Step 3.1, if a lightweight complexity classifier Current task Classified as a simple problem Then it will be routed to the answer module. Answer module Implemented by a large language model;
[0028] Step 3.2: Large-scale language models directly generate answers. ;
[0029] Step 3.3, the generated answer and the corresponding issues Will be stored in the answer cache library In, that is .
[0030] Further, step 4 includes:
[0031] Step 4.1, if a lightweight complexity classifier Current task Classified as a complex problem Then it will be routed to the task decomposer. ;
[0032] Step 4.2, the task decomposer Using a large language model, the current task Recursively split into A set of semantically coherent subtasks , Let i represent the i-th subtask, denoted as . Each subtask Inherited from its parent task during generation. Context information ;
[0033] Step 4.3: Push these subtasks back onto the processing stack in sequence. In, that is, for each ,implement Waiting for the recursive processing in step 2.
[0034] Further, step 5 includes:
[0035] Step 5.1, determine whether (a) the basic termination condition is met: if the current task Lightweight classifier Classified as a simple problem If so, then its decomposition will terminate;
[0036] Step 5.2, determine if the depth termination condition (b) is met: maintain a recursive depth counter. Initially 0; each time step 4 is executed to decompose the task, the subtasks... depth If the depth of a certain subtask Reaching the preset maximum recursion depth limit If this happens, further decomposition of the branch will be forcibly terminated, and the subtask will be directly routed to the answer module in step 3. Process it.
[0037] Further, step 6 includes:
[0038] Step 6.1, determine the processing stack Is it empty? If it is empty, it means that all subtasks have been processed and answers have been generated.
[0039] Step 6.2: Aggregate sub-answers from bottom to top according to the logical hierarchy formed during task decomposition; for a parent task... and its subtask set and the corresponding set of answers , The aggregate function represents the answer to the i-th subtask. Responsible for synthesizing the answer of the parent task ;
[0040] Step 6.3, during the aggregation process, evaluate the unit. For the aggregated answer Perform a consistency check to examine its logical consistency and numerical reasonableness, and generate a confidence score. ;
[0041] Step 6.4, Output the original problem The complete answer and its confidence score .
[0042] Furthermore, it also includes step 7:
[0043] Task caching and optimization include: the adaptive inference system caches processed tasks and their results during operation, and directly returns the cached results when encountering the same or highly similar task inputs.
[0044] An adaptive reasoning system for implementing the adaptive reasoning method described above includes:
[0045] A router unit, which has a built-in lightweight complexity classifier, is responsible for classifying and routing the input task into simple / complex categories.
[0046] A task decomposer is responsible for recursively decomposing complex tasks into subtasks.
[0047] The response module, which consists of a large language model, is responsible for directly solving simple tasks.
[0048] An evaluation unit is responsible for verifying the final answer and generating a confidence score.
[0049] The cache management module is responsible for managing the task-answer cache library and performing cache query and update operations.
[0050] The process control engine is responsible for coordinating the various components, controlling the recursive process, and executing intelligent termination judgments.
[0051] Compared with the prior art, the beneficial effects of the present invention are:
[0052] 1) Dynamic Adaptive Reasoning: For the first time, an adaptive routing mechanism based on the complexity of the input problem is realized, breaking through the fixed structure limitations of traditional chain or tree-based reasoning and achieving precise allocation of computing resources;
[0053] 2) Significantly improved computational efficiency: By making early decisions through the complexity classifier, unnecessary multi-step reasoning is avoided for simple problems. Experiments show that token consumption can be reduced by 8-12%.
[0054] 3) Versatility and scalability: It supports multiple large language models as backend inference engines and can adapt to models of different sizes without modifying the core architecture;
[0055] 4) End-to-end optimization: The entire system adopts a unified training and inference framework, with classifiers and decomposers working together to optimize and ensure the accuracy and stability of routing decisions;
[0056] 5) Enhanced result reliability: Through multi-level answer aggregation and consistency verification mechanisms, the risk of error propagation is effectively reduced, and the accuracy is improved by up to 38.0% on complex reasoning tasks. Attached Figure Description
[0057] Figure 1 This is a schematic diagram of the adaptive reasoning method of the present invention;
[0058] Figure 2 This is a schematic diagram of the recursive task decomposition process of the present invention;
[0059] Figure 3This is a bar chart showing the experimental results of this invention under various model tests. In the figure, a represents the performance comparison of using three different base models to perform different inference strategies on five datasets, and b represents the performance comparison of GPT-4.1 and DeepSeek-V3 on two datasets. Detailed Implementation
[0060] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0061] Please see Figure 1 and Figure 2 An adaptive reasoning method based on dynamic thinking networks and iterative routing agents includes:
[0062] Step 1, Input and initialize the question, including:
[0063] Step 1.1: Receive the original question input from the user. And perform preprocessing and formatting.
[0064] Step 1.2: Initialize and initialize the recursive processing stack. The original problem Push the initial task onto the stack, i.e. ,in, The standard push operation on the execution stack includes:
[0065] First, create and initialize an empty stack structure that manages pending tasks in a Last-In-First-Out (LIFO) manner. Then, the original problem... Complete information (including the problem content, metadata, and initial context) is stored at the top of the stack, and the stack pointer is updated to point to the original problem. Simultaneously, mark the task as "pending" and record its recursion depth identifier (initial depth). The system establishes a starting point for subsequent iterative routing and task decomposition by first setting up the recursive processing stack and the parent task reference (initially empty). This confirms that the recursive processing stack has been correctly initialized and the system has entered a ready-to-process state.
[0066] Step 2 involves complexity classification and routing decisions, including:
[0067] Step 2.1, from the stack The current task pops up. .
[0068] Step 2.2, using a lightweight complexity classifier right Perform binary classification to determine if it belongs to the simple problem category. or complex problem class The lightweight complexity classifier The process of building a pre-trained BERT model can be formally described as follows: given a sequence of input tokens... ,in This indicates that the question text will be displayed. Converted into a vector representation of a series of tokens, each This corresponds to an embedding vector for a token; the hidden representation is obtained through a BERT encoder (a pre-trained language model based on the Transformer architecture, capable of capturing deep semantic information of the input sequence). ,in This represents the context-aware hidden state sequence output by BERT, with [CLS] marking the corresponding hidden state. (This tag is typically used for classification tasks, aggregating the semantic information of the entire sequence.) The predicted probability distribution is obtained through a linear classification layer and a softmax function. ,in and These are learnable parameters; this lightweight classifier The model training uses the standard cross-entropy loss function:
[0069]
[0070] in, This represents the classification loss, used to measure the probability predicted by the model. With real labels The difference between them is minimized to optimize the model parameters and improve classification accuracy. log(·) represents the log function. This is the true label of the i-th sample, where 0 represents simple and 1 represents complex. It is the probability that the model predicts it to be a complex class. It is the training batch size.
[0071] Training dataset The initial version was generated from GPT-4o and refined through manual review. Training was performed using the AdamW optimizer with a learning rate set to 2×10⁻⁶. -5 The batch size is 16, and the training lasts for 10 epochs.
[0072] Step 2.3, based on a lightweight complexity classifier The given results are used to make a routing decision: route to the direct solution branch or the recursive decomposition branch.
[0073] Step 3, directly solve the branches, perform direct reasoning for simple problems and cache the results, including:
[0074] Step 3.1, if a lightweight complexity classifier Current task Classified as a simple problem Then it will be routed to the answer module. Answer module It is implemented by a large language model.
[0075] Step 3.2: Large-scale language models directly generate answers. .
[0076] Step 3.3, the generated answer and the corresponding issues Will be stored in the answer cache library In, that is This is for future reuse in possible queries.
[0077] Step 4, recursively decompose the branches, performing multi-level decomposition of the complex problem and generating sub-tasks, including:
[0078] Step 4.1, if a lightweight complexity classifier Current task Classified as a complex problem Then it will be routed to the task decomposer. .
[0079] Step 4.2, the task decomposer Using a large language model, the current task Recursively split into A set of semantically coherent subtasks , Let i represent the i-th subtask, denoted as . Each subtask Inherited from its parent task during generation. Context information This is to ensure semantic and logical coherence.
[0080] Step 4.3: Push these subtasks back onto the processing stack in sequence. In, that is, for each ,implement Waiting for the recursive processing in step 2.
[0081] The task decomposer inherits and maintains the context information of the parent task during decomposition, ensuring the semantic and logical coherence of the subtasks.
[0082] Step 5: Perform intelligent termination judgment. During the recursive processing, the system monitors two termination conditions in real time, including:
[0083] Step 5.1, determine whether (a) the basic termination condition is met: if the current task Lightweight classifier Classified as a simple problem If the decomposition is terminated, then the decomposition will cease.
[0084] Step 5.2, determine if the depth termination condition (b) is met: maintain a recursive depth counter. Initially 0; each time step 4 is executed to decompose the task, the subtasks... depth If the depth of a certain subtask Reaching the preset maximum recursion depth limit If this happens, further decomposition of the branch will be forcibly terminated, and the subtask will be directly routed to the answer module in step 3. Process it.
[0085] Step 6 involves aggregating, validating, and finally outputting the sub-answers, including:
[0086] Step 6.1, determine the processing stack Is it empty? If it is empty, it means that all subtasks have been processed and answers have been generated.
[0087] Step 6.2: The system aggregates sub-answers from bottom to top according to the logical hierarchy formed during task decomposition; for a parent task... and its subtask set and the corresponding set of answers , This represents the i-th subtask. The aggregate function represents the answer to the i-th subtask. Responsible for synthesizing the answer of the parent task .
[0088] Step 6.3, during the aggregation process, evaluate the unit. For the aggregated answer Perform a consistency check to examine its logical consistency and numerical reasonableness, and generate a confidence score. .
[0089] Step 6.4, Output the original problem The complete answer and its confidence score .
[0090] Step 7, Task caching and optimization, including:
[0091] The adaptive inference system caches processed tasks and their results during operation. When it encounters the same or highly similar task inputs, it directly returns the cached results to avoid redundant calculations, improve system throughput, and reduce inference latency.
[0092] The present invention also provides an adaptive reasoning system for implementing the adaptive reasoning method described above, including a router unit, a task decomposer, a response module, an evaluation unit, a cache management module, and a flow control engine.
[0093] The router unit is a computer program with a built-in lightweight complexity classifier responsible for simple / complex classification and routing of the input task. For specific implementation, please refer to step 2.2 of the adaptive inference method above.
[0094] The task decomposer is a computer program that is responsible for recursively decomposing complex tasks and generating subtasks. For specific implementation, please refer to step 4.2 of the adaptive reasoning method above.
[0095] The response module is a computer program, which consists of a large language model and is responsible for directly solving simple tasks. For specific implementation, please refer to step 3.2 of the adaptive reasoning method above.
[0096] The evaluation unit is a computer program responsible for verifying the final answer and generating a confidence score. For specific implementation details, please refer to step 6.3 of the adaptive reasoning method described above.
[0097] The cache management module is a computer program that is responsible for managing the task-answer cache library and performing cache query and update operations. For specific implementation details, please refer to steps 3.3 and 4.3 of the adaptive reasoning method described above.
[0098] The process control engine is a computer program that is responsible for coordinating the components, controlling the recursive process, and executing intelligent termination judgments. For specific implementation, please refer to steps 2.3 and 5 of the adaptive reasoning method above.
[0099] The aforementioned adaptive inference system supports the integration of different large language models as its backend inference engine via plug-in, including the GPT series, GLM series, Qwen series, and Mistral series models.
[0100] Example: This example is experimentally validated on the mathematical reasoning benchmark datasets GSM8K, SVAMP, ASDiv-A, GSM-Hard, and Math500. These datasets cover a variety of problem types, from simple arithmetic to complex multi-step reasoning. Specific statistical information is shown in Table 1.
[0101] Table 1. Detailed information on the experimental dataset
[0102]
[0103] In this embodiment, the adaptive inference method based on dynamic thinking network and iterative routing agent is tested on the above dataset. The specific implementation steps of the method are as follows:
[0104] Step 1, System Initialization and Component Configuration. Configure core system components: The router unit uses a BERT-based classifier architecture; the task decomposer and response module use GPT-3.5-turbo as the base LLM; evaluate the unit configuration logic for consistency checks and numerical verification rules. Set the maximum recursion depth. The cache library is initialized to an empty dictionary.
[0105] Step 2, Complexity Classifier Training: An initial training set of 10,000 labeled samples is generated using GPT-4o, with a simple to complex problem ratio of 6:4. After manual review and refinement, the final training set contains 8,500 high-quality samples. Classifier training parameters: learning rate 2×10⁻⁶. -5 With a batch size of 16 and a training epoch of 10, a classification accuracy of 92.3% was achieved on the validation set.
[0106] Step 3, execution of recursive reasoning process: For the input problem The system executes the following recursive processing flow:
[0107] 1) Initialize the processing stack And Push it onto the stack;
[0108] 2) Repeat the following steps until the stack is empty:
[0109] a. Pop the top task in the stack ;
[0110] b. Classifier right Classification ;
[0111] c. If The system calls the answer module to generate and cache the answer.
[0112] d. If Decomposer Generate 2-4 subtasks and push them onto the stack;
[0113] e. Check the recursion depth; if it exceeds... Then it will be forcibly terminated.
[0114] Step 4, Answer Aggregation and Validation: A bottom-up aggregation strategy is adopted: For each parent task, all child task answers are collected and validated using a context-aware aggregation function. The final answer is synthesized. The evaluation unit performs dual verification on the aggregation result: logical consistency check and numerical accuracy verification, generating a confidence score in the range of 0 to 1.
[0115] Step 5, Performance Evaluation and Comparison: Compare the performance of this framework with the baseline method on the test set. As shown in Table 2, this framework significantly reduces computational overhead while maintaining high accuracy.
[0116] Table 2 Performance comparison of various methods on GSM8K (based on GPT-3.5-turbo)
[0117]
[0118] Step 6, Ablation Experiment Analysis: The contribution of each component was verified through ablation experiments, and the results are shown in Table 3.
[0119] Table 3 Ablation Experiment Results (GSM8K Dataset)
[0120]
[0121] Step 7, Cross-model generalization testing: The generalization ability of this framework was tested on various basic LLMs, including THUDM / GLM-4-9B, Qwen3-8B, and Mistral-7B-Instruct. Experimental results show that this framework can bring stable performance improvements on models of different sizes, with an accuracy improvement of about 20%.
[0122] This invention achieves dynamic optimization of the inference process through a complexity-aware routing mechanism and a recursive task decomposition strategy. The overall process is as follows: Figure 1 As shown, the core steps include: problem input and initialization, complexity classification and routing decision, recursive decomposition and direct solution, intelligent termination judgment, answer aggregation and verification, etc. Figure 2 This demonstrates the specific process of decomposing a recursive task. Figure 3 The performance comparison results with the baseline method are presented.
[0123] Experimental results show that the present invention achieves optimal or near-optimal performance in multiple mathematical reasoning benchmark tests, while significantly outperforming existing methods in terms of computational efficiency. This method provides a new technical approach for efficiently solving complex reasoning tasks and has broad application prospects in fields such as intelligent education, automated reasoning systems, and decision support systems.
[0124] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. An adaptive reasoning method based on dynamic thinking networks and iterative routing agents, characterized in that, include: Step 1: Input the question and initialize; Step 2 involves complexity classification and routing decision-making, including the following steps: Step 2.1, from the stack The current task pops up. ; Step 2.2, using a lightweight complexity classifier right Perform binary classification to determine if it belongs to the simple problem category. or complex problem class Lightweight classifier The construction based on the pre-trained BERT model involves the following process: given the token representation of the input sequence... ,in, This indicates that the question text will be displayed. Converted into a vector representation of a series of tokens, each The hidden representation is obtained through a BERT encoder, corresponding to the embedding vector of a token. ,in, This represents the context-aware hidden state sequence output by the BERT encoder; the hidden state corresponding to [CLS] is taken. The predicted probability distribution is obtained through a linear classification layer and a softmax function. ,in and These are learnable parameters; Step 2.3, based on a lightweight complexity classifier The given results will trigger a routing decision: route to the direct solution branch or the recursive decomposition branch; Step 3: Solve the branches directly, perform direct reasoning for simple problems and cache the results; Step 4: Recursively decompose branches to break down complex problems into multi-level subtasks. Step 5: Perform intelligent termination judgment. During the recursive processing, monitor two termination conditions in real time, including: Step 5.1, determine whether (a) the basic termination condition is met: if the current task Lightweight classifier Classified as a simple problem If so, then its decomposition will terminate; Step 5.2, determine if the depth termination condition (b) is met: maintain a recursive depth counter. Initially 0; each time step 4 is executed to decompose the task, the subtasks... depth If the depth of a certain subtask Reaching the preset maximum recursion depth limit If this happens, further decomposition of the branch will be forcibly terminated, and the subtask will be directly routed to the answer module in step 3. Process it; Step 6 involves aggregating, validating, and finally outputting the sub-answers, including: Step 6.1, determine the processing stack Is it empty? If it is empty, it means that all subtasks have been processed and answers have been generated. Step 6.2: Aggregate sub-answers from bottom to top according to the logical hierarchy formed during task decomposition; for a parent task... and its subtask set and the corresponding set of answers , The aggregate function represents the answer corresponding to the i-th subtask. Responsible for synthesizing the answer of the parent task ; Step 6.3, during the aggregation process, evaluate the unit. For the aggregated answer Perform a consistency check to examine its logical consistency and numerical reasonableness, and generate a confidence score. ; Step 6.4, Output the original problem The complete answer and its confidence score .
2. The adaptive reasoning method based on dynamic thinking network and iterative routing agent according to claim 1, characterized in that, Step 1 includes: Step 1.1: Receive the original question input from the user. And perform preprocessing and formatting; Step 1.2: Initialize and initialize the recursive processing stack. The original problem Push the initial task onto the stack, i.e. ,in, The standard push operation on the execution stack includes: First, create and initialize an empty stack structure that manages pending tasks in a last-in-first-out manner. Then, the original problem is... The complete information is stored in the top space of the stack, and the stack pointer is updated to point to the original problem. At the same time, the task is marked as "pending", its recursion depth identifier and parent task reference are recorded, and finally it is confirmed that the recursive processing stack has been correctly initialized.
3. The adaptive reasoning method based on dynamic thinking network and iterative routing agent according to claim 1, characterized in that, Step 2.2 further includes: This lightweight and complex classifier The model training uses the standard cross-entropy loss function: , in, This represents the classification loss, and log(·) represents the log function. This is the true label of the i-th sample, where 0 represents simple and 1 represents complex. It is the probability that the model predicts it to be a complex class. It is the training batch size.
4. The adaptive reasoning method based on dynamic thinking network and iterative routing agent according to claim 1, characterized in that, Step 3 includes: Step 3.1, if a lightweight complexity classifier Current task Classified as a simple problem Then it will be routed to the answer module. Answer module Implemented by a large language model; Step 3.2: Large-scale language models directly generate answers. ; Step 3.3, the generated answer and the corresponding issues Will be stored in the answer cache library In, that is .
5. The adaptive reasoning method based on dynamic thinking network and iterative routing agent according to claim 1, characterized in that, Step 4 includes: Step 4.1, if a lightweight complexity classifier Current task Classified as a complex problem Then it will be routed to the task decomposer. ; Step 4.2, the task decomposer Using a large language model, the current task Recursively split into A set of semantically coherent subtasks , Let i represent the i-th subtask, denoted as . Each subtask Inherited from its parent task during generation. Context information ; Step 4.3: Push these subtasks back onto the processing stack in sequence. In, that is, for each ,implement Waiting for the recursive processing in step 2.
6. The adaptive reasoning method based on dynamic thinking network and iterative routing agent according to claim 1, characterized in that, It also includes step 7: Task caching and optimization include: the adaptive inference system caches processed tasks and their results during operation, and directly returns the cached results when encountering the same or highly similar task inputs.
7. An adaptive reasoning system for implementing the adaptive reasoning method as described in any one of claims 1-6, characterized in that, include: A router unit, which has a built-in lightweight complexity classifier, is responsible for classifying and routing the input task into simple / complex categories. A task decomposer is responsible for recursively decomposing complex tasks into subtasks. The response module, which consists of a large language model, is responsible for directly solving simple tasks. An evaluation unit is responsible for verifying the final answer and generating a confidence score. The cache management module is responsible for managing the task-answer cache library and performing cache query and update operations. The process control engine is responsible for coordinating the various components, controlling the recursive process, and executing intelligent termination judgments.
Citation Information
Patent Citations
Providing answers to questions using hypothesis pruning
CN103229120A
Distributed machine learning resource sharing and request routing
CN114885029A