Optimised Grouped-Query Attention Mechanism for Transformers

Yuang Chen, Cheng Zhang, Xitong Gao, Robert D. Mullins, George A. Constantinides +1 more
6/21/2024
cs.LG

No confident code implementation found for this paper.

Abstract

Grouped-query attention (GQA) has been widely adopted in LLMs to mitigate the complexity of multi-head attention (MHA). To transform an MHA to a GQA, neighbour queries in MHA are evenly split into groups where each group shares the value and key layers. In this work, we propose AsymGQA, an activation-informed approach to asymmetrically grouping an MHA to a GQA for better model performance. Our AsymGQA outperforms the GQA within the same model size budget. For example, AsymGQA LLaMA-2-7B has an accuracy increase of 7.5% on MMLU compared to neighbour grouping. Our approach addresses the GQA's trade-off problem between model performance and hardware efficiency.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{chen2024optimised,
  title  = {Optimised Grouped-Query Attention Mechanism for Transformers},
  author = {Yuang Chen and Cheng Zhang and Xitong Gao and Robert D. Mullins and George A. Constantinides and Yiren Zhao},
  year   = {2024},
  eprint = {2406.14963},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2406.14963v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2406.14963.svg)](https://codeofpaper.com/paper/2406.14963)

Discussion