Compress, Gather, and Recompute: REFORMing Long-Context Processing in Transformers

Woomin Song, Sai Muralidhar Jayanthi, Srikanth Ronanki, Kanthashree Mysore Sathyendra, Jinwoo Shin +3 more
6/1/2025
cs.CLcs.LG

No confident code implementation found for this paper.

Abstract

As large language models increasingly gain popularity in real-world applications, processing extremely long contexts, often exceeding the model's pre-trained context limits, has emerged as a critical challenge. While existing approaches to efficient long-context processing show promise, recurrent compression-based methods struggle with information preservation, whereas random access approaches require substantial memory resources. We introduce REFORM, a novel inference framework that efficiently handles long contexts through a two-phase approach. First, it incrementally processes input chunks while maintaining a compressed KV cache, constructs cross-layer context embeddings, and utilizes early exit strategy for improved efficiency. Second, it identifies and gathers essential tokens via similarity matching and selectively recomputes the KV cache. Compared to baselines, REFORM achieves over 52% and 34% performance gains on RULER and BABILong respectively at 1M context length. It also outperforms baselines on Infinite-Bench, RepoEval, and MM-NIAH, demonstrating flexibility across diverse tasks and domains. Additionally, REFORM reduces inference time by 30% and peak memory usage by 5%, achieving both efficiency and superior performance.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{song2025compress,
  title  = {Compress, Gather, and Recompute: REFORMing Long-Context Processing in Transformers},
  author = {Woomin Song and Sai Muralidhar Jayanthi and Srikanth Ronanki and Kanthashree Mysore Sathyendra and Jinwoo Shin and Aram Galstyan and Shubham Katiyar and Sravan Babu Bodapati},
  year   = {2025},
  eprint = {2506.01215},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2506.01215v2}
}

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

Discussion