LightThinker++: From Reasoning Compression to Memory Management
MemoryReasoningContext CompressionAgent浙江大学蚂蚁集团Zhu Y, Zhang J, Wan Z, et al. LightThinker++: From Reasoning Compression to Memory Management. 2026.
LightThinker++:从推理压缩到记忆管理
Abstract
Large language models (LLMs) excel at complex reasoning, yet their efficiency is limited by the surging cognitive overhead of long thought traces. In this paper, we propose LightThinker, a method that enables LLMs to dynamically compress intermediate thoughts into compact semantic representations. However, static compression often struggles with complex reasoning where the irreversible loss of intermediate details can lead to logical bottlenecks. To address this, we evolve the framework into LightThinker++, introducing Explicit Adaptive Memory Management. This paradigm shifts to behavioral-level management by incorporating explicit memory primitives, supported by a specialized trajectory synthesis pipeline to train purposeful memory scheduling. Extensive experiments demonstrate the framework's versatility across three dimensions.
大语言模型(LLM)擅长复杂推理,但冗长思维轨迹带来的认知开销急剧增加,限制了其效率。 本文提出 LightThinker,使 LLM 能够将中间思维动态压缩为紧凑的语义表示。 然而,在复杂推理中,静态压缩往往难以应对中间细节不可逆丢失所造成的逻辑瓶颈。 为此,我们将该框架发展为 LightThinker++,引入显式自适应记忆管理。 这一范式通过引入显式记忆原语,将管理提升到行为层面,并利用专门的轨迹合成流程训练有目的的记忆调度。 大量实验从三个维度展示了该框架的通用性。
(1) LightThinker reduces peak token usage by 70% and inference time by 26% with minimal accuracy loss. (2) In standard reasoning, LightThinker++ slashes peak token usage by 69.9% while yielding a +2.42% accuracy gain under the same context budget for maximum performance. (3) Most notably, in long-horizon agentic tasks, it maintains a stable footprint beyond 80 rounds (a 60%–70% reduction), achieving an average performance gain of 14.8% across different complex scenarios. Overall, our work provides a scalable direction for sustaining deep LLM reasoning over extended horizons with minimal overhead.
(1)LightThinker 在准确率损失极小的情况下,将峰值 token 用量降低 70%,推理时间缩短 26%。 (2)在标准推理中,LightThinker++ 将峰值 token 用量降低 69.9%,同时在以最高性能为目标的相同上下文预算下,将准确率提升 2.42%。 (3)最值得关注的是,在长程智能体任务中,它在超过 80 轮交互后仍保持稳定的内存占用(降低 60%–70%),并在不同复杂场景中平均提升 14.8% 的性能。 总体而言,我们的工作为以极低开销在更长时间跨度内维持 LLM 的深度推理,提供了一条可扩展的方向。
1. Introduction
Recent advancements in Large Language Models (LLMs) have demonstrated their remarkable capabilities in complex reasoning tasks. As research in this domain progresses, the reasoning patterns of these models have gradually evolved from “fast thinking” to “slow thinking”. This transition is exemplified by methods such as Chain-of-Thought (CoT) prompting, which enhances reasoning by breaking down complex problems into sequential sub-steps. Building on this, the o1-like thinking mode introduces multiple reasoning abilities such as trial-and-error, backtracking, correction, and iteration, further improving the success rate of models in solving complex problems.
大语言模型(LLM)的最新进展展示了它们在复杂推理任务中的卓越能力。 随着这一领域研究的推进,这些模型的推理模式逐渐从“快思考”演变为“慢思考”。 思维链(Chain-of-Thought,CoT)提示等方法体现了这一转变:它们通过将复杂问题分解为一系列子步骤来增强推理。 在此基础上,类 o1 思考模式 引入了试错、回溯、纠正和迭代等多种推理能力,进一步提高了模型解决复杂问题的成功率。
However, this performance improvement comes at the cost of generating a large number of tokens. Given that current LLMs are predominantly based on the Transformer architecture, the computational complexity of the attention mechanism grows quadratically with the context length, while the storage overhead of the KV Cache increases linearly with the context length. For example, in the case of Qwen32B, when the context length reaches
然而,这种性能提升的代价是生成大量 token。 由于当前 LLM 主要基于 Transformer 架构,注意力机制的计算复杂度随上下文长度呈二次增长,而 KV 缓存的存储开销随上下文长度线性增长。 例如,对于 Qwen32B,当上下文长度达到
To mitigate this issue, two main approaches have been proposed, primarily differentiated by their intervention requirements during inference. The first category requires no additional intervention during inference, achieving efficiency through prompt engineering or specialized training to guide LLMs in generating fewer or even zero intermediate tokens during reasoning. The second category operates through real-time token-by-token intervention during inference, reducing memory usage by selectively retaining important parts of the KV Cache while discarding less critical ones. However, both approaches face distinct challenges: the first typically requires careful data construction and iterative refinement, while the second introduces substantial inference latency due to the computational overhead of token-wise importance assessment.
为缓解这一问题,已有研究提出了两类主要方法,其主要区别在于推理过程中是否需要干预。 第一类在推理过程中不需要额外干预,而是通过提示工程或专门训练,引导 LLM 在推理时生成更少、甚至完全不生成中间 token,以提高效率。 第二类在推理过程中实时逐 token 干预,通过选择性保留 KV 缓存中的重要部分、丢弃不太关键的部分来降低内存用量。 然而,两类方法各自面临挑战:前者通常需要精心构建数据并反复改进,后者则因逐 token 评估重要性所带来的计算开销而引入显著的推理延迟。

