mlsanityData to 7 Oct 2026

Primer: Searching for Efficient Transformers for Language Modeling

arXiv 2109.08668 ↗First posted 17 Sep 2021cs.LG cs.AI cs.CLcited by 162

Not on the map. Why?

Abstract (arXiv)

Large Transformer models have been central to recent advances in natural language processing. The training and inference costs of these models, however, have grown rapidly and become prohibitively expensive. Here we aim to reduce the costs of Transformers by searching for a more efficient variant. Compared to previous approaches, our search is performed at a lower level, over the primitives that define a Transformer TensorFlow program. We identify an architecture, named Primer, that has a smaller training cost than the original Transformer and other variants for auto-regressive language modeling. Primer's improvements can be mostly attributed to two simple modifications: squaring ReLU activations and adding a depthwise convolution layer after each Q, K, and V projection in self-attention. Experiments show Primer's gains over Transformer increase as compute scale grows and follow a power law with respect to quality at optimal model sizes. We also verify empirically that Primer can be dropped into different codebases to significantly speed up training without additional tuning. For example, at a 500M parameter size, Primer improves the original T5 architecture on C4 auto-regressive language modeling, reducing the training cost by 4X. Furthermore, the reduced training cost means Primer needs much less compute to reach a target one-shot performance. For instance, in a 1.9B parameter configuration similar to GPT-3 XL, Primer uses 1/3 of the training compute to achieve the same one-shot performance as Transformer. We open source our models and several comparisons in T5 to help with reproducibility.

Key facts. Cited by 162 papers in the map (data through 7 Oct 2026). Builds on 48 of its 60 references that are in the map. First posted on arXiv 17 Sep 2021.

Builds on

48 of 60 references.

References · 48

  1. 2017Attention Is All You Needcited by 59,932
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  3. 2020Language Models are Few-Shot Learnerscited by 32,199
  4. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  5. 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
  6. 2019EfficientNet: Rethinking Model Scaling for Convolutional Neural Networkscited by 6,415
  7. 2020Scaling Laws for Neural Language Modelscited by 6,411
  8. 2016Layer Normalizationcited by 5,579
  9. 2021Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsitycited by 3,014
  10. 2014Sequence to Sequence Learning with Neural Networkscited by 2,974
  11. 2019XLNet: Generalized Autoregressive Pretraining for Language Understandingcited by 2,801
  12. 2018SentencePiece: A simple and language independent subword tokenizer and detokenizer for Neural Text Processingcited by 1,973
36 more
  1. 2020Conformer: Convolution-augmented Transformer for Speech Recognitioncited by 1,838
  2. 2020GLU Variants Improve Transformercited by 1,724
  3. 2019Root Mean Square Layer Normalizationcited by 1,425
  4. 2020Making Pre-trained Language Models Better Few-shot Learnerscited by 1,255
  5. 2018Self-Attention with Relative Position Representationscited by 1,112
  6. 2021CvT: Introducing Convolutions to Vision Transformerscited by 946
  7. 2018MnasNet: Platform-Aware Neural Architecture Search for Mobilecited by 937
  8. 2020On Layer Normalization in the Transformer Architecturecited by 906
  9. 2018Regularized Evolution for Image Classifier Architecture Searchcited by 902
  10. 2018Adafactor: Adaptive Learning Rates with Sublinear Memory Costcited by 896
  11. 2019Compressive Transformers for Long-Range Sequence Modellingcited by 699
  12. 2016Hyperband: A Novel Bandit-Based Approach to Hyperparameter Optimizationcited by 688
  13. 2016Language Modeling with Gated Convolutional Networkscited by 688
  14. 2020It's Not Just Size That Matters: Small Language Models Are Also Few-Shot Learnerscited by 668
  15. 2018ProxylessNAS: Direct Neural Architecture Search on Target Task and Hardwarecited by 666
  16. 2021Carbon Emissions and Large Neural Network Trainingcited by 561
  17. 2020Towards a Human-like Open-Domain Chatbotcited by 467
  18. 2017Large-Scale Evolution of Image Classifierscited by 348
  19. 2013One Billion Word Benchmark for Measuring Progress in Statistical Language Modelingcited by 302
  20. 2019Random Search and Reproducibility for Neural Architecture Searchcited by 253
  21. 2016Dense Associative Memory for Pattern Recognitioncited by 230
  22. 2018Adaptive Input Representations for Neural Language Modelingcited by 226
  23. 2020Synthesizer: Rethinking Self-Attention in Transformer Modelscited by 204
  24. 2015Semi-supervised Sequence Learningcited by 198
  25. 2017Hierarchical Representations for Efficient Architecture Searchcited by 188
  26. 2019The Evolved Transformercited by 180
  27. 2018QANet: Combining Local Convolution with Global Self-Attention for Reading Comprehensioncited by 164
  28. 2018Efficient Multi-objective Neural Architecture Search via Lamarckian Evolutioncited by 151
  29. 2020AutoML-Zero: Evolving Machine Learning Algorithms From Scratchcited by 137
  30. 2021Entailment as Few-Shot Learnercited by 122
  31. 2019Evaluating the Search Phase of Neural Architecture Searchcited by 120
  32. 2021Do Transformer Modifications Transfer Across Implementations and Applications?cited by 87
  33. 2019Lingvo: a Modular and Scalable Framework for Sequence-to-Sequence Modelingcited by 86
  34. 2018Tensor2Tensor for Neural Machine Translationcited by 85
  35. 2020Can weight sharing outperform random architecture search? An investigation with TuNAScited by 68
  36. 2020Evolving Normalization-Activation Layerscited by 45

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2021: 5; 2022: 35; 2023: 32; 2024: 28; 2025: 30; 2026: 32.

