English
Related papers

Related papers: Transformer tricks: Precomputing the first layer

200 papers

Finetuning a pretrained model has become a standard approach for training neural networks on novel tasks, resulting in fast convergence and improved performance. In this work, we study an alternative finetuning method, where instead of…

Machine Learning · Computer Science 2023-07-04 Gal Kaplun , Andrey Gurevich , Tal Swisa , Mazor David , Shai Shalev-Shwartz , Eran Malach

Scaling transformers has led to significant breakthroughs in many domains, leading to a paradigm in which larger versions of existing models are trained and released on a periodic basis. New instances of such models are typically trained…

Mixture models arise in many regression problems, but most methods have seen limited adoption partly due to these algorithms' highly-tailored and model-specific nature. On the other hand, transformers are flexible, neural sequence models…

Machine Learning · Computer Science 2023-11-15 Reese Pathak , Rajat Sen , Weihao Kong , Abhimanyu Das

Transformers achieve state-of-the-art performance for natural language processing tasks by pre-training on large-scale text corpora. They are extremely compute-intensive and have very high sample complexity. Memory replay is a mechanism…

Machine Learning · Computer Science 2022-05-23 Rui Liu , Barzan Mozafari

In this paper, we propose Transformer Layer Injection (TLI), a novel method for efficiently upscaling large language models (LLMs) while minimizing computational costs and maintaining model performance. Model scale is a key factor in…

Computation and Language · Computer Science 2024-10-16 James Vo

Mixture-of-Experts (MoE) Large Language Models (LLMs) efficiently scale-up the model while keeping relatively low inference cost. As MoE models only activate part of the experts, related work has proposed expert prediction and caching…

Computation and Language · Computer Science 2025-11-17 Shien Zhu , Samuel Bohl , Robin Oester , Gustavo Alonso

Traditional transformer models often allocate a fixed amount of computational resources to every input token, leading to inefficient and unnecessary computation. To address this, the Mixture of Depths (MoD) was introduced to dynamically…

Computation and Language · Computer Science 2025-09-15 Shwai He , Tao Ge , Guoheng Sun , Bowei Tian , Xiaoyang Wang , Dong Yu

Despite the remarkable success of transformer-based models in various real-world tasks, their underlying mechanisms remain poorly understood. Recent studies have suggested that transformers can implement gradient descent as an in-context…

Machine Learning · Computer Science 2024-08-09 Xingwu Chen , Lei Zhao , Difan Zou

Transformer-based models have demonstrated remarkable in-context learning capabilities, prompting extensive research into its underlying mechanisms. Recent studies have suggested that Transformers can implement first-order optimization…

Machine Learning · Computer Science 2024-03-06 Angeliki Giannou , Liu Yang , Tianhao Wang , Dimitris Papailiopoulos , Jason D. Lee

Huge memory consumption has been a major bottleneck for deploying high-throughput large language models in real-world applications. In addition to the large number of parameters, the key-value (KV) cache for the attention mechanism in the…

Computation and Language · Computer Science 2024-06-05 Haoyi Wu , Kewei Tu

This work identifies a simple pre-training mechanism that leads to representations exhibiting better continual and transfer learning. This mechanism -- the repeated resetting of weights in the last layer, which we nickname "zapping" -- was…

Machine Learning · Computer Science 2024-10-22 Lapo Frati , Neil Traft , Jeff Clune , Nick Cheney

Transformer is the backbone of modern NLP models. In this paper, we propose RealFormer, a simple and generic technique to create Residual Attention Layer Transformer networks that significantly outperform the canonical Transformer and its…

Machine Learning · Computer Science 2021-09-14 Ruining He , Anirudh Ravula , Bhargav Kanagal , Joshua Ainslie

LLM architecture research generally aims to maximize model quality subject to fixed compute/latency budgets. However, many applications of interest such as edge and on-device deployment are further constrained by the model's memory…

Machine Learning · Computer Science 2026-04-28 Abbas Zeitoun , Lucas Torroba-Hennigen , Yoon Kim

This paper presents a modular approach to accelerate inference in large language models (LLMs) by adding early exit heads at intermediate transformer layers. Each head is trained in a self-supervised manner to mimic the main model's…

Computation and Language · Computer Science 2026-02-13 Florian Valade

Transformer layers, which use an alternating pattern of multi-head attention and multi-layer perceptron (MLP) layers, provide an effective tool for a variety of machine learning problems. As the transformer layers use residual connections…

Machine Learning · Computer Science 2022-12-13 Yaofeng Desmond Zhong , Tongtao Zhang , Amit Chakraborty , Biswadip Dey

Efficient inference is a critical challenge in deep generative modeling, particularly as diffusion models grow in capacity and complexity. While increased complexity often improves accuracy, it raises compute costs, latency, and memory…

Machine Learning · Computer Science 2025-09-24 Siu Hang Ho , Prasad Ganesan , Nguyen Duong , Daniel Schlabig

This document aims to be a self-contained, mathematically precise overview of transformer architectures and algorithms (*not* results). It covers what transformers are, how they are trained, what they are used for, their key architectural…

Machine Learning · Computer Science 2022-07-26 Mary Phuong , Marcus Hutter

Transformers trained in low precision can suffer forward-error amplification. We give a first-order, module-wise theory that predicts when and where errors grow. For self-attention we derive a per-layer bound that factorizes into three…

Machine Learning · Computer Science 2025-10-28 Jinwoo Baek

Large language models~(LLMs) are known for their high demand on computing resources and memory due to their substantial model size, which leads to inefficient inference on moderate GPU systems. Techniques like quantization or pruning can…

Computational Engineering, Finance, and Science · Computer Science 2024-11-26 Wenxiang Lin , Xinglin Pan , Shaohuai Shi , Xuan Wang , Xiaowen Chu

Due to the huge amount of parameters, fine-tuning of pretrained language models (PLMs) is prone to overfitting in the low resource scenarios. In this work, we present a novel method that operates on the hidden representations of a PLM to…

Computation and Language · Computer Science 2023-05-29 Linlin Liu , Xingxuan Li , Megh Thakkar , Xin Li , Shafiq Joty , Luo Si , Lidong Bing