图1:压缩推理范式示意。(a)一个 CoT 示例。黄色高亮 token 表示关键推理 token,其余 token 主要用于保证语言流畅性。(b)Vanilla 方法生成完整的思维 token。(c)LightThinker 将每一步思维压缩为简洁表示(
In this work, we propose a new approach by training LLMs to dynamically compress and manage historical content during reasoning. Our motivation stems from the concept of cognitive economy:
本文提出一种新方法,通过训练 LLM,使其在推理过程中动态压缩和管理历史内容。 我们的动机源于认知经济性这一概念:
- Tokens generated by the LLM serve dual purposes of ensuring linguistic fluency and facilitating actual reasoning, which makes it possible to distill the “gist” of thoughts.
- When humans solve complex problems, they do not maintain every intermediate word in active working memory; instead, they store key conclusions mentally and only “unpack” or revisit details when encountering logical bottlenecks.
- LLM 生成的 token 同时承担保证语言流畅性和支持实际推理的双重作用,因此可以从思维中提炼出“要旨”。
- 人类解决复杂问题时,并不会在活跃工作记忆中保留每一个中间词语;相反,人们会在头脑中存储关键结论,只有遇到逻辑瓶颈时,才会“展开”或重新查看细节。
Based on these insights, we first introduce LightThinker, which achieves efficiency through representation-level thought compression. As illustrated in Figure 1(c), after generating a lengthy thought step (e.g., Thought i), it is compressed into a compact representation (e.g., C Ti), and the original thought chain is discarded, with reasoning continuing based solely on the compressed content. Specifically, we train the LLM to condense lengthy thoughts into a set of hidden states corresponding to a small number of special tokens (i.e., gist tokens). Through carefully designed attention masks, the LLM learns when and how to compress and continue generating based on the compressed content.
基于这些认识,我们首先提出 LightThinker,通过 表示层面 的思维压缩来提高效率。 如 图1(c) 所示,模型生成一个冗长的思维步骤(例如 Thought i)后,将其压缩为紧凑表示(例如 C Ti),随后丢弃原始思维链,仅基于压缩内容继续推理。 具体而言,我们训练 LLM,将冗长思维浓缩为少量特殊 token(即 gist token)所对应的一组隐藏状态。 通过精心设计的注意力掩码,LLM 学会何时压缩、如何压缩,以及如何基于压缩内容继续生成。
While representation-level compression works well for many reasoning tasks, we find that purely implicit compression can lead to irreversible information loss in more complex scenarios. Then, to address this limitation, we evolve the framework into LightThinker++, introducing Explicit Adaptive Management. As shown in Figure 1(d), this paradigm shifts to behavioral-level memory management by introducing explicit memory primitives (e.g., commit, expand, fold). It enables the model to autonomously archive thoughts into semantic summaries or retrieve raw details upon logical necessity, ensuring robustness in both complex reasoning and long-horizon agentic tasks like DeepResearch. To support this evolution, we develop a collaborative synthesis pipeline, which generates expert trajectories that interleave reasoning with purposeful memory operations, training the model to master complex memory scheduling.
尽管表示层面的压缩适用于许多推理任务,但我们发现,纯粹的隐式压缩在更复杂的场景中可能导致不可逆的信息丢失。 因此,为克服这一局限,我们将该框架发展为 LightThinker++,引入显式自适应管理。 如 图1(d) 所示,这一范式通过引入显式记忆原语(例如 commit、expand、fold),转向 行为层面 的记忆管理。 它使模型能够自主将思维归档为语义摘要,或在逻辑需要时检索原始细节,从而在复杂推理以及 DeepResearch 等长程智能体任务中保持稳健。 为支持这一演进,我们开发了一套协同合成流程,生成将推理与有目的的记忆操作交织在一起的专家轨迹,训练模型掌握复杂的记忆调度。
We conduct extensive experiments across four datasets using two representative model families: Llama and Qwen. First, with the Qwen model, LightThinker reduces the peak token usage by 70% and decreases inference time by 26% compared to the Vanilla model, while maintaining comparable accuracy (with only a 1% drop). Furthermore, LightThinker++ achieves a superior accuracy–efficiency balance under two distinct scenarios: (1) in the Throughput setting (prioritizing inference speed), it slashes peak memory by 69.9% while maintaining baseline accuracy; (2) in the Budget setting (prioritizing reasoning quality), it not only reduces peak memory by 45.0% but also yields a +2.42% average accuracy gain. This confirms that a condensed, high-signal context is more effective for complex reasoning than a verbose, unmanaged one.
我们使用 Llama 和 Qwen 两个有代表性的模型家族,在四个数据集上开展了广泛实验。 首先,在 Qwen 模型上,LightThinker 相较于 Vanilla 模型,将峰值 token 用量降低 70%,推理时间缩短 26%,同时保持相当的准确率(仅下降 1%)。 此外,LightThinker++ 在两种不同场景下实现了更优的准确率与效率平衡:(1)在优先考虑推理速度的 Throughput 设置下,峰值内存降低 69.9%,同时维持基线准确率;(2)在优先考虑推理质量的 Budget 设置下,峰值内存降低 45.0%,平均准确率还提升了 2.42%。 这证实了,对于复杂推理,紧凑且有效信息密度高的上下文比冗长、未经管理的上下文更有效。
Beyond standard benchmarks, a more critical challenge is whether the compressed-context reasoning paradigm can also benefit long-horizon agentic tasks, where the context continuously grows over many interaction rounds. To validate the scalability of our approach in complex scenarios, we further evaluate LightThinker++ on long-horizon agentic tasks using the Qwen3-30B-A3B model. On challenging benchmarks including xBench-DeepSearch, BrowseComp-ZH, and BrowseComp-EN, LightThinker++ demonstrates remarkable efficiency. While the Vanilla agent's context inflates to 100k tokens within 60 rounds, LightThinker++ maintains a lean 30k–40k footprint (a 60%–70% reduction) even beyond 80 rounds. By decoupling reasoning depth from memory consumption, our method delivers an average +4.4% Pass@1 boost across three benchmarks, with a remarkable 2.51× performance leap on the challenging hard subset.
除标准基准外,一个更关键的挑战是:压缩上下文推理范式能否同样使长程智能体任务受益,因为这类任务的上下文会在多轮交互中持续增长。 为验证我们的方法在复杂场景中的可扩展性,我们进一步使用 Qwen3-30B-A3B 模型,在长程智能体任务上评估 LightThinker++。 在 xBench-DeepSearch、BrowseComp-ZH 和 BrowseComp-EN 等具有挑战性的基准上,LightThinker++ 展现出显著的效率优势。 Vanilla 智能体的上下文在 60 轮内就膨胀至 100k token,而 LightThinker++ 即使在超过 80 轮后,仍能将占用维持在精简的 30k–40k token(降低 60%–70%)。 通过将推理深度与内存消耗解耦,我们的方法在三个基准上使 Pass@1 平均提升 4.4%,并在具有挑战性的困难子集上实现了 2.51 倍的性能跃升。
Our contributions are as follows:
我们的贡献如下:
- We propose LightThinker, a method that dynamically compresses thought chains during reasoning, significantly reducing memory overhead and inference time.
- We also present LightThinker++, a framework for explicit adaptive memory management using memory primitives, and show that it can work effectively for both standard reasoning benchmarks and agentic tasks.
- We demonstrate that the LightThinker family achieves a good balance between reasoning efficiency and accuracy, offering new insights for future LLM inference acceleration.
- 我们提出 LightThinker,一种在推理过程中动态压缩思维链的方法,可显著降低内存开销并缩短推理时间。
- 我们还提出 LightThinker++,这是一个利用记忆原语实现显式自适应记忆管理的框架,并表明它对标准推理基准和智能体任务均有效。
- 我们证明,LightThinker 家族在推理效率与准确率之间实现了良好平衡,为未来的 LLM 推理加速提供了新的认识。
2. Background
Slow Thinking. The ability of LLMs to perform reasoning is fundamental, particularly when addressing complex tasks that require moving beyond the rapid, intuitive mode of System 1 toward the deliberative mode of System 2. A representative approach is Chain-of-Thought (CoT), which tackles difficult problems by breaking them down into smaller steps and solving them sequentially. Building on this idea, the o1-like thinking mode introduces additional behaviors such as trial-and-error, reflection, backtracking, and self-correction. Existing empirical results indicate that this thinking mode yields markedly better performance than CoT on challenging reasoning tasks. Such slow-thinking behavior can be learned by models through Supervised Fine-Tuning (SFT) with carefully designed training data. From the perspective of generation length, the token usage of System 1, CoT, and o1-like thinking mode increases in an orderly manner.
慢思考。 推理是 LLM 的一项基础能力,尤其是在处理复杂任务时,模型需要超越系统 1 的快速、直觉式模式,转向系统 2 的审慎思考模式。 思维链(CoT)是一种代表性方法,它将难题分解为更小的步骤,并按顺序求解。 在此基础上,类 o1 思考模式 引入了试错、反思、回溯和自我纠正等额外行为。 已有实证结果表明,在具有挑战性的推理任务中,这种思考模式的表现明显优于 CoT。 通过在精心设计的训练数据上进行监督微调(SFT),模型可以学会这种慢思考行为。 从生成长度来看,系统 1、CoT 和 类 o1 思考模式 的 token 用量依次增加。
Inference Challenges. Prior studies on the o1-like thinking mode have pointed out that solving complex problems often requires producing a large number of tokens. However, this long-generation behavior poses two major challenges for the attention mechanism, which lies at the core of Transformers. First, the memory burden grows continuously during inference. To improve decoding efficiency, the Key and Value of each token are stored in the KV cache at every layer. For Qwen-32B, once the context length reaches
推理挑战。 此前关于 类 o1 思考模式 的研究指出,解决复杂问题通常需要生成大量 token。 然而,这种长序列生成行为给 Transformer 核心的注意力机制带来了两大挑战。 首先,推理过程中的 内存 负担持续增加。 为提高解码效率,每个 token 的 Key 和 Value 都会存储在每一层的 KV 缓存中。 对于 Qwen-32B,一旦上下文长度达到
Second, the computational cost of autoregressive generation also increases substantially. Because of the attention operation in Transformers, the computation required for inference scales quadratically with the number of tokens.
其次,自回归生成的 计算成本 也会显著增加。 由于 Transformer 中的注意力运算,推理所需的计算量随 token 数量呈 二次 增长。
3. Methodology
We present the LightThinker family to accelerate the reasoning process of LLMs, as illustrated in Figure 1. The core idea is to train LLMs to dynamically compress the current thought during reasoning, enabling subsequent generation to be based on the compressed content rather than the original long thought.
我们提出 LightThinker 家族 来加速 LLM 的推理过程,如 图1 所示。 其核心思想是 训练 LLM 在推理过程中动态压缩当前思维,使后续生成基于压缩内容,而非原始的冗长思维。
Here we introduce two complementary paradigms. LightThinker (Section 3.2) targets maximal efficiency via implicit hidden-state compression, where completed thought spans in the attention context are replaced with a small number of compressed tokens. LightThinker++ (Section 3.3) improves robustness for general reasoning by introducing explicit adaptive memory management and a set of controllable actions that support on-demand archival and expansion of information. While our experiments focus on the reasoning setting, this explicit management mechanism also naturally extends to long-horizon agentic scenarios (see Section 5).
3.1. Overview
The efficiency of complex reasoning is fundamentally constrained by the cognitive overhead of processing long contexts. Inspired by human Working Memory (WM) and the Information Bottleneck (IB) principle, intelligence emerges not from retaining all information, but from strategically compressing and maintaining what is predictive for future reasoning. Specifically, we propose a hierarchical framework that progresses from implicit, representation-level distillation to explicit, behavioral-level memory management, analogous to the shift from automatic intuition to deliberate control in human cognition. From this perspective, the LightThinker family can be understood as a progressive design that balances efficiency, interpretability, and controllability through different levels of memory abstraction.
复杂推理的效率,从根本上受限于处理长上下文所带来的认知开销。 受人类工作记忆(Working Memory,WM)和信息瓶颈(Information Bottleneck,IB)原理启发,智能的来源并非保留所有信息,而是有策略地压缩并维持对未来推理具有预测价值的信息。 具体而言,我们提出一个分层框架,从隐式的表示层面蒸馏,逐步发展到显式的行为层面记忆管理,类似于人类认知从自动化直觉到有意识控制的转变。 从这一角度看,LightThinker 家族是一种渐进式设计,通过不同层次的记忆抽象,在效率、可解释性与可控性之间取得平衡。
From Implicit Representation to Explicit Management. Based on the principle of thought compression, we construct two progressive paradigms to balance reasoning efficiency and task complexity:
从隐式表示到显式管理。 基于思维压缩原理,我们构建了两种渐进范式,以平衡推理效率与任务复杂度:
- LightThinker: Focuses on representation-level optimization via an information bottleneck. It implicitly encodes thoughts into hidden state Cache Tokens, offering extreme efficiency without altering the output format. However, its lossy nature may limit performance in high-precision tasks.
- LightThinker++: Advances toward behavior-level memory management. To mitigate the irreversibility of implicit compression, we introduce explicit memory mechanisms that allow the model to regulate information retention and reactivation. The model learns to actively manage its memory by archiving details or retrieving them upon logical necessity, ensuring robustness in complex, long-horizon reasoning.
- LightThinker: 通过信息瓶颈,专注于 表示层面 的优化。它将思维隐式编码到隐藏状态缓存 token 中,无需改变输出格式即可实现极高效率。然而,其有损特性可能限制它在高精度任务中的表现。
- LightThinker++: 进一步转向 行为层面 的记忆管理。为缓解隐式压缩的不可逆性,我们引入显式记忆机制,使模型能够调节信息的保留与重新激活。模型通过归档细节,或在逻辑需要时检索细节,学会主动管理记忆,从而在复杂、长程推理中保持稳健。
Design. To realize these paradigms, we systematically address two key design dimensions:
设计。 为实现这些范式,我们系统地处理两个关键设计维度:
- When to compress? The timing of compression dictates the balance between reasoning efficiency and semantic integrity. In LightThinker, we employ rule-driven strategies such as token-level or thought-level triggers. In LightThinker++, this evolves into a model-driven decision, where the LLM autonomously invokes different memory operations based on reasoning complexity.
- How to compress? The objective is to transform lengthy thoughts into compact, navigable representations. LightThinker utilizes hidden state compression via gist tokens, implemented through a thought-based attention mask. In contrast, LightThinker++ upgrades this to explicit summarization and bidirectional management, dynamically reorganizing contextual information to approximate human working memory regulation.
- 何时压缩? 压缩时机会决定推理效率与语义完整性之间的平衡。在 LightThinker 中,我们采用 规则驱动 的策略,例如 token 级 或 思维级 触发器。在 LightThinker++ 中,这一过程演变为 模型驱动 的决策,由 LLM 根据推理复杂度自主调用不同记忆操作。
- 如何压缩? 目标是将冗长思维转换为紧凑、可检索的表示。LightThinker 通过 gist token 进行 隐藏状态压缩,并使用 基于思维的注意力掩码 来实现。相比之下,LightThinker++ 将其升级为 显式摘要与双向管理,通过动态重组上下文信息来近似人类对工作记忆的调节。
What content has been compressed? We do not aim to compress lengthy thought information into a compact representation without loss. Instead, our focus is on preserving only the information that is essential for subsequent reasoning. As highlighted by the gray dashed box in Figure 1, the lengthy thought is retained solely for the elements that contribute to further inference.
压缩了哪些内容? 我们的目标并不是将冗长的思维信息无损压缩为紧凑表示。 相反,我们专注于仅保留后续推理必需的信息。 如 图1 中灰色虚线框所强调的,冗长思维中只有有助于进一步推断的要素会被保留。

图2:LightThinker 概览,以三步推理为例。(a)展示 Vanilla 在训练和推理时的注意力掩码。(b)展示 LightThinker 训练时的注意力掩码。(c)展示 LightThinker 的完整推理过程,以及各步骤对应的注意力掩码。这里,w 表示矩阵大小。

图3:不同方法中上下文长度与生成 token 数量的关系。Dependency 指标对应曲线下面积,Peak Token 表示曲线的最大值。详见附录 A。
3.2. LightThinker: Implicit Thought Compression
Notation. We first clarify the notation used in this section. A lowercase symbol such as [·] to represent a special token, e.g., [c], and <·> to denote an optional special token, such as <w>. Our training corpus is the o1-like thinking mode dataset
符号约定。 我们首先说明本节使用的符号。 [·] 表示特殊 token,例如 [c];使用 <·> 表示可选的特殊 token,例如 <w>。 我们的训练语料是 类 o1 思考模式 数据集
Data Reconstruction. Our goal is to expose the model to an intermediate compression process while it is generating reasoning traces. To this end, we transform each sample in Seg() to split <w>, [o].
数据重构。 我们的目标是让模型在生成推理轨迹时经历一个中间压缩过程。 为此,我们将 Seg() 将 <w>、[o]。
Here, <w> acts as an optional signal that indicates the preceding segment should be compressed; it can be removed when token-level segmentation is used or when the trigger already appears in [o] is required to resume generation from the compressed representation, inspired by Zhang et al. With these insertions, the reconstructed output becomes
其中,<w> 是一个可选信号,表示应压缩前一个片段;当采用 token 级分段,或触发器已包含在 [o] 用于从压缩表示恢复生成,是必需的。 插入这些 token 后,重构的输出变为
Accordingly, the transformed dataset is
相应地,转换后的数据集为
Thought-based Attention Mask Construction. To ensure that the model learns both how to compress and how to reason from compressed content, we introduce the Thought-based Mask Construction illustrated in Figure 2(b). Let
基于思维的注意力掩码构建。 为确保模型既学会压缩,也学会基于压缩内容推理,我们引入了 图2(b) 所示的 基于思维的掩码构建 方法。 令
In the compression stage, tokens in
在压缩阶段,
where Cmp() denotes the compression operation. Under this constraint, the model is encouraged to distill the essential information in Cmp() is given in Appendix B.
其中,Cmp() 表示压缩操作。 在这一约束下,模型被引导将 Cmp() 的详细数学描述见附录 B。
In the generation stage,
在生成阶段,
where Gen() denotes the generation operation. This design allows the model to continue reasoning based on the question and the compact summary of previous thoughts.
其中,Gen() 表示生成操作。 这一设计使模型能够基于问题及此前思维的紧凑摘要继续推理。
Training and Inference. The training objective is to maximize the likelihood of the reconstructed sequence under the model parameterized by
训练与推理。 训练目标是在由
where [o]. Instead, these tokens serve as structural placeholders that guide the model to learn compression-aware reasoning. The optimization still follows the standard next-token prediction paradigm, and the samples are drawn from
其中,[o]。 相反,这些 token 充当结构占位符,引导模型学习感知压缩过程的推理能力。 优化仍遵循标准的下一 token 预测范式,样本取自

图4:LightThinker++ 概览。a)记忆动作空间: 推理步骤被实例化为具有两种形式的实体
3.3. LightThinker++: Explicit Adaptive Memory Management
While the implicit compression in Section 3.2 provides significant efficiency gains, its predefined information bottleneck may struggle with highly complex reasoning tasks which require precise backtracking to intermediate logical steps. To address this, we propose LightThinker++, a paradigm that evolves thought compression from the representation-level to the behavioral-level by empowering the model to actively manage its own context memory through a dynamic substitution mechanism.
尽管第 3.2 节 中的隐式压缩带来了显著的效率收益,但其预先设定的信息瓶颈,可能难以应对需要精确回溯中间逻辑步骤的高度复杂推理任务。 为此,我们提出 LightThinker++,通过动态替换机制赋予模型主动管理自身上下文记忆的能力,使思维压缩从 表示层面 演进到 行为层面。
The Explicit Memory Management Framework. As illustrated in Figure 4(b), We formalize the model's reasoning history as an ordered sequence of reasoning entities
显式记忆管理框架。 如 图4(b) 所示,我们将模型的推理历史形式化为一个有序的 推理实体 序列
This architecture enables granularity-aware control over the thought stream through two core mechanisms:
该架构通过两个核心机制,实现对思维流的 粒度感知控制:
- Step Instantiation: A new entity
is instantiated only when the model emits . This signals the completion of a reasoning unit, allowing the verbose to be offloaded from the active workspace while preserving its distilled gist in the archivestate. - Step Manipulation: By outputting
or , the model actively “toggles” the resolution of the -th historical step. This allows the model to re-examine evidentiary details through expansion when encountering logical bottlenecks, and subsequently fold them back to maintain a high-signal, noise-free context. - Termination: The primitive
concludes the entire reasoning chain by submitting the final solution.
- 步骤实例化: 只有当模型发出
时,才会实例化一个新实体 。这标志着一个推理单元的完成,使冗长的 可以从活跃工作区移出,同时将提炼出的要旨 保存在 archive状态。 - 步骤操作: 模型通过输出
或 ,主动“切换”第 个历史步骤的细节粒度。这样,模型在遇到逻辑瓶颈时,可以通过 展开 重新审视证据细节,随后再将其 折叠,以保持有效信息密度高、无噪声的上下文。 - 终止: 原语
通过提交最终解答,结束整条推理链。
By decoupling reasoning depth from sequence length growth, LightThinker++ ensures that the model can sustain long-range coherence in complex Chain-of-Thought tasks, effectively mitigating performance degradation caused by contextual redundancy.
通过将推理深度与序列长度增长解耦,LightThinker++ 确保模型能够在复杂的思维链任务中保持长距离连贯性,有效缓解上下文冗余导致的性能下降。
Environment-Aware Trajectory Synthesis. To train the model in mastering these behaviors, we develop an Online Thought Synthesis framework designed to simulate a memory-constrained environment. Concretely, we use a strong teacher model to generate high-quality reasoning trajectories that are interleaved with explicit memory actions, forming demonstrations of how to reason under a managed context. Unlike traditional static supervised fine-tuning, our framework is environment-aware: when the teacher model issues a structural
环境感知轨迹合成。 为训练模型掌握这些行为,我们开发了一个旨在模拟内存受限环境的 在线思维合成 框架。 具体而言,我们使用能力较强的教师模型,生成与显式记忆动作交织的高质量推理轨迹,示范如何在受管理上下文中进行推理。 与传统静态监督微调不同,我们的框架具有环境感知能力:当教师模型发出结构化的
Behavioral Pruning and Quality Control. To extract the most effective reasoning patterns from the synthesized trajectories, we implement a Behavioral Pruning mechanism centered on a strict Memory Lifecycle constraint. This ensures the fine-tuning data reflects purposeful context management rather than stochastic tool usage. A trajectory is deemed admissible only if it satisfies the following criteria:
行为剪枝与质量控制。 为从合成轨迹中提取最有效的推理模式,我们实现了一种以严格的 记忆生命周期 约束为核心的 行为剪枝 机制。 它确保微调数据反映的是有目的的上下文管理,而非随机的工具使用。 一条轨迹只有满足以下标准才会被接受:
- Lifecycle Completeness: The trajectory must exercise the full
suite and yield a correct answer through consistent tool invocations, ensuring the reasoning process is both functional and verifiable. - Symmetry Constraint: We enforce structural integrity where a fold operation must be strictly preceded by an expand on the same step. This ensures retrieved details are purposefully reverted once their immediate utility within the reasoning chain is exhausted.
- Anti-Jitter Heuristics: To ensure management is purposeful rather than stochastic, we enforce operational density limits where
and , with denoting the total occurrences of each respective primitive within a trajectory. In addition, we disallow consecutive identical memory operations (e.g., back-to-back expand or fold) and discard trajectories in which consecutive commit steps have a lexical similarity measured by longest common subsequence greater than 0.9, to encourage progressive reasoning.
- 生命周期完整性: 轨迹必须使用完整的
操作集合,并通过一致的工具调用给出正确的 answer,确保推理过程既能正常工作,又可验证。 - 对称性约束: 我们要求结构完整性,即针对同一步骤的 fold 操作必须严格发生在 expand 之后。 这确保检索出的细节在推理链中的即时用途耗尽后,会被有目的地恢复为折叠状态。
- 抗抖动启发式规则: 为确保管理是有目的而非随机的,我们施加 操作密度 限制,即
且 ,其中 表示相应原语在轨迹中出现的总次数。 此外,我们禁止连续执行相同的记忆操作(例如连续的 expand 或 fold),并丢弃连续 commit 步骤之间、以最长公共子序列衡量的词面相似度大于 0.9 的轨迹,以鼓励推理不断推进。
Such filtering encourages monotonic logical progression and prevents the model from falling into repetitive or redundant reasoning loops.
这种过滤鼓励逻辑单调向前推进,防止模型陷入重复或冗余的推理循环。
Training and Implementation. Through this rigorous filtering, we obtain a final expert dataset
训练与实现。 通过上述严格过滤,我们得到最终的高质量专家轨迹数据集
where active, while replacing it with the summary archived. This step-wise state-aware training forces the model to learn that its current reasoning
其中,active 状态时,archived 状态,就用摘要
3.4. Discussions: Implicit vs. Explicit
The transition here in our work reflects a shift from structural optimization to behavioral management, addressing the inherent limitations of rigid information bottlenecks. We summarize their key differences as follows:
我们工作中的这一转变,体现了从结构优化到行为管理的转向,旨在克服刚性信息瓶颈的固有局限。 我们将二者的主要区别概括如下:
Information Abstraction Paradigm. LightThinker operates at the representation-level via attention masking to enforce a fixed bottleneck. In contrast, LightThinker++ shifts to a behavioral-level approach, delegating context control to explicit memory primitives. This alignment between reasoning actions and working memory states enables interpretable context orchestration that adapts to the model's logical needs.
信息抽象范式。 LightThinker 在 表示层面 运作,通过注意力掩码施加固定的信息瓶颈。 相比之下,LightThinker++ 转向 行为层面 的方法,将上下文控制交给显式记忆原语。 推理动作与工作记忆状态之间的这种对齐,使上下文编排具备可解释性,并能够适应模型的逻辑需求。
Static vs. Adaptive Rhythm. While LightThinker follows predefined token or thought-level intervals, LightThinker++ is inherently adaptive. It empowers the model to autonomously decide when to archive or retrieve information, demonstrating a more flexible cognitive economy for varying task complexities.
静态节奏与自适应节奏。 LightThinker 遵循预先设定的 token 级或思维级间隔,而 LightThinker++ 则具有内在的自适应性。 它让模型自主决定何时归档或检索信息,针对不同的任务复杂度,展现出更灵活的认知经济性。
Efficiency vs. Fidelity. LightThinker is optimized for maximal inference speedup, making it ideal for standard tasks where a general gist of thoughts suffices. However, the lossy nature of hidden-state compression can lead to the irreversible loss of critical details. LightThinker++ prioritizes reasoning fidelity by ensuring that fine-grained information remains restorable through explicit backtracking via expand. This bidirectional capability mitigates the “information evaporation” common in implicit bottlenecks, providing the precision necessary for long-horizon tasks.
效率与保真度。 LightThinker 以最大化推理加速为优化目标,因而适合只需保留思维大致要旨的标准任务。 然而,隐藏状态压缩的有损性质可能导致关键细节不可逆地丢失。 LightThinker++ 优先考虑推理保真度,通过 expand 显式回溯,确保细粒度信息始终可以恢复。 这种双向能力缓解了隐式瓶颈中常见的“信息蒸发”,提供了长程任务所需的精确性。
4. Experiments: General Reasoning
4.1. Experimental Settings
| Method | GSM8K | MMLU | GPQA | BBH | AVG. | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Acc ↑ | Time ↓ | Peak ↓ | Dep ↓ | Acc ↑ | Time ↓ | Peak ↓ | Dep ↓ | Acc ↑ | Time ↓ | Peak ↓ | Dep ↓ | Acc ↑ | Time ↓ | Peak ↓ | Dep ↓ | Acc ↑ | Time ↓ | Peak ↓ | Dep ↓ | |
| Qwen2.5-7B Series | ||||||||||||||||||||
| CoT | 86.12 | 1.66 | 513 | 0.1M | 66.50 | 1.77 | 649 | 0.2M | 26.76 | 0.60 | 968 | 0.5M | 65.45 | 0.68 | 570 | 0.1M | 61.21 | 1.18 | 675 | 0.2M |
| Distill-R1 | 81.88 | 5.60 | 844 | 1.1M | 51.70 | 14.31 | 2483 | 7.5M | 24.75 | 8.01 | 6718 | 31M | 57.78 | 5.53 | 1967 | 6.0M | 54.03 | 8.36 | 3003 | 11.3M |
| Vanilla | 90.90 | 11.83 | 2086 | 3.9M | 59.98 | 20.61 | 3417 | 10M | 30.81 | 10.76 | 8055 | 39M | 69.90 | 11.50 | 3786 | 13M | 62.90 | 13.68 | 4336 | 16.6M |
| + H2O | 89.92 | 22.19 | 640 | 1.2M | 59.69 | 29.02 | 1024 | 3.2M | 24.75 | 15.61 | 1200 | 9.8M | 70.10 | 15.61 | 1024 | 3.5M | 61.12 | 20.61 | 972 | 4.4M |
| + SepLLM | 30.40 | 53.52 | 1024 | 6.9M | 10.81 | 53.45 | 1024 | 9.0M | 0.00 | 11.65 | 1024 | 10M | 8.08 | 26.64 | 1024 | 9.4M | 12.32 | 36.32 | 1024 | 8.9M |
| AnLLM | 78.39 | 15.26 | 789 | 1.6M | 54.63 | 14.13 | 875 | 2.0M | 19.70 | 9.14 | 3401 | 11M | 54.95 | 10.04 | 1303 | 3.8M | 51.92 | 12.14 | 1592 | 4.6M |
| LThinkertho | 90.14 | 11.46 | 676 | 1.0M | 60.47 | 13.09 | 944 | 1.9M | 30.30 | 8.41 | 2385 | 9.3M | 70.30 | 7.71 | 1151 | 2.7M | 62.80 | 10.17 | 1289 | 3.7M |
| LThinkertok | 87.11 | 11.48 | 1038 | 1.5M | 57.35 | 13.80 | 489 | 3.5M | 28.28 | 8.26 | 3940 | 18M | 62.83 | 8.95 | 1884 | 5.6M | 58.89 | 10.62 | 1838 | 7.2M |
| Llama3.1-8B Series | ||||||||||||||||||||
| CoT | 85.14 | 2.15 | 550 | 0.2M | 65.82 | 2.39 | 736 | 0.3M | 24.75 | 0.96 | 1231 | 0.9M | 66.46 | 0.93 | 642 | 0.2M | 60.54 | 1.61 | 790 | 0.4M |
| Distill-R1 | 73.62 | 2.58 | 395 | 0.1M | 53.46 | 2.97 | 582 | 0.8M | 20.20 | 5.24 | 3972 | 16M | 61.21 | 0.83 | 380 | 0.2M | 52.12 | 2.91 | 1332 | 4.4M |
| Vanilla | 91.43 | 12.06 | 1986 | 3.0M | 69.62 | 14.82 | 2883 | 6.9M | 40.91 | 7.98 | 6622 | 26M | 83.03 | 6.80 | 2793 | 5.9M | 71.25 | 10.42 | 3571 | 10.5M |
| + H2O | 90.45 | 20.23 | 640 | 1.0M | 65.92 | 27.11 | 736 | 1.8M | 31.81 | 12.55 | 1536 | 7.9M | 78.99 | 11.43 | 1024 | 2.1M | 66.79 | 17.83 | 984 | 3.2M |
| + SepLLM | 26.25 | 50.05 | 1024 | 5.8M | 25.12 | 50.11 | 1024 | 7.5M | 2.53 | 12.62 | 1024 | 10M | 14.55 | 27.14 | 1024 | 8.5M | 17.11 | 34.98 | 1024 | 8.0M |
| AnLLM | 77.33 | 17.92 | 589 | 1.1M | 58.62 | 16.53 | 589 | 1.2M | 31.31 | 7.19 | 838 | 3.7M | 68.89 | 9.79 | 621 | 1.6M | 59.04 | 12.86 | 659 | 1.9M |
| LThinkertho | 88.25 | 12.65 | 629 | 0.9M | 63.39 | 14.88 | 882 | 1.8M | 36.36 | 6.38 | 1796 | 6.4M | 79.39 | 7.46 | 911 | 1.9M | 66.85 | 10.34 | 1055 | 2.7M |
| LThinkertok | 85.52 | 13.87 | 1104 | 1.7M | 61.05 | 15.85 | 1538 | 3.3M | 31.82 | 6.94 | 3150 | 12M | 74.14 | 7.43 | 1512 | 2.9M | 63.13 | 11.02 | 1826 | 4.8M |
表1:LThinker 的主要结果。CoT 基于指令模型,Vanilla、AnLLM 和 LightThinker 基于 Distill-R1。浅蓝色背景表示加速方法,其中粗体表示最佳结果,下划线表示次佳结果。Vanilla 的 Acc 作为加速方法准确率的上界。Dep 以百万计,Time 以小时计,Peak 以 token 数量计。加速方法与 Vanilla 的 Dep 比值可用于粗略估计压缩比,详见附录 A。注意,这里的结果基于相同批大小;相同内存预算下的结果见 表2。
Baselines. 1) LightThinker. We evaluate our method on two backbone LLMs: Qwen2.5-7B and Llama3.1-8B. To provide an upper-bound reference, we apply full-parameter instruction tuning on the Bespoke-Stratos-17k dataset (BS17K; an example is shown in Figure 27), and refer to the resulting model as Vanilla. Following our preliminary experiments, training is initialized from the R1-Distill (e.g., DeepSeek-R1-Distill-Qwen-7B), since fine-tuning instruction-tuned models such as Qwen2.5-7B-instruct leads to only modest gains. For comparison, we consider five baselines: two training-free acceleration methods applied to Vanilla, namely H2O and SepLLM, both of which preserve important KV cache entries using different strategies; one training-based approach, AnLLM; and two CoT baselines, obtained by prompting the instruction-tuned model and the R1-Distill model, respectively.
基线。 1)LightThinker。 我们在 Qwen2.5-7B 和 Llama3.1-8B 两个骨干 LLM 上评估我们的方法。 为提供性能上界参考,我们在 Bespoke-Stratos-17k 数据集(BS17K;示例见图27)上进行全参数指令微调,并将得到的模型称为 Vanilla。 根据初步实验,我们从 R1-Distill(例如 DeepSeek-R1-Distill-Qwen-7B)初始化训练,因为对 Qwen2.5-7B-instruct 等指令微调模型继续微调,只能获得有限收益。 作为比较,我们考虑五个基线:应用于 Vanilla 的两个无需训练的加速方法 H2O 和 SepLLM,它们通过不同策略保留重要的 KV 缓存条目;一个需要训练的方法 AnLLM;以及两个 CoT 基线,分别通过提示指令微调模型和 R1-Distill 模型得到。
- LightThinker++.
We follow the same model setup, conducting experiments on the R1-Distill models and fine-tuning all methods from the corresponding R1-Distill checkpoints. For this setup, we curated a high-quality distillation dataset by sampling from BS17k and DeepScaleR, employing DeepSeek-V3.2-Thinking as the teacher model for data synthesis. To ensure a comprehensive comparison, we introduce four additional baselines: the Vanilla model, which is fine-tuned on the uncompressed, full-length original outputs synthesized by our framework; TokenSkip, which fine-tunes models on pruned CoT paths to enable selective token-level skipping; and the Base Prompting results, which provide the performance of the original models without fine-tuning. For simplicity, we use LThinker and LThinker++ to denote our models.
2)LightThinker++。 我们沿用相同的模型设置,在 R1-Distill 模型上开展实验,所有方法都从对应的 R1-Distill 检查点开始微调。 针对这一设置,我们从 BS17k 和 DeepScaleR 中采样,并使用 DeepSeek-V3.2-Thinking 作为教师模型合成数据,整理出一个高质量蒸馏数据集。 为进行全面比较,我们引入四个额外基线:Vanilla 模型,在我们框架合成的未经压缩、完整长度的原始输出上微调;TokenSkip,在经过剪枝的 CoT 路径上微调模型,以实现选择性的 token 级跳过;以及 Base Prompting 结果,用于展示原始模型未经微调时的表现。 为简洁起见,我们使用 LThinker 和 LThinker++ 表示我们的模型。
Evaluation Metrics and Datasets. We conduct experiments on four benchmark datasets: GSM8K, MMLU, GPQA, and BBH. For MMLU and BBH, we evaluate on randomly sampled subsets rather than the full datasets. To assess model performance, we consider two aspects: effectiveness and efficiency. Effectiveness is measured by accuracy (Acc), while efficiency is evaluated using three indicators: inference time (Time), the maximum number of tokens appearing in the context during decoding (Peak), and the cumulative dependency of generated tokens on earlier tokens (Dep). As illustrated in Figure 3, Peak reflects the highest contextual load at a specific moment, whereas Dep is represented by the area enclosed by the curves and captures the overall information usage throughout inference. A smaller Dep value indicates that the model relies on less information, suggesting stronger compression.
评估指标与数据集。 我们在 GSM8K、MMLU、GPQA 和 BBH 四个基准数据集上进行实验。 对于 MMLU 和 BBH,我们评估的是随机采样的子集,而非完整数据集。 我们从 效果 和 效率 两个方面评估模型表现。 效果通过准确率(Acc)衡量;效率则采用三个指标:推理时间(Time)、解码过程中上下文中出现的最大 token 数量(Peak),以及生成 token 对此前 token 的累计 依赖度(Dep)。 如 图3 所示,Peak 反映特定时刻的最高上下文负载,而 Dep 由曲线下的面积表示,衡量整个推理过程中的总体信息使用量。 较小的 Dep 表明模型依赖的信息更少,意味着更强的压缩。
Since Peak measures a transient state and Dep summarizes the entire generation process, the two quantities are not directly linked. Further details on Dep are provided in Appendix A.
由于 Peak 衡量瞬时状态,而 Dep 概括整个生成过程,二者并不存在直接关联。 关于 Dep 的更多细节见附录 A。
Implementation 1) Variants of LThinker. To study implicit compression at different granularities, we consider two variants of LThinker. LThinkertok operates at the token-level and compresses every 6 original tokens into 2 gist tokens, i.e., \n\n ” serves as the boundary between thoughts; each thought is then compressed into
- Variants of LThinker++.
实现 1)LThinker 的变体。 为研究不同粒度的隐式压缩,我们考虑两种 LThinker 变体。 LThinkertok 在 token 级 运作,将每 6 个原始 token 压缩为 2 个 gist token,即 \n\n”作为思维边界;对于 Qwen 骨干,每个思维被压缩为
For the explicit management, we compare: LThinker++, the full model supporting all memory primitives (commit, expand, and fold) for reversible and dynamic context management; and LThinker*, a commit-only ablation variant that performs irreversible summary compression, used to verify the necessity of active retrieval (expand and fold). We evaluate LThinker++ under two inference configurations, Throughput and Budget, to assess its performance under varied serving constraints(see Section 4.3.1). Please refer to Appendix C.1 and Appendix C.2 for further technical details on LThinker and LThinker++, respectively.
4.2. Evaluation of LightThinker.
We assess LThinker from three perspectives: overall performance, inference efficiency, and ablation-based component analysis. We also include a qualitative case study to better understand its behavior.
我们从整体表现、推理效率和基于消融的组件分析三个角度评估 LThinker。 此外,我们还通过一个定性案例来更好地理解其行为。
4.2.1. Main Results
Table 1 reports the results on four metrics, two backbone models, and four datasets. The main findings are summarized as follows.
表1 报告了四个指标、两个骨干模型和四个数据集上的结果。 主要发现概括如下。
- Distill-R1 consistently performs worse than CoT on all datasets. A likely reason is its weaker instruction-following ability, which makes rule-based answer extraction unreliable, even when an LLM is used as the evaluator. Since this issue is orthogonal to our study, we do not investigate it further.
- H2O reduces memory consumption effectively while preserving the accuracy of Vanilla, suggesting that its greedy eviction strategy works well for long-form generation. That said, it comes with a noticeable latency cost: compared with Vanilla, inference time increases by 51% on Qwen (
) and by 72% on Llama. This overhead is mainly caused by its token-level eviction mechanism, which adds extra computation at every decoding step. - SepLLM yields the weakest performance overall. During generation, it gradually loses language capability, often failing to produce termination tokens, which in turn leads to much longer inference time.
- Compared with H2O, LThinker (tho.) maintains similar performance at lower Dep values, indicating a comparable compression ratio, while cutting inference time by 52% on Qwen and 41% on Llama on average. It also achieves higher accuracy and faster decoding than AnLLM.
- Distill-R1 在所有数据集上的表现都持续弱于 CoT。 一个可能的原因是其指令遵循能力较弱,导致基于规则的答案提取不可靠,即使使用 LLM 作为评估器也是如此。 由于这一问题与我们的研究相互独立,我们不再深入探讨。
- H2O 在保留 Vanilla 准确率的同时有效降低了内存消耗,说明其贪心淘汰策略适用于长文本生成。 不过,它会带来明显的延迟代价:与 Vanilla 相比,Qwen 的推理时间增加了 51%(
),Llama 则增加了 72%。 这一开销主要来自其 token 级淘汰机制,该机制会在每个解码步骤引入额外计算。 - SepLLM 的总体表现最弱。 在生成过程中,它逐渐丧失语言能力,经常无法生成终止 token,进而导致推理时间大幅延长。
- 与 H2O 相比,LThinker(tho.)在较低 Dep 值下维持了相似表现,表明其压缩比相当,同时在 Qwen 和 Llama 上分别平均缩短了 52% 和 41% 的推理时间。 它的准确率和解码速度也优于 AnLLM。
These results lead to the following conclusions.
这些结果得出以下结论。
- BS17K is an effective instruction-tuning dataset for improving reasoning quality. Vanilla outperforms both CoT and Distill-R1 on most datasets, suggesting that BS17K helps SFT mitigate the repetition issue observed in Distill-R1.
- LThinker achieves a favorable trade-off between reasoning quality and inference cost. On Qwen, it sacrifices only 1% accuracy while saving 26% inference time, reducing Peak by 70% and Dep by 78%, corresponding to a 4.5× compression ratio (16.6/3.7). On Llama, it sacrifices 6% accuracy but saves 1% inference time, reduces Peak by 70%, and lowers Dep by 74%, giving a 3.9× compression ratio (10.5/2.7).
- The segmentation strategy plays a critical role in LThinker. Thought-level segmentation consistently outperforms token-level segmentation, improving accuracy by 6.2% on Qwen and 5.6% on Llama. This suggests that token-level segmentation may blur semantic boundaries and thus weaken the quality of compression.
- BS17K 是一个能够提高推理质量的有效指令微调数据集。 Vanilla 在大多数数据集上优于 CoT 和 Distill-R1,说明 BS17K 有助于 SFT 缓解 Distill-R1 中观察到的重复问题。
- LThinker 在推理质量与推理成本之间取得了良好权衡。 在 Qwen 上,它仅牺牲 1% 的准确率,就节省了 26% 的推理时间,将 Peak 降低 70%、Dep 降低 78%,对应 4.5 倍压缩比(16.6/3.7)。 在 Llama 上,它牺牲了 6% 的准确率,但节省了 1% 的推理时间,将 Peak 降低 70%、Dep 降低 74%,对应 3.9 倍压缩比(10.5/2.7)。
- 分段策略对 LThinker 至关重要。 思维级分段持续优于 token 级分段,在 Qwen 和 Llama 上分别将准确率提高 6.2% 和 5.6%。 这表明,token 级分段可能模糊语义边界,从而削弱压缩质量。

