MemOCR: Layout-Aware Visual Memory for Efficient Long-Horizon Reasoning
Yaorui Shi, Shugui Liu, Yu Yang, Wenyu Mao, Yuxin Chen, Qi GU, Hui Su, Xunliang Cai, Xiang Wang, An Zhang
TL;DR
MemOCR tackles the memory bottleneck in long-horizon reasoning under context-window limits by moving from linear textual memory to a 2D visual memory whose layout governs information density. It introduces a two-stage lifecycle: memory drafting in the text domain to encode visual salience, and memory reading in the vision domain via a lightweight renderer that outputs a memory image $V_T$, with budget control via visual tokens. Budget-aware reinforcement learning trained on three QA tasks—$ T_{ ext{std}}$, $ T_{ ext{augM}}$, and $ T_{ ext{augQ}}$—learns a single layout policy (via GRPO) that preserves crucial evidence under extreme compression while retaining detail when budget allows. Across HotpotQA, 2WikiMultiHopQA, Natural Questions, and TriviaQA, MemOCR achieves stronger overall QA performance and markedly better robustness at tight budgets, delivering up to an $ extbf{8}$-fold improvement in effective context utilization and highlighting the practical impact of non-uniform information density in memory systems.
Abstract
Long-horizon agentic reasoning necessitates effectively compressing growing interaction histories into a limited context window. Most existing memory systems serialize history as text, where token-level cost is uniform and scales linearly with length, often spending scarce budget on low-value details. To this end, we introduce MemOCR, a multimodal memory agent that improves long-horizon reasoning under tight context budgets by allocating memory space with adaptive information density through visual layout. Concretely, MemOCR maintains a structured rich-text memory (e.g., headings, highlights) and renders it into an image that the agent consults for memory access, visually prioritizing crucial evidence while aggressively compressing auxiliary details. To ensure robustness across varying memory budgets, we train MemOCR with reinforcement learning under budget-aware objectives that expose the agent to diverse compression levels. Across long-context multi-hop and single-hop question-answering benchmarks, MemOCR outperforms strong text-based baselines and achieves more effective context utilization under extreme budgets.
