TokenGate: Adapting LLMs for Fast and Memory-Efficient Prefill with Learned Token Pruning

Liana Patel, Rishabh Ranjan, Ion Stoica, Matei Zaharia, Carlos Guestrin
10/19/2026
cs.CLcs.AI

Official code: tokengate-models/TokenGate (2 stars, Apache-2.0, last commit 2026-10-21).

Abstract

Expert human readers process large inputs (e.g., code repositories and long documents) by skimming to closely read only what matters. On the other hand, language models process all input tokens through each model layer, resulting in significant processing costs for long-context inputs. We introduce TokenGate, a small, drop-in component that extends existing trained models to enable end-to-end learnable token pruning over long-context inputs for fast and memory-efficient prefill. To enable end-to-end learning despite the non-differentiable top-K operator for token pruning, we introduce token-gated attention, a mechanism inspired by Mixture-of-Experts that re-weights attention logits using token importance scores. Across diverse tasks, TokenGate achieves $1.4$-$11.3\times$ faster time-to-first token (TTFT) and $1.5$-$3.4\times$ lower peak memory at no accuracy degradation for prefill in transformers. Compared to the best-performing prior methods for token-pruning, TokenGate gives up to $6.4\times$ faster prefill and $2\times$ lower peak memory. TokenGate natively extends both standard transformers (e.g., Qwen3) and hybrid-attention models (e.g., Qwen3.5) with simple lightweight adaptation comparable to standard parameter-efficient fine-tuning. We make our code available at: https://github.com/tokengate-models/TokenGate.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

https://arxiv.org/abs/2610.26754 Process all your context faster with LLMs that can skim then read what matters

20Shell, PythonOct 19, 2026todayApache-2.0

Similar Papers

Cite this paper

@article{patel2026tokengate,
  title  = {TokenGate: Adapting LLMs for Fast and Memory-Efficient Prefill with Learned Token Pruning},
  author = {Liana Patel and Rishabh Ranjan and Ion Stoica and Matei Zaharia and Carlos Guestrin},
  year   = {2026},
  eprint = {2610.26754},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2610.26754v1}
}

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/2610.26754.svg)](https://codeofpaper.com/paper/2610.26754)

Discussion