图5:效率分析与消融结果。(a)展示各模型在各数据集上生成的平均 token 数量。(b)展示 token 长度在不同区间的分布,累计曲线表示截至各区间的总体占比。(c)展示输出长度与推理时间的关系,每个子图均报告推理时间与峰值 token 数量。(d)报告平均压缩比,误差条表示 95% 置信区间。(e–f)考察缓存大小
4.2.2. Efficiency
For readability, we use “LThinker” in the following to refer to LThinker (tho.). This section examines the efficiency of LThinker from four perspectives.
为便于阅读,下文用“LThinker”指代 LThinker(tho.)。 本节从四个角度考察 LThinker 的效率。
| GSM8K | MMLU | GPQA | BBH | AVG | |
|---|---|---|---|---|---|
| Vanilla | 11.83 | 20.61 | 10.76 | 11.50 | 13.68 |
| LightThinker | 6.73 | 7.44 | 3.86 | 3.97 | 5.50 |
表2:在相同内存预算下,Qwen 模型上的 Vanilla 与 LThinker 在四个数据集上的推理时间对比,单位为小时。
| GSM8K | MMLU | GPQA | BBH | |
|---|---|---|---|---|
| Qwen | 20 | 37 | 115 | 48 |
| Llama | 26 | 47 | 139 | 55 |
表3:LThinker 在不同数据集上每个问题的平均压缩次数。
How does LightThinker accelerate under same memory budget? We measure efficiency in terms of both memory usage and inference speed. As shown in Table 1, LThinker can substantially reduce memory consumption at the same batch size. In turn, this allows larger batches to be processed under the same memory budget, which can improve throughput in practice. Under identical memory constraints, experiments on four datasets with the Qwen model show that LThinker reduces inference time by 2.5× on average relative to Vanilla, as reported in Table 2. These results indicate that LThinker not only lowers memory and time costs at a fixed batch size (Table 1), but also brings additional speed gains when the memory budget is held constant.
LightThinker 如何在相同内存预算下实现加速? 我们从内存用量和推理速度两个方面衡量效率。 如 表1 所示,在相同批大小下,LThinker 可以显著降低内存消耗。 因此,它能够在相同内存预算下处理更大的批次,从而在实际应用中提高吞吐量。 在相同内存约束下,使用 Qwen 模型在四个数据集上的实验表明,LThinker 的平均推理时间为 Vanilla 的 1/2.5,如 表2 所示。 这些结果表明,LThinker 不仅能够在固定批大小下降低内存与时间成本(表1),还能够在内存预算固定时带来额外的速度收益。
Does LightThinker generate more tokens compared to Vanilla? Figure 5(a) compares the average output tokens of H2O, AnLLM, LightThinker, and Vanilla across four datasets, with additional results provided in Appendix C.1.6. Two observations are worth noting:
与 Vanilla 相比,LightThinker 会生成更多 token 吗? 图5(a) 对比了 H2O、AnLLM、LightThinker 和 Vanilla 在四个数据集上的平均输出 token 数量,更多结果见附录 C.1.6。 有两个观察值得关注:
- LThinker is the only method that consistently generates fewer tokens than Vanilla, reducing the output length by 15% on Qwen and 13% on Llama on average. This shorter generation length is one of the main reasons behind its faster decoding speed.
- H2O shows an inconsistent trend: it increases the number of generated tokens by 10% on Qwen but decreases it by 7% on Llama. However, even when fewer tokens are generated on Llama, inference time still increases, as shown in Table 1, suggesting that the overhead introduced by its eviction policy accumulates as generation proceeds.
- LThinker 是唯一始终比 Vanilla 生成更少 token 的方法,在 Qwen 和 Llama 上分别平均缩短输出长度 15% 和 13%。 较短的生成长度是其解码速度更快的主要原因之一。
- H2O 呈现出不一致的趋势:它在 Qwen 上将生成 token 数量增加了 10%,却在 Llama 上减少了 7%。 然而,即使在 Llama 上生成了更少的 token,推理时间仍然增加,如 表1 所示,这表明其淘汰策略引入的开销会随生成过程不断累积。
What is the compression ratio of LightThinker? The compression behavior of LightThinker is summarized in three views: Figure 5(d) presents the compression ratio across four datasets, Table 3 reports the average number of compressions, and Figure 5(b) shows the distribution of compressed token counts on GPQA with Qwen (additional datasets are included in Appendix C.1.6). From these results, we observe that:
LightThinker 的压缩比是多少? 我们从三个角度概括 LightThinker 的压缩行为:图5(d) 展示四个数据集上的压缩比,表3 报告平均压缩次数,图5(b) 展示 Qwen 在 GPQA 上被压缩 token 数量的分布(其他数据集见附录 C.1.6)。 根据这些结果,我们观察到:
- Compression frequency and compression ratio are influenced more by the task than by the backbone model. For example, easier tasks such as GSM8K tend to require fewer compressions and achieve higher ratios, whereas harder tasks such as GPQA involve more frequent compressions and lower ratios.
- The compressed token counts exhibit a clear long-tail distribution.
- 任务对压缩频次和压缩比的影响大于骨干模型。 例如,GSM8K 等较简单任务通常需要更少的压缩次数,且压缩比更高;GPQA 等较难任务则需要更频繁的压缩,压缩比也更低。
- 被压缩 token 数量呈现明显的长尾分布。
How efficient is LightThinker in memory usage and inference for long-text generation? Figure 5(c) compares the inference time and peak tokens of LThinker and Vanilla as the output length increases. Unless otherwise specified, we use a prompt length of 125 and compress 56 tokens into 8 tokens, corresponding to
在长文本生成中,LightThinker 的内存与推理效率如何? 图5(c) 对比了随着输出长度增加,LThinker 和 Vanilla 的推理时间与峰值 token 数量。 除非另有说明,我们使用长度为 125 的提示,并将 56 个 token 压缩为 8 个 token,对应
For shorter outputs between 1K and 4K tokens, the reduction is smaller, but still ranges from 1% to 4%. Second, LThinker consistently lowers peak token usage, even for short generations. For example, peak tokens decrease by 72% at 1K tokens and by 85% at 32K tokens.
对于 1K–4K token 的较短输出,降幅较小,但仍达到 1%–4%。 其次,即使生成较短序列,LThinker 也能持续降低峰值 token 用量。 例如,在 1K token 和 32K token 时,峰值 token 数量分别降低了 72% 和 85%。
4.2.3. Ablation
We study two factors that may contribute to LThinker's performance: 1) the decoupled token design with its corresponding attention-mask strategy, and 2) the cache size
我们研究了可能影响 LThinker 表现的两个因素:1)解耦的 token 设计及其对应的注意力掩码策略;2)缓存大小
Decoupled Token and Attention Mask Mode.
解耦 token 与注意力掩码模式。
| GSM8K | MMLU | GPQA | BBH | AVG | |
|---|---|---|---|---|---|
| AnLLM | 78.39 | 54.63 | 19.70 | 54.95 | 51.92 |
| Ours (|C|=1, T) | 78.32 | 58.23 | 20.71 | 55.35 | 53.15 |
| Ours (|C|=1, F) | 80.21 | 58.23 | 22.22 | 62.02 | 55.67 |
表4:Qwen 在四个数据集上的准确率消融结果。“T”表示 AnLLM 的注意力掩码机制,“F”表示 LThinker 的注意力掩码机制。
Compared with AnLLM, LThinker introduces two differences: a decoupled token design and a different attention mask, as illustrated in Figure 21. To examine their roles, we conduct controlled ablations. As reported in Table 4, when the cache size is fixed and LThinker uses AnLLM's attention-mask pattern (“AnLLM” vs. “Ours (
与 AnLLM 相比,LThinker 有两点不同:解耦的 token 设计和不同的注意力掩码,如图21 所示。 为检验它们的作用,我们进行了控制变量消融实验。 如 表4 所示,在缓存大小固定、LThinker 使用 AnLLM 的注意力掩码模式时(“AnLLM”与“Ours(
Cache Size. We sweep
缓存大小。 我们在
- As Figure 5(e) shows, a larger cache generally improves accuracy while lowering inference time. This suggests that increasing cache capacity helps preserve more information after compression.
- Figure 5(g) shows that a larger cache size reduces both the compression frequency and the number of generated tokens.
- Taken together, Figure 5(e) and Figure 5(g) indicate a clear trade-off: smaller caches trigger more frequent generation and compression to preserve information, whereas larger caches reduce this need.
- 如 图5(e) 所示,较大的缓存通常能够提高准确率,同时降低推理时间。 这说明增加缓存容量有助于在压缩后保留更多信息。
- 图5(g) 表明,较大的缓存会同时减少压缩频次和生成 token 数量。
- 综合 图5(e) 和 图5(g) 可以看出明确的权衡:较小的缓存会触发更频繁的生成与压缩以保留信息,而较大的缓存则会减少这种需求。
4.2.4. Case Study

图6:案例研究。图中展示了一个 GSM8K 示例的部分推理轨迹。完整示例见附录 C.1.6。粉色和浅蓝色背景表示交替发生的压缩步骤,每种颜色对应一次压缩。
Figure 6 presents a failure case from GSM8K. Although the model reaches the correct answer during intermediate reasoning (see the Model's Thoughts field in Figure 6), the final response is incorrect (see the Model's Solution field). In particular, the first “4000” in the third sentence of Model's Solution is wrong. This suggests that the second compression step discarded part of the necessary numerical information: ideally, “8000”, “4000”, and “24000” should all have been preserved, but the model retained only “4000” and “24000”. As a result, the subsequent reasoning became inconsistent. Such failures are common on GSM8K, indicating that the current compression mechanism is still not sufficiently sensitive to numerical details.
图6 展示了 GSM8K 中的一个失败案例。 尽管模型在中间推理阶段得出了正确答案(见 图6 中的 Model's Thoughts 字段),最终回答却是错误的(见 Model's Solution 字段)。 具体来说,Model's Solution 第三句中第一次出现的“4000”是错误的。 这表明第二次压缩丢弃了部分必要的数值信息:理想情况下,“8000”“4000”和“24000”都应保留,但模型仅保留了“4000”和“24000”。 结果,后续推理变得不一致。 这类失败在 GSM8K 上很常见,说明当前压缩机制对数值细节仍不够敏感。
4.3. Evaluation of LightThinker++.
Following the evaluation of LThinker, we evaluate LThinker++ on the same benchmarks and analyze how explicit action-based memory management improves the accuracy–efficiency trade-off.
在评估 LThinker 之后,我们在相同基准上评估 LThinker++,分析基于显式动作的记忆管理如何改善准确率与效率之间的权衡。
| Method | GSM8K | MMLU | GPQA | BBH | AVG. | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Acc ↑ | Time ↓ | Peak ↓ | Dep ↓ | Acc ↑ | Time ↓ | Peak ↓ | Dep ↓ | Acc ↑ | Time ↓ | Peak ↓ | Dep ↓ | Acc ↑ | Time ↓ | Peak ↓ | Dep ↓ | Acc ↑ | Time ↓ | Peak ↓ | Dep ↓ | |
| Qwen2.5-7B Series | ||||||||||||||||||||
| CoT | 86.12 | 99.6 | 513 | 0.1M | 66.50 | 106.2 | 649 | 0.2M | 26.76 | 36.0 | 968 | 0.5M | 65.45 | 40.8 | 570 | 0.1M | 61.21 | 70.8 | 675 | 0.2M |
| Distill-R1 | 81.88 | 336.0 | 844 | 1.1M | 51.70 | 858.6 | 2483 | 7.5M | 24.75 | 480.6 | 6718 | 31M | 57.78 | 331.8 | 1967 | 6.0M | 54.03 | 501.6 | 3003 | 11.3M |
| Vanilla | 87.34 | 12.7 | 812 | 1.1M | 55.27 | 33.1 | 2682 | 7.7M | 34.34 | 15.3 | 5781 | 21.9M | 61.55 | 24.7 | 3205 | 10.2M | 59.62 | 21.5 | 3120 | 10.3M |
| TokenSkip | 87.92 | 47.8 | 775 | 1.0M | 54.40 | 72.3 | 2831 | 9.1M | 38.22 | 17.5 | 5611 | 21.2M | 59.87 | 33.2 | 2850 | 9.3M | 60.10 | 42.7 | 3017 | 10.2M |
| LThinker* | 84.94 | 13.5 | 376 | 0.3M | 52.87 | 41.7 | 718 | 1.6M | 24.75 | 20.6 | 1298 | 7.3M | 51.85 | 36.5 | 851 | 2.9M | 53.60 | 28.0 | 811 | 3.0M |
| LThinker++ | 88.32 | 12.7 | 408 | 0.3M | 55.05 | 31.8 | 755 | 1.6M | 35.69 | 17.4 | 1669 | 8.1M | 61.01 | 28.5 | 927 | 2.5M | 60.02 | 22.6 | 940 | 3.1M |
| Llama3.1-8B Series | ||||||||||||||||||||
| CoT | 85.14 | 129.0 | 550 | 0.2M | 65.82 | 143.4 | 736 | 0.3M | 24.75 | 57.6 | 1231 | 0.9M | 66.46 | 55.8 | 642 | 0.2M | 60.54 | 96.9 | 790 | 0.4M |
| Distill-R1 | 73.62 | 154.8 | 395 | 0.1M | 53.46 | 178.2 | 582 | 0.8M | 20.20 | 314.4 | 3972 | 16M | 61.21 | 49.8 | 380 | 0.2M | 52.12 | 174.6 | 1332 | 4.4M |
| Vanilla | 82.79 | 16.1 | 811 | 1.3M | 61.15 | 45.8 | 2570 | 7.1M | 30.30 | 22.0 | 6364 | 25.7M | 67.68 | 28.5 | 2826 | 8.8M | 60.48 | 28.1 | 3143 | 10.7M |
| TokenSkip | 79.40 | 54.1 | 838 | 1.2M | 57.06 | 77.9 | 2499 | 6.9M | 26.60 | 22.7 | 6016 | 23.8M | 69.16 | 34.2 | 2581 | 7.6M | 58.06 | 47.2 | 2984 | 9.9M |
| LThinker* | 75.54 | 12.5 | 357 | 0.2M | 56.80 | 35.2 | 782 | 1.3M | 21.04 | 15.6 | 1275 | 4.6M | 58.79 | 21.2 | 734 | 1.1M | 53.04 | 21.1 | 787 | 1.8M |
| LThinker++ | 82.23 | 13.3 | 424 | 0.3M | 61.77 | 31.4 | 883 | 1.4M | 33.16 | 18.6 | 1793 | 7.2M | 69.09 | 21.9 | 896 | 1.7M | 61.56 | 21.3 | 999 | 2.7M |
表5:LThinker++ 的主要结果(Throughput 设置)。Time 表示端到端实际耗时,单位为分钟(详见附录 C.2.5)。CoT 基于指令模型,其他方法在各自对应的模型系列内比较。本表中,LThinker++ 表示完整方法,LThinker* 表示仅启用 commit 动作的变体。
4.3.1. Main Results
We report results under two serving configurations with the same global context budget (MaxContext) but different token allocation policies: i) Throughput (Table 5): a fixed, small max_new_tokens per reasoning round to mimic latency-constrained serving; ii) Budget (Table 6): max_new_tokens is set to the remaining budget, i.e., MaxContext minus tokens kept after memory actions (e.g., commit, fold).
我们报告两种服务配置下的结果,它们采用相同的全局上下文预算(MaxContext),但 token 分配策略不同:i)Throughput(表5):每轮推理使用固定且较小的 max_new_tokens,以模拟受延迟约束的服务;ii)Budget(表6):将 max_new_tokens 设为剩余预算,即 MaxContext 减去记忆动作(例如 commit、fold)后保留的 token 数量。
| Method | GSM8K | MMLU | GPQA | BBH | AVG. | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Acc ↑ | Peak ↓ | Dep ↓ | Acc ↑ | Peak ↓ | Dep ↓ | Acc ↑ | Peak ↓ | Dep ↓ | Acc ↑ | Peak ↓ | Dep ↓ | Acc ↑ | Peak ↓ | Dep ↓ | |
| Qwen2.5-7B Series | |||||||||||||||
| CoT | 86.12 | 513 | 0.1M | 66.50 | 649 | 0.2M | 26.76 | 968 | 0.5M | 65.45 | 570 | 0.1M | 61.21 | 675 | 0.2M |
| Distill-R1 | 81.88 | 844 | 1.1M | 51.70 | 2483 | 7.5M | 24.75 | 6718 | 31M | 57.78 | 1967 | 6.0M | 54.03 | 3003 | 11.3M |
| Vanilla | 87.62 | 782 | 1.1M | 57.58 | 2432 | 6.5M | 32.49 | 5493 | 20.0M | 62.76 | 2714 | 8.2M | 60.11 | 2855 | 8.9M |
| TokenSkip | 87.92 | 775 | 1.0M | 54.40 | 2831 | 9.1M | 38.22 | 5611 | 21.2M | 59.87 | 2850 | 9.3M | 60.10 | 3017 | 10.2M |
| LThinker* | 84.61 | 444 | 0.7M | 57.68 | 1141 | 4.1M | 28.96 | 3496 | 23.2M | 56.63 | 1580 | 7.0M | 56.97 | 1665 | 8.7M |
| LThinker++ | 87.87 | 471 | 0.4M | 60.27 | 1133 | 3.0M | 38.22 | 3265 | 16.1M | 63.77 | 1415 | 4.2M | 62.53 | 1571 | 5.9M |
| Llama3.1-8B Series | |||||||||||||||
| CoT | 85.14 | 550 | 0.2M | 65.82 | 736 | 0.3M | 24.75 | 1231 | 0.9M | 66.46 | 642 | 0.2M | 60.54 | 790 | 0.4M |
| Distill-R1 | 73.62 | 395 | 0.1M | 53.46 | 582 | 0.8M | 20.20 | 3972 | 16M | 61.21 | 380 | 0.2M | 52.12 | 1332 | 4.4M |
| Vanilla | 79.38 | 740 | 0.9M | 59.82 | 2111 | 4.9M | 31.82 | 5773 | 21.7M | 67.95 | 2606 | 7.5M | 59.74 | 2808 | 8.8M |
| TokenSkip | 79.40 | 838 | 1.2M | 57.06 | 2499 | 6.9M | 26.60 | 6016 | 23.8M | 69.16 | 2581 | 7.6M | 58.06 | 2984 | 9.9M |
| LThinker* | 76.72 | 522 | 0.9M | 59.59 | 1394 | 6.5M | 28.28 | 4271 | 34.5M | 63.10 | 1664 | 8.1M | 56.92 | 1963 | 12.5M |
| LThinker++ | 77.69 | 528 | 0.7M | 59.72 | 1370 | 4.5M | 33.67 | 4101 | 22.9M | 73.20 | 1481 | 4.6M | 61.07 | 1870 | 8.2M |
表6:LThinker++ 的主要结果(Budget 设置)。注意,这里的结果基于相同批大小。其他设置与指标定义同 表5。
As shown in Table 5 and Table 6, our method achieves a better trade-off between reasoning accuracy and memory efficiency. We summarize the key observations:
如 表5 和 表6 所示,我们的方法在推理准确率与内存效率之间实现了更好的权衡。 我们将关键观察概括如下:
1) Overall Performance and Accuracy-Cost Trade-off. As shown in Table 5 and Table 6, LThinker++ achieves a superior balance between reasoning accuracy and memory efficiency. In the Throughput setting, LThinker++ demonstrates extreme resource efficiency by slashing both average Peak and Dep by 69.9% (e.g., 3120 → 940 tokens on Qwen2.5-7B) while maintaining comparable accuracy to the Vanilla baseline. In the Budget setting, LThinker++ prioritizes reasoning depth, yielding a +2.42% average accuracy gain while still reducing Peak and Dep by 45.0% and 33.7%, respectively. We attribute this to a semantic denoising effect: by explicitly pruning logical redundancies, LThinker++ maintains a cleaner reasoning context, allowing the model to focus on critical logical anchors rather than being distracted by verbose intermediate steps.
1)整体表现与准确率–成本权衡。 如 表5 和 表6 所示,LThinker++ 在推理准确率与内存效率之间取得了更优平衡。 在 Throughput 设置下,LThinker++ 展现出极高的资源效率,平均 Peak 和 Dep 均降低 69.9%(例如 Qwen2.5-7B 上的 token 数从 3120 降至 940),同时保持与 Vanilla 基线相当的准确率。 在 Budget 设置下,LThinker++ 优先考虑推理深度,平均准确率提高 2.42%,同时仍将 Peak 和 Dep 分别降低 45.0% 和 33.7%。 我们将这一结果归因于 语义去噪 效应:通过显式剪除逻辑冗余,LThinker++ 保持更干净的推理上下文,使模型能够专注于关键逻辑锚点,而不是被冗长的中间步骤干扰。
2) Efficiency and the Latency-Throughput Balance. In the Throughput setting (Table 5), LThinker++ demonstrates a more stable efficiency ceiling for deployment. For Qwen2.5-7B, it slashes Peak memory (3120 → 940) and Dep (10.3M → 3.1M) with comparable accuracy to Vanilla (60.02 vs. 59.62). Notably, while methods like TokenSkip also aim for compression, they often incur a “latency paradox”—a significantly higher time cost (e.g., 42.7 vs. 21.5 on Qwen2.5-7B). This is likely because pruning-style training forces the model to generate more exhaustive token sequences to restore the probabilistic coherence of its Chain-of-Thought, a trend especially pronounced in long-CoT distilled models. In contrast, while LThinker++ introduces minor prefill overhead due to multi-round generation, its drastic reduction in KV cache footprint enables a much higher system-level throughput via increased batch sizes.
2)效率与延迟–吞吐量平衡。 在 Throughput 设置下(表5),LThinker++ 展示了更稳定的部署效率上限。 对于 Qwen2.5-7B,它大幅降低了峰值内存(3120 → 940)和 Dep(10.3M → 3.1M),同时保持与 Vanilla 相当的准确率(60.02 对比 59.62)。 值得关注的是,TokenSkip 等方法虽然同样以压缩为目标,却经常产生“延迟悖论”——时间成本显著增加(例如在 Qwen2.5-7B 上为 42.7 对比 21.5)。 这可能是因为,剪枝式训练迫使模型生成更充分的 token 序列,以恢复其思维链的概率连贯性;这一趋势在长 CoT 蒸馏模型中尤为明显。 相比之下,尽管 LThinker++ 的多轮生成引入了少量预填充开销,但其大幅缩减的 KV 缓存占用允许增大批大小,从而实现更高的系统级吞吐量。
3) Maximizing Reasoning Potential under Strict Budgets. When operating under fixed global context constraints (Table 6), LThinker++'s dynamic management proves most effective. By actively compressing redundant history, the model “saves” budget for subsequent critical reasoning steps. This leads to substantial gains in reasoning-heavy benchmarks like GPQA, where LThinker++ achieves a +5.73 accuracy boost on Qwen2.5-7B while utilizing 40.5% less Peak memory. These results suggest that for complex, multi-step problems, a condensed and high-signal context is fundamentally more effective than a verbose, unmanaged one.
3)在严格预算下最大化推理潜力。 在固定全局上下文约束下运行时(表6),LThinker++ 的动态管理最为有效。 通过主动压缩冗余历史,模型为后续关键推理步骤“节省”了预算。 这使它在 GPQA 等推理密集型基准上获得显著提升:在 Qwen2.5-7B 上,LThinker++ 的准确率提高了 5.73,同时峰值内存减少 40.5%。 这些结果表明,对于复杂的多步问题,紧凑且有效信息密度高的上下文从根本上优于冗长、未经管理的上下文。
4.3.2. Efficiency
To analyze the underlying mechanisms of LThinker++ and how it manages the trade-off between reasoning accuracy and memory efficiency, we conduct an in-depth diagnostic study. Our analysis primarily focuses on the Throughput configuration (Figure 7), with corresponding statistics for the Budget setting provided in App. Figure 20. We focus on the following four questions:
为分析 LThinker++ 的底层机制,以及它如何在推理准确率与内存效率之间进行权衡,我们开展了深入的诊断研究。 我们的分析主要聚焦于 Throughput 配置(图7),Budget 设置的相应统计结果见附录图20。 我们重点关注以下四个问题:

