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

DORA: Dynamic Optimization Prompt for Continuous Reflection of LLM-based Agent

Kun Li, Tingzhang Zhao, Wei Zhou, Songlin HuCOLING 2025

TL;DR

This paper introduces DORA, a novel framework that dynamically optimizes reflection prompts for LLM-based agents, overcoming the "Early Stop Reflection" problem where agents fail to improve after initial learning. By using a small language model and Bayesian optimization, DORA generates adaptive reflection advice, leading to significantly better performance on complex, long-term tasks.

What Problem Does This Paper Address?

Autonomous agents powered by Large Language Models (LLMs) show great promise, but their ability to learn from past mistakes, a process known as "reflection," is often limited. Previous "reflection" frameworks suffer from "Early Stop Reflection," where agents only improve in the initial stages of learning and then plateau. This happens because the reflection prompts are static and don't adapt to the agent's evolving needs or the task's complexity. Consequently, agents struggle with long-term, intricate tasks that require continuous adaptation and learning.

Methods

DORA tackles the "Early Stop Reflection" issue by introducing a dynamic prompt generation mechanism. The core idea is to replace static, hand-crafted reflection prompts with prompts that are adaptively generated and optimized. This is achieved through two main components:

  1. Prompter (Small Language Model - SLM): An external, open-source SLM (like Llama3-8B) is used to dynamically generate reflection prompts. This Prompter receives feedback from the agent's performance and the diversity of its reflection suggestions.
  2. Bayesian Optimization (BO): A non-gradient BO algorithm is employed to optimize a low-dimensional "soft prompt" that controls the SLM's prompt generation. This allows the system to iteratively refine the prompts based on agent performance and diversity metrics, ensuring the reflection process evolves and remains effective over time.

The DORA framework integrates these components to create a feedback loop: the agent acts, generates trajectories, the Prompter generates a task-adaptive reflection prompt, the Reflector provides suggestions based on this prompt, and the BO algorithm updates the soft prompt based on the agent's rewards and suggestion diversity.

Datasets

The experiments were conducted in two environments:

  • MiniWoB++: A web-based simulation environment designed for evaluating agents on a variety of computer tasks, ranging from simple clicks to complex reasoning tasks like booking flight tickets. It features a unified action space and is suitable for systematic assessment.
  • Alfworld: A collection of over 3,000 text-based interactive environments that present agents with multi-step tasks, often involving navigating and manipulating objects in simulated daily living scenarios.

Key Insights and Ideas

  • "Early Stop Reflection" is a real limitation: The paper empirically demonstrates that standard reflection methods plateau quickly, hindering continuous learning.
  • Dynamic prompts are crucial: Static prompts are insufficient for long-term agent adaptation; prompts need to evolve with the agent and task.
  • Bayesian Optimization for prompt tuning is effective: BO provides a powerful, gradient-free method to optimize prompt generation by balancing task performance and reflection diversity.
  • Diversity as an optimization objective matters: Including diversity in reflection suggestions helps prevent repetitive advice and encourages exploration, even when task performance is initially low.
  • SLMs can act as effective prompt generators: Leveraging smaller, specialized language models for prompt generation is a viable and efficient approach.

Key Results

  • Significant Performance Improvement: DORA achieved an average task success rate increase of 19% in MiniWoB++ and 9% in Alfworld compared to baseline methods.
  • Mitigation of "Early Stop Reflection": Experiments showed that DORA effectively maintains iterative improvements, unlike baseline reflection methods that plateau early. Figure 4 illustrates a more uniform distribution of successful reflection rounds with DORA.
  • Superior Performance on Difficult Tasks: DORA demonstrated the most significant improvements on challenging "n-screen-n-steps" tasks in MiniWoB++, indicating its strength in complex scenarios.
  • Improved Reward Metrics: DORA consistently achieved higher median, mean, and IQM (interquartile mean) scores for agent rewards, with a lower optimality gap, indicating more effective and stable performance.
  • Effective Prompt Adaptation: Ablation studies showed that DORA with Bayesian Optimization significantly outperformed DORA without BO, highlighting the importance of adaptive prompt generation.

Limitations and Future Work

  • Limited Environments: The current study was conducted in only two environments (MiniWoB++ and Alfworld). Future work could extend the evaluation to a broader range of settings to assess generalizability.
  • "Toxic Reflection" persists: While DORA effectively turns many "ineffective" reflections into "effective" ones, it doesn't entirely eliminate "toxic reflections" (where reflection leads to worse performance). Addressing this issue remains an area for future research.
  • Soft Prompt Dimensionality: The paper found that extremely low soft prompt dimensions can hurt performance, while very high dimensions can increase computational costs. Further research could explore optimal dimensionality ranges and more efficient optimization strategies.
  • Hyperparameter Tuning: While the paper explored the impact of the diversity-task performance weight (alpha), systematic evaluation of other hyperparameters could further refine the method.

Summary updated

BibTeX
@inproceedings{li2025dora,
  author = {Kun Li and Tingzhang Zhao and Wei Zhou and Songlin Hu},
  title = {{DORA: Dynamic Optimization Prompt for Continuous Reflection of LLM-based Agent}},
  booktitle = {International Conference on Computational Linguistics},
  year = {2025},
  url = {https://openreview.net/forum?id=okkIQZIIbO},
}
Figure