Density-aware Soft Context Compression with Semi-Dynamic Compression Ratio

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Yu, Yijiong, Yuan, Shuai, Zheng, Jie, Wang, Huazheng, Pei, Ji
Format: Preprint
Published: 2026
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866908916260012032
author Yu, Yijiong
Yuan, Shuai
Zheng, Jie
Wang, Huazheng
Pei, Ji
author_facet Yu, Yijiong
Yuan, Shuai
Zheng, Jie
Wang, Huazheng
Pei, Ji
contents Soft context compression reduces the computational workload of processing long contexts in LLMs by encoding long context into a smaller number of latent tokens. However, existing frameworks apply uniform compression ratios, failing to account for the extreme variance in natural language information density. While adopting a density-aware dynamic compression ratio seems intuitive, empirical investigations reveal that models struggle intrinsically with operations parameterized by input dependent, continuous structural hyperparameters. To resolve this pitfall, we introduce Semi-Dynamic Context Compression framework. Our approach features a Discrete Ratio Selector, which predicts a compression target based on intrinsic information density and quantizes it to a predefined set of discrete compression ratios. It is efficiently jointly trained with the compressor on synthetic data, with the summary lengths as a proxy to create labels for compression ratio prediction. Extensive evaluations confirm that our density-aware framework, utilizing mean pooling as the backbone, consistently outperforms static baselines, establishing a robust Pareto frontier for context compression techniques. Our code, data and model weights are available at https://github.com/yuyijiong/semi-dynamic-context-compress
format Preprint
id arxiv_https___arxiv_org_abs_2603_25926
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle Density-aware Soft Context Compression with Semi-Dynamic Compression Ratio
Yu, Yijiong
Yuan, Shuai
Zheng, Jie
Wang, Huazheng
Pei, Ji
Computation and Language
Soft context compression reduces the computational workload of processing long contexts in LLMs by encoding long context into a smaller number of latent tokens. However, existing frameworks apply uniform compression ratios, failing to account for the extreme variance in natural language information density. While adopting a density-aware dynamic compression ratio seems intuitive, empirical investigations reveal that models struggle intrinsically with operations parameterized by input dependent, continuous structural hyperparameters. To resolve this pitfall, we introduce Semi-Dynamic Context Compression framework. Our approach features a Discrete Ratio Selector, which predicts a compression target based on intrinsic information density and quantizes it to a predefined set of discrete compression ratios. It is efficiently jointly trained with the compressor on synthetic data, with the summary lengths as a proxy to create labels for compression ratio prediction. Extensive evaluations confirm that our density-aware framework, utilizing mean pooling as the backbone, consistently outperforms static baselines, establishing a robust Pareto frontier for context compression techniques. Our code, data and model weights are available at https://github.com/yuyijiong/semi-dynamic-context-compress
title Density-aware Soft Context Compression with Semi-Dynamic Compression Ratio
topic Computation and Language
url https://arxiv.org/abs/2603.25926