图7:Throughput 设置下的效率分析与消融结果。(a)展示当前上下文中保留的生成 token 的平均数量。(b)展示 Qwen-2.5-7B 的记忆动作分布比例(Commit 与 Expand+Fold)。(c)展示 GPQA(Qwen-2.5-7B)中 commit 前 token 长度落在指定区间的比例。(d)考察峰值内存 token 数量随生成预算的扩展情况。(e)汇总不同模型系列的平均压缩倍数和 token 节省比例。(f)通过消融实验,对比完整 LThinker++ 与退化变体的准确率和平均峰值 token 数量。
How much context memory does LightThinker++ save compared to Vanilla? Figure 7(a) illustrates the average number of visible generated tokens per reasoning step, reflecting the actual context window the model attends to. We observe that LThinker++ constrains this window significantly: on Qwen-2.5-7B, visible tokens are reduced by 82.9% (from 2982 to 511) compared to Vanilla; on Llama-3.1-8B, the reduction is 80.4% (from 3007 to 590). These results demonstrate that LThinker++ distills redundant reasoning traces into compact semantic representations, reducing the memory footprint while maintaining logical continuity.
与 Vanilla 相比,LightThinker++ 节省了多少上下文内存? 图7(a) 展示每个推理步骤中可见的生成 token 的平均数量,反映模型实际关注的上下文窗口。 我们观察到,LThinker++ 显著限制了这一窗口:相比 Vanilla,Qwen-2.5-7B 的可见 token 减少了 82.9%(从 2982 降至 511);Llama-3.1-8B 的可见 token 减少了 80.4%(从 3007 降至 590)。 这些结果表明,LThinker++ 将冗余推理轨迹提炼为紧凑的语义表示,在降低内存占用的同时维持逻辑连续性。
How does LightThinker++ adapt its memory-management strategy to task complexity? Figure 7(b) presents the distribution of actions across benchmarks, revealing a pattern of cognitive economy:
LightThinker++ 如何根据任务复杂度调整记忆管理策略? 图7(b) 展示了各基准上的动作分布,揭示出一种 认知经济性 模式:
- Compression-driven efficiency: commit dominates across all tasks, serving as the key operation for context compression and faster inference.
- Strategic adaptivity via Context Refinement: While commit frequency remains high, the model modulates its context refinement actions (expand and fold) based on task difficulty. On simpler tasks such as MMLU, the model prioritizes straightforward archiving with minimal refinement (5.8%). Conversely, on challenging tasks like GPQA, these refinement actions increase substantially to 21.5%. This suggests that our method learns to proactively reorganize or retrieve historical details to compensate for potential information loss during complex reasoning, rather than compressing indiscriminately.
- 压缩驱动的效率: 在所有任务中,commit 都占主导地位,是压缩上下文和加速推理的关键操作。
- 通过上下文细化实现策略适应: 虽然 commit 的频次始终较高,但模型会根据任务难度调整上下文细化动作(expand 和 fold)。 对于 MMLU 等较简单任务,模型优先采用直接归档,仅进行极少量细化(5.8%)。 相反,在 GPQA 等具有挑战性的任务中,这些细化动作的比例显著上升至 21.5%。 这表明,我们的方法学会了主动重组或检索历史细节,以弥补复杂推理中可能发生的信息丢失,而非不加区分地压缩。
What are the characteristics of LightThinker++’s compression granularity and semantic density? Figure 7(c) depicts the distribution of raw reasoning segment lengths immediately preceding each commit on GPQA, while Figure 7(e) quantifies the resulting compression ratios. We observe that:
LightThinker++ 的压缩粒度和语义密度有什么特点? 图7(c) 展示了 GPQA 上每次 commit 之前的原始推理片段长度分布,图7(e) 则量化了由此产生的压缩比。 我们观察到:
- High-fidelity compression: LThinker++ achieves a compression ratio of 15.0× on GPQA, and still maintains 8.6× on the simpler GSM8K.
- Task-aware cadence: The frequency of compression actions scales naturally with task difficulty. Specifically, LThinker++ executes fewer
commitoperations on simpler tasks like GSM8K (average 3 times per question) compared to more challenging benchmarks such as GPQA (average 7–8 times) and BBH (average 5–7 times). The distribution in Figure 7(c) indicates that mostcommitactions occur after long logical blocks. This adaptive cadence aligns compression with logical boundaries, allowing LThinker++ to encode deeper semantics in fewer tokens.
- 高保真压缩: LThinker++ 在 GPQA 上实现了 15.0× 的压缩比,在更简单的 GSM8K 上仍保持 8.6×。
- 任务感知的节奏: 压缩动作的频次随任务难度自然变化。 具体而言,相比 GPQA(平均每题 7–8 次)和 BBH(平均每题 5–7 次)等更具挑战性的基准,LThinker++ 在 GSM8K 等较简单任务上执行的
commit操作更少(平均每题 3 次)。 图7(c) 的分布表明,大多数commit动作发生在较长的逻辑块之后。 这种自适应节奏使压缩与逻辑边界对齐,让 LThinker++ 能够以更少的 token 编码更深层的语义。
Does LightThinker++ decouple reasoning depth from memory limits? Figure 7(d) examines peak memory usage as the generation budget scales. While Vanilla's peak tokens climb linearly, LThinker++ maintains a remarkably flat ceiling, peaking at only 1,830 (a 71.3% reduction). This confirms that LThinker++ effectively decouples reasoning depth from physical memory constraints, facilitating long-horizon complex reasoning with a substantially smaller memory footprint. Consistent scaling trends under the Budget setting are further detailed in Figure 20.
LightThinker++ 是否将推理深度与内存限制解耦? 图7(d) 考察了生成预算扩展时的峰值内存用量。 Vanilla 的峰值 token 数量线性攀升,而 LThinker++ 的上限十分平稳,峰值仅为 1,830(降低 71.3%)。 这证实了 LightThinker++ 能够有效地将推理深度与物理内存约束解耦,以显著更小的内存占用支持长程复杂推理。 Budget 设置下的一致扩展趋势详见图20。
4.3.3. Ablation
As shown in Figure 7(f), restricting LThinker++ to a one-way compression mode (No-Ex&Fold) causes accuracy to plummet from 60.1% to 53.6%, proving that irreversible compression leads to critical information loss. Restoring the full action set recovers accuracy to 60.0% while maintaining a 69.9% reduction in peak memory (940 vs. 3120). Interestingly, LThinker++ achieves higher accuracy with only a marginal increase in peak tokens (940 vs. 811) compared to the degraded variant. We attribute this to a reasoning compensation effect: without explicit retrieval (e.g., expand), the model may generate redundant, circular explanations to bridge memory gaps, whereas a full action suite enables semantic denoising. By distilling noisy trajectories into curated logical entities, our method allows the model to attend more effectively to core logical nodes, matching the performance of a full-context baseline at a fraction of the resource cost.
如 图7(f) 所示,将 LThinker++ 限制为单向压缩模式(No-Ex&Fold),会使准确率从 60.1% 急降至 53.6%,证明不可逆压缩会导致关键信息丢失。 恢复完整动作集合后,准确率回升至 60.0%,同时仍保持 69.9% 的峰值内存降幅(940 对比 3120)。 有趣的是,相比退化变体,LThinker++ 仅略微增加峰值 token 数量(940 对比 811),就获得了更高准确率。 我们将其归因于 推理补偿 效应:缺少显式检索(例如 expand)时,模型可能生成冗余、循环的解释来弥合记忆缺口,而完整的动作集合则能够实现 语义去噪。 通过将嘈杂轨迹提炼为经过整理的逻辑实体,我们的方法使模型能够更有效地关注核心逻辑节点,仅消耗一小部分资源即可达到完整上下文基线的表现。
4.3.4. Case Study

