Tools Need Not Speak in Text: Latent Context Compression for Agents

Yt Liu, Zhehao Zhou, Yitong Zhang, Haorui Chen, Jia Li

Tools Need Not Speak in Text: Latent Context Compression for Agents: 8 upvotes on Hugging Face Daily Papers, #20 of 32 papers on 2026-11-06. Day-by-day upvote history.

Upvotes over time

It had 2 upvotes by the next day, 7 upvotes by day 3, 8 upvotes by day 7, and has 8 now. It ranked #128 of 207 papers in its week and #190 of 340 in its month. Its code repository has 13 GitHub stars.

Large language model (LLM) agents typically append raw tool outputs to their context. Over multi-step interactions, long and noisy observations incur substantial context overhead and dilute the agent's attention to task-relevant information. Existing token pruning and summarization methods remain constrained by discrete text representations, limiting the achievable compression ratios. In this work, we challenge the prevailing assumption that agents must consume tool observations as explicit text tokens. To this end, we propose Coca-Cola, a continuous latent context compression model for LLM agents. Coca-Cola compresses tool observations into latent tokens and embeds them into the input embedding space of the agent. We further introduce Action-Preserving Training, which aligns the agent's next-action distributions under full and compressed observations. This trains the compression model to learn action-sufficient latent tokens that retain decision-critical information. Experiments with web-search agents on four QA benchmarks and two model families show that Coca-Cola reduces the agent's token consumption by 70.01%-89.24% and end-to-end runtime by 24.45%-55.97%, while consistently improving task performance. These results suggest that Coca-Cola offers a promising approach for context compression in agents. Our code is available at https://github.com/THU-Agent/Coca-cola.

Paper page on Hugging Face · arXiv

Data: hysts-bot-data/daily-papers-stats and the Daily Papers API. Open data: tardellirs/paper-pulse-data. Sister project: Model Pulse, the download history of every model on the Hub.