Revolve: Optimizing AI Systems by Tracking Response Evolution in Textual Optimization

Peiyan Zhang, Haibo Jin, Leyang Hu, Xinnuo Li, Liying Kang, Man Luo, Yangqiu Song, Haohan Wang

TL;DR

REVOLVE is a novel optimization framework for LLM-based systems that moves beyond simple "first-order" textual feedback. By tracking how responses evolve across multiple iterations, it simulates second-order optimization effects (analogous to the Hessian in numerical calculus). This leads to more stable convergence, better performance on complex reasoning tasks, and significantly faster total runtimes.

What Problem Does This Paper Address?

In the burgeoning field of "Agentic AI," systems are often optimized using an LLM to provide textual feedback on its own (or another model's) outputs—a process known as textual optimization. Current state-of-the-art methods like TextGrad treat this feedback like a numerical gradient: they look at the immediate error and suggest a fix.

However, this "first-order" approach lacks memory. If the suggested adjustments are too small, the system stagnates in a local optimum. If they are too large or inconsistent, the system's performance fluctuates wildly.

REVOLVE vs First-Order Methods

This paper addresses the need for a more "thoughtful" optimization process that understands the trajectory of the system's responses over time, rather than just reacting to the most recent mistake.

Methods

The authors introduce REVOLVE (Responses EVOLVE), which extends the TextGrad framework by incorporating "Response Evolution Awareness."

Key technical components include:

  • Similarity Function ($S$): Instead of just looking at the current loss, REVOLVE uses an LLM to evaluate the similarity between responses from consecutive iterations ($t$ and $t-1$).
  • Second-Order Analogy: Mathematically, the authors show that by factoring in the change between iterations, they are effectively approximating a second-order derivative. While traditional deep learning uses a Hessian matrix to understand the "curvature" of the loss landscape, REVOLVE uses textual descriptions of response shifts to achieve a similar effect.
  • Refined Textual Gradients: The system prompt is designed to make the optimizer LLM reflect on how the responses have changed over time. This prevents the model from making the same ineffective tweaks repeatedly and encourages "nuanced, progressive adjustments."

Datasets

The researchers evaluated REVOLVE across three diverse and challenging domains:

  1. Prompt Optimization for Reasoning:
    • Object Counting (from Big Bench Hard): Testing the ability to count items in complex descriptions.
  2. GSM8K: Grade-school math word problems.
  3. Solution Optimization:
    • GPQA (Google-Proof QA): Expert-level science questions that are difficult even for non-expert humans to Google.
  4. MMLU (Massive Multitask Language Understanding): Specifically the Machine Learning and College Physics subsets.
  5. Code Optimization:
    • LeetCode Hard: Complex programming problems requiring intricate logic and efficiency.

Key Insights and Ideas

  • Textual Curvature: The most striking idea is that "curvature" in an optimization landscape can be captured through natural language. By asking an LLM to compare two versions of an answer, the system gains an intuition for whether it is "stuck" or "oscillating," allowing it to adjust its "step size" metaphorically.
  • Escaping Local Optima: First-order methods often hit a plateau where the feedback becomes repetitive. REVOLVE identifies this repetition as a signal to try a more significant or different type of adjustment, effectively "jumping" out of local minima.
  • Stability is Efficiency: While REVOLVE takes slightly more time per iteration (due to the extra context of past responses), it converges in far fewer steps. This leads to a "work smarter, not harder" result where total compute time is often halved.
  • The "Teacher" Effect: The framework allows a powerful model (like GPT-4) to act as an optimizer for a smaller, more cost-effective model (like Llama 3.1 8B), significantly boosting the smaller model's performance.

Key Results

REVOLVE consistently outperformed both standard TextGrad and Momentum-enhanced versions across multiple benchmarks.

Accuracy Improvements on Reasoning Tasks
  • Reasoning: On the Object Counting task using Llama 3.1 8B, REVOLVE achieved a 7.8% accuracy boost over TextGrad. It also showed solid gains for GPT-3.5 on GSM8K (6.2% improvement).
  • Scientific QA: In solution optimization tasks, REVOLVE saw an average 17.79% relative improvement in final accuracy compared to first-order methods.
  • Coding: On LeetCode Hard, it reached a 31% completion rate, a 29.17% improvement over the baseline.
  • Computational Efficiency: On the Object Counting dataset, REVOLVE reduced total runtime by 50% because it required fewer iterations to reach a superior solution.

Limitations and Future Work

  • Optimizer Dependency: The system's success depends heavily on the "optimization engine" (the LLM providing the feedback). If the optimizer is less capable than the model being optimized (as seen in some Gemini 1.5 Pro tests), the benefits diminish.
  • Context Window Pressure: Tracking multiple past iterations increases the number of tokens sent in each prompt, which could become a bottleneck for very long optimization chains.
  • Future Directions: The authors suggest exploring even more advanced optimization principles from classical mathematics—such as Adam-like adaptive learning rates or trust-region methods—translated into the textual domain. They also envision applying REVOLVE to multi-agent systems where several models must evolve their communication strategies simultaneously.

Summary updated

BibTeX
@inproceedings{zhang2025revolve,
  author = {Peiyan Zhang and Haibo Jin and Leyang Hu and Xinnuo Li and Liying Kang and Man Luo and Yangqiu Song and Haohan Wang},
  title = {{Revolve: Optimizing AI Systems by Tracking Response Evolution in Textual Optimization}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=4vb9BDTIDh},
}
Figure