paper-with-me

Papers

MoA: Mixture of Sparse Attention for Automatic Large Language Model Compression

2024-06-21 · Tianyu Fu, Haofeng Huang, Xuefei Ning, Genghan Zhang, Boju Chen, Tianqi Wu, Hongyi Wang, Zixiao Huang, Shiyao Li, Shengen Yan, Guohao Dai, Huazhong Yang, Yu Wang

Sparse attention can effectively mitigate the significant memory and throughput demands of Large Language Models (LLMs) in long contexts. Existing methods typically employ a uniform sparse attention mask, applying the same sparse pattern across different attention heads and input lengths. However, this uniform approach fails to capture the diverse attention patterns inherent in LLMs, ignoring their distinct accuracy-latency trade-offs. To address this challenge, we propose the Mixture of Attention (MoA), which automatically tailors distinct sparse attention configurations to different heads and layers. MoA constructs and navigates a search space of various attention patterns and their scaling rules relative to input sequence lengths. It profiles the model, evaluates potential configurations, and pinpoints the optimal sparse attention compression plan. MoA adapts to varying input sizes, revealing that some attention heads expand their focus to accommodate longer sequences, while other heads consistently concentrate on fixed-length local contexts. Experiments show that MoA increases the effective context length by $3.9\times$ with the same average attention span, boosting retrieval accuracy by $1.5-7.1\times$ over the uniform-attention baseline across Vicuna-{7B,13B}, and Llama3-{8B,70B} models. Moreover, MoA narrows the capability gaps between sparse and dense models, reducing the maximum relative performance drop from $9\%-36\%$ to within $5\%$ across two long-context understanding benchmarks. MoA achieves a $1.2-1.4\times$ GPU memory reduction, boosting decode throughput by $6.6-8.2\times$ and $1.7-1.9\times$ compared to FlashAttention2 and vLLM, with minimal impact on performance. Our code is available at \url{https://github.com/thu-nics/MoA}.

📄 PDF Abstract BibTeX arXiv:2406.14909

Code (1)

thu-nics/moa 공식 구현 pytorch

Tasks

GPULanguage ModelingLanguage ModellingLarge Language ModelLong-Context UnderstandingModel Compression

Methods 이 논문이 사용한 방법론

Softmax The Softmax output function transforms a previous layer's output into a vector of probabilities. It is commonly used for multiclass classification. Given an input vector $x$…
Attention 설명 없음
Focus 설명 없음

Similar Papers 제목 키워드 기반

Mixture of Attention Heads: Selecting Attention Heads Per Token

2022-10-11 · Xiaofeng Zhang, Yikang Shen, Zeyu Huang, Jie zhou 외

Mixture-of-Experts (MoE) networks have been proposed as an efficient way to scale up model capacity and implement conditional computing. However, the study of MoE components mostly focused on the feedforward layer in Tra…

Computational EfficiencyLanguage ModelingLanguage ModellingMachine Translation+2

Mixture of Sparse Attention: Content-Based Learnable Sparse Attention via Expert-Choice Routing

2025-05-01 · Piotr Piękos, Róbert Csordás, Jürgen Schmidhuber

Recent advances in large language models highlighted the excessive quadratic cost of self-attention. Despite the significant research efforts, subquadratic attention methods still suffer from inferior performance in prac…

Mixture-of-Experts

A.X K2 Technical Report

2026-08-31 · Cheolseung Baek, Dhammiko Arya, Eunki Kim, Gun Song 외 arxiv

We introduce A.X K2, a 688B-parameter Mixture-of-Experts (MoE) language model trained from scratch as a high-performance foundation for \emph{agentic} applications. Trained on approximately 8.5T tokens---fewer than its p…

Learning Attentional Mixture of LoRAs for Language Model Continual Learning

2024-09-29 · Jialin Liu, Jianhua Wu, Jie Liu, Yutai Duan

Fine-tuning large language models (LLMs) with Low-Rank adaption (LoRA) is widely acknowledged as an effective approach for continual learning for new tasks. However, it often suffers from catastrophic forgetting when dea…

Continual LearningLanguage ModelingLanguage Modelling

Balanced and Elastic End-to-end Training of Dynamic LLMs

2025-05-20 · Mohamed Wahib, Muhammed Abdullah Soyturk, Didem Unat

To reduce computational and memory costs in Large Language Models (LLMs), dynamic workload reduction schemes like Mixture of Experts (MoEs), parameter pruning, layer freezing, sparse attention, early token exit, and Mixt…

GPUMixture-of-Experts