2025-02-24 · 进阶 · 自然语言处理 · 机器学习

LightThinker: Thinking Step-by-Step Compression

LightThinker通过动态压缩中间思维步骤,有效降低了大型语言模型在复杂推理任务中的内存和计算成本,同时保持竞争力。

更新于 2025-02-24。作者:Jintian Zhang、Yuqi Zhu、Mengshu Sun、Yujie Luo、Shuofei Qiao、Lun Du、Da Zheng、Huajun Chen、Ningyu Zhang。

中文摘要

大型语言模型(LLMs)在复杂推理任务中表现出色,但它们的效率受到生成长序列标记所伴随的大量内存和计算成本的制约。在本文中,我们提出了一种名为LightThinker的新方法,该方法使LLMs能够在推理过程中动态压缩中间思想。LightThinker受人类认知过程的启发,将冗长的思维步骤压缩成紧凑的表示形式,并丢弃原始的推理链,从而显著减少存储在上下文窗口中的标记数量。这是通过在数据构建时训练模型何时以及如何进行压缩,将隐藏状态映射到浓缩的要点标记,并创建专门的注意力掩码来实现的。此外,我们引入了依赖(Dep)指标来量化压缩程度,通过测量生成过程中对历史标记的依赖性来衡量。在四个数据集和两种模型上的大量实验表明,LightThinker降低了峰值内存使用量和推理时间,同时保持了有竞争力的准确率。我们的工作为在不牺牲性能的情况下提高LLMs在复杂推理任务中的效率提供了新的方向。代码将在https://github.com/zjunlp/LightThinker上发布。

英文摘要

Large language models (LLMs) have shown remarkable performance in complex reasoning tasks, but their efficiency is hindered by the substantial memory and computational costs associated with generating lengthy tokens. In this paper, we propose LightThinker, a novel method that enables LLMs to dynamically compress intermediate thoughts during reasoning. Inspired by human cognitive processes, LightThinker compresses verbose thought steps into compact representations and discards the original reasoning chains, thereby significantly reducing the number of tokens stored in the context window. This is achieved by training the model on when and how to perform compression through data construction, mapping hidden states to condensed gist tokens, and creating specialized attention masks. Additionally, we introduce the Dependency (Dep) metric to quantify the degree of compression by measuring the reliance on historical tokens during generation. Extensive experiments on four datasets and two models show that LightThinker reduces peak memory usage and inference time, while maintaining competitive accuracy. Our work provides a new direction for improving the efficiency of LLMs in complex reasoning tasks without sacrificing performance. Code will be released at https://github.com/zjunlp/LightThinker.

解读

一句话总结

LightThinker通过动态压缩中间思维步骤,有效降低了大型语言模型在复杂推理任务中的内存和计算成本,同时保持竞争力。

问题1:这篇论文想要解决什么具体问题?

问题2:论文的核心创新点是什么?

问题3:实验结果如何验证了方法的有效性?

问题4:这个研究的实际应用价值是什么?

来源

机器可读索引:llms.txt