图8:案例研究。图中展示了 LThinker++ 在 GSM8K 上一个案例的部分推理结果。
In our case analysis, we observe two typical uses of memory: (i) verifying previous reasoning states, and (ii) recovering information that is lost during compression. We take the second case as an example. As shown in Figure 8, the model has already inferred the key fact that John has 2 Lego sets, but this information is not reliably retained after compression due to missing intermediate details. The model then performs an expand action to retrieve the missing context from memory and continue reasoning from a consistent state, demonstrating the effectiveness of our recovery mechanism.
在案例分析中,我们观察到两种典型的记忆用途:(i)核查此前的推理状态;(ii)恢复压缩过程中丢失的信息。 我们以第二种情况为例。 如 图8 所示,模型已经推导出 John 拥有 2 套乐高这一关键事实,但由于缺少中间细节,该信息在压缩后未被可靠保留。 随后,模型执行 expand 动作,从记忆中检索缺失的上下文,并从一致的状态继续推理,展示了恢复机制的有效性。
4.4. Discussions: Implicit vs. Explicit
| Method | GSM8K | MMLU | GPQA | BBH | AVG. | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Acc ↑ | Peak ↓ | Dep ↓ | Acc ↑ | Peak ↓ | Dep ↓ | Acc ↑ | Peak ↓ | Dep ↓ | Acc ↑ | Peak ↓ | Dep ↓ | Acc ↑ | Peak ↓ | Dep ↓ | |
| Qwen2.5-7B Series | |||||||||||||||
| CoT | 86.12 | 513 | 0.1M | 66.50 | 649 | 0.2M | 26.76 | 968 | 0.5M | 65.45 | 570 | 0.1M | 61.21 | 675 | 0.2M |
| Distill-R1 | 81.88 | 844 | 1.1M | 51.70 | 2483 | 7.5M | 24.75 | 6718 | 31M | 57.78 | 1967 | 6.0M | 54.03 | 3003 | 11.3M |
| LThinkertho1 | 84.61 | 1043 | 2.1M | 52.96 | 2792 | 8.4M | 18.69 | 6781 | 29.7M | 53.54 | 3687 | 13.8M | 52.45 | 3576 | 13.5M |
| LThinkertho2 | 85.75 | 1003 | 1.8M | 52.00 | 2822 | 8.23M | 24.24 | 7042 | 30.8M | 51.31 | 4130 | 16.3M | 53.33 | 3749 | 14.3M |
| LThinker++ | 87.87 | 471 | 0.4M | 60.27 | 1133 | 3.0M | 38.22 | 3265 | 16.1M | 63.77 | 1415 | 4.2M | 62.53 | 1571 | 5.9M |
| LThinker* | 84.61 | 444 | 0.7M | 57.68 | 1141 | 4.1M | 28.96 | 3496 | 23.2M | 56.63 | 1580 | 7.0M | 56.97 | 1665 | 8.7M |
| Llama3.1-8B Series | |||||||||||||||
| CoT | 85.14 | 550 | 0.2M | 65.82 | 736 | 0.3M | 24.75 | 1231 | 0.9M | 66.46 | 642 | 0.2M | 60.54 | 790 | 0.4M |
| Distill-R1 | 73.62 | 395 | 0.1M | 53.46 | 582 | 0.8M | 20.20 | 3972 | 16M | 61.21 | 380 | 0.2M | 52.12 | 1332 | 4.4M |
| LThinkertho1 | 76.72 | 917 | 1.5M | 53.26 | 2682 | 7.6M | 20.70 | 6697 | 28.8M | 57.58 | 3674 | 13.3M | 52.01 | 3493 | 12.8M |
| LThinkertho2 | 78.92 | 842 | 1.2M | 52.68 | 2783 | 7.7M | 18.18 | 6420 | 27.1M | 56.57 | 4123 | 15.7M | 51.59 | 3542 | 12.9M |
| LThinker++ | 77.69 | 528 | 0.7M | 59.72 | 1370 | 4.5M | 33.67 | 4101 | 22.9M | 73.20 | 1481 | 4.6M | 61.07 | 1870 | 8.2M |
| LThinker* | 76.72 | 522 | 0.9M | 59.59 | 1394 | 6.5M | 28.28 | 4271 | 34.5M | 63.10 | 1664 | 8.1M | 56.92 | 1963 | 12.5M |
表7:LThinker 与 LThinker++ 在四个基准上的比较。为公平比较,LThinkertho1 和 LThinkertho2 使用与 表5 相同的训练数据。
4.4.1. Reasoning Performance Comparison
We first evaluate implicit and explicit reasoning under the same experimental protocol. In particular, to ensure a fair comparison, we keep the training and evaluation setup identical to LThinker and only replace the training traces with the synthetic traces generated by LThinker++. Within this setting, tho1 follows the same preprocessing/segmentation procedure as tho (in Table 1), whereas tho2 additionally introduces a finer-grained thought segmentation strategy using \n.
我们首先在相同实验协议下评估隐式与显式推理。 具体而言,为确保公平比较,我们保持与 LThinker 相同的训练和评估设置,只将训练轨迹替换为由 LThinker++ 生成的合成轨迹。 在这一设置中,tho1 遵循与 tho(表1)相同的预处理与分段流程,而 tho2 进一步引入了使用 \n 的更细粒度思维分段策略。
The corresponding results are reported in Table 7. The table reveals a clear performance divergence: while LThinkertho remains competitive on the original Distilled-R1 traces, the implicit variants degrade more noticeably on our newly synthesized traces generated by LThinker++ (Section 3.3). We hypothesize this is due to differences in information density. The synthesized structured traces often align each segment with a self-contained logical step, concentrating critical anchors within a compact span. In contrast, R1-Distill traces contain more discourse connectives and redundant phrasing, which “dilutes” information across a softer linguistic flow.
相应结果见 表7。 表中呈现出明显的性能分化:LThinkertho 在原始 Distilled-R1 轨迹上仍具有竞争力,但隐式变体在我们使用 LThinker++ 新合成的轨迹上退化得更明显(第 3.3 节)。 我们推测,这源于信息密度的差异。 合成的结构化轨迹通常使每个片段对应一个 自包含的逻辑步骤,将关键锚点集中在紧凑的片段内。 相比之下,R1-Distill 轨迹包含更多篇章连接词和冗余表述,将信息“稀释”在更柔和的语言流中。
4.4.2. Quantitative Data Analysis: Length Distribution and Logical Density
To investigate whether the data characteristics contribute to the above performance degradation, we analyze the character-length distribution of thought segments for the datasets corresponding to the strong implicit baseline in Table 1 (denoted as tho) and our two segmented variants (tho1 and tho2). Figure 9 reports kernel density estimates (KDE) of per-thought segment lengths.
为研究数据特征是否导致了上述性能下降,我们分析了 表1 中较强隐式基线所用数据集(记为 tho)以及两种分段变体(tho1 和 tho2)的思维片段字符长度分布。 图9 报告了每个思维片段长度的核密度估计(KDE)。

