Hugging Face Blog

How we sped up transformer inference 100x for 🤗 API customers

arXiv AI
Sep 24

KITE: KV-Invariant Transformer Expansion for Efficient Agentic LLM Scaling

KITE (KV-Invariant Transformer Expansion) is a scaling paradigm that trains a language model from a smaller size to a larger one, saving training costs by upcycling. It places new parameters in regions that do not affect attention KV, so inference only requires prefilling KV from the smaller part, reducing inference costs. The Step Scale Transformer (SST), a two-tower decoder, demonstrates this by achieving lower training loss than comparable MoE Transformers while cutting estimated inference cost by 6.7% and 31.6%.

By Zhiheng Hu, Yixun Wei, Jian Zhou, Yizhuang Zhou, Ji Li, Xing Chen, Yang Li, Bojun Wang, Yibo Zhu, Xiangyu Zhang, Daxin Jiang
arXiv Machine Learning
Sep 2

Performance-Efficiency Tradeoffs in Transformers: An Approximation Theory Perspective

The paper examines how to allocate attention heads and head dimensions across Transformer layers to balance expressivity and efficiency. It provides a mathematical analysis of early layers’ role in information extraction and characterizes the trade‑off between head count and dimension under a fixed parameter budget. The authors prove a saturation effect of softmax activations, showing that increasing head dimensions yields diminishing returns, especially for long sequences, and propose strategies for efficient parameter allocation across layers.

By Ruoxi Yu, Haotian Jiang, Jingpu Cheng, Penghao Yu, Qianxiao Li, Zhong Li
arXiv Machine Learning
Nov 6

LAMP: Look-Ahead Mixed-Precision Inference of Large Language Models

The paper proposes LAMP, a look‑ahead mixed‑precision inference method for large language models. By analyzing rounding errors in composed functions, it adaptively selects a small subset of components to compute with higher precision while the rest use lower precision. Experiments on GPT‑2 show that even minimal recomputation can improve accuracy by up to two orders of magnitude.

By Stanislav Budzinskiy, Marian Gloser, Tolunay Yilmaz, Ying Hong Tham, Yuanyi Lin, Wenyi Fang, Fan Wu, Philipp Petersen
arXiv Machine Learning
Oct 15

Your Transformer Is Secretly Elastic

The paper presents a retraining‑free technique that transforms pre‑trained transformers into elastic models capable of adapting to any computational budget on the fly. By jointly ranking every MLP neuron and attention head on a common scale and applying soft pruning across multiple sparsity targets, the method achieves smooth performance degradation up to 60% sparsity while outperforming one‑shot baselines. Experiments on 27 vision and text transformer encoders show significant parameter reductions with minimal accuracy loss and notable throughput and latency gains on GPUs, all produced in minutes.

By Walter Simoncini, Dheeraj Varghese, Gertjan J. Burghouts, Cees G. M. Snoek