arXiv:2501.13629cs.CL2025-01被引 3

通过差异化压缩查询键值提升推理效率,专为系统领域优化的语言模型。

Sigma: Differential Rescaling of Query, Key and Value for Efficient Language Models

  • 针对查询、键、值分别设计压缩策略,提升注意力机制效率。
  • 长上下文下推理速度比传统分组查询快33.36%,系统领域性能超越GPT-4达52.5%。
  • 适用于系统编程、代码生成等对效率与领域精度要求高的场景。

我们提出Sigma,一个专为系统领域优化的高效大语言模型,采用新型架构DiffQKV注意力机制,并在精心收集的系统领域数据上进行预训练。DiffQKV注意力通过根据查询(Q)、键(K)、值(V)对模型性能和效率的不同影响,对三者进行差异化优化,显著提升推理效率。具体而言:(1)通过大量实验发现模型对K和V压缩的敏感度不同,据此提出差异化压缩的KV方案;(2)通过扩展查询头维度增强表示能力,对推理速度影响极小。理论与实证分析表明,该方法在长上下文场景中相比传统分组查询注意力(GQA)推理速度最高提升33.36%。我们使用6T tokens进行预训练,其中包含195亿个系统领域数据和1T合成重写数据。在通用领域,Sigma表现接近当前最优模型;在系统领域,我们构建首个全面基准测试AIMicius,Sigma在所有任务中均表现卓越,最高达52.5%超越GPT-4。

原文摘要 · Abstract (English)

We introduce Sigma, an efficient large language model specialized for the system domain, empowered by a novel architecture including DiffQKV attention, and pre-trained on our meticulously collected system domain data. DiffQKV attention significantly enhances the inference efficiency of Sigma by optimizing the Query (Q), Key (K), and Value (V) components in the attention mechanism differentially, based on their varying impacts on the model performance and efficiency indicators. Specifically, we (1) conduct extensive experiments that demonstrate the model's varying sensitivity to the compression of K and V components, leading to the development of differentially compressed KV, and (2) propose augmented Q to expand the Q head dimension, which enhances the model's representation capacity with minimal impacts on the inference speed. Rigorous theoretical and empirical analyses reveal that DiffQKV attention significantly enhances efficiency, achieving up to a 33.36% improvement in inference speed over the conventional grouped-query attention (GQA) in long-context scenarios. We pre-train Sigma on 6T tokens from various sources, including 19.5B system domain data that we carefully collect and 1T tokens of synthesized and rewritten data. In general domains, Sigma achieves comparable performance to other state-of-arts models. In the system domain, we introduce the first comprehensive benchmark AIMicius, where Sigma demonstrates remarkable performance across all tasks, significantly outperforming GPT-4 with an absolute improvement up to 52.5%.

语言模型注意力机制系统领域推理效率

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