Research Papers 论文研究 19h ago Updated 18h ago 更新于 18小时前 49

Looped Latent Attention: Cross-Loop KV Compression for Looped Transformers 循环潜在注意力:循环Transformer的跨循环KV压缩

Looped Latent Attention (LLA) introduces a post-training cache codec that compresses K/V caches in weight-tied Transformers by exploiting the low-rank structure of recurrence steps. The method uses SVD initialization and KL/attention-output distillation to reconstruct loop-specific vectors on-demand, achieving up to 21.3x compression without performance loss. LLA significantly increases batch capacity (from 32 to 768 sequences at 4k context on H200) and improves reasoning accuracy on long math r 提出循环潜在注意力(LLA),一种针对权重共享Transformer的解码器缓存压缩技术,通过存储紧凑的K/V潜变量并在读取时重构来降低显存占用。 发现循环索引的KV缓存具有高度结构化特征,固定token、层和头部的K/V向量在循环轴上呈现低秩轨迹,而在头部和层轴上较为平坦。 LLA采用SVD初始化并结合KL散度和注意力输出蒸馏进行微调,在匹配缓存预算下优于MLA、跨层共享、KV量化及最终循环复用等基线方法。 实验显示在H200 GPU上,Ouro-1.4B模型在4k上下文长度下的批量处理能力从32提升至768个序列(21.3倍压缩),且数学推理任务准确率显著提升。

65
Hot 热度
75
Quality 质量
70
Impact 影响力

Analysis 深度分析

TL;DR

  • Looped Latent Attention (LLA) introduces a post-training cache codec that compresses K/V caches in weight-tied Transformers by exploiting the low-rank structure of recurrence steps.
  • The method uses SVD initialization and KL/attention-output distillation to reconstruct loop-specific vectors on-demand, achieving up to 21.3x compression without performance loss.
  • LLA significantly increases batch capacity (from 32 to 768 sequences at 4k context on H200) and improves reasoning accuracy on long math rollouts (MATH-500 score increase).
  • The approach demonstrates that recurrent caches are low-rank but not safely collapsible to a single state, requiring structured compression rather than simple sharing.

Why It Matters

This research addresses a critical bottleneck in efficient Transformer deployment: memory overhead during autoregressive decoding. By enabling high compression ratios for weight-tied models, LLA allows practitioners to run larger batches or longer contexts on existing hardware, directly impacting cost-efficiency and scalability for inference-heavy applications.

Technical Details

  • Mechanism: LLA stores compact K and V latents instead of full loop-indexed caches, reconstructing specific vectors only when attention requires them.
  • Compression Modes: Default per-head codec compresses recurrence; LLA-2D folds heads into one latent for extreme compression regimes.
  • Training: Codec initialized via SVD of teacher activations and refined using KL divergence and attention-output distillation.
  • Performance: Outperforms head-axis MLA, cross-layer sharing, KV quantization, and final-loop reuse at matched cache budgets. Near-lossless compression up to 32x observed on Huginn-3.5B.
  • Hardware Impact: On an H200 GPU, increased batch capacity from 32 to 768 sequences at 4k context length with 21.3x compression.

Industry Insight

  • Efficiency Gains: Organizations deploying weight-tied or recurrent Transformer variants can significantly reduce VRAM requirements, enabling higher throughput without hardware upgrades.
  • Long-Context Viability: The ability to maintain performance over long rollouts (e.g., math reasoning) suggests LLA is particularly valuable for complex, multi-step inference tasks where context window limits are often hit.
  • Post-Training Applicability: Since LLA is a post-training codec, it offers a low-friction path for optimizing existing models without retraining from scratch, accelerating adoption in production environments.

TL;DR

  • 提出循环潜在注意力(LLA),一种针对权重共享Transformer的解码器缓存压缩技术,通过存储紧凑的K/V潜变量并在读取时重构来降低显存占用。
  • 发现循环索引的KV缓存具有高度结构化特征,固定token、层和头部的K/V向量在循环轴上呈现低秩轨迹,而在头部和层轴上较为平坦。
  • LLA采用SVD初始化并结合KL散度和注意力输出蒸馏进行微调,在匹配缓存预算下优于MLA、跨层共享、KV量化及最终循环复用等基线方法。
  • 实验显示在H200 GPU上,Ouro-1.4B模型在4k上下文长度下的批量处理能力从32提升至768个序列(21.3倍压缩),且数学推理任务准确率显著提升。

为什么值得看

本文揭示了循环Transformer中KV缓存的低秩特性,为突破长上下文推理的显存瓶颈提供了新的后训练压缩思路。其提出的LLA方法在不增加参数量的情况下大幅提升了吞吐量,对优化高效Transformer部署具有重要参考价值。

技术解析

  • 核心机制:LLA是一种后训练缓存编解码器,不改变模型权重,而是将循环步骤中的K/V向量压缩为紧凑潜变量,仅在注意力计算时按需重构,实现了精确的缓存缩减。
  • 架构设计:默认版本按头部编码循环维度,LLA-2D变体进一步将头部折叠进单一潜变量以实现极端压缩。初始化基于教师激活值的SVD分解,并通过KL散度和注意力输出蒸馏进行细化。
  • 性能表现:在Ouro-2.6B-Thinking和Huginn-3.5B模型上验证,SVD编解码器在解码器独立评估中保持近无损状态,压缩比可达32倍。在MATH-500任务上,通过策略微调将4x上下文下的准确率从0.43提升至0.66。
  • 对比优势:相比多头注意力(MLA)、跨层共享、KV量化和仅复用最后一个循环状态等方法,LLA在相同缓存预算下表现出更优的性能,证明循环缓存虽具低秩性但不可安全地坍缩为单一状态。

行业启示

  • 显存优化新路径:对于采用权重共享或循环结构的Transformer,KV缓存压缩是提升吞吐量的关键杠杆,后训练编解码技术可能成为标准优化组件。
  • 长上下文推理效率:通过利用缓存的结构化低秩特性,可在不牺牲精度的前提下显著扩展有效上下文长度,降低大规模推理成本。
  • 部署策略调整:开发者应关注模型内部状态的相关性结构,针对特定轴(如循环步数)进行降维处理,而非均匀量化所有缓存数据,以实现更高效的资源分配。

Disclaimer: The above content is generated by AI and is for reference only. 免责声明:以上内容由 AI 生成,仅供参考。

Inference 推理 Research 科学研究 Optimization Optimization