NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Learn-by-interact: A Data-Centric Framework For Self-Adaptive Agents in Realistic Environments

Hongjin Su, Ruoxi Sun, Jinsung Yoon, Pengcheng Yin, Tao Yu, Sercan O Arik

Abstract

Large Language Model (LLM) agents often struggle in specialized digital environments due to a lack of high-quality, environment-specific training data. We present Learn-by-interact, a data-centric framework that enables agents to autonomously adapt to new environments. By leveraging a novel "backward construction" process, the framework transforms agent-environment interaction trajectories into high-quality synthetic data. Our evaluation across four diverse benchmarks—SWE-bench, WebArena, OSWorld, and Spider2-V—demonstrates significant performance gains in both in-context learning and fine-tuning scenarios, outperforming existing retrieval and reasoning-based methods.

Introduction

While LLMs have shown remarkable capabilities, their deployment as agents in complex, real-world digital environments (e.g., software engineering, web navigation, desktop automation) remains challenging. Standard adaptation techniques, such as fine-tuning or few-shot prompting, rely heavily on high-quality, human-annotated examples. However, collecting such data is prohibitively expensive and slow, as it requires experts to meticulously record multi-step interactions.

Existing synthetic data generation methods often face the issue of misalignment. When an agent fails a task, the resulting trajectory does not match the initial instruction. Training on this noisy data can degrade performance. Learn-by-interact addresses this by autonomously generating aligned, high-quality data for any target environment.

The Learn-by-interact Framework

The framework employs a four-stage pipeline designed to turn every interaction into a learning opportunity:

  1. Self-Instruct: The system generates diverse task instructions by analyzing environment-specific resources like documentation, tutorials, and FAQs.
  2. Agent-Environment Interaction: An LLM agent attempts to solve these tasks, recording its observations and actions.
  3. Backward Construction: This core innovation re-evaluates "failed" trajectories. Instead of discarding them, an LLM analyzes a sub-trajectory and generates a new instruction that accurately describes the actions taken. This ensures perfect alignment between the instruction and the trajectory.
  4. Filtering & Adaptation: An "LLM committee" filters the synthesized data for quality. The resulting dataset is used for Supervised Fine-Tuning (SFT) or In-Context Learning (ICL). For ICL, we use Agentic Retrieval, which matches current states with successful historical observations.
Overview of the Learn-by-interact framework, illustrating the pipeline from self-instruction to agentic retrieval.

Experimental Evaluation

We evaluated Learn-by-interact across four realistic benchmarks:

  • SWE-bench: Resolving real-world software engineering issues from GitHub.
  • WebArena: Navigating complex web environments (e-commerce, forums, etc.).
  • OSWorld: Performing open-ended tasks in a desktop environment (Ubuntu).
  • Spider2-V: Professional data science and engineering workflows (BigQuery, Airbyte).

Results and Analysis

Learn-by-interact consistently outperformed existing approaches across all benchmarks and models.

Performance comparison of Learn-by-interact against existing baselines and RAG-based methods across four benchmarks.

Key Findings

  • Significant Performance Gains: Using Claude 3.5-Sonnet on OSWorld, performance nearly doubled, increasing from 12.4% to 22.5%. For fine-tuned models like Codestral-22B on WebArena, performance rose from 4.7% to 24.2%.
  • The Value of Mistakes: Backward construction allows the system to utilize failed attempts. For instance, a failed file upload might be repurposed as a successful example of navigating a specific UI menu.
  • Efficiency: Unlike test-time reasoning methods (e.g., LATS, Reflexion) that require multiple LLM calls during inference, Learn-by-interact shifts the computational burden to the offline synthesis phase, resulting in lower latency and token usage during deployment.
  • Granularity: Short, "atomic" trajectories (under 5 steps) were found to be more effective for training than long, complex ones, as they generalize better as building blocks for larger tasks.

Conclusion

Learn-by-interact provides a scalable, autonomous path for adapting LLM agents to new environments without human intervention. While the initial synthesis phase is computationally intensive, the resulting performance gains and inference-time efficiency make it a robust solution for real-world agent deployment. Future work will explore multi-modal extensions and generalist agent training.

Summary updated

BibTeX
@inproceedings{su2025learn,
  author = {Hongjin SU and Ruoxi Sun and Jinsung Yoon and Pengcheng Yin and Tao Yu and Sercan O Arik},
  title = {{Learn-by-interact: A Data-Centric Framework For Self-Adaptive Agents in Realistic Environments}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=3UKOzGWCVY},
}
Figure