Autoencoding-Free Context Compression for LLMs via Contextual Semantic Anchors

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Liu, Xin, Zhao, Runsong, Huang, Pengcheng, Liu, Xinyu, Xiao, Junyi, Xiao, Chunyang, Xiao, Tong, Gao, Shengxiang, Yu, Zhengtao, Zhu, Jingbo
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866914385683808256
author Liu, Xin
Zhao, Runsong
Huang, Pengcheng
Liu, Xinyu
Xiao, Junyi
Xiao, Chunyang
Xiao, Tong
Gao, Shengxiang
Yu, Zhengtao
Zhu, Jingbo
author_facet Liu, Xin
Zhao, Runsong
Huang, Pengcheng
Liu, Xinyu
Xiao, Junyi
Xiao, Chunyang
Xiao, Tong
Gao, Shengxiang
Yu, Zhengtao
Zhu, Jingbo
contents Context compression is an advanced technique that accelerates large language model (LLM) inference by converting long inputs into compact representations. Existing methods primarily rely on autoencoding tasks to train special compression tokens to represent contextual semantics. While autoencoding tasks enable compression tokens to acquire compression capabilities, we remark that such capabilities potentially conflict with actual downstream task requirements, prevent the models from learning the features more beneficial for real-world usage. Based on this observation, we propose Semantic-Anchor Compression (SAC), a novel method that shifts from autoencoding task based compression to an architecture that is equipped with this compression capability \textit{a priori}. Instead of training models to compress contexts through autoencoding tasks, SAC directly selects so-called anchor tokens from the original context and aggregates contextual information into their key-value (KV) representations. To ensure that anchors can effectively collect information, SAC introduces two key designs: (1) anchor embedding, a learnable embedding vector attached to the selected anchor tokens to mark compression carriers and (2) bidirectional attention modification, which enables anchor tokens to integrate information from the entire context. Experimental results show that SAC consistently outperforms existing context compression methods across different compression ratios and model sizes on question-answering and long-context summarization tasks. Our data, model and code have been released at \href{https://github.com/lx-Meteors/SAC}{https://github.com/lx-Meteors/SAC}.
format Preprint
id arxiv_https___arxiv_org_abs_2510_08907
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Autoencoding-Free Context Compression for LLMs via Contextual Semantic Anchors
Liu, Xin
Zhao, Runsong
Huang, Pengcheng
Liu, Xinyu
Xiao, Junyi
Xiao, Chunyang
Xiao, Tong
Gao, Shengxiang
Yu, Zhengtao
Zhu, Jingbo
Computation and Language
Context compression is an advanced technique that accelerates large language model (LLM) inference by converting long inputs into compact representations. Existing methods primarily rely on autoencoding tasks to train special compression tokens to represent contextual semantics. While autoencoding tasks enable compression tokens to acquire compression capabilities, we remark that such capabilities potentially conflict with actual downstream task requirements, prevent the models from learning the features more beneficial for real-world usage. Based on this observation, we propose Semantic-Anchor Compression (SAC), a novel method that shifts from autoencoding task based compression to an architecture that is equipped with this compression capability \textit{a priori}. Instead of training models to compress contexts through autoencoding tasks, SAC directly selects so-called anchor tokens from the original context and aggregates contextual information into their key-value (KV) representations. To ensure that anchors can effectively collect information, SAC introduces two key designs: (1) anchor embedding, a learnable embedding vector attached to the selected anchor tokens to mark compression carriers and (2) bidirectional attention modification, which enables anchor tokens to integrate information from the entire context. Experimental results show that SAC consistently outperforms existing context compression methods across different compression ratios and model sizes on question-answering and long-context summarization tasks. Our data, model and code have been released at \href{https://github.com/lx-Meteors/SAC}{https://github.com/lx-Meteors/SAC}.
title Autoencoding-Free Context Compression for LLMs via Contextual Semantic Anchors
topic Computation and Language
url https://arxiv.org/abs/2510.08907