Papers
Topics
Authors
Recent
Gemini 2.5 Flash
Gemini 2.5 Flash
41 tokens/sec
GPT-4o
59 tokens/sec
Gemini 2.5 Pro Pro
41 tokens/sec
o3 Pro
7 tokens/sec
GPT-4.1 Pro
50 tokens/sec
DeepSeek R1 via Azure Pro
28 tokens/sec
2000 character limit reached

Dynamic Context Pruning for Efficient and Interpretable Autoregressive Transformers (2305.15805v3)

Published 25 May 2023 in cs.CL and cs.LG

Abstract: Autoregressive Transformers adopted in LLMs are hard to scale to long sequences. Despite several works trying to reduce their computational cost, most of LLMs still adopt attention layers between all pairs of tokens in the sequence, thus incurring a quadratic cost. In this study, we present a novel approach that dynamically prunes contextual information while preserving the model's expressiveness, resulting in reduced memory and computational requirements during inference. Our method employs a learnable mechanism that determines which uninformative tokens can be dropped from the context at any point across the generation process. By doing so, our approach not only addresses performance concerns but also enhances interpretability, providing valuable insight into the model's decision-making process. Our technique can be applied to existing pre-trained models through a straightforward fine-tuning process, and the pruning strength can be specified by a sparsity parameter. Notably, our empirical findings demonstrate that we can effectively prune up to 80\% of the context without significant performance degradation on downstream tasks, offering a valuable tool for mitigating inference costs. Our reference implementation achieves up to $2\times$ increase in inference throughput and even greater memory savings.

User Edit Pencil Streamline Icon: https://streamlinehq.com
Authors (6)
  1. Sotiris Anagnostidis (21 papers)
  2. Dario Pavllo (12 papers)
  3. Luca Biggio (18 papers)
  4. Lorenzo Noci (17 papers)
  5. Thomas Hofmann (121 papers)
  6. Aurelien Lucchi (75 papers)
Citations (36)