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

GQA: обучение обобщённых трансформерных моделей с grouped-query attention на основе чекпоинтов с многоголовым вниманием
Joshua Ainslie, James Lee-Thorp, Michiel de Jong, Yury Zemlyanskiy, Federico Lebrón, Sumit Sanghai
2023-01-01

decoder inference speedupgrouped-query attentionmulti-query attentionpre-training compute savingsuptraining from multi-head checkpoints
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.
1
A recipe is proposed to uptrain existing multi-head language model checkpoints into models with multi-query attention (MQA) using only 5% of the original pre-training compute.
2
Grouped-query attention (GQA) is introduced as a generalization of MQA that uses an intermediate number of key-value heads (more than one, fewer than the number of query heads).
3
The uptraining approach enables converting models to faster inference formats (MQA/GQA) without training separate models from scratch.
4
Uptrained GQA models achieve quality close to multi-head attention while having inference speed comparable to MQA.

Transformer decoder language models (multi-head, multi-query, and grouped-query attention variants) derived from multi-head checkpoints

Methods for uptraining multi-head checkpoints into multi-query and grouped-query attention models using minimal additional pretraining compute, and evaluation of resulting trade-offs between inference speed and quality compared to multi-head attention

Publication Details
Publication Date
2023-01-01
Journal
Publisher
ISSN
Cited by
388
Access Type
Author Information
Authors
Joshua Ainslie
James Lee-Thorp
Michiel de Jong
Yury Zemlyanskiy
Federico Lebrón
Sumit Sanghai
Explore further
Open the scid.ai AI chat with a ready-made request: it will find papers on a similar topic and help build a literature review.
Find similar papers in the chat
Make a presentation
100%