图9:思维片段长度分布。 对 LThinker_tho、LThinker_tho1 和 LThinker_tho2 的每个思维片段长度(以字符计)进行核密度估计。横轴为片段长度(字符数),纵轴为概率密度。竖直虚线标示峰值位置。
LThinker_tho、LThinker_tho1 和 LThinker_tho2 的每个思维片段长度(以字符计)进行核密度估计。横轴为片段长度(字符数),纵轴为概率密度。竖直虚线标示峰值位置。The original-flow data (tho) peaks at ≈ 38 characters and is characterized by substantial linguistic redundancy such as connectives and hedging tokens. This redundancy acts as a semantic buffer. Even if implicit compression discards certain local details, the model can often reconstruct the global intent via remaining semantic cues and pretrained language priors.
原始文本流数据(tho)在约 38 个字符处达到峰值,包含大量连接词和模糊限定词等语言冗余。 这种冗余起到了语义缓冲作用。 即使隐式压缩丢弃了某些局部细节,模型通常仍能通过剩余语义线索和预训练语言先验重建整体意图。
In contrast, LThinker++ synthesized traces (tho1) exhibit a peak shift to ≈ 51 characters. This distributional shift reflects our synthesis strategy which explicitly generates segments to encapsulate semantically complete reasoning units. By design, these structured traces prioritize the inclusion of critical logical anchors including subscripts, constants, and variable bindings within each segment. Consequently, tho1 possesses a significantly higher information density than the redundant natural language flow observed in tho.
相比之下,LThinker++ 合成轨迹(tho1)的峰值移动至约 51 个字符。 这一分布变化反映了我们的合成策略:显式生成用于封装语义完整推理单元的片段。 按照设计,这些结构化轨迹优先在每个片段中纳入下标、常数和变量绑定等关键逻辑锚点。 因此,tho1 的信息密度显著高于 tho 中所观察到的冗余自然语言流。
We attribute the degradation of implicit variants to a representation bottleneck when processing such high-density information. Within a constrained latent space, the loss of a single pivotal anchor like a mathematical sign becomes irrecoverable due to the lack of surrounding redundancy. This causes errors to propagate and eventually break the reasoning chain. Furthermore, while tho2 reduces per-segment length with a peak at ≈ 22 characters, the excessive number of boundaries leads to semantic fragmentation. Many segments contain only isolated punctuation or vestigial characters that lack independent logical value. This effectively injects structural noise into the context, forcing the model into frequent and error-prone state switching which leads to cumulative reconstruction failures.
我们将隐式变体的性能下降归因于处理这种高密度信息时的表示瓶颈。 在受限的潜在空间中,由于周围缺少冗余,数学符号等单个关键锚点的丢失就会变得不可恢复。 这会导致错误传播,最终破坏推理链。 此外,虽然 tho2 将每个片段的长度缩短,峰值约为 22 个字符,但过多的边界会造成语义碎片化。 许多片段只包含孤立标点或残留字符,缺乏独立的逻辑价值。 这实际上向上下文注入了结构噪声,迫使模型频繁且容易出错地切换状态,最终导致累积性的重构失败。
4.4.3. Takeaways and Future Directions
Overall, fixed-capacity implicit compression appears well-suited to “soft,” redundant natural-language reasoning flows, but it is more likely to expose capacity limits when confronted with dense, atomic “hard-logic” steps. In contrast, LThinker++ mitigates this issue by explicitly managing key anchors (e.g., via textual summaries or structured records), providing a robust mechanism for state transfer in high-density settings.
总体而言,固定容量的隐式压缩似乎适用于“柔性”、冗余的自然语言推理流,但面对密集、原子化的“硬逻辑”步骤时,更容易暴露容量限制。 相比之下,LThinker++ 通过显式管理关键锚点(例如使用文本摘要或结构化记录)来缓解这一问题,为高密度场景中的状态传递提供稳健机制。
These findings also suggest a clear optimization direction for implicit models: rather than merely increasing a static number of Gist tokens, future work should explore adaptive latent capacity allocation (e.g., dynamically adjusting the number or budget of Gist tokens based on estimated segment information density/entropy), thereby improving fidelity and robustness on dense reasoning steps.
这些发现也为隐式模型指出了明确的优化方向:未来工作不应仅增加固定数量的 Gist token,而应探索 自适应潜在容量分配(例如根据估计的片段信息密度或熵,动态调整 Gist token 的数量或预算),从而提高处理密集推理步骤时的保真度与稳健性。

