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

Optimistic Online Learning for Coding Agents with Aggregate Feedback

Hao Luan, Hao Qiu, Zhi Zheng, See-Kiong Ng, Zhiyong HuangarXiv 2026

Imagine you’ve hired a junior developer to fix a complex bug in a massive codebase. They have to navigate files, run tests, and edit code over dozens of steps. Halfway through, they start "overthinking"—going down a rabbit hole that has nothing to do with the bug. You could nudge them back on track, but here’s the catch: you only get to see if they actually fixed the bug at the very end. You don't know which specific nudge at step 20 or step 45 was the one that saved the day.

This is the "credit assignment" problem for LLM coding agents, and it’s exactly what this paper tackles.

TL;DR

Coding agents often drift off-course during long tasks, and while "activation steering" (nudging the LLM's internal math) can help, no single nudge works for every task. This paper introduces a framework that dynamically picks the best steering strategy on the fly, using internal "hints" from the LLM to make guesses and final task results to correct them, significantly boosting success rates on real-world coding benchmarks.

What Problem Does This Paper Address?

Large Language Model (LLM) agents are great at short tasks but often suffer from behavioral drift during long-horizon engineering work. They might start repeating themselves or hallucinating irrelevant actions.

Researchers have found that "activation steering"—intervening in the LLM’s internal transformer residual streams—can regularize these behaviors. However, current methods usually apply a static steering policy. The problem? A nudge that helps fix a logic error in Python might be disastrous when the agent is trying to write documentation.

The challenge is that we only get aggregate feedback (a "Pass/Fail" at the end of the task). We don't see "turn-level" rewards. If an agent takes 100 turns to solve a problem, how do we know which steering policy was effective at turn 5, and which was a waste of time at turn 50?

Methods

The authors frame this as a Multi-Armed Bandit (MAB) problem with a twist: delayed, aggregate feedback and turn-level predictive hints.

They introduce Online Optimistic Activation Steering (OOAS). Here’s the intuitive breakdown:

  1. The Hints: Before each turn, the system looks at the LLM's internal activations to generate "hints"—provisional estimates of how well different steering policies might work.
  2. Optimistic Selection: It uses these hints to pick a steering policy (using a Follow-the-Regularized-Leader approach). It’s "optimistic" because it acts as if the hints are true until proven otherwise.
  3. Shared Noise: To solve the credit assignment problem, they use a clever sampling trick. They draw "noise" once at the start of a task and reuse it. This encourages the agent to stick with a policy long enough to see if it actually works, making the math for "who gets credit" much cleaner.
  4. The Correction: Once the task is finished and the real reward (Pass/Fail) is revealed, the algorithm calculates the "residual"—the difference between what the hints predicted and what actually happened—and updates its strategy for the next task.

They also developed an adaptive version (Algorithm 2) that doesn't need to know the "prediction error budget" in advance; it automatically adjusts its learning rate as it gains experience.

Datasets

The researchers evaluated their framework on two rigorous, realistic benchmarks:

  • SWE-Bench Verified (SWE-V): 500 real-world software engineering tasks pulled from GitHub.
  • Terminal Bench 2.0 (TB2): 89 tasks requiring complex command-line interactions.
  • Simulations: They also ran extensive synthetic simulations to prove their theoretical "regret bounds" (essentially, proving that their algorithm learns as efficiently as mathematically possible).

Key Insights and Ideas

  • Static is Stale: The authors proved via a case study that no single steering hyperparameter ($\lambda$) is optimal for all tasks. As shown in the table below, an "adaptive oracle" that switches policies can solve tasks that any single fixed policy would fail.
Table 1: Resolving rates of different static steering policies in the 4-task case study (✓= resolved, × = unresolved).
  • Hints are a Superpower: Even if the hints are imperfect, using them to guide turn-level decisions is vastly superior to waiting for the end of a task to learn anything.
  • Theoretical Optimality: They established a "minimax optimal" regret bound. In plain English: they proved that their method is about as good as any algorithm can possibly be at this specific problem.

Key Results

The OOAS framework consistently outperformed both vanilla LLMs and static steering methods:

  • SWE-Bench Verified: The success rate jumped from 55.0% (vanilla) to 65.0% (their best adaptive method).
  • Terminal Bench 2.0: Success rates rose from 28.1% to 34.8%.
  • Vs. Naive Baselines: It beat standard bandit algorithms (like B-EXP3) because those algorithms are "blind" during the task, whereas OOAS uses internal LLM hints to stay "optimistic" and proactive.

Limitations and Future Work

  • Hint Dependency: The method relies on having a good source of "hints" (like the TACT behavioral scores). If the hints are pure noise, the performance gains diminish (though the algorithm is designed to be resilient to this).
  • Additive Reward Assumption: The mathematical model assumes rewards are additive across turns. In reality, coding is often "all or nothing"—one bad turn can ruin a whole task regardless of how good the other 99 turns were.
  • Computational Overhead: While they use analytical shortcuts, calculating hints for every candidate policy at every turn adds some inference-time latency.

In short, the paper provides a solid mathematical foundation for "steering" agents through the fog of long-duration tasks, turning internal LLM vibes into actionable, winning strategies.

Summary updated

BibTeX
@misc{luan2026optimistic,
  author = {Hao Luan and Hao Qiu and Zhi Zheng and See-Kiong Ng and Zhiyong Huang},
  title = {{Optimistic Online Learning for Coding Agents with Aggregate Feedback}},
  year = {2026},
  eprint = {2611.30405},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.30405},
}
Figure