162 papers.

Sort:

By area:

  1. 2022Flamingo: a Visual Language Model for Few-Shot Learningcited by 4,337
  2. 2022Scaling Instruction-Finetuned Language Modelscited by 2,997
  3. 2022Fast Inference from Transformers via Speculative Decodingcited by 1,615
  4. 2023RWKV: Reinventing RNNs for the Transformer Eracited by 814
  5. 2022ST-MoE: Designing Stable and Transferable Sparse Expert Modelscited by 391
  6. 2023SqueezeLLM: Dense-and-Sparse Quantizationcited by 285
  7. 2022Zero-Shot Video Question Answering via Frozen Bidirectional Language Modelscited by 229
  8. 2021Efficient Training of Audio Transformers with Patchoutcited by 222
  9. 2023Multimodal C4: An Open, Billion-scale Corpus of Images Interleaved with Textcited by 208
  10. 2022Transformer Quality in Linear Timecited by 189
  11. 2022The Carbon Footprint of Machine Learning Training Will Plateau, Then Shrinkcited by 183
  12. 2022Mega: Moving Average Equipped Gated Attentioncited by 178
38 more
  1. 2023Speculative Decoding with Big Little Decodercited by 163
  2. 2022Compute Trends Across Three Eras of Machine Learningcited by 161
  3. 2022A Fast Post-Training Pruning Framework for Transformerscited by 161
  4. 2023Neural Architecture Search: Insights from 1000 Paperscited by 136
  5. 2022MetaFormer Baselines for Visioncited by 131
  6. 2023EvoPrompting: Language Models for Code-Level Neural Architecture Searchcited by 129
  7. 2024Transformers are Multi-State RNNscited by 120
  8. 2021The Efficiency Misnomercited by 98
  9. 2025NVIDIA Nemotron Nano 2: An Accurate and Efficient Hybrid Mamba-Transformer Reasoning Modelcited by 94
  10. 2025Nemotron-H: A Family of Accurate and Efficient Hybrid Mamba-Transformer Modelscited by 88
  11. 2021NormFormer: Improved Transformer Pretraining with Extra Normalizationcited by 83
  12. 2024Transformers Can Achieve Length Generalization But Not Robustlycited by 82
  13. 2022Cramming: Training a Language Model on a Single GPU in One Daycited by 81
  14. 2023Full Stack Optimization of Transformer Inference: a Surveycited by 79
  15. 2023MatFormer: Nested Transformer for Elastic Inferencecited by 79
  16. 2022Tranception: protein fitness prediction with autoregressive transformers and inference-time retrievalcited by 78
  17. 2023OtterHD: A High-Resolution Multi-modality Modelcited by 72
  18. 2023Conditional Adapters: Parameter-efficient Transfer Learning with Fast Inferencecited by 69
  19. 2025Don't be lazy: CompleteP enables compute-efficient deep transformerscited by 69
  20. 2024ReLU2 Wins: Discovering Efficient Activation Functions for Sparse LLMscited by 66
  21. 2025Dion: Distributed Orthonormalized Updatescited by 64
  22. 2024Model Compression and Efficient Inference for Large Language Models: A Surveycited by 62
  23. 2022General-purpose, long-context autoregressive modeling with Perceiver ARcited by 60
  24. 2022VeLO: Training Versatile Learned Optimizers by Scaling Upcited by 57
  25. 2024Mechanistic Design and Scaling of Hybrid Architecturescited by 57
  26. 2024Training-Free Activation Sparsity in Large Language Modelscited by 51
  27. 2025Baichuan-M1: Pushing the Medical Capability of Large Language Modelscited by 41
  28. 2022Machine Learning Model Sizes and the Parameter Gapcited by 39
  29. 2022Compute-Efficient Deep Learning: Algorithmic Trends and Opportunitiescited by 38
  30. 2023A Survey of Techniques for Optimizing Transformer Inferencecited by 35
  31. 2021NLP From Scratch Without Large-Scale Pretraining: A Simple and Efficient Frameworkcited by 34
  32. 2023AutoML in the Age of Large Language Models: Current Challenges, Future Opportunities and Riskscited by 34
  33. 2025Scaling Behavior of Discrete Diffusion Language Modelscited by 32
  34. 2025Physics of Language Models: Part 4.1, Architecture Design and the Magic of Canon Layerscited by 32
  35. 2023Brainformers: Trading Simplicity for Efficiencycited by 31
  36. 2024Multi-Candidate Speculative Decodingcited by 30
  37. 2023Prismer: A Vision-Language Model with Multi-Task Expertscited by 28
  38. 2023Gradient-Free Structured Pruning with Unlabeled Datacited by 26

50 most cited of 162 All 162 (JSON)