GQA:从多头检查点训练通用多查询 Transformer 模型

GQA: Training Generalized Multi-Query Transformer Models from Multi-Head Checkpoints

约书亚·安斯利 Joshua Ainslie · Google · 2023-05-22 · arXiv:2305.13245 ↗ · 被引 1533

打开互动全文版(逐段中英对照 + 图/公式 + 论文问答)→

摘要 · Abstract

多查询注意力(MQA)仅使用单个键值头,大幅加速了解码器推理。然而,MQA 可能导致质量下降,而且仅为加速推理而单独训练模型可能并不理想。我们(1)提出了一种方法,利用原始预训练计算的 5%将现有的多头语言模型检查点微调为具有 MQA 的模型;(2)引入了分组查询注意力(GQA),这是多查询注意力的一种泛化,使用中间数量(多于一个,少于查询头数)的键值头。我们表明,微调后的 GQA 在质量上接近多头注意力,同时速度与 MQA 相当。

Multi-query attention (MQA), which only uses a single key-value head, drastically speeds up decoder inference. However, MQA can lead to quality degradation, and moreover it may not be desirable to train a separate model just for faster inference. We (1) propose a recipe for uptraining existing multi-head language model checkpoints into models with MQA using 5% of original pre-training compute, and (2) introduce grouped-query attention (GQA), a generalization of multi-query attention which uses an intermediate (more than one, less than number of query heads) number of key-value heads. We show that uptrained GQA achieves quality close to multi-head attention with comparable speed to MQA.

核心贡献 · Key contributions

局限 · Limitations

论文章节 · Sections(共 10)

阅读逐段中英对照全文 →