cs.CLMar 26, 2026

Large Language Model as Token Compressor and Decompressor

Authors: Wenbing Li, Yiran Wang, Zikai Song, Jielei Zhang, Tianhao Zhao, Junkai Lin, Wei Yang

Abstract

In this paper, we study whether an off-the-shelf LLM can be adapted into a discrete, variable-length token compressor and decompressor for long-context processing. To this end, we design a self-expressive autoencoding framework that fine-tunes a pretrained LLM with lightweight LoRA adapters to map long texts into compact sequences of learned latent codes, termed Z-tokens, and to decode them back into natural language or task outputs. The resulting representation is content-adaptive: less predictable or information-dense segments can receive more Z-tokens, while redundant regions can be represented more compactly through a budget-aware length regularizer. Our method is evaluated on long-context datasets such as Wikipedia, CNN/DailyMail, HotpotQA, and QuALITY, showing that it preserves reconstruction quality and downstream performance while reducing effective context length, generation-stage memory usage, and end-to-end latency. This simple design supports both direct decoding from compressed contexts and autoregressive generation in the Z-token space, providing a practical interface for efficient long-context inference.

Figures & tables

Appendix figures & tables6 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. End-to-End Context Compression at Scale

    Jun 8, 2026Ang Li, Sean McLeish, Haozhe Chen +12LLM CompressionLong-Context Language Model Inference

  2. SeDeM: Selective Decompression of Hidden-State Memories for Long-Context Question Answering

    Jul 31, 2026Maryam Haghifam, Jason Cong, Yizhou SunMemory-Augmented Language ModelsLong-Context QA

  3. LatentPress: Context Compression Beyond Text and Vision

    Sep 1, 2026Yuanda Xu, Zhengze Zhou, Hejian Sang +3LLM Inference AccelerationLLM Context Compression