paper-with-me

홈 › Papers

QCQA: Quality and Capacity-aware grouped Query Attention

2024-06-08 · Vinay Joshi, Prashant Laddha, Shambhavi Sinha, Om Ji Omer, Sreenivas Subramoney

Excessive memory requirements of key and value features (KV-cache) present significant challenges in the autoregressive inference of large language models (LLMs), restricting both the speed and length of text generation. Approaches such as Multi-Query Attention (MQA) and Grouped Query Attention (GQA) mitigate these challenges by grouping query heads and consequently reducing the number of corresponding key and value heads. However, MQA and GQA decrease the KV-cache size requirements at the expense of LLM accuracy (quality of text generation). These methods do not ensure an optimal tradeoff between KV-cache size and text generation quality due to the absence of quality-aware grouping of query heads. To address this issue, we propose Quality and Capacity-Aware Grouped Query Attention (QCQA), which identifies optimal query head groupings using an evolutionary algorithm with a computationally efficient and inexpensive fitness function. We demonstrate that QCQA achieves a significantly better tradeoff between KV-cache capacity and LLM accuracy compared to GQA. For the Llama2 $7\,$B model, QCQA achieves $\mathbf{20}$\% higher accuracy than GQA with similar KV-cache size requirements in the absence of fine-tuning. After fine-tuning both QCQA and GQA, for a similar KV-cache size, QCQA provides $\mathbf{10.55}\,$\% higher accuracy than GQA. Furthermore, QCQA requires $40\,$\% less KV-cache size than GQA to attain similar accuracy. The proposed quality and capacity-aware grouping of query heads can serve as a new paradigm for KV-cache optimization in autoregressive LLM inference.

📄 PDF Abstract BibTeX arXiv:2406.10247

Code (0)

등록된 구현이 없습니다.

Tasks

Text Generation

Methods 이 논문이 사용한 방법론

SPEED The monocular depth estimation (MDE) is the task of estimating depth from a single frame. This information is an essential knowledge in many computer vision tasks such as scene…
Multi-Query Attention 설명 없음

Similar Papers 제목 키워드 기반

Knocking-Heads Attention

2025-10-27 · Zhanchao Zhou, Xiaodong Chen, Haoxing Chen, Zhenzhong Lan 외 arxiv

Multi-head attention (MHA) has become the cornerstone of modern large language models, enhancing representational capacity through parallel attention heads. However, increasing the number of heads inherently weakens indi…

Hardware-Efficient Attention for Fast Decoding

2025-05-27 · Ted Zadouri, Hubert Strauss, Tri Dao

LLM decoding is bottlenecked for large batches and long contexts by loading the key-value (KV) cache from high-bandwidth memory, which inflates per-token latency, while the sequential nature of decoding limits parallelis…

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

2023-05-22 · Joshua Ainslie, James Lee-Thorp, Michiel de Jong, Yury Zemlyanskiy 외

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 …

DecoderLanguage ModelingLanguage Modelling

Groupwise Query Specialization and Quality-Aware Multi-Assignment for Transformer-based Visual Relationship Detection

2024-03-26 · CVPR 2024 1 · Jongha Kim, Jihwan Park, Jinyoung Park, Jinyoung Kim 외

Visual Relationship Detection (VRD) has seen significant advancements with Transformer-based architectures recently. However, we identify two key limitations in a conventional label assignment for training Transformer-ba…

RelationRelationship DetectionScene Graph GenerationVisual Relationship Detection

PaQ-DETR: Learning Pattern and Quality-Aware Dynamic Queries for Object Detection

2026-03-06 · Zhengjian Kang, Jun Zhuang, Kangtong Mo, Qi Chen 외 arxiv

Detection Transformer (DETR) has redefined object detection by casting it as a set prediction task within an end-to-end framework. Despite its elegance, DETR and its variants still rely on fixed learnable queries and suf…

Object Detection