Universal Retrieval for Multimodal Trajectory Modeling

Xuan Zhang, Ziyan Jiang, Rui Meng, Yifei Leng, Zhenbang Xiao, Zora Zhiruo Wang, Yanyi Shang, Dehan Kong

TL;DR

This paper introduces Multimodal Trajectory Retrieval, a framework and task for indexing and retrieving agent experiences (states, actions, and sub-trajectories) in graphical user interface (GUI) environments. The authors build GAE-Bench, a standardized benchmark derived from five major agent datasets, and propose GAE-Retriever, a vision-language model (VLM) contrastive retrieval architecture equipped with UI-based token pruning and gradient caching. GAE-Retriever outperforms zero-shot VLMs, existing multimodal retrievers, and GUI planning models by an average of 10.22 points in recall.

What Problem Does This Paper Address?

As autonomous agents operate across web, mobile, and desktop interfaces, they produce rich sequential data consisting of screenshots, mouse/keyboard actions, and text goals. Reusing past trajectories can dramatically boost agent performance via in-context learning, experience replay, or world modeling.

However, trajectory data is inherently token-heavy, highly multimodal, and structurally diverse across different agent frameworks. Prior work either ignored visual signals (relying solely on text search) or tackled isolated text-to-image tasks. This paper addresses two foundational questions:

  1. How do we standardize and benchmark retrieval over complex, multi-step agent trajectories?
  2. How can we train vision-language models to effectively embed long, heterogeneous sequences of high-resolution observations and actions under GPU memory constraints?

Methods

The authors frame trajectory retrieval as a mapping between keys and values across both temporal relationships (e.g., retrieving the next state or remaining sub-trajectory given past steps) and semantic relationships (e.g., finding identical "gold" or analogous "silver" trajectories for a given task).

Key elements of their method include:

  • Standardized State-Action Formulation: Environmental states are treated as raw screenshots to eliminate dependency on platform-specific DOM trees. Actions are formatted into structured JSON (operation, target bounding box, value) prepended by an environment-specific action space definition.
  • GAE-Retriever Architecture: Built on top of VLM2Vec using a Qwen2-VL-2B backbone. Instead of using separate encoders, it processes multi-image, multi-action context within a unified transformer and extracts embeddings from the final layer representation of the last token.
  • UI-Graph Token Pruning: Trajectories containing multiple screenshots rapidly overflow context limits. The authors construct a UI-connected graph in RGB space during training, pruning 50% of redundant visual tokens without adding learnable parameters.
  • GradCache Optimization: Decouples the encoder forward/backward passes from the InfoNCE contrastive loss, enabling effective batch sizes of up to 2,048 across multi-image inputs on limited GPU hardware.

Datasets

  • Unified Agent Trajectory Dataset (UATD): A newly unified collection consolidating five open-source GUI benchmarks: Mind2Web, AutoWebGLM, WebArena, WebLINX, and GUIAct. It encompasses 7,747 human demonstrations and 82,793 states.
  • GAE-Bench & GAE-Bench-lite: The newly introduced retrieval benchmark generated from UATD via 12 extraction schemes spanning 6 core retrieval tasks (text-to-trajectory, state-to-trajectory, trajectory-to-state, etc.).
  • GAE-Bench contains 714,628 positive retrieval pairs.
  • GAE-Bench-lite caps trajectories at 10 steps to fit current VLM context windows, providing 514,956 training pairs, 21,805 in-domain test pairs, and 27,139 out-of-domain test pairs evaluated against a pool of over 570,000 candidate items.

Key Insights and Ideas

  • Planning capability $\neq$ retrieval proficiency: State-of-the-art GUI trajectory planning models (e.g., ShowUI, UI-TARS) fail at zero-shot retrieval, performing on par with raw base VLMs (Recall@1 remains under 4.0 across benchmarks). Generating valid next actions does not automatically yield dense, discriminative latent representations.
  • Semantic retrieval is easier than temporal projection: Across all tested models, standard text-to-trajectory ($q \to \tau$) and text-to-state ($q \to s$) retrieval yielded the highest recall. Performance dropped steeply when models were tasked with complex temporal sub-trajectory forecasting (e.g., $(q, s) \to \tau$ or $(q, \tau) \to \tau'$).
  • Video pretraining transfers partially, but specialized fine-tuning is vital: Strong video-language retrievers like VLM2Vec-V2.2 outperformed text/image retrievers on basic trajectory matching, but consistently lagged on fine-grained intra-trajectory state-action transitions.

Key Results

  • Recall Gains: GAE-Retriever outperforms all baselines across all five benchmark environments, achieving an average improvement of 10.22 points over the best-performing baseline (VLM2Vec-V2.2).
  • Top-End Metrics: On AutoWebGLM, GAE-Retriever reaches 76.3 Recall@10 and 22.1 Recall@1 (vs. 15.7 for VLM2Vec-V2.2). On GUIAct, it achieves 67.9 Recall@10 and 25.7 Recall@1 (a 13.5-point gain over the 12.2 achieved by VLM2Vec-V2.2).
  • Out-of-Domain Robustness: GAE-Retriever maintains strong generalization, exhibiting higher out-of-domain recall than in-domain recall on several multi-step trajectory retrieval tasks.

Limitations and Future Work

  • Length Constraints: Due to VLM context windows and GPU memory bottlenecks, practical training was restricted to GAE-Bench-lite (trajectories capped at 10 steps). Longer multi-page workflows remain difficult to encode without further context scaling.
  • Scope of Environments: Evaluation was limited to digital GUI environments (web, desktop, Android); the authors note embodied/robotics trajectories as an unexplored extension.
  • Privacy and Misuse: Trajectory data from public GUI environments can inadvertently contain user-sensitive information, requiring strict sanitization protocols in production deployments.

Summary updated

BibTeX
@inproceedings{zhang2025universal,
  author = {Xuan Zhang and Ziyan Jiang and Rui Meng and Yifei Leng and Zhenbang Xiao and Zora Zhiruo Wang and Yanyi Shang and Dehan Kong},
  title = {{Universal Retrieval for Multimodal Trajectory Modeling}},
  booktitle = {WCUA @ ICML},
  year = {2025},
  url = {https://openreview.net/forum?id=wNFgL1c6It},
}
Figure