Optimizing Inference Performance of Transformers on CPUs
Not on the map. Why?
Abstract (arXiv)
The Transformer architecture revolutionized the field of natural language processing (NLP). Transformers-based models (e.g., BERT) power many important Web services, such as search, translation, question-answering, etc. While enormous research attention is paid to the training of those models, relatively little efforts are made to improve their inference performance. This paper comes to address this gap by presenting an empirical analysis of scalability and performance of inferencing a Transformer-based model on CPUs. Focusing on the highly popular BERT model, we identify key components of the Transformer architecture where the bulk of the computation happens, and propose three optimizations to speed them up. The optimizations are evaluated using the inference benchmark from HuggingFace, and are shown to achieve the speedup of up to x2.37. The considered optimizations do not require any changes to the implementation of the models nor affect their accuracy.
Key facts. Cited by 7 papers in the map (data through 7 Oct 2026). Builds on 18 of its 37 references that are in the map. First posted on arXiv 12 Feb 2021.
Builds on
18 of 37 references.
References · 18
- 2017Attention Is All You Needcited by 59,932
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2019RoBERTa: A Robustly Optimized BERT Pretraining Approachcited by 13,266
- 2019DistilBERT, a distilled version of BERT: smaller, faster, cheaper and lightercited by 4,243
- 2016Gaussian Error Linear Units (GELUs)cited by 3,431
- 2020Longformer: The Long-Document Transformercited by 3,362
- 2019ALBERT: A Lite BERT for Self-supervised Learning of Language Representationscited by 2,772
- 2019Transformer-XL: Attentive Language Models Beyond a Fixed-Length Contextcited by 1,830
- 2020Big Bird: Transformers for Longer Sequencescited by 1,673
- 2020Linformer: Self-Attention with Linear Complexitycited by 1,462
- 2020MiniLM: Deep Self-Attention Distillation for Task-Agnostic Compression of Pre-Trained Transformerscited by 1,414
- 2019Large Batch Optimization for Deep Learning: Training BERT in 76 minutescited by 671
6 more
- 2019Patient Knowledge Distillation for BERT Model Compressioncited by 502
- 2020TurboTransformers: An Efficient GPU Serving System For Transformer Modelscited by 71
- 2018Optimizing CNN Model Inference on CPUscited by 29
- 2020DeFormer: Decomposing Pre-trained Transformers for Faster Question Answeringcited by 29
- 2020Which *BERT? A Survey Organizing Contextualized Encoderscited by 26
- 2019Exploiting Parallelism Opportunities with Deep Learning Frameworkscited by 10
Built on by
Citing papers per year: 2023: 4; 2024: 1; 2025: 2.
7 papers.
- 2024IceFormer: Accelerated Inference with Long-Sequence Transformers on CPUscited by 8
- 2025Scaling Laws for Energy Efficiency of Local LLMscited by 4
- 2023AttMEMO : Accelerating Transformers with Memoization on Big Memory Systemscited by 2
- 2023Packrat: Automatic Reconfiguration for Latency Minimization in CPU-based DNN Servingcited by 2
- 2025Energy-Efficient Transformer Inference: Optimization Strategies for Time Series Classificationcited by 2
- 2023YFlows: Systematic Dataflow Exploration and Code Generation for Efficient Neural Network Inference using SIMD Architectures on CPUscited by 1
- 2023Improving Inference Performance of Machine Learning with the Divide-and-Conquer Principlecited by 0
- 2025Scaling Laws for Energy Efficiency of Local LLMs18 Dec 2025
- 2025Energy-Efficient Transformer Inference: Optimization Strategies for Time Series Classification23 Feb 2025
- 2024IceFormer: Accelerated Inference with Long-Sequence Transformers on CPUs5 May 2024
- 2023Packrat: Automatic Reconfiguration for Latency Minimization in CPU-based DNN Serving30 Nov 2023
- 2023YFlows: Systematic Dataflow Exploration and Code Generation for Efficient Neural Network Inference using SIMD Architectures on CPUs1 Oct 2023
- 2023AttMEMO : Accelerating Transformers with Memoization on Big Memory Systems23 Jan 2023
- 2023Improving Inference Performance of Machine Learning with the Divide-and-Conquer Principle12 Jan 2023