A reasoning time control method based on reflection trigger signal words
By constructing a set of reflection-triggered signal words and a consistency verification mechanism, and dynamically pruning redundant steps, the problem of high computational overhead and high inference latency in mathematical reasoning tasks of large language models is solved, thereby improving inference efficiency and accuracy. It is applicable to a variety of inference tasks and application scenarios.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- PEKING UNIV
- Filing Date
- 2026-02-11
- Publication Date
- 2026-05-29
AI Technical Summary
Large language models suffer from high computational overhead and high inference latency in mathematical reasoning tasks. Furthermore, their over-reliance on long thought chains leads to redundant reasoning and wasted computational resources, making them difficult to apply effectively in scenarios with high real-time requirements.
By constructing a set of reflection-triggered signal words, reflecting behavior in the parallel reasoning process is monitored in real time. Early stopping and path correction are performed by using consistency checks of intermediate derivation steps, redundant steps are dynamically pruned, and parallel control of multiple reasoning trajectories and majority voting mechanisms are combined to achieve fine-grained control of the reasoning process.
It significantly reduces computational overhead and inference time, improves inference efficiency and accuracy, expands the application of large language models in scenarios with high real-time requirements, and ensures the stability and reliability of problem-solving results.
Smart Images

Figure CN122114164A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of natural language processing and logical computation, specifically to a method for controlling the reasoning time of a large language model for logical reasoning tasks involving complex mathematical problems. Background Technology
[0002] As the reasoning capabilities of large language models continue to improve, they demonstrate significant advantages in tasks such as solving complex problems, logical deduction, and multi-step decision-making, particularly mathematical reasoning problems. These models typically enhance their success rate by generating longer thought chains during the reasoning phase, thus fully leveraging the model's inherent reasoning potential. However, this over-reliance on long thought chains has also revealed significant problems: on the one hand, lengthy reasoning processes significantly increase computational overhead and latency, limiting the model's application in scenarios with limited computing power or high real-time requirements; on the other hand, the model is prone to overthinking during generation, continuously outputting large amounts of repetitive, irrelevant, or low-value reasoning content, wasting computational resources and potentially deviating from the correct reasoning path, ultimately reducing the accuracy of the final answer. Existing solutions often limit this by fixing the number of reasoning steps or adjusting the model structure during training. However, the reasoning mechanisms generally lack the ability to dynamically adjust the length and behavior of reasoning during result generation, making it difficult to suppress redundant reasoning in a timely manner and terminate generation early when the result has stabilized, thus creating a clear contradiction between reasoning efficiency and reasoning quality. To address the aforementioned issues, there is an urgent need for a method that enables fine-grained control over generation behavior during the reasoning phase, in order to achieve synergistic optimization of reasoning efficiency and reasoning effectiveness.
[0003] Existing research indicates that reflective behavior is typically triggered by specific reflective signals, such as keywords like "Wait," "Alternatively," "But," and "Hmm," and their frequency is correlated with generation length and error rate. Therefore, researching how to detect and respond to these signals during the inference phase is crucial for large language models to dynamically balance response latency and generation quality during mathematical reasoning tasks, thus meeting user requests with varying real-time requirements. Summary of the Invention
[0004] To address the issues of high computational overhead and high inference latency in existing large language models when performing multi-step mathematical reasoning tasks, this invention proposes a reasoning time control method based on reflective trigger signal words. This is a lightweight reasoning time control method based on a reflective mechanism. This invention captures reflective trigger signals in the reasoning text stream and uses consistency checks of intermediate derivation steps as the basis for early stopping or path correction, achieving dynamic pruning of the mathematical problem-solving process. The aim is to eliminate redundant mathematical derivation steps, significantly reducing memory usage and inference time while ensuring the correctness of complex mathematical logic reasoning, thus meeting the needs of users with different real-time requirements.
[0005] For convenience, the following lists the names and meanings of relevant terms in this invention:
[0006] The reasoning phase of the large language model: The relevant questions of the reasoning task are input to the large language model generation engine through the reasoning control interface of the large language model. During the reasoning process, the generation engine outputs the results step by step in the form of word token stream. The token is the smallest semantic or character encoding unit used by the large language model to generate text, and is used to represent characters, words or combinations thereof.
[0007] Reflection Trigger Words: When generating reasoning content, the model may output certain linguistic signals representing reflective behaviors such as hesitation, repetitive reasoning, or self-correction. Based on statistical analysis of a large number of reasoning behaviors, this invention constructs a configurable set of trigger word words to indicate that the model may enter an inefficient reasoning path. These trigger word words are not limited to any specific words and can be flexibly set according to the application scenario, task type, or model characteristics. Typical examples may include words with reflective or contrastive semantics, such as "But" and "Wait," and their equivalent expressions. The detection method for trigger word words is case-insensitive.
[0008] The technical solution of this invention is as follows:
[0009] A reasoning-time control method based on reflection-triggered signal words is proposed to control the reasoning time of input questions in mathematical logic reasoning tasks; the method includes the following steps:
[0010] (1) Based on actual needs, define and identify reflection trigger signal words, construct a set of reflection trigger signal words, initialize the sampling parameters and inference control parameters of the large language model, the sampling parameters include: sampling length limit, sampling temperature and kernel sampling threshold; the inference control parameters include: suppression threshold, answer consistency step number N and sampling group size G, and initialize the reflection trigger signal word counters on G trajectories;
[0011] (2) Input the mathematical problem to be reasoned into the large language model reasoning interface and start the parallel reasoning process of G trajectories;
[0012] (3) The large language model performs parallel prediction and generation of the next token for G trajectories, forming a continuously output token stream. For each output token of each trajectory, the following steps are performed: generation boundary detection, signal word monitoring and sampling suppression, single-trajectory self-consistency early stopping determination, and group consistency early stopping determination; specifically:
[0013] The generation boundary detection detects whether the token currently generated for the trajectory is the end marker EOS. If it is EOS, the trajectory inference is marked as ended and the result is temporarily stored.
[0014] The monitoring and sampling suppression of the signal words include:
[0015] Monitor whether the current token belongs to the preset set of reflection trigger signal words; if so, accumulate the occurrence count of the corresponding reflection trigger signal words under the trajectory, and determine whether the occurrence count of the corresponding reflection trigger signal words in the trajectory reaches the preset suppression threshold; if the suppression threshold is reached, it means that the trajectory has entered an inefficient reflection loop, and suppress the generation probability of all tokens corresponding to the reflection trigger signal words in the subsequent generation of the trajectory to zero at the sampling level, so as to limit the model from continuing to generate this type of reflection signal words;
[0016] The single-trajectory self-consistent early stopping determination, when a reflection trigger signal word is sampled on a certain trajectory, performs the following operations, including:
[0017] The trajectory before the occurrence of the reflection trigger signal word is extracted, and the intermediate answer in the current reasoning process is obtained by splicing probe templates and sampling.
[0018] Determine whether the extracted intermediate answer satisfies the condition of N consecutive consistent iterations. If it does, temporarily store the currently generated intermediate answer as a valid reasoning result for the trajectory and mark the trajectory reasoning as finished. If it does not satisfy the condition, perform the group consistency early stopping determination, the steps of which include:
[0019] For all G trajectories, the currently obtained valid inference results (temporarily stored intermediate answers or generated final results) are used to determine group consistency: if the inference results obtained for all trajectories are consistent, the global early stopping condition is met, the inference process of all trajectories is ended, and the consistent inference result is output; if the group consistency early stopping condition is not met, the process is returned to continue to predict and generate the next token for each trajectories that have not finished inference.
[0020] If the aforementioned early stop of group consensus is not triggered before all trajectory inferences are completed and the end marker is generated, the final inference result will be output based on the majority voting mechanism, and the entire inference process will be terminated.
[0021] Furthermore, the inference control parameters are used to determine the truncation strategy and convergence conditions of the inference process. Among them, the suppression threshold represents the maximum tolerance of the model to self-reflection or error correction in a single inference path; the number of consistent answer steps represents the number of consecutive stable inference steps required to determine the validity of intermediate results during the generation of inference paths; and the sampling group size represents the number of inference paths initialized in parallel, which are used for subsequent voting.
[0022] Furthermore, based on users' different preferences for response latency and generation quality, a balance is achieved by dynamically adjusting the control parameters during inference: when users prioritize high real-time performance, an aggressive strategy is adopted, i.e., reducing the suppression threshold, the number of steps to achieve consistent answers, or the sampling group size; when users prioritize high accuracy, a conservative strategy is adopted, i.e., increasing the suppression threshold, the number of steps to achieve consistent answers, or the sampling group size.
[0023] Furthermore, the reflection trigger signal words are configured by the user according to the specific application scenario. The detection of reflection trigger signal words is case-insensitive and is used to indicate that the model is entering an inefficient path of representational hesitation, repetitive reasoning, or self-correction.
[0024] The technical effects of this invention are as follows:
[0025] This invention addresses the problem-solving process of mathematical reasoning. By introducing a dynamic monitoring and sampling control mechanism based on reflection-triggered signal words during the reasoning stage, it can identify redundant reflection behaviors in mathematical derivation in real time during the generation of a large language model and adaptively suppress the generation probability of corresponding word units, effectively reducing invalid or repetitive derivation content, thereby significantly shortening the length of the reasoning thought chain and reducing computational overhead. By introducing a probe mechanism at the reflection-triggered position, continuous self-consistency judgment is performed on intermediate derivation results in the mathematical reasoning process to achieve early stopping of reasoning. This allows the model to terminate generation early when the solution result has stabilized, avoiding unnecessary subsequent reasoning steps and further improving reasoning efficiency and response speed. Through parallel control and independent suppression of multiple reasoning trajectories, combined with consistency judgment of intermediate result groups and a majority voting mechanism to output the final result, the overall reasoning redundancy is reduced while improving the stability and reliability of the mathematical solution, balancing reasoning efficiency and problem-solving accuracy.
[0026] Furthermore, the method described in this invention achieves fine-grained control of reasoning behavior without altering the original parameters and structure of the large language model. It boasts advantages such as low implementation cost, strong versatility, and ease of deployment, making it suitable for various reasoning tasks and application scenarios. This method can reduce the computational resource overhead of large language models in tasks such as complex problem solving, logical inference, and multi-step decision-making, improve the real-time response speed of tasks, and expand the application of large language models in scenarios with high real-time requirements. Attached Figure Description
[0027] Figure 1 This is the overall flowchart of the reasoning time control method based on reflection trigger signal words of the present invention;
[0028] Figure 2 This invention demonstrates the effectiveness of various language models implemented on the AIME24 mathematical reasoning test set. Detailed Implementation
[0029] The technical solution of the present invention will now be further described in conjunction with the accompanying drawings and embodiments.
[0030] This invention is mainly used in multi-step logical reasoning scenarios such as solving complex mathematical problems. By using a dynamic intervention mechanism based on reflection trigger signals, it reduces the exploration of invalid paths in the long thought chain generation process of the model without modifying the model parameters, thereby improving the accuracy and computational resource utilization efficiency of the model when solving mathematical problems.
[0031] The present invention discloses a reasoning control method based on reflection trigger signal words, which is applicable to the reasoning stage control and optimization of various large language models when dealing with mathematical reasoning problems. It can significantly reduce redundant calculations and the length of thought chains while ensuring the accuracy of model reasoning.
[0032] The method of this invention requires pre-setting a set of reflection trigger signal words and their related control thresholds, as well as setting sampling parameters and inference control parameters for a large language model. The sampling parameters control the diversity and generation space of inference paths, specifically including: sampling length limit: used to limit the maximum computational cost allowed in a single inference (e.g., set to 20480 tokens) to prevent the model from getting stuck in an infinite loop; sampling temperature and kernel sampling threshold (top-p): used to introduce appropriate randomness while ensuring the rigor of mathematical reasoning logic, so as to generate differentiated inference paths for consistency verification during parallel sampling. The inference control parameters determine the truncation strategy and convergence conditions of the inference process to respond to the real-time needs of different users, specifically including: suppression threshold: representing the maximum tolerance of the model to self-reflection or error correction in a single inference path (e.g., set to 64); answer consistency steps: representing the number of consecutive stable inference steps required to determine the validity of intermediate results during the generation of inference paths (e.g., set to 32); sampling group size: representing the number of inference paths initialized in parallel for subsequent voting (e.g., set to 8). The system achieves a balance by dynamically adjusting the control parameters during inference based on users' different preferences for response latency and generation quality: when users prioritize high real-time performance (low latency), an aggressive strategy is adopted, that is, reducing the suppression threshold, the number of answer consistency steps, or the sampling group size to accelerate inference truncation and reduce the amount of parallel computation; when users prioritize high accuracy (high quality), a conservative strategy is adopted, that is, increasing the above parameter values to ensure the correctness of mathematical answers through more thorough path exploration and more rigorous consistency checks.
[0033] The overall process of the method of this invention is as follows: Figure 1 As shown, the specific steps include:
[0034] (1) Based on actual needs, define and identify reflection trigger signal words, construct a set of reflection trigger signal words, initialize the sampling parameters and inference control parameters of the large language model, the sampling parameters include: sampling length limit, sampling temperature and kernel sampling threshold; the inference control parameters include: suppression threshold, answer consistency step number N and sampling group size G, and initialize the reflection trigger signal word counters on G trajectories;
[0035] (2) Input the mathematical problem to be reasoned into the large language model reasoning interface and start the parallel reasoning process of G trajectories;
[0036] (3) The large language model performs parallel prediction and generation of the next token for G trajectories, forming a continuously output token stream. For each output token of each trajectory, the following steps are performed: generation boundary detection, signal word monitoring and sampling suppression, single-trajectory self-consistency early stopping determination, and group consistency early stopping determination; specifically:
[0037] The generation boundary detection detects whether the token currently generated for the trajectory is the end marker EOS. If it is EOS, the trajectory inference is marked as ended and the result is temporarily stored.
[0038] The monitoring and sampling suppression of the signal words include:
[0039] Monitor whether the current token belongs to the preset set of reflection trigger signal words; if so, accumulate the occurrence count of the corresponding reflection trigger signal words under the trajectory, and determine whether the occurrence count of the corresponding reflection trigger signal words in the trajectory reaches the preset suppression threshold; if the suppression threshold is reached, it means that the trajectory has entered an inefficient reflection loop, and suppress the generation probability of all tokens corresponding to the reflection trigger signal words in the subsequent generation of the trajectory to zero at the sampling level, so as to limit the model from continuing to generate this type of reflection signal words;
[0040] The single-trajectory self-consistent early stopping determination, when a reflection trigger signal word is sampled on a certain trajectory, performs the following operations, including:
[0041] The trajectory before the occurrence of the reflection trigger signal word is extracted, and the intermediate answer in the current reasoning process is obtained by splicing probe templates and sampling.
[0042] Determine whether the extracted intermediate answer satisfies the condition of N consecutive consistent iterations. If it does, temporarily store the currently generated intermediate answer as a valid reasoning result for the trajectory and mark the trajectory reasoning as finished. If it does not satisfy the condition, perform the group consistency early stopping determination, the steps of which include:
[0043] For all G trajectories, the currently obtained valid inference results (temporarily stored intermediate answers or generated final results) are used to determine group consistency. If the inference results obtained for all trajectories are consistent, the global early stopping condition is met, the inference process of all trajectories is ended, and the consistent inference result is output. If the group consistency early stopping condition is not met, the process returns to continue predicting and generating the next token for each trajectories that have not finished inference.
[0044] If the aforementioned early stop of group consensus is not triggered before all trajectory inferences are completed and the end marker is generated, the final inference result will be output based on the majority voting mechanism, and the entire inference process will be terminated.
[0045] The inference time control method based on reflection trigger signal words of the present invention includes the following core steps: reflection trigger signal word monitoring step, sampling suppression step, single-trajectory self-consistency early stopping determination step, group consistency early stopping determination step, and result recording step. In the inference phase, G inference trajectories are first initialized in parallel according to a preset sampling group size G. The mathematical reasoning problem to be solved is input to the large language model generation engine through the inference control interface. The generation engine outputs results step by step in the form of tokens during the inference process. While the generation engine continuously outputs the token stream, the reflection trigger signal word monitoring step monitors the generated token content in real time. When a preset reflection trigger signal word (e.g., "Wait", "But") is detected, the position information and cumulative occurrence count of the corresponding token are recorded, and the relevant information is fed back to the sampling suppression step. When the occurrence count of a reflection trigger signal word in a certain trajectory exceeds the suppression threshold, the sampling suppression step immediately reduces the generation probability of the corresponding token to zero, thereby implementing probability suppression processing on the reflection trigger signal word to effectively reduce redundant reflection content and shorten the length of the inference thought chain. Meanwhile, the single-trajectory self-consistent early stopping step extracts intermediate mathematical derivations for the trajectory using a probe mechanism. When N consecutive consistent intermediate results are detected, the trajectory is considered locally converged. Subsequently, the group consistency early stopping step performs global verification on the intermediate results or inference results obtained for the G trajectories. When all trajectories' intermediate answers or results are found to be consistent, the inference process of all trajectories is terminated early, and a consistent answer is output. Otherwise, after all trajectory inferences are completed, the final result is output based on a majority voting mechanism, thereby improving overall inference efficiency while ensuring problem-solving accuracy.
[0046] In this embodiment, the sampling parameters used for model inference include: the sampling group size G is set to 8, that is, 8 independent inference trajectories are initialized in parallel for the same input question; the sampling length is limited to 20×1024, the sampling temperature is set to 0.6, and the top-p parameter is set to 0.9, so as to maintain the stability of the inference process while ensuring the diversity of generation.
[0047] Before inference begins, reflection trigger signal words are configured in advance. Based on statistical analysis of a large number of inference behaviors, this invention constructs a configurable set of reflection trigger signal words. These signal words are not limited to any fixed vocabulary and can be flexibly configured according to specific application scenarios. Typical examples include "But," "Wait," and their uppercase and lowercase equivalents. The detection of reflection trigger signal words is case-insensitive. These signal words are used to indicate that the model may be entering an inefficient path of representational hesitation, repetitive reasoning, or self-correction. During inference, the large language model outputs content step by step in units of tokens, and the system scans the generated token stream in real time.
[0048] For each parallel inference trajectory, perform the following fine-grained control steps:
[0049] Signal monitoring and counting: During the inference process, the generated token stream is scanned in real time. When the current token is detected to belong to the set of reflection trigger signal words, the system records its position and the cumulative number of occurrences under that trajectory in real time, providing a basis for subsequent sampling intervention and early stop determination.
[0050] Frequency suppression: A threshold-based frequency control mechanism for generating reflection trigger words is implemented. In this example, the suppression threshold for reflection trigger words is set to 64. When the cumulative occurrence of a reflection trigger word in a certain inference path reaches this threshold, the sampling suppression mechanism is triggered. Specifically, the system forcibly reduces the generation probability of this type of token to zero, prohibiting the model from continuing to generate such reflective content in subsequent steps, thus prompting it to switch to a more direct inference path.
[0051] Single-trajectory self-consistency early stopping determination: When a reflection trigger signal word is detected, the system uses a probe template to extract the current intermediate answer. In this example, the number of steps for answer consistency for a single trajectory is set to 32. If the intermediate answers extracted consecutively for 32 times in the same trajectory are semantically consistent, that is, the trajectory is determined to have converged, the system will terminate the token generation of the trajectory early, mark it as a completed state, and mark the inference of the trajectory as finished.
[0052] Group Consistency Early Stop Detection: The system performs real-time global verification of the currently obtained valid inference results for all 8 trajectories (including intermediate answers temporarily stored through single-trajectory early stop or the generated final results). Once it detects that the currently obtained inference results for all trajectories are consistent, a global early stop is triggered, the inference process of all trajectories is immediately terminated, and the consistent answer is output. Otherwise, the system continues to generate; if the above-mentioned global early stop is not triggered before all trajectory inference is completed (i.e., all end markers EOS are generated), the final inference result is output based on the majority voting mechanism, and the inference process is terminated.
[0053] As attached Figure 2 As shown, this invention is applied to the AIME24 math competition benchmark test task, and in
[0054] DeepSeek-R1-Distill-Qwen-1.5B, DeepSeek-R1-Distill-Qwen-7B,
[0055] The results were validated on large language models with varying parameter sizes, including DeepSeek-R1-Distill-Llama-8B and QwQ-32B. In the specific experimental setup, each test question was sampled independently eight times.
[0056] The distribution trend of the data points in the figure shows that: compared with the baseline (green data points in the figure) without the control strategy, its average response length is at a higher level; when the reflection trigger signal word threshold early stop mechanism is introduced (cyan data points in the figure), the average response length of each model initially decreases; on this basis, the application of the intermediate answer consistency number threshold early stop mechanism (light blue data points in the figure) further optimizes the inference cost of the model; finally, after adopting the early stop mechanism when the answers of each trajectory in the group are consistent (white hollow data points in the figure), the average response length is significantly shortened to the lowest range.
[0057] Overall, as the control strategy described in this invention is implemented in a progressively deeper manner, the data points of each model show a clear leftward shift on the horizontal axis (average response length), while the vertical axis (average accuracy per response) remains within a relatively stable range. This indicates that, through the above technical solution, this embodiment achieves refined control over the generation behavior in the inference stage without changing the parameter structure of the large language model, effectively suppressing redundant reflection generation, shortening the inference chain length, and balancing inference efficiency and the stability of inference results in both single-track and multi-track scenarios.
[0058] This invention, during the reasoning stage of a large language model, dynamically monitors and controls the reflection trigger signal words generated by the model that are related to extending the thought chain. It dynamically determines whether the model has entered an inefficient reflection loop and intervenes in the sampling process when preset conditions are met, thereby suppressing redundant reflection generation, shortening the reasoning chain, and improving reasoning efficiency. Furthermore, this invention combines a single-trajectory self-consistent early stopping mechanism and a group consistency early stopping mechanism to reduce invalid generation while ensuring the stability of the reasoning results.
[0059] While the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the invention. Any person skilled in the art can make many possible variations and modifications to the technical solutions of the present invention, or modify them into equivalent embodiments, without departing from the scope of the present invention. Therefore, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention, without departing from the scope of the present invention, shall still fall within the protection scope of the present invention.
Claims
1. A reasoning-time control method based on reflection-triggered signal words, for controlling the reasoning time of input problems in mathematical logic reasoning tasks; characterized in that, The method includes the following steps: (1) Based on actual needs, define and identify reflection trigger signal words, construct a set of reflection trigger signal words, initialize the sampling parameters and inference control parameters of the large language model, the sampling parameters include: sampling length limit, sampling temperature and kernel sampling threshold; the inference control parameters include: suppression threshold, answer consistency step number N and sampling group size G, and initialize the reflection trigger signal word counters on G trajectories; (2) Input the mathematical problem to be reasoned into the large language model reasoning interface and start the parallel reasoning process of G trajectories; (3) The large language model predicts and generates the next token in parallel for G trajectories, forming a continuous output token stream. For each output token of each trajectory, the generation boundary detection, signal word monitoring and sampling suppression, single trajectory self-consistency early stopping determination, and group consistency early stopping determination steps are performed.
2. The method as described in claim 1, characterized in that, Step (3) specifically includes: The generation boundary detection detects whether the token currently generated for a single trajectory is the end marker EOS. If it is EOS, the inference of the trajectory is marked as ended and the result is temporarily stored. The monitoring and sampling suppression of the signal words include: Monitor whether the current token belongs to the preset set of reflection trigger signal words; if so, accumulate the occurrence count of the corresponding reflection trigger signal words under the trajectory, and determine whether the occurrence count of the corresponding reflection trigger signal words in the trajectory reaches the preset suppression threshold; if the suppression threshold is reached, it means that the trajectory has entered an inefficient reflection loop, and suppress the generation probability of all tokens corresponding to the reflection trigger signal words in the subsequent generation of the trajectory to zero at the sampling level, so as to limit the model from continuing to generate this type of reflection signal words; The single-trajectory self-consistent early stopping determination, when a reflection trigger signal word is sampled on a certain trajectory, performs the following operations, including: The trajectory before the occurrence of the reflection trigger signal word is extracted, and the intermediate answer in the current reasoning process is obtained by splicing probe templates and sampling. Determine whether the extracted intermediate answer satisfies the condition of N consecutive consistent iterations. If it does, temporarily store the currently generated intermediate answer as a valid reasoning result for the trajectory and mark the trajectory reasoning as finished. If it does not satisfy the condition, perform the group consistency early stopping determination, the steps of which include: For all G trajectories, the currently obtained valid inference results (temporarily stored intermediate answers or generated final results) are used to determine group consistency: if the inference results obtained for all trajectories are consistent, the global early stopping condition is met, the inference process of all trajectories is ended, and the consistent inference result is output; if the group consistency early stopping condition is not met, the process is returned to continue to predict and generate the next token for each trajectories that have not finished inference. If EOS does not trigger early stop due to group consensus before all trajectory inferences are completed and end markers are generated, the final inference result will be output based on the majority voting mechanism, and the entire inference process will be terminated.
3. The method as described in claim 1, characterized in that, The inference control parameters are used to determine the truncation strategy and convergence conditions of the inference process. Among them, the suppression threshold represents the maximum tolerance of the model to self-reflection or error correction in a single inference path; the number of consistent steps represents the number of consecutive stable inference steps required to determine the validity of intermediate results during the generation of inference paths; and the sampling group size represents the number of inference paths initialized in parallel, which are used for subsequent voting.
4. The method as described in claim 1, characterized in that, Based on users' different preferences for response latency and generation quality, a balance is achieved by dynamically adjusting the control parameters during inference: when users prioritize high real-time performance, an aggressive strategy is adopted, i.e., reducing the suppression threshold, the number of steps to achieve answer consistency, or the sampling group size; when users prioritize high accuracy, a conservative strategy is adopted, i.e., increasing the suppression threshold, the number of steps to achieve answer consistency, or the sampling group size.
5. The method as described in claim 1, characterized in that, The reflection trigger signal words are configured by the user according to the specific application scenario. The detection of reflection trigger signal words is case-insensitive and is used to indicate that the model is entering an inefficient path of representational hesitation, repetitive reasoning, or self-correction.