Token Compression in the AI Agent Lifecycle: A Comprehensive Survey from Perceptual Inputs to Semantic Contexts

Manuscript submitted to IEEE Communications Surveys & Tutorials   PDF 下载

Authors

Fengxi Zhang1, Zhengxue Cheng1,*, Guo Lu1, Li Song1,*, Zhu Li2, Zhiyong Chen1, Meixia Tao1, and Wenjun Zhang1

Affiliations

1 School of Information Science and Electronic Engineering, Shanghai Jiao Tong University, Shanghai 200240, China

2 School of Science and Engineering, University of Missouri–Kansas City, Kansas City, MO 64110, USA

* Corresponding authors: Zhengxue Cheng and Li Song

Abstract

Tokens serve as the fundamental interactive units through which foundation models represent inputs, maintain contexts, and support reasoning, thereby enabling communication and collaboration between humans and AI systems. In AI agents, tokens arise not only from current perceptual inputs, but also from workflow contexts accumulated across multi-step execution, including retrieval results, reasoning traces, action-observation histories, and memory records. Dense multimodal inputs and iterative workflow accumulation lead to token explosion, increasing inference cost and making active-context management critical for efficient and reliable agent execution. This survey reviews token compression from the perspective of the AI agent lifecycle. We propose an active context optimization problem formulation for token compression, which aims to reduce the token cost of active contexts while preserving task utility under limited context window and computation budgets. We then organize existing methods according to where tokens arise in the lifecycle. Perception compression targets current input-side tokens derived from text, image, video, and audio, and is reviewed through transformation, token selection, token aggregation, and token resampling. Semantic compression targets workflow contexts introduced or accumulated during agent execution, covering retrieval, thought, action-observation, and memory token compression. Finally, we discuss open challenges and future directions from a unified AI-agent perspective, highlighting token compression as an essential technique for managing active contexts in long-horizon agent execution. A repository of token compression methods is available at: https://github.com/XCJinggai/Awesome_Token_Compression_in_AI_Agent_Lifecycle .

Keywords

Token compression; AI agents; large language models; multimodal large language models.

Figures Preview

Figure 1. Token Explosion in the AI Agent Lifecycle. As agents execute long-horizon tasks, dense multimodal perceptual inputs and multi-turn interactions continuously expand the active context, resulting in token explosion. This rapid token growth substantially increases token cost and inference latency. Additionally, excessive context length can degrade task performance and increase the risk of task failure.

Figure 2. Token Explosion in the AI Agent Lifecycle. As agents execute long-horizon tasks, dense multimodal perceptual inputs and multi-turn interactions continuously expand the active context, resulting in token explosion. This rapid token growth substantially increases token cost and inference latency. Additionally, excessive context length can degrade task performance and increase the risk of task failure.

Figure 4. Agent-centric taxonomy of token compression. Token compression is organized into perception compression for current perceptual inputs by users and semantic compression for contexts accumulated across the AI agent lifecycle. Perception compression is further categorized by compression mechanisms, while semantic compression follows the agent workflow.

Figure 5. Representative application scenarios of token compression. (a) Human-MLLM interaction compresses multimodal perceptual tokens transmitted from users for efficient real-time responses. (b) Human-agent collaboration compresses active contexts exchanged across execution steps for reliable long-horizon task completion. (c) Multi-agent collaboration compresses exchanged semantic messages for scalable inter-agent coordination.

Figure 6. Future directions for token compression in agent workflows, organized from method design through evaluation to deployment.
Li Song
Li Song
Professor, IEEE Senior Member

Professor, Doctoral Supervisor, the Deputy Director of the Institute of Image Communication and Network Engineering of Shanghai Jiao Tong University, the Double-Appointed Professor of the Institute of Artificial Intelligence and the Collaborative Innovation Center of Future Media Network, the Deputy Secretary-General of the China Video User Experience Alliance and head of the standards group.

Related