图10:面向长程智能体推理的 LightThinker++ 概览。 LightThinker++ 遵循思考–动作–观察循环,同时显式管理有状态记忆。每个交互步骤都可以通过 commit 形成归档摘要;必要时通过 expand 重新展开到活跃上下文,恢复原始证据;随后再通过 fold 折叠,以保持上下文整洁。
5. LightThinker++: Long-Horizon Agentic Reasoning
To demonstrate the robustness of explicit memory management under extreme context demands, we extend LightThinker++ to the DeepResearch domain (Figure 10). While our evaluation focuses on this scenario, which is characterized by high-entropy web interactions and multi-step information synthesis, the LightThinker++ framework is fundamentally domain-agnostic. It serves as a general-purpose paradigm for any long-horizon task where an agent must reconcile iterative planning with voluminous external feedback.
为展示显式记忆管理在极高上下文需求下的稳健性,我们将 LightThinker++ 扩展到 DeepResearch 领域(图10)。 虽然我们的评估聚焦于这一具有高熵网页交互和多步信息合成特征的场景,但 LightThinker++ 框架本质上与领域无关。 它可以作为一种通用范式,适用于任何需要智能体协调迭代规划与海量外部反馈的长程任务。
Formalizing LightThinker++ within the TAO Paradigm. Standard agentic interaction typically follows the Thought-Action-Observation (TAO) cycle. To bridge this with the framework in Section 3.3, we instantiate the reasoning entity
在 TAO 范式中形式化 LightThinker++。 标准智能体交互通常遵循 思考–动作–观察(Thought-Action-Observation,TAO)循环。 为将其与第 3.3 节 的框架衔接,我们将推理实体
To counteract the context rot inherent in linear histories, LightThinker++ redefines the research log as a stateful, managed memory
为对抗线性历史固有的 上下文腐化,LightThinker++ 将研究日志重新定义为有状态、受管理的记忆
By treating memory management as an explicit decision, LightThinker++ ensures the context window is prioritized for high-signal content. High-entropy evidentiary details are only restored via expand when required for synthesis and are promptly folded to maintain context hygiene.
通过将记忆管理作为一项显式决策,LightThinker++ 确保上下文窗口优先容纳有效信息密度高的内容。 只有在合成信息需要时,高熵的证据细节才会通过 expand 恢复,随后及时通过 fold 折叠,以保持上下文整洁。
Adapted Memory Actions for Deep Research. To manage the high informational density inherent in web-based research, we instantiate the memory framework introduced in Section 3.3 through a specialized toolset tailored for the agentic interaction loop:
适配深度研究的记忆动作。 为管理网页研究固有的高信息密度,我们通过一组专门适配智能体交互循环的工具,将第 3.3 节 提出的记忆框架实例化:
- Environment Actions (
): High-throughput tools such as search and visit, optimized for rapid information discovery across the open web. - Memory Actions (
): Operators governing the contextual lifecycle. Specifically, commit distills the holistic interaction into a summary to preserve long-term coherence; expand re-activates a past step to retrieve raw evidence for precise synthesis; and fold purges these details once their utility is exhausted.
- 环境动作(
): search 和 visit 等高吞吐工具,专门针对开放网络上的快速信息发现进行优化。 - 记忆动作(
): 管理上下文生命周期的操作。具体而言,commit 将完整交互 提炼为摘要 ,以保持长期连贯性;expand 重新激活历史步骤,检索原始证据 以支持精确的信息合成;fold 则在这些细节不再有用时将其移出上下文。
Trajectory Synthesis via Multi-Agent Orchestration. To generate expert-level trajectories for research tasks, we extend the Environment-Aware Trajectory Synthesis framework (Section 3.3) into a Multi-Agent Orchestration paradigm. While the single-model synthesis described in Section 3.3 suffices for standard reasoning, the high informational density of web-based research imposes a heavy cognitive load, requiring a model to reconcile long-term strategic planning with high-entropy external data.
To maintain synthesis quality, we partition this labor between two specialized roles within the closed-loop environment:
为保持合成质量,我们在闭环环境中将这一工作分配给两个专门角色:
- Interaction Agent: Executes
tools while performing granular memory retrieval via expand and fold to navigate raw information. - Contextual Governor: Acts as the curator of the research log, adaptively triggering commit to distill holistic interaction steps into actionable summaries
.
- 交互智能体: 执行
工具,同时通过 expand 和 fold 进行细粒度记忆检索,以浏览原始信息。 - 上下文管理者: 负责整理研究日志,自适应地触发 commit,将完整交互步骤提炼为可执行摘要
。
By decoupling the generation of execution-level details from high-level context management, this collaborative synthesis ensures that the resulting trajectories maintain both rigorous logical depth and optimized context density.
通过将执行层面细节的生成与高层上下文管理解耦,这种协同合成确保所得轨迹既保持严谨的逻辑深度,又具有优化后的上下文密度。
Behavioral Pruning and Memory Lifecycle. To extract the most effective reasoning patterns from the multi-agent orchestration, we implement a Behavioral Pruning mechanism tailored for the high-entropy research domain. We filter the synthesized trajectories against the Memory Lifecycle constraint established in Section 3.3, ensuring the data reflects active context governance rather than passive logging of web interactions. A trajectory is deemed admissible only if it satisfies the following criteria:
行为剪枝与记忆生命周期。 为从多智能体编排中提取最有效的推理模式,我们实现了一种专门面向高熵研究领域的行为剪枝机制。 我们根据第 3.3 节 确立的记忆生命周期约束过滤合成轨迹,确保数据反映的是主动的上下文管理,而非被动记录网页交互。 一条轨迹只有满足以下标准才会被接受:
- Lifecycle Completeness: It demonstrates the full cycle, including archiving via commit and evidence retrieval via expand /fold;
- Symmetry Constraint: Reflecting the need for context hygiene in long-horizon interactions, a fold operation must strictly revert a previously expanded step, ensuring the context window remains purged of raw snippets once synthesis is complete.
- Anti-Jitter Heuristics: We prohibit redundant memory operations including consecutive actions on the same step and operations targeting non-existent step IDs to ensure management is purposeful. This is particularly crucial in the agentic loop to prevent the model from falling into stochastic retrieval patterns when faced with complex external observations.
- 生命周期完整性:展示完整的生命周期,包括通过 commit 归档,以及通过 expand / fold 检索证据;
- 对称性约束:考虑到长程交互中保持上下文整洁的需要,fold 操作必须严格还原一个此前已展开的步骤,确保信息合成完成后,上下文窗口中不再保留原始片段。
- 抗抖动启发式规则:我们禁止冗余记忆操作,包括连续针对同一步骤执行的动作,以及针对不存在的步骤 ID 进行的操作,以确保管理具有明确目的。 这在智能体循环中尤为关键,可防止模型面对复杂外部观察时陷入随机检索模式。
Through this rigorous filtering, the collaborative expertise of the multi-agent system is distilled into a single, cohesive policy. We fine-tune the model by minimizing the negative log-likelihood over the pruned expert trajectories
通过这种严格过滤,多智能体系统的协作经验被蒸馏为一个统一、连贯的策略。 我们通过最小化经过剪枝的专家轨迹
By optimizing the joint predictive likelihood of reasoning traces and memory operations, the agent internalizes explicit context engineering as a core component of its decision-making process. This high-density learning signal allows the model to maintain context hygiene and reasoning fidelity across extended interaction horizons.
通过优化推理轨迹与记忆操作的联合预测似然,智能体将 显式上下文工程 内化为其决策过程的核心组成部分。 这种高密度学习信号使模型能够在延长的交互时域内,保持上下文整洁和推理保真度。
6. Experiments: Long-Horizon Agentic Reasoning
6.1. Experimental Settings
Dataset Construction and Filtering. The base query pool is curated from a diversified ensemble of sources, including HotpotQA, MuSiQue, WebDancer, WebShaper, and WebWalkerQA-Silver. To ensure the necessity of multi-hop reasoning and high-order planning, we perform heuristic filtering on HotpotQA and MuSiQue by selecting only those instances where Qwen3-30B-A3B-Instruct-2507 fails to yield direct solutions. Regarding the WebWalkerQA-Silver corpus, we adopted a language-specific selection policy: the English subset was fully incorporated to maintain linguistic diversity, while the Chinese subset was filtered to include only those instances explicitly categorized as “hard” according to the dataset's intrinsic difficulty metadata. This collection is further augmented with diversified web-navigation tasks to form the final query pool, with a detailed categorical breakdown provided in Appendix C.2.1.
数据集构建与过滤。 基础查询池由多种来源整理而成,包括 HotpotQA、MuSiQue、WebDancer、WebShaper 和 WebWalkerQA-Silver。 为确保任务确实需要多跳推理和高阶规划,我们对 HotpotQA 和 MuSiQue 进行启发式过滤,仅选择 Qwen3-30B-A3B-Instruct-2507 无法直接解答的实例。 对于 WebWalkerQA-Silver 语料,我们采用与语言相关的选择策略:完整纳入英文子集,以保持语言多样性;中文子集则仅保留按照数据集自身难度元数据明确归为“hard”的实例。 我们进一步加入多样化的网页导航任务,形成最终查询池;详细的类别划分见附录 C.2.1。
From this pool, we employ a hierarchical filtering pipeline to construct two distinct training sets:
我们在该查询池上使用分层过滤流程,构建两个不同的训练集:
- Vanilla Baseline: We synthesize reasoning trajectories using DeepSeek-V3.2 in non-thinking mode, utilizing only the Aenv tool. After filtering for correctness, we retain 6,625 high-quality standard trajectories.
- LThinker++: We augment the correctness filter with the Behavioral Pruning constraints described in Section 5. In this configuration, the agent utilizes both the Aenv and Amem tools. Due to the stringent requirements for logical memory transitions, only 3,677 expert trajectories were retained. Despite this 44.5% reduction in base trajectories compared to the Vanilla, these trajectories were decomposed into 42,633 fine-grained training instances. This yields a more potent and logically dense learning signal, providing the model with the necessary supervision to maintain context hygiene and reasoning fidelity in context-heavy tasks.
- Vanilla 基线: 使用非思考模式下的 DeepSeek-V3.2 合成推理轨迹,仅调用 Aenv 工具。 经过正确性过滤,我们保留了 6,625 条高质量标准轨迹。
- LThinker++: 在正确性过滤的基础上,增加第 5 节 所述的行为剪枝约束。 在这一配置下,智能体同时使用 Aenv 和 Amem 工具。 由于对逻辑记忆转移的要求严格,最终仅保留 3,677 条专家轨迹。 尽管基础轨迹数量较 Vanilla 减少了 44.5%,但这些轨迹被分解为 42,633 个细粒度训练实例。 这产生了更有力、逻辑更密集的学习信号,为模型在上下文密集型任务中保持上下文整洁和推理保真度提供了必要监督。
Baselines and Training. We evaluate our framework against several state-of-the-art LLMs, including GLM-4.6, Claude-4-Sonnet, GPT-5, Kimi-K2 and Qwen3-235B-A22B-Instruct and the DeepSeek-V3 series (V3.1 and V3.2). To assess the specific impact of explicit memory management, we develop and evaluate two internal variants initialized from Qwen3-30B-A3B-Thinking-2507. The first, Vanilla-Agent, is fine-tuned on the Vanilla Baseline dataset to equip the model with environment-level capabilities via
基线与训练。 我们将该框架与多个先进 LLM 进行比较,包括 GLM-4.6、Claude-4-Sonnet、GPT-5、Kimi-K2、Qwen3-235B-A22B-Instruct,以及 DeepSeek-V3 系列(V3.1 和 V3.2)。 为评估显式记忆管理的具体影响,我们开发并评估了两个从 Qwen3-30B-A3B-Thinking-2507 初始化的内部变体。 第一个是 Vanilla-Agent,在 Vanilla 基线 数据集上微调,通过
Evaluation Metrics and Datasets. We benchmark our models across three representative agentic datasets: xbench-DeepSearch-2510, BrowseComp-EN, and BrowseComp-ZH, which we refer to as xbench, BC-EN, and BC-ZH for brevity. Performance is quantified by the average Pass@1 score across all test samples and the Pass@3 score over three independent rollouts to assess reasoning stability. Specifically, we employ gpt-5-2025-08-07 as the primary automated judge to evaluate the semantic alignment between model predictions and ground-truth answers. To facilitate autonomous web interaction, we implement two core functional tools:
评估指标与数据集。 我们在 xbench-DeepSearch-2510、BrowseComp-EN 和 BrowseComp-ZH 三个有代表性的智能体数据集上评估模型,为简洁起见,分别简称为 xbench、BC-EN 和 BC-ZH。 性能采用所有测试样本的平均 Pass@1 得分,以及三次独立运行的 Pass@3 得分衡量,后者用于评估推理稳定性。 具体而言,我们使用 gpt-5-2025-08-07 作为主要自动评估器,评估模型预测与真实答案之间的语义一致性。 为支持自主网页交互,我们实现了两个核心功能工具:
- Search: An interface with the Google Search API that supports concurrent queries and retrieves the top-10 results per query.
- Visit: A navigation module that utilizes Jina for HTML parsing and Qwen-Flash to distill task-relevant evidence from the extracted content.
- Search:对接 Google Search API,支持并发查询,并为每个查询检索前 10 个结果。
- Visit:一个导航模块,使用 Jina 解析 HTML,并用 Qwen-Flash 从提取内容中提炼与任务相关的证据。
6.2. Main Results
| Method | xBench-DeepSearch | BrowseComp-ZH | BrowseComp-EN |
|---|---|---|---|
| Proprietary Agents | |||
| GPT-5 | 66.0 | 61.3 | 61.5 |
| Claude-4-Sonnet | 35.0 | 29.1 | 12.2 |
| DeepSeek-V3.2 | 51.0 | 53.6 | 35.0 |
| DeepSeek-V3.1 | 44.0 | 49.5 | 23.6 |
| GLM-4.6 | 47.0 | 42.2 | 34.9 |
| Kimi-K2-Instruct | 30.0 | 28.8 | 14.1 |
| Qwen3-235B-A22B-Instruct | 27.0 | 21.8 | - |
| Our Agents | |||
| Qwen3-30B-A3B-Thinking | 8.7 (16.0) | 10.0 (17.3) | 2.1 (4.0) |
| + SFT (vanilla) | 38.3 (53.0) ↑29.6 | 31.5 (47.8) ↑21.5 | 16.0 (27.3) ↑13.9 |
| + LThinker++ (ours) | 44.0 (60.0) ↑35.3 | 36.9 (57.1) ↑26.9 | 18.1 (31.5) ↑16.0 |
表8:三个数据集上的 BrowseComp 基准总体结果。所有方法均报告 Pass@1;对我们的智能体,另外报告 Pass@3(灰色括号内),以反映多次尝试的稳健性。
Table 8 summarizes the results across three benchmarks, illustrating the incremental gains from our data synthesis and memory orchestration:
表8 汇总了三个基准上的结果,展示数据合成和记忆编排带来的逐步提升:
Effectiveness of Standard Synthesis. The Vanilla-Agent, trained on standard trajectories, exhibits a substantial performance leap over the base Qwen3-Thinking model. For instance, Pass@1 scores rise from 8.7% to 38.3% on xbench and from 10.0% to 31.5% on BrowseComp-ZH. This improvement confirms that our base data pipeline effectively equips the model with fundamental environment-level execution (
标准合成的有效性。 在标准轨迹上训练的 Vanilla-Agent,相较于基础 Qwen3-Thinking 模型实现了显著的性能跃升。 例如,在 xbench 上,Pass@1 从 8.7% 提高到 38.3%;在 BrowseComp-ZH 上,则从 10.0% 提高到 31.5%。 这一提升证实,我们的基础数据流程有效地赋予了模型基础环境执行能力(
Superiority of Orchestrated Memory Actions. Building upon this baseline, LThinker++ achieves further performance leaps across all benchmarks by internalizing memory management actions (
记忆动作编排的优势。 在此基线之上,LThinker++ 通过多智能体编排内化记忆管理动作(
Performance Gain on Hard Instances. To better isolate the effect of our approach on robustness, we bucket examples by the Vanilla-Agent 's success count over three runs,
困难实例上的性能增益。 为更清楚地分离出我们的方法对稳健性的影响,我们根据 Vanilla-Agent 在三次运行中的成功次数
As shown in Table 9, LThinker++ yields substantially larger improvements on
如 表9 所示,LThinker++ 在三个基准的
| Method | xBench-DeepSearch (hard01) | BrowseComp-ZH (hard01) | BrowseComp-EN (hard01) | |||
|---|---|---|---|---|---|---|
| Pass@1 (%) ↑ | Pass@3 (%) ↑ | Pass@1 (%) ↑ | Pass@3 (%) ↑ | Pass@1 (%) ↑ | Pass@3 (%) ↑ | |
| Our Agents | ||||||
| Vanilla SFT | 6.8 | 20.3 | 8.6 | 25.9 | 5.1 | 15.4 |
| LightThinker++ | 20.9 | 33.9 | 20.6 | 40.3 | 10.5 | 22.4 |
表9:三个基准的
6.3. Efficiency and Scalability Analysis

图11:上下文管理效率的定量分析。 (a)展示跨交互轮次的活跃上下文轨迹(
6.3.1. Action Budget Efficiency.
We evaluate model performance under varying action budget constraints in Figure 11(a). The budget
我们在 图11(a) 中评估了不同动作预算约束下的模型表现。 预算
Action Efficiency. Across all benchmarks, LThinker++ exhibits a significantly steeper performance trajectory compared to the Vanilla baseline. Our model reaches the peak performance levels of the Vanilla model (achieved at 60 actions) with substantially fewer interactions. Specifically, on xbench, LThinker++ attains the Vanilla peak of 38.3% in only 24 actions, representing a 2.5× efficiency gain. Similar trends are observed on BrowseComp-ZH and BrowseComp-EN, which achieve 2.1× and 1.6× efficiency improvements, respectively. This efficiency stems primarily from our explicit memory management, which effectively mitigates context rot.
动作效率。 在所有基准上,相比 Vanilla 基线,LThinker++ 的性能提升曲线明显更陡。 我们的模型只需少得多的交互次数,就能达到 Vanilla 模型在 60 次动作时取得的峰值性能。 具体而言,在 xbench 上,LThinker++ 仅用 24 次动作就达到 Vanilla 的 38.3% 峰值,实现了 2.5 倍的效率提升。 BrowseComp-ZH 和 BrowseComp-EN 也呈现类似趋势,效率分别提高了 2.1 倍和 1.6 倍。 这种效率主要来自显式记忆管理,它有效缓解了上下文腐化。
By folding redundant observations and expanding only task-relevant details, LThinker++ maintains a high-signal context window throughout extended interactions. This prevents the accumulation of irrelevant noise that typically degrades reasoning in the Vanilla baseline, allowing the agent to reach high-precision decisions with significantly fewer environment probes.
通过折叠冗余观察、仅展开与任务相关的细节,LThinker++ 在长程交互中始终维持较高有效信息密度的上下文窗口。 这防止了通常会削弱 Vanilla 基线推理能力的无关噪声不断累积,使智能体能够用显著更少的环境探索得出高精度决策。
Scaling with Action Budgets. The performance gap in Figure 11(a) reveals a critical advantage of our approach: superior information utility per environment interaction. Since the action budget only constrains
随动作预算扩展。 图11(a) 中的性能差距揭示了我们方法的一项关键优势:每次环境交互所获得信息的利用效率更高。 由于动作预算仅限制
6.3.2. Scaling with Horizon and Token Budgets.
We evaluate the scaling characteristics of the model across two dimensions: the number of interaction rounds (Horizon) and total input consumption (Token Budget).
我们从两个维度评估模型的扩展特征:交互轮数(Horizon)和总输入消耗(Token Budget)。
Horizon Scaling. Figure 11(b) illustrates accuracy trends relative to maximum interaction rounds. Performance scales consistently with exploration depth, with the most significant gains occurring between 10 and 60 rounds. For instance, xbench accuracy surges to 44.0% as the horizon extends. The convergence observed after 80 rounds suggests that LThinker++ effectively balances exploration breadth and reasoning depth. Rather than being limited by information overload or “lost-in-the-middle” effects, the model successfully resolves complex queries within a strategic window, beyond which additional rounds yield diminishing utility as the solution space has been sufficiently exhausted.
交互时域扩展。 图11(b) 展示了准确率相对于最大交互轮数的变化趋势。 性能随探索深度持续提升,最显著的增益出现在 10–60 轮之间。 例如,随着交互时域延长,xbench 的准确率升至 44.0%。 80 轮后观察到的收敛表明,LThinker++ 有效平衡了探索广度与推理深度。 模型没有受限于信息过载或“中间信息丢失”效应,而是在一个经过策略调节的时间窗口内成功解决复杂查询;超过这一窗口后,由于解空间已被充分探索,增加轮数带来的效用逐渐减小。
Token Budget Scaling. Figure 11(c) illustrates the performance trends as a function of the token budget. Accuracy improves rapidly in the low-budget regime and gradually saturates around 32k–48k tokens, indicating that most task-relevant information can be effectively utilized within a moderate context size. As the token budget increases further, performance remains stable up to 110k tokens, suggesting that the method can maintain consistent reasoning behavior under large-context settings. However, the observed plateau also highlights that once sufficient information is captured, the ultimate performance upper bound is governed by the model’s inherent reasoning capacity rather than further context expansion.
Token 预算扩展。 图11(c) 展示了性能随 token 预算变化的趋势。 准确率在低预算区间快速提高,并在约 32k–48k token 时逐渐饱和,说明在适中的上下文大小内,大多数与任务相关的信息就能得到有效利用。 随着 token 预算进一步增加,性能一直稳定至 110k token,表明该方法能够在大上下文设置下保持一致的推理行为。 然而,观察到的平台期也说明,一旦获取了足够的信息,最终性能上限取决于模型固有的推理能力,而非进一步扩大上下文。

图12:上下文管理效率的定量分析。 (a)展示跨交互轮次的活跃上下文轨迹(
6.3.3. Active Context Analysis.
To quantify the efficiency of context management, we analyze the trajectory of the active context size per round
为量化上下文管理效率,我们分析每轮活跃上下文大小
Figure 12(a) illustrates the average
图12(a) 展示整个交互时域中的平均
Suppression of Contextual Growth. The Vanilla model suffers from rapid contextual inflation: its active context window swells to approximately 100k tokens within merely 50–60 rounds. This extreme redundancy not only consumes excessive resources but also triggers performance degradation due to noise. In sharp contrast, LThinker++ maintains a remarkably lean and stable footprint, staying between 30k and 40k tokens even as the interaction extends to 80 rounds. This suggests that LThinker++ effectively distills environmental feedback into high-density insights, allowing the agent to sustain long-horizon reasoning without the cognitive and computational strain of an unmanaged context.
抑制上下文增长。 Vanilla 模型存在快速的 上下文膨胀:仅在 50–60 轮内,活跃上下文窗口就增大到约 100k token。 这种极端冗余不仅消耗过多资源,还会因噪声导致性能下降。 相比之下,LThinker++ 保持了十分精简、稳定的占用,即使交互延长至 80 轮,仍维持在 30k–40k token 之间。 这表明 LThinker++ 能够有效地将环境反馈提炼为高密度认识,使智能体持续进行长程推理,而无需承受未经管理的上下文带来的认知与计算负担。
Dynamic Changes and Peak Control. Unlike the continuous growth observed in the baseline, the LThinker++ trajectory shows periodic changes driven by our expand-and-fold mechanism. The model temporarily expands context to process new evidence before condensing it into essential insights. Statistical results in Figure 12(b) show that LThinker++ consistently outperforms the Vanilla model in both Mean and P95 metrics. Notably, in BC_EN, our P95 peak of 46,104 tokens is not only much lower than the Vanilla peak of 110,634, but also approximately 24.3% lower than the Vanilla model's mean usage of 60,928 tokens. This proves that LThinker++ effectively prevents “contextual explosion” even during intensive search phases.
动态变化与峰值控制。 与基线中持续增长的现象不同,LThinker++ 的轨迹在 展开–折叠 机制驱动下呈现 周期性变化。 模型先暂时展开上下文以处理新证据,再将其浓缩为关键信息。 图12(b) 的统计结果表明,LThinker++ 在 Mean 和 P95 两项指标上始终优于 Vanilla 模型。 值得关注的是,在 BC_EN 上,我们的 P95 峰值为 46,104 token,不仅远低于 Vanilla 的 110,634 token 峰值,也比 Vanilla 的平均用量 60,928 token 低约 24.3%。 这证明,即使处于密集搜索阶段,LThinker++ 也能有效防止“上下文爆炸”。
Extended Reasoning Lifespan. The termination patterns reveal a fundamental difference in exploration depth. Vanilla models often stop prematurely, which is typically triggered by degraded information processing capabilities rather than simple sequence length limits. As the context becomes increasingly noisy, these models suffer from lost-in-the-middle effects or hallucinations, causing them to provide incomplete answers before fully exploring the solution space. In contrast, by maintaining a high-density and manageable context, LThinker++ avoids such cognitive failures and supports sustained investigation beyond 80 rounds. This ensures the model's reasoning lifespan is governed by task complexity rather than the internal strain of redundant information.
延长推理持续时间。 终止模式揭示了探索深度上的根本差异。 Vanilla 模型经常过早停止,这通常由信息处理能力退化引起,而不只是序列长度限制所致。 随着上下文越来越嘈杂,这些模型会受到中间信息丢失效应或幻觉影响,导致它们在充分探索解空间之前就给出不完整答案。 相比之下,LThinker++ 通过维持高密度且可管理的上下文,避免了这类认知失败,支持超过 80 轮的持续研究。 这确保模型的推理持续时间由任务复杂度决定,而非由冗余信息造成的内部负担决定。
6.4. Ablation
We conducted incremental ablation experiments to verify the effectiveness of our memory orchestration components. As illustrated in Figure 13, we compare three configurations: (1) Base, representing the vanilla model with standard SFT; (2) + commit, which introduces the summary-based memory commit mechanism; and (3) + all memory actions, our model incorporating the complete orchestration suite including Commit, Fold, and Expand.
我们开展了逐步增加组件的消融实验,以验证记忆编排组件的有效性。 如 图13 所示,我们比较三种配置:(1)Base,表示经过标准 SFT 的 Vanilla 模型;(2)+ commit,引入基于摘要的记忆提交机制;(3)+ all memory actions,即集成 Commit、Fold 和 Expand 完整编排操作集合的模型。

图13:记忆编排的消融实验结果。
Impact of Information Distillation. Comparing the Base and + commit variants reveals that introducing the commit mechanism improves Pass@1 performance from 38.3% to 41.7% on xbench and from 31.5% to 34.8% on BC_ZH. These gains indicate that distilling raw interaction data into structured evidence effectively filters environmental noise, which helps the model maintain logical consistency throughout extended reasoning trajectories.
信息蒸馏的影响。 比较 Base 与 + commit 变体可见,引入 commit 机制后,xbench 上的 Pass@1 从 38.3% 提高到 41.7%,BC_ZH 上则从 31.5% 提高到 34.8%。 这些增益说明,将原始交互数据提炼为结构化证据可以有效过滤环境噪声,帮助模型在长程推理轨迹中保持逻辑一致性。
Benefits of Structural Context Control. The integration of fold and expand mechanisms in the + all memory actions model leads to the highest performance, reaching 44.0% on xbench and 36.9% on BC_ZH. These improvements show that dynamic context control is as important as information distillation: an example in Figure 29 shows that when archiving omits crucial intermediate evidence, the model can expand the relevant past step to recover it from memory and fold it back after use.
结构化上下文控制的收益。 在 + all memory actions 模型中集成 fold 与 expand 机制,带来了最高性能,在 xbench 上达到 44.0%,在 BC_ZH 上达到 36.9%。 这些提升表明,动态上下文控制与信息蒸馏同样重要:图29 的示例显示,当归档遗漏关键中间证据时,模型可以 expand 相关历史步骤,从记忆中恢复证据,并在使用后将其 fold 回去。
Consistency Across Benchmarks. The performance trends are highly consistent across both xbench and BC_ZH, with steady improvements observed as more orchestration components are added. This evolution confirms the generalizable value of our memory orchestration mechanism across different languages and task domains, ensuring that the model avoids early stopping during difficult investigations.
跨基准的一致性。 在 xbench 和 BC_ZH 上,性能趋势高度一致,随着编排组件逐步增加,模型表现持续改善。 这一演进证实了我们的记忆编排机制在不同语言和任务领域中的普适价值,确保模型在困难研究中避免过早停止。
7. Related Work
Current research on accelerating the inference process of large language models (LLMs) primarily focuses on three categories of methods: Quantizing Model, Generating Fewer Tokens, and Reducing KV Cache. Quantizing Model includes both parameter quantization and KV Cache quantization, while this section will concentrate on the latter two categories. It is important to note that generating long texts and understanding long texts represent distinct application scenarios; therefore, acceleration methods specifically targeting the long-text generation phase (e.g., pre-filling stage acceleration techniques such as AutoCompressor, ICAE, LLMLingua, Activation Beacon, SnapKV, and PyramidKV) are not discussed here. This section provides a detailed overview of the latter two categories while introducing a systematic analysis of Context Management.
当前关于加速大语言模型(LLM)推理过程的研究,主要关注三类方法:模型量化、生成更少 token 和 缩减 KV 缓存。 模型量化包括参数量化和 KV 缓存量化,而本节将重点讨论后两类方法。 需要区分的是,生成长文本与理解长文本是不同的应用场景;因此,本文不讨论专门针对长文本生成阶段的加速方法(例如 AutoCompressor、ICAE、LLMLingua、Activation Beacon、SnapKV 和 PyramidKV 等预填充阶段加速技术)。 本节详细概述后两类方法,同时对上下文管理进行系统分析。
Reducing KV Cache. This category can be divided into two types of strategies: pruning-based KV Cache selection in discrete space and merging-based KV Cache compression in continuous space.
缩减 KV 缓存。 这一类别可分为两种策略:在离散空间中基于剪枝选择 KV 缓存,以及在连续空间中基于合并压缩 KV 缓存。
- Pruning-Based Strategies. Specific eviction policies are designed to retain important tokens during inference. For example, StreamingLLM considers the initial sink tokens and the most recent tokens as important. H2O focuses on tokens with high historical attention scores. SepLLM emphasizes tokens corresponding to punctuation marks.
- Merging-Based Strategies. Anchor tokens are introduced, and LLMs are trained to compress historically important information into these tokens, thereby achieving KV Cache merging.
- 基于剪枝的策略。 这类方法设计特定的淘汰策略,以在推理过程中保留重要 token。 例如,StreamingLLM 将最初的注意力汇聚 token 和最近的 token 视为重要信息。 H2O 关注历史注意力得分较高的 token。 SepLLM 则强调标点符号对应的 token。
- 基于合并的策略。 这类方法引入锚点 token,并训练 LLM 将历史重要信息压缩到这些 token 中,从而实现 KV 缓存合并。
Both strategies require intervention during inference. The key difference is that the first strategy is training-free but applies the eviction policy for every generated token, while the second strategy is a training-based method and allows the LLM to decide when to apply the eviction policy.
两种策略都需要在推理过程中进行干预。 主要区别在于,第一种策略无需训练,但对每个生成 token 都要执行淘汰策略;第二种则需要训练,并允许 LLM 决定何时执行淘汰策略。
Generating Fewer Tokens. This category can be further divided into three strategies based on the number and type of tokens used during inference.
生成更少 token。 根据推理过程中使用的 token 数量和类型,这一类别可进一步划分为三种策略。
- Discrete Token Reduction. Techniques such as prompt engineering, instruction fine-tuning, or reinforcement learning are used to guide LLMs to use fewer discrete tokens during inference. For example, TALE prompts LLMs to complete tasks under a predefined token budget. Arora and Zanette construct specific datasets and employ reinforcement learning reward mechanisms to encourage models to generate concise and accurate outputs, thereby reducing token usage. TokenSkip introduces a controllable framework that fine-tunes models on pruned CoT paths, enabling the selective skipping of redundant tokens at adjustable compression ratios.
- Continuous Token Replacement. These methods explore using continuous-space tokens instead of traditional discrete vocabulary tokens. A representative example is CoConut, which leverages Curriculum Learning to train LLMs to perform inference with continuous tokens.
- No Token Usage. By internalizing the inference process between model layers, the final answer is generated directly during inference without intermediate tokens.
- 减少离散 token。 这类方法利用提示工程、指令微调或强化学习等技术,引导 LLM 在推理时使用更少的离散 token。 例如,TALE 通过提示要求 LLM 在预先设定的 token 预算内完成任务。 Arora 和 Zanette 构建特定数据集,并使用强化学习奖励机制鼓励模型生成简洁、准确的输出,从而减少 token 用量。 TokenSkip 引入了一个可控框架,在经过剪枝的 CoT 路径上微调模型,使其能够在可调压缩比下选择性跳过冗余 token。
- 使用连续 token 替代。 这些方法探索使用连续空间中的 token,替代传统离散词表 token。 代表性方法 CoConut 利用课程学习,训练 LLM 使用连续 token 进行推理。
- 不使用 token。 通过将推理过程内化到模型层之间,模型在推理时直接生成最终答案,无需中间 token。
These three strategies are implemented after model training and do not require additional intervention during inference. Technically, the acceleration effect of these methods increases sequentially, but at the cost of a gradual decline in the generalization performance of LLMs. Additionally, the first strategy does not significantly reduce GPU memory usage.
这三种策略在模型训练完成后即可执行,推理过程中不需要额外干预。 从技术上看,这些方法的加速效果依次增强,但代价是 LLM 的泛化性能逐步下降。 此外,第一种策略并不能显著减少 GPU 内存用量。
Context Management. Unlike methods that focus on hardware-level optimization or simply shortening the generation length, context management dynamically reorganizes the information within the context window throughout the reasoning process. This approach is particularly critical for agents performing complex, long-horizon interactions. Specifically, MEM1 and MemAgent utilize reinforcement learning to maintain a fixed-size internal memory, allowing agents to handle long-term tasks by retaining essential information and discarding redundant data. ReSum addresses context constraints by periodically summarizing interaction histories, enabling agents to resume exploration from compact, state-based representations. Further advancing this paradigm, AgentFold and Context-Folding, introduce a “folding” mechanism that compresses detailed interaction histories into compact reasoning states. Compared to token-level KV-cache pruning, these semantic-level methods better preserve the task-critical logic required for complex reasoning scenarios.
上下文管理。 与关注硬件层面优化或单纯缩短生成长度的方法不同,上下文管理在整个推理过程中动态重组上下文窗口内的信息。 这一方法对于执行复杂长程交互的智能体尤为关键。 具体而言,MEM1 和 MemAgent 使用强化学习维持固定大小的内部记忆,使智能体通过保留关键信息、丢弃冗余数据来处理长期任务。 ReSum 通过定期总结交互历史来应对上下文约束,使智能体能够从紧凑的状态表示继续探索。 AgentFold 和 Context-Folding 进一步推进了这一范式,引入“折叠”机制,将详细交互历史压缩为紧凑的推理状态。 相比 token 级 KV 缓存剪枝,这些语义层面的方法能更好地保留复杂推理场景所需的关键任务逻辑。
8. Conclusion
In this paper, we present LightThinker, a new approach to enhance the efficiency of LLMs in complex reasoning tasks by dynamically compressing intermediate thoughts during generation. By training the LLM to learn when and how to compress verbose thought steps into compact representations, LightThinker significantly reduces memory overhead and computational costs while maintaining competitive accuracy. We introduce the Dependency (abbr., Dep) metric to quantify the degree of compression across different accelerating methods.
本文提出 LightThinker,一种通过在生成过程中动态压缩中间思维,来提高 LLM 复杂推理任务效率的新方法。 通过训练 LLM 学会何时以及如何将冗长思维步骤压缩为紧凑表示,LightThinker 在保持有竞争力的准确率的同时,显著降低了内存开销和计算成本。 我们引入 Dependency(简称 Dep)指标,量化不同加速方法的压缩程度。
Extensive experiments demonstrate that LightThinker is an effective approach to balancing efficiency and performance.
大量实验表明,LightThinker 是一种有效平衡效率与性能的方法。