WHALE Optimizes AI Agent Performance Through Joint Harness-Weight Learning

Haechan Kim, Yoonho Lee, Gisang Lee, Chelsea Finn, Kangwook Lee· September 2, 2026 View original

Key takeaways

  • AI agent performance depends on both model weights and harness code.
  • WHALE jointly optimizes both components through alternating learning phases.
  • It significantly outperforms isolated optimization methods across domains.
  • Interleaved updates are more effective than sequential optimization.

Who benefits

AI/TechSoftware DevelopmentGamingRoboticsCustomer Service

Summary

Researchers introduce WHALE (Weight-Harness Alternating LEarning), a simple recipe that jointly optimizes both model parameters (weights) and the executable harness code for AI agents. By alternating between updating the model and searching for a better harness, WHALE significantly outperforms isolated optimization methods across various domains, improving accuracy by 4.15-24.38 percentage points.

The performance of AI agents is a complex interplay between the underlying model parameters (weights) and the "harness" code that manages context and control flow. Optimizing these components in isolation often leads to bottlenecks, as changes in one can render the other suboptimal. Existing joint-adaptation methods typically focus on weights and prompts, leaving the broader harness fixed. A new approach, Weight-Harness Alternating LEarning (WHALE), proposes a simple yet effective recipe for joint optimization. WHALE alternates between two phases: updating the model's weights given the current harness, and then searching for an improved harness given the updated model. This iterative process allows both components to adapt synergistically. Instantiated with online rejection-sampling fine-tuning for weights and Meta-Harness for harness search, WHALE demonstrated significant performance gains. Across domains like search question answering, mathematical reasoning, and chess puzzles, WHALE outperformed weight-only, harness-only, and Fast-Slow Training by 4.15-24.38 percentage points in accuracy. The research highlights that either component can be the primary bottleneck, and small, interleaved updates are more effective than sequential, stagewise optimization.

Why it matters

WHALE provides a practical and effective method for substantially improving the performance of AI agents by recognizing and optimizing the critical interplay between model weights and their operational harness, leading to more capable and robust AI systems.

How to implement this in your domain

  1. 1Adopt the WHALE methodology for developing and fine-tuning AI agents in complex tasks.
  2. 2Implement alternating optimization strategies for model weights and control flow logic in AI applications.
  3. 3Evaluate the impact of joint optimization on agent performance compared to traditional isolated approaches.
  4. 4Develop internal tools or frameworks that facilitate the iterative search and update of agent harnesses.

Original post by Haechan Kim, Yoonho Lee, Gisang Lee, Chelsea Finn, Kangwook Lee

"arXiv:2609.00196v1 Announce Type: new Abstract: Agent performance depends jointly on the model parameters and the executable harness code that manages context and control flow. Optimizing either component in isolation can leave the system bottlenecked by its frozen counterpart: w…"

View on X

Originally posted by Haechan Kim, Yoonho Lee, Gisang Lee, Chelsea Finn, Kangwook Lee on X · view source

Want to go deeper?

Turn these trends into skills with Learnijoy's hands-on AI & tech courses.

Explore courses