Task-CoEvolve: Efficient Harness Optimization via Adaptive Validation Task Selection

Atsuyuki Miyai, Kiyoharu Aizawa, Toshihiko YamasakiarXiv 2026

TL;DR

Task-CoEvolve is a new framework that slashes the compute cost of optimizing Large Language Model (LLM) "harnesses" by up to 80%. Instead of evaluating every new harness candidate on an entire validation benchmark, it dynamically selects a small, highly informative subset of tasks near the model's current capability frontier and mathematically estimates the full-set performance.

What Problem Does This Paper Address?

When deploying LLM agents, the "harness"—the wrapper code that manages prompts, memory retrieval, and tool interactions—is just as crucial as the model weights themselves. Tweaking the harness can lead to massive performance boosts (up to 6×), prompting a surge in automated harness optimization methods where an AI agent iteratively rewrites and tests this wrapper code.

However, existing optimization methods suffer from a massive bottleneck: at every single iteration, they evaluate every candidate harness on the entire validation dataset. This is incredibly expensive, especially for complex, long-horizon tasks (like terminal-based coding agents) that can take tens of minutes per run. Furthermore, this static approach wastes compute on tasks that are either already trivial or still completely impossible for the current iteration of the harness, providing zero useful signal for optimization.

Figure 1: Comparison between existing harness optimization and our Task-CoEvolve.

Methods

The authors introduce Task-CoEvolve, a method that co-evolves the validation task set alongside the harness through two core phases:

  1. Variance-Weighted Task Selection: Instead of uniform sampling, Task-CoEvolve prioritizes tasks based on the Bernoulli variance of their historical success rates. Tasks where previous candidate harnesses disagreed (some succeeded, some failed) have high variance and are deemed highly informative. Tasks that are consistently solved or failed have zero variance and are deprioritized. An uncertainty bonus ($\lambda/\sqrt{n_t}$) ensures that rarely tested tasks aren't prematurely ignored.
  2. Sampling-Aware Full-Set Estimation: Because different iterations evaluate different subsets of tasks, raw scores cannot be directly compared. Task-CoEvolve uses task inclusion probabilities to mathematically estimate what the score would have been across the full dataset. Depending on the benchmark structure, it deploys either a Hájek estimator (ideal for pools with extreme success rates near 0 or 1) or an Anchored difference estimator (which measures deviations from historical baselines to prevent rare samples from dominating the score).
Figure 2: Overview of the Task-CoEvolve procedure. Task-CoEvolve first selects a subset of tasks from the full validation set using variance-weighted sampling and evaluates the candidate harness on the selected tasks. The resulting outcomes are used to update the validation-task statistics. Finally, Task-CoEvolve estimates the full-set accuracy from the sampled evaluations.

Datasets

The authors evaluated Task-CoEvolve across two distinct environments:

  • Online Text Classification: Evaluated using three datasets with varying difficulties: LawBench (predicting criminal charges; 215 classes), Symptom2Disease (predicting diseases from symptoms; 22 classes), and USPTO-50k (predicting chemical reactants; 180 classes).
  • Terminal-Bench 2.1: A highly practical, compute-intensive benchmark consisting of 89 challenging, long-horizon command-line tasks requiring fully autonomous execution in a sandboxed environment.

Key Insights and Ideas

  • The Capability Frontier Matters Most: Tasks that consistently pass or fail provide almost no ranking signal for candidate harnesses. Over 70% of a typical static validation budget is wasted on these uninformative extremes.
  • Validation Sets are Moving Targets: As a harness evolves, the difficulty distribution of the tasks shifts. Tasks that were once excellent discriminators become too easy. Task-CoEvolve naturally adapts to this drift by shifting its sampling distribution toward harder tasks over time.
  • Subsampling Acts as a Regularizer: Surprisingly, evaluating on a dynamic subset can actually outperform full-set evaluation. This is because full-set search tends to overfit to the specific validation set, whereas rolling task subsets mitigate this risk.

Key Results

  • Massive Efficiency Gains: On Terminal-Bench 2.1, Task-CoEvolve matched the final performance of a full-set search while using only 20% of the evaluations, reducing the total token search cost by 67% to 80% and cutting total search time in half.
  • Superior Performance with Less Data: In online text classification with a 20% evaluation budget, Task-CoEvolve achieved an average accuracy of 49.3%, actually outperforming the expensive 100% full-set search baseline (48.6%) due to reduced overfitting. Even at an extreme 7% budget, it nearly matched full search performance.

Limitations and Future Work

A key limitation of Task-CoEvolve is that it pre-allocates a fixed sample size (e.g., 20%) for every candidate before observing any execution results. It cannot dynamically perform early stopping on a candidate that is clearly failing early on, nor can it allocate extra tasks to break a close tie between two highly competitive candidates. The authors note that developing an adaptive, sequential allocation size during evaluation is a promising direction for future work.

Summary updated

BibTeX
@misc{miyai2026task,
  author = {Atsuyuki Miyai and Kiyoharu Aizawa and Toshihiko Yamasaki},
  title = {{Task-CoEvolve: Efficient Harness Optimization via Adaptive Validation Task Selection}},
  year = {2026},
  eprint = {2608.20169},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2608.20169},
}
Figure