SepLLM: Accelerate Large Language Models by Compressing One Segment into One Separator

Guoxuan Chen, Han Shi, Jiawei Li, Yihang Gao, Xiaozhe Ren, Yimeng Chen, Xin Jiang, Zhenguo Li, Weiyang Liu, Chao Huang

TL;DR

Researchers have discovered that "meaningless" separator tokens—like periods and commas—act as natural information hubs in Large Language Models (LLMs). By leveraging this insight, they developed SepLLM, a framework that compresses text segments into these separators and discards redundant tokens. This approach achieves over a 50% reduction in memory usage (KV cache) while maintaining performance, enabling models to process sequences of up to 4 million tokens.

The Problem: The Quadratic Bottleneck

The "quadratic bottleneck" of the Transformer architecture remains the primary hurdle for long-context AI. As the input sequence grows, the memory required to store the Key-Value (KV) cache and the computation needed for self-attention explode exponentially.

While researchers have attempted to solve this by evicting "unimportant" tokens or utilizing linear attention, these methods often face a harsh trade-off: they either lose critical information (degrading performance) or require a complete architectural overhaul that prevents the use of powerful pre-trained weights. Furthermore, most existing KV cache pruning methods are "training-free" and fail to account for how the model was actually trained, leading to a discrepancy between training efficiency and inference performance.

The SepLLM Approach: Punctuation as Information Hubs

The core of SepLLM is based on a fascinating observation: LLMs naturally prioritize separator tokens. When visualizing attention maps, the authors found that tokens like ., ,, and \n receive disproportionately high attention scores compared to semantically "heavy" words like nouns or verbs. This suggests that the model already uses these separators to "summarize" the preceding segment of text.

The authors argue that the hidden embedding of a separator token becomes functionally similar to the hidden state of a Recurrent Neural Network (RNN)—it "stores" the gist of the segment it follows.

The Compression Mechanism

Instead of keeping every token in the KV cache, SepLLM employs a selective retention strategy that relies on natural language sparsity. It retains only three types of tokens:

  1. Initial Tokens: The first few tokens in a sequence (often acting as "attention sinks").
  2. Neighboring Tokens: A small window of the most recent tokens to maintain local context.
  3. Separator Tokens: All punctuation and formatting marks that have occurred so far.
SepLLM KV Cache Management

In streaming scenarios, when the cache reaches capacity, SepLLM "compresses" the oldest segment. It keeps only the separators and drops the remaining content tokens. To make this practical for training, the authors implemented custom hardware-efficient kernels using FlexAttention, reducing the discrepancy between how a model is trained and how it is later pruned during inference.

Experimental Setup & Key Results

The authors put SepLLM through a rigorous battery of tests, evaluating it on the Deduplicated Pile (207B tokens) for training, GSM8K-CoT and MMLU for reasoning, and datasets like WikiText and PG19 for long-context streaming.

The framework demonstrated remarkable efficiency and robustness:

  • Memory Efficiency: On the Llama-3-8B backbone, SepLLM achieved a >50% reduction in KV cache on the GSM8K-CoT benchmark with negligible performance loss.
  • Extreme Context: In streaming settings, SepLLM successfully processed sequences of 4 million tokens, maintaining a lower perplexity (better language modeling) than previous state-of-the-art methods like StreamingLLM. The model also remained highly effective at "Needle-in-a-Haystack" retrieval tests despite discarding over half of the tokens.
  • Training Speedup: During training, SepLLM reduced computational costs by 28% and wall-clock training time by 26% while reaching the same target loss as a vanilla model.
Training Efficiency Gains

Importantly, SepLLM is plug-and-play. It works effectively in training-free settings for existing models, but performs even better when integrated into post-training or training-from-scratch pipelines.

Limitations and Future Work

While highly effective, SepLLM has a few limitations that pave the way for future research:

  • Separator Definition: Performance is sensitive to what counts as a "separator." While the authors used a standard set of 10 common marks, different languages or specialized domains (like code) might require tailored separator definitions.
  • Segment Length: If a text segment between two separators is extremely long, compressing it into a single token might eventually hit an information bottleneck. Exploring hierarchical separators could address this.
  • Hardware Specifics: Although the authors implemented FlexAttention kernels, fully realizing the potential of this sparsity pattern likely requires deeper hardware-level optimizations across various GPU architectures.

Summary updated

BibTeX
@inproceedings{chen2025sepllm,
  author = {Guoxuan Chen and Han Shi and Jiawei Li and Yihang Gao and Xiaozhe Ren and Yimeng Chen and Xin Jiang and Zhenguo Li and Weiyang Liu and Chao Huang},
  title = {{SepLLM: Accelerate Large Language Models by Compressing One Segment into One Separator}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=MhVJCxYEEi},
}
Figure