VLM Agents Generate Their Own Memories: Distilling Experience into Embodied Programs of Thought

Gabriel Sarch, Lawrence Jang, Michael J. Tarr, William W. Cohen, Kenneth Marino, Katerina Fragkiadaki

TL;DR

Vision-Language Models (VLMs) are excellent at few-shot learning, but they usually rely on humans to hand-craft perfect examples for their prompts. This paper introduces In-Context Abstraction Learning (ICAL), a method that allows VLMs to generate their own high-quality memory bank by analyzing noisy, sub-optimal demonstrations, extracting key "cognitive abstractions," and refining them via human feedback. The result is a self-improving agent that sets new state-of-the-art records in embodied AI and web navigation tasks.

The Bottleneck: Hand-Crafted Prompts

Large Language and Vision-Language Models (LLMs/VLMs) are incredibly capable zero- and few-shot learners. However, to achieve peak performance on complex decision-making tasks—like navigating a web browser or cooking in a 3D household simulator—they need high-quality "exemplar" demonstrations in their context window.

Traditionally, these examples are painstakingly hand-written by domain experts. If you feed the model raw, sub-optimal demonstrations (like a confused human clicking the wrong buttons before finding the right one, or a passive video with no action labels), the model's performance tanks. The authors tackle a critical bottleneck: Can we teach VLMs to process messy, real-world demonstrations and distill them into perfect, generalized examples on their own?

Introducing In-Context Abstraction Learning (ICAL)

The authors propose In-Context Abstraction Learning (ICAL). Instead of just memorizing a sequence of actions, the agent learns to extract the underlying logic of a task.

Overview of the ICAL pipeline

The process operates in two main phases:

  1. VLM-Driven Abstraction: The system takes a noisy trajectory (e.g., a video of a human making mistakes while completing a task). It prompts a VLM (like GPT-4V) to correct inefficient actions and annotate the trajectory with "cognitive abstractions." These include:
  2. Causal relationships (why an action matters).
  3. Object state changes (e.g., predicting "the bowl will become clean").
  4. Temporal subgoals (step-by-step reasoning).
  5. Task construals (identifying the most relevant visual elements to pay attention to).
  6. Human-in-the-Loop (HITL) Verification: The agent attempts to execute this newly optimized plan in the environment. If it fails, a human observer provides natural language feedback (e.g., "The toaster is full right now"). The VLM uses this feedback to revise both its action plan and its abstractions.

Once an example is successfully executed, it is saved to an external memory bank. During deployment, the agent uses Retrieval-Augmented Generation (RAG) to pull the most relevant abstracted examples from this memory to help it solve novel tasks.

How ICAL Works in Practice

To understand why this is so powerful, consider how the agent handles a complex web navigation task.

Example of ICAL generating and revising abstractions for a web task

When given a user instruction and a noisy video demonstration, the VLM generates an initial set of abstractions and optimized actions. If the agent makes a mistake during execution—such as failing to fill out a required comments section—the human-in-the-loop provides simple feedback. The VLM then revises its task decomposition, abstraction comments, and predicted state changes, ultimately learning the correct sequence of actions. Because ICAL accepts natural language feedback rather than requiring humans to write code, non-experts can easily guide the agent to state-of-the-art performance.

Key Results Across Benchmarks

The authors evaluated ICAL across three diverse benchmarks, showing significant improvements:

  • TEACh (3D Household Simulation): ICAL achieved a 12.6% absolute improvement in goal-condition success over the previous state-of-the-art (HELPER), even though HELPER relied on expert hand-written examples.
  • VisualWebArena (Web Navigation): ICAL boosted the task success rate from 14.3% (the previous SOTA using GPT-4V + Set-of-Marks) to 22.7% (and up to 23.4% using GPT-4o).
  • Ego4D (Action Anticipation): ICAL outperformed few-shot GPT-4V and remained competitive with fully supervised models, despite using 639x less in-domain training data.
  • Fine-tuning Synergy: Fine-tuning a smaller model (GPT-3.5) on the ICAL-generated examples, combined with RAG, yielded an additional 4.9% boost in TEACh. This shows that self-generated abstractions make excellent training data for smaller, more efficient models.

Insights and Limitations

Storing the "why" and "how" (causal relationships, state changes) is vastly superior to just storing successful action sequences. It allows the model to generalize better to unseen environments because it understands the principles of the task. Furthermore, learning accelerates over time: as the agent's memory bank grows, it uses its own past abstractions to process new noisy demonstrations. In the second half of training, the agent required 38.8% fewer environment steps and 71.6% less human feedback per example.

However, the system has limitations. ICAL struggles if the initial demonstrations or the human feedback are extremely misleading. It also relies on a predefined set of actions (an API), which might restrict its adaptability in highly dynamic, open-ended environments. Finally, the system inherits the underlying visual grounding deficiencies of models like GPT-4V (e.g., struggling with precise spatial reasoning), which in-context learning alone cannot entirely fix.

Summary updated

BibTeX
@inproceedings{sarch2024vlm,
  author = {Gabriel Sarch and Lawrence Jang and Michael J. Tarr and William W. Cohen and Kenneth Marino and Katerina Fragkiadaki},
  title = {{VLM Agents Generate Their Own Memories: Distilling Experience into Embodied Programs of Thought}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=5G7MRfPngt},
}
Figure