arXiv:2505.16552cs.CL2025-05NeurIPS被引 86

让大模型推理更快更省:通过动态压缩隐空间推理链提升效率

Think Silently, Think Fast: Dynamic Latent Compression of LLM Reasoning Chains

  • 在隐空间动态压缩推理过程,用随机压缩因子合并连续词元嵌入
  • 相比显式推理链减少53.3%长度,仅损失4.8%性能,数学推理准确率高14.1%
  • 支持推理速度按需调节,适合对效率敏感的实时推理场景

大型语言模型(LLMs)通过思维链(Chain-of-Thought, CoT)推理取得优异表现,但其基于词元的推理链计算开销大且效率低。本文提出压缩隐空间推理(Compressed Latent Reasoning, CoLaR),一种通过两阶段训练实现推理过程动态压缩的新框架。首先,在监督微调中,CoLaR扩展了下一词元预测任务,引入辅助的下一压缩嵌入预测目标;通过从预定义范围随机采样的压缩因子合并连续词元嵌入,并训练专用隐空间头以预测后续压缩嵌入分布。其次,利用隐空间头的非确定性,通过强化学习(RL)探索多样化推理路径并挖掘更紧凑路径。该方法实现:一是在密集隐空间进行推理(即‘静默’推理),显著缩短推理链长度;二是推理时可灵活调整速度,只需提示期望压缩因子。在四个数学推理数据集上的实验证明,CoLaR在相近压缩比下比基线方法准确率高14.1%,推理链长度减少53.3%,仅损失4.8%性能;应用于更复杂任务时,性能最高提升5.4%,隐空间推理链长度减少82.8%。

原文摘要 · Abstract (English)

Large Language Models (LLMs) achieve superior performance through Chain-of-Thought (CoT) reasoning, but these token-level reasoning chains are computationally expensive and inefficient. In this paper, we introduce Compressed Latent Reasoning (CoLaR), a novel framework that dynamically compresses reasoning processes in latent space through a two-stage training approach. First, during supervised fine-tuning, CoLaR extends beyond next-token prediction by incorporating an auxiliary next compressed embedding prediction objective. This process merges embeddings of consecutive tokens using a compression factor randomly sampled from a predefined range, and trains a specialized latent head to predict distributions of subsequent compressed embeddings. Second, we enhance CoLaR through reinforcement learning (RL) that leverages the latent head's non-deterministic nature to explore diverse reasoning paths and exploit more compact ones. This approach enables CoLaR to: i) perform reasoning at a dense latent level (i.e., silently), substantially reducing reasoning chain length, and ii) dynamically adjust reasoning speed at inference time by simply prompting the desired compression factor. Extensive experiments across four mathematical reasoning datasets demonstrate that CoLaR achieves 14.1% higher accuracy than latent-based baseline methods at comparable compression ratios, and reduces reasoning chain length by 53.3% with only 4.8% performance degradation compared to explicit CoT method. Moreover, when applied to more challenging mathematical reasoning tasks, our RL-enhanced CoLaR demonstrates performance gains of up to 5.4% while dramatically reducing latent reasoning chain length by 82.8%.

推理压缩隐空间强化学习大模型效率

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。