mlsanityData to 7 Oct 2026

Transformer tricks: Precomputing the first layer

arXiv 2402.13388 ↗First posted 20 Feb 2024cs.LGcited by 3

Not on the map. Why?

Abstract (arXiv)

This micro-paper describes a trick to speed up inference of transformers with RoPE (such as LLaMA, Mistral, PaLM, and Gemma). For these models, a large portion of the first transformer layer can be precomputed, which results in slightly lower latency and lower cost-per-token. Because this trick optimizes only one layer, the relative savings depend on the total number of layers. For example, the maximum savings for a model with only 4 layers (such as Whisper tiny) is limited to 25%, while a 32-layer model is limited to 3% savings. See https://github.com/OpenMachine-ai/transformer-tricks for code and more transformer tricks.

Key facts. Cited by 3 papers in the map (data through 7 Oct 2026). Builds on 12 of its 17 references that are in the map. First posted on arXiv 20 Feb 2024.

Builds on

12 of 17 references.

References · 12

  1. 2017Attention Is All You Needcited by 59,932
  2. 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
  3. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
  4. 2022PaLM: Scaling Language Modeling with Pathwayscited by 5,304
  5. 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,581
  6. 2022Robust Speech Recognition via Large-Scale Weak Supervisioncited by 3,972
  7. 2023Pythia: A Suite for Analyzing Large Language Models Across Training and Scalingcited by 1,734
  8. 2020GLU Variants Improve Transformercited by 1,724
  9. 2023GQA: Training Generalized Multi-Query Transformer Models from Multi-Head Checkpointscited by 1,311
  10. 2020On Layer Normalization in the Transformer Architecturecited by 906
  11. 2019Fast Transformer Decoding: One Write-Head is All You Needcited by 700
  12. 2023The Micro-Paper: Towards cheaper, citable research ideas and conversationscited by 2

Built on by

Cited by year

Citing papers per year: 2024: 2; 2025: 1.

3 papers.