arXiv(opens in a new tab)cs.CLAug 2026Cited by 1 paper on PaperVantage

Manuscript Offprint

arXiv:2608.29897

When History Is Multimodal: Rethinking Context Management for Long-Horizon Agents

Jiaqi Su, Cong Pang, Jiawei Hong, Tiankuo Yao, Zixuan Chen, Xin Lou, Lewei Lu

ABSTRACT

Long-horizon agents need a context manager to compress growing interaction histories into a bounded working context, via passive strategies or active strategies that decide how memory is accessed and reorganized. Meanwhile, prior optical-memory work mainly treats pixels as a dense codec for textualized histories, often presupposing that rendering context into optical memory incurs a significant performance drop relative to text, thus coupling this representation with SFT, self-distillation, or reinforcement learning to close this gap, leaving unresolved (i) how visual rendering performs as a context manager under a fair, controlled comparison, and (ii) whether this carrier offers a native advantage when history is inherently multimodal. In this paper, we formulate context management as a budget-constrained history transformation and introduce Visual Rendering (VR) as a representational context manager. Under a shared harness, policy model, trigger, and task domain, we evaluate VR on four text-centric and three multimodal benchmarks against four baselines (No Compression, Discard-All, Sliding Window, Summarization), finding visual memory is a natural carrier of native visual evidence. Building on this finding, we propose VERA (Visual Evidence-Retaining strategy for long-horizon Agents), a training-free context manager built on deterministic rendering with no exposed memory operations: on text-centric benchmarks it renders textual history as VR does, while on multimodal benchmarks it retains native visual observations instead of translating them into text. Across nearly all benchmarks, VERA cuts cumulative non-cache tokens by 31.5%–63.1% versus No Compression, matches existing managers on text-centric tasks, and achieves the highest accuracy among all baselines on multimodal tasks, supporting a modality-preserving view of long-horizon context management.

1 Introduction

The ReAct paradigm [1] and recent agentic models [2, 3] enable agents to execute open-ended tasks through extended loops of reasoning, tool use, and observation. In deep research, GUI operation, and software engineering, a trajectory can span dozens or hundreds of turns. Retaining the complete trajectory increases inference cost, eventually exceeds the usable context window, and can impair access to evidence buried in long prompts [4]. Long-horizon agents therefore require an explicit mechanism for converting an ever-growing history into a bounded working context.

Context managers make different choices about what to retain, how to encode it, and whether memory access is fixed or policy-controlled. Our controlled comparison uses four experimental baselines spanning full retention, full removal, and alternative fixed context managers. No Compression retains the full history, while Discard-All removes the history selected for management without constructing a replacement memory. We treat these as boundary controls rather than context managers. Sliding Window discards tool responses outside its retained window, Summarization converts the managed interaction history into a structured textual summary, and Visual Rendering re-encodes that history as pixels. Section 3.1 formalizes this distinction. Active managers additionally decide when and how memory is accessed. Retrieval-based managers [5, 6, 7] determine when to query external memory, which records to recall, and how to integrate them, while policy-level orchestration methods [8, 9, 10] expose or learn context operations. Optical-context methods [11, 12, 13, 14, 15, 16] instead change the representation by rendering long text or agent histories as images.

∗^{*}Equal contribution, work done during internship at SenseTime Research. †\daggerCorresponding author.

However, they primarily treat pixels as a dense codec or index for textualized history and commonly couple the carrier with learned construction or specialized access, leaving unclear how untrained Visual Rendering compares with standard fixed managers and whether it offers an additional advantage for evidence that is natively visual.

This comparison exposes a second, complementary question. Optical-context research has largely studied how textualized history should be rendered, through choices such as layout, resolution, compression rate, and learned construction or access policies. We ask what domain-specific information should survive rendering when the history itself is multimodal. Image-search trajectories contain retrieved images and localized crop or zoom evidence; data-analysis trajectories contain tables, charts, document pages, and database outputs whose spatial structure can be weakened when flattened into prose. Other domains may expose different useful structures, such as module and dependency relations in code [17]. Treating pixels only as a dense carrier for text leaves these signals unused. We therefore study Visual Rendering as a domain-aware context interface that can preserve both textual trajectories and the multimodal or structured evidence produced by the task environment.

