What Layers When: Learning to Skip Compute in LLMs with Residual Gates

Filipe Laitenberger, Dawid Kopiczko, Cees G. M. Snoek, Yuki M. Asano
10/13/2025
cs.CLcs.AI

No official code found. Best implementation: Thiggel/GateSkip (4 stars, last commit 2025-11-27).

Abstract

We introduce GateSkip, a simple residual-stream gating mechanism that enables token-wise layer skipping in decoder-only LMs. Each Attention/MLP branch is equipped with a sigmoid-linear gate that condenses the branch's output before it re-enters the residual stream. During inference we rank tokens by the gate values and skip low-importance ones using a per-layer budget. While early-exit or router-based Mixture-of-Depths models are known to be unstable and need extensive retraining, our smooth, differentiable gates fine-tune stably on top of pretrained models. On long-form reasoning, we save up to 15% compute while retaining over 90% of baseline accuracy. For increasingly larger models, this tradeoff improves drastically. On instruction-tuned models we see accuracy gains at full compute and match baseline quality near 50% savings. The learned gates give insight into transformer information flow (e.g., BOS tokens act as anchors), and the method combines easily with quantization, pruning, and self-speculative decoding.

View on arXivView PDF

Code Implementations(1)

Thiggel/GateSkipCommunity73%

Official Code Implementation for the Paper "What Layers When: Learning to Skip Compute in LLMs with Residual Gates"

42Shell, PythonMay 15, 202510 months ago

Similar Papers

Cite this paper

@article{laitenberger2025what,
  title  = {What Layers When: Learning to Skip Compute in LLMs with Residual Gates},
  author = {Filipe Laitenberger and Dawid Kopiczko and Cees G. M. Snoek and Yuki M. Asano},
  year   = {2025},
  eprint = {2510.13876},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2510.13876v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2510.13876.svg)](https://codeofpaper.com/paper/2510.13876)

Discussion