TAKE: Task-Aware Chunked KV Cache Eviction for Efficient Long-Context LLM Prefill

Long Hu, Nan Jia, Rui Wang, Jiahui Li, Qingyi Yang, Yixue Hao, Xianzhi Li, Xiaofei LiaoOpenReview 2026 · Submission to ICLR 2026 · Rejected

Large Language Models (LLMs) are increasingly capable of "reading" entire books or codebases, with context windows now stretching to 128k tokens and beyond. However, there is a massive hidden hurdle: the prefill stage. Before a model generates its first word, it must encode the entire prompt into a "KV Cache." For long sequences, this creates a massive memory spike that often leads to Out-of-Memory (OOM) errors on anything less than a cluster of A100s.

A new paper, TAKE (Task-Aware Chunked KV Cache Eviction), proposes a clever way to dismantle this memory wall. By interleaving computation with pruning, the authors demonstrate that you can run 128k-token contexts on a standard 24GB consumer GPU without sacrificing model quality.

TL;DR

TAKE is a training-free framework that slashes the peak memory requirements of LLM prefill by processing long inputs in chunks and evicting unimportant KV pairs on the fly. It reduces peak memory usage by over 90% and latency by 60%, enabling stable 128k-context inference on consumer-grade hardware like an RTX 3090 or 4090.

What Problem Does This Paper Address?

The "prefill bottleneck" is the primary enemy of long-context LLMs. To generate text, a Transformer stores "Keys" and "Values" (the KV cache) for every single token in the input.

Existing solutions usually focus on decoding (the generation phase), pruning the cache after the entire prompt has been processed. The problem? You still have to survive the initial memory peak during that first encoding pass. If your prompt is 100k tokens long, the memory required to store the activations and the KV cache during prefill will crash a standard GPU long before the pruning even begins.

Methods

TAKE introduces a "chunk-wise" inference scheme that alternates between attention computation and cache eviction. Instead of processing the whole sequence at once, it breaks it into smaller chunks. Its magic lies in three components:

  1. Incremental Chunking: The model processes one chunk at a time. It only keeps the KV cache for the current chunk and a "pruned summary" of all previous chunks. This ensures the model never holds the full sequence in memory.
  2. Accumulated Task-Aware Probes: To prevent the model from "forgetting" important context across chunk boundaries, TAKE appends lightweight "probe tokens" to each chunk. These probes use an Exponential Moving Average (EMA) to accumulate semantic information, acting as a guide to identify which tokens are truly salient for the specific task at hand.
  3. Delayed & Retrospective Eviction: The authors observed that shallow layers in a Transformer have "dense" attention (they look at everything), while deeper layers are "sparse" (they focus on specific targets). TAKE uses a Delayed Eviction strategy: it keeps more information in shallow layers and waits for deeper layers to make "smart" pruning decisions. It then retrospectively applies those deep-layer decisions to prune the shallow-layer caches.

Datasets

The authors evaluated TAKE using two primary long-context benchmarks:

  • Needle-in-a-Haystack (NIAH): A test of retrieval accuracy where a specific fact (the "needle") is hidden inside a massive document (the "haystack").
  • LongBench: A comprehensive suite of 20+ tasks covering multi-document QA, summarization, few-shot learning, and code completion.

They tested these on popular open-source models: LLaMA-3.1-8B-Instruct and Mistral-7B-Instruct-v0.3.

Key Insights and Ideas

  • The "Prefill Peak" is the Real Bottleneck: Most researchers focus on the size of the final KV cache, but TAKE highlights that the peak memory during the first pass is what actually limits hardware accessibility.
  • Intelligence Flows Upward: Pruning decisions made in the first few layers are often "dumb" because the model hasn't yet figured out what the prompt is about. By using decisions from Layer 15 to prune Layer 0, TAKE "borrows" the model's deeper understanding to save memory at the start.
  • Filtering as a Feature: Surprisingly, TAKE sometimes outperforms the full-KV baseline. This suggests that by evicting "noise" tokens during prefill, the model can focus more effectively on relevant information, essentially performing a form of automated denoising.

Key Results

  • Massive Memory Savings: TAKE reduced peak GPU memory usage for the KV cache and activations to just 8.9% of the baseline.
  • Speed Gains: It lowered the Time-to-First-Token (TTFT) latency by over 60% for 128k-token sequences.
  • Consumer Hardware Ready: The system successfully ran 128k-token contexts on a 24GB GPU without needing quantization (which usually degrades quality) or KV offloading (which is slow).
  • Efficiency: For a 128k sequence, TAKE requires only 7.1% of the FLOPs compared to a standard full-KV prefill.

Limitations and Future Work

  • Hyperparameter Sensitivity: The EMA factor ($\alpha$) and the number of "warm-up" layers ($W$) need to be tuned based on the task. A setting that works for summarization might not be optimal for code retrieval.
  • Kernel Overhead: While TAKE reduces FLOPs significantly, processing in chunks introduces more "kernel launches" on the GPU, which adds a small amount of fixed overhead.
  • Future Directions: The authors suggest that TAKE could be combined with 4-bit or 8-bit quantization to push context windows into the millions of tokens on a single machine. There is also potential to adapt the "probe token" mechanism to be even more dynamic based on the specific content of the chunks.

Summary updated

BibTeX
@misc{hu2026take,
  author = {Long Hu and Nan Jia and Rui Wang and Jiahui Li and Qingyi Yang and Yixue Hao and Xianzhi Li and Xiaofei Liao},
  title = {{TAKE: Task-Aware Chunked KV Cache Eviction for Efficient Long-Context LLM Prefill}},
  year = {2026},
  url = {https://openreview.net/forum?id=kMLfUshPwo},
  howpublished = {OpenReview},
  note = {Submitted to ICLR 2026},
}

Loading related content...

Figure