Share Your Attention: Transformer Weight Sharing via Matrix-based Dictionary Learning
Not on the map. Why?
Abstract (arXiv)
Large language models have revolutionized AI applications, yet their high computational and memory demands hinder their widespread deployment. Existing compression techniques focus on intra-block optimizations (e.g., low-rank approximation or attention pruning), while the repetitive layered structure of transformers implies significant inter-block redundancy - a dimension largely unexplored beyond key-value (KV) caching. Inspired by dictionary learning in convolutional networks, we propose a framework for structured weight sharing across transformer layers. Our approach decomposes attention projection matrices (Q, K, V, O) into shared dictionary atoms, reducing the attention module's parameters by 66.7% while achieving on-par performance. Unlike complex methods requiring distillation or architectural changes, MASA (Matrix Atom Sharing in Attention) operates as a drop-in replacement-trained with standard optimizers - and represents each layer's weights as linear combinations of shared matrix atoms. Experiments across scales (100M-700M parameters) show that MASA achieves better benchmark accuracy and perplexity than GQA, low-rank baselines and recent Repeat-all-over/Sequential sharing at comparable parameter budgets. Ablation studies confirm robustness to the dictionary size and the efficacy of shared representations in capturing cross-layer statistical regularities. Extending to Vision Transformers (ViT), MASA matches performance metrics on image classification tasks with 66.7% fewer attention parameters. By combining dictionary learning strategies with transformer efficiency, MASA offers a scalable blueprint for parameter-efficient models without sacrificing performance. Finally, we investigate the possibility of employing MASA on large pretrained models to reduce their number of parameters without experiencing any significant drop in their performance.
Key facts. Cited by 5 papers in the map (data through 14 Oct 2026). Builds on 23 of its 35 references that are in the map. First posted on arXiv 6 Aug 2025.
Builds on
23 of 35 references.
References · 23
- 2017Attention Is All You Needcited by 60,361
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 14,132
- 2020Measuring Massive Multitask Language Understandingcited by 7,963
- 2020Scaling Laws for Neural Language Modelscited by 6,586
- 2018Think you have Solved Question Answering? Try ARC, the AI2 Reasoning Challengecited by 4,886
- 2023Mamba: Linear-Time Sequence Modeling with Selective State Spacescited by 4,718
- 2019HellaSwag: Can a Machine Really Finish Your Sentence?cited by 4,100
- 2022FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awarenesscited by 3,673
- 2022OPT: Open Pre-trained Transformer Language Modelscited by 3,512
- 2016Pointer Sentinel Mixture Modelscited by 3,096
- 2019PIQA: Reasoning about Physical Commonsense in Natural Languagecited by 2,883
- 2016The LAMBADA dataset: Word prediction requiring a broad discourse contextcited by 992
11 more
- 2017RACE: Large-scale ReAding Comprehension Dataset From Examinationscited by 861
- 2023RWKV: Reinventing RNNs for the Transformer Eracited by 827
- 2023The RefinedWeb Dataset for Falcon LLM: Outperforming Curated Corpora with Web Data, and Web Data Onlycited by 763
- 2018Universal Transformerscited by 647
- 2019Patient Knowledge Distillation for BERT Model Compressioncited by 508
- 2016Using the Output Embedding to Improve Language Modelscited by 272
- 2013Predicting Parameters in Deep Learningcited by 224
- 2024MobileLLM: Optimizing Sub-billion Parameter Language Models for On-Device Use Casescited by 223
- 2021Lessons on Parameter Sharing across Layers in Transformerscited by 85
- 2024Basis Sharing: Cross-Layer Parameter Sharing for Large Language Model Compressioncited by 35
- 2024Beyond KV Caching: Shared Attention for Efficient LLMscited by 10
Built on by
Citing papers per year: 2025: 1; 2026: 4.
5 papers.
- 2025CoSpaDi: Compressing LLMs via Calibration-Guided Sparse Dictionary Learningcited by 6
- 2026A Practical Tensor-Network Compression Pipeline for Production-Scale Large Language Modelscited by 3
- 2026ROCKET: Rapid Optimization via Calibration-guided Knapsack Enhanced Truncation for Efficient Model Compressioncited by 2
- 2026COMPOT: Calibration-Optimized Matrix Procrustes Orthogonalization for Transformers Compressioncited by 1
- 2026GeoPair: Geometry-Preserving Cross-Layer Factorization for Training-Free Transformer Compressioncited by 0
- 2026GeoPair: Geometry-Preserving Cross-Layer Factorization for Training-Free Transformer Compression22 Sep 2026
- 2026COMPOT: Calibration-Optimized Matrix Procrustes Orthogonalization for Transformers Compression16 Feb 2026
- 2026ROCKET: Rapid Optimization via Calibration-guided Knapsack Enhanced Truncation for Efficient Model Compression11 Feb 2026
- 2026A Practical Tensor-Network Compression Pipeline for Production-Scale Large Language Models2 Feb 2026
- 2025CoSpaDi: Compressing LLMs via Calibration-Guided Sparse Dictionary Learning26 Sep 2025