Abstract
Large-scale generative language and vision-language models (LLMs and VLMs) excel in few-shot in-context learning for decision making and instruction following. However, they require high-quality exemplar demonstrations in their context window. In this work, we ask: Can LLMs and VLMs generate their own examples from generic, sub-optimal demonstrations? We propose In-Context Abstraction Learning (ICAL), a method that builds a memory of multimodal experience from sub-optimal demonstrations and human feedback. Given a task demonstration that may contain inefficiencies or mistakes, a VLM abstracts the trajectory into a generalized program of thoughts by correcting inefficient actions and annotating cognitive abstractions: causal relationships, object state changes, temporal subgoals, and task-relevant visual elements. These programs of thought are iteratively improved through human feedback while the agent executes the trajectory in a similar environment. The resulting examples significantly improve decision-making in retrieval-augmented LLM and VLM agents. Moreover, as the agent's library of examples grows, it becomes more efficient, relying less on human feedback and requiring fewer environment interactions per demonstration. Our ICAL agent surpasses the SOTA in dialogue-based instruction following in TEACh, multimodal web agents in VisualWebArena, and action anticipation in Ego4D. In TEACh, we achieve a 12.6% improvement in goal-condition success. In VisualWebArena, our task success rate improves over few-shot GPT4V. In Ego4D action forecasting, we improve over few-shot GPT-4V and remain competitive with supervised models.
1. Introduction
While large Vision-Language Models (VLMs) like GPT-4V are impressive few-shot learners, they are highly sensitive to the quality of the demonstrations provided in their prompts. In real-world settings, demonstrations are rarely perfect: human experts may make redundant moves, passive video demonstrations often lack explicit action labels, and agents frequently fail during initial exploration.
Existing methods typically store successful trajectories as-is, but these "raw" memories often contain noise and lack the underlying reasoning—the why behind an action—that is crucial for generalizing to new environments. We address this "demonstration gap" by enabling agents to introspect on their experiences and generate structured, annotated memories, or "programs of thought," that are significantly more useful for future decision-making.
2. Methodology: In-Context Abstraction Learning (ICAL)
The ICAL framework operates in two primary phases to transform suboptimal experience into high-quality multimodal memory.
2.1 Abstraction Phase
Given a noisy or suboptimal trajectory, a VLM acting as an "editor" transforms it into an optimized Python-like script. Crucially, it adds four types of cognitive abstractions:
- Task and Causal Relationships: Explaining the necessity of specific actions.
- Object State Changes: Predicting how actions affect the environment (e.g., a bowl becoming "clean").
- Temporal Subgoals: Decomposing complex tasks into a step-by-step plan.
- Task Construals: Identifying goal-relevant visual elements.
2.2 Human-in-the-Loop (HITL) Refinement
The agent attempts to execute its newly generated script. If it fails, a human provides natural language feedback (e.g., "The toaster is full, you can only toast one slice"). The VLM uses this feedback to revise the script and the associated abstractions. Once successful, the resulting program of thought is stored in a memory library for Retrieval-Augmented Generation (RAG) during deployment.
3. Experimental Evaluation
We evaluated ICAL across three distinct benchmarks:
- TEACh: Dialogue-based instruction following in simulated household environments (AI2-THOR).
- VisualWebArena: Autonomous agents performing complex tasks on live websites.
- Ego4D: Long-term action forecasting using egocentric video data.
4. Results and Discussion
ICAL achieved state-of-the-art results across all tested benchmarks. In TEACh, combining fine-tuning with ICAL retrieval outperformed raw human demonstrations by 17.5% in goal-condition success. In VisualWebArena, using ICAL with GPT-4V improved task success by 1.6x, while fine-tuning a smaller model (Qwen2-VL) yielded a 2.8x improvement. In Ego4D, ICAL remained competitive with supervised models that utilized over 600x more in-domain training data.
4.1 Meta-Learning Efficiency
A significant finding was the emergence of learning efficiency as the memory library grew. In the latter half of TEACh experiments, the agent required 38.8% fewer environment steps and 71.6% less human feedback per example. This suggests that ICAL scales effectively, with ten processed examples providing a larger performance boost than a much larger volume of raw human demonstrations.
4.2 Limitations
ICAL currently relies on a fixed action API and cannot yet learn entirely new low-level motor skills. Additionally, while VLMs are powerful, they still suffer from grounding deficiencies, occasionally missing small visual details. Future work will explore self-defined action APIs and improved multimodal integration for more robust visual grounding.
5. Conclusion
ICAL demonstrates that distillation and abstraction are superior to simple mimicry for multimodal agent learning. By transforming messy, real-world experience into structured cognitive programs, ICAL significantly reduces the reliance on manual prompt engineering and provides a scalable path for agents to learn continually from their own interactions.
Summary updated