We define context management as a budget-constrained transformation of interaction history. This formulation separates what history is retained from how it is represented and accessed. Visual Rendering intervenes specifically on representation: it converts the managed history into an explicit visual memory, which the VLM encodes into visual tokens, while leaving the management trigger, retained recent context, and downstream policy unchanged. This controlled view makes VR directly comparable with other fixed managers and isolates the visual carrier from learned construction and memory-access policies.

VERA, a Visual Evidence-Retaining for long-horizon Agents, is our training-free, harness-level implementation of Visual Rendering. Using a deterministic renderer, VERA arranges historical text and native visual observations on a chronological canvas while retaining recent interactions in their original form. It requires no learned rendering policy, separately trained reader, or agent-exposed memory action, allowing the representational contribution of VR to be studied before introducing additional optimization. We evaluate VERA against No Compression, Discard-All, Sliding Window, and Summarization under a shared agent harness, policy model, management trigger, and task protocol. Across four text-centric search benchmarks, two multimodal search benchmarks, and one multimodal data-analysis benchmark, we ask three questions: how VR compares with the four baselines; whether preserving native visual evidence is more effective than replacing it with text-only descriptions; and how the availability and rendering fidelity of older visual history affect accuracy and search cost.

In summary, our main contributions are as follows:

• A Unified Definition of Context Management. We define a context manager as constructing a nonempty, budgeted representation of interaction history, separating fixed and active managers from full-retention and reset controls. This definition places Visual Rendering in the same functional design space as textual context managers while preserving their representational differences.

• A Controlled Comparison and Mechanistic Analysis. Under a shared policy and agent protocol, we compare plain Visual Rendering with No Compression, Discard-All, Sliding Window, and Summarization on four text-centric benchmarks. Beyond reporting rankings, we analyze why reset can benefit from repeated attempts and show that training-free Visual Rendering remains competitive while using the fewest cumulative non-cache tokens.

• A Domain-Aware, Modality-Preserving Context Manager. We propose VERA, a training-free manager that preserves native images and structured analytical artifacts alongside rendered text. It consistently outperforms text-only rendering on multimodal search and data analysis, showing that domain-native evidence adds value beyond text packing.

References (27)

  • React: Synergizing reasoning and acting in language models, 2023
  • A survey of context engineering for large language models, 2025
  • Memgpt: Towards llms as operating systems, 2024
  • A-mem: Agentic memory for llm agents, 2025
  • Mem0: Building production-ready ai agents with scalable long-term memory, 2025
  • Longseeker: Elastic context orchestration for long-horizon search agents, 2026
  • Scaling long-horizon llm agent via context-folding, 2025
  • Agentfold: Long-horizon web agents with proactive context management, 2025
  • Deepseek-ocr: Contexts optical compression, 2025
  • Glyph: Scaling context windows via visual-text compression, 2025
  • MemOCR: Layout-aware visual memory for efficient long-horizon reasoning
  • Agentocr: Reimagining agent history via optical self-compression, 2026
  • VizoMem: A visual-textual memory framework for efficient long-horizon reasoning
  • OCR-memory: Optical context retrieval for long-horizon agent memory
  • Can vision-language models handle long-context code? an empirical study on visual compression, 2026
  • Swe-bench: Can language models resolve real-world github issues?, 2024
  • Claw-eval: Towards trustworthy evaluation of autonomous agents, 2026
  • MMSearch: Unveiling the potential of large models as multi-modal search engines
  • Browsecomp-v $^{3}$: A visual, vertical, and verifiable benchmark for multimodal browsing agents, 2026
  • Mm-browsecomp: A comprehensive benchmark for multimodal browsing agents, 2025
  • Infiagent-dabench: Evaluating agents on data analysis tasks, 2024
  • Agenticdatabench: A comprehensive benchmark for data agents, 2026
  • Lensvlm: Selective context expansion for compressed visual representation of text, 2026
  • Browsecomp: A simple yet challenging benchmark for browsing agents, 2025
  • Browsecomp-zh: Benchmarking web browsing ability of large language models in chinese, 2025
  • xbench: Tracking agents productivity scaling with profession-aligned real-world evaluations, 2025
  • Sealqa: Raising the bar for reasoning in search-augmented language models, 2026