TL;DR
Even after seeing concrete environment feedback like SQL query results or error messages, LLM agents are surprisingly bad at telling whether they actually solved a task—and standard reinforcement learning (RL) accidentally trains them to suppress honest self-doubt. This paper introduces RefGRPO, a clever RL tweak that adds a zero-cost calibration bonus by simply checking if the agent's self-assessment matches reality. The result is an agent that not only solves tasks better, but effectively becomes its own grounded verifier, unlocking reliable self-improvement and smarter test-time filtering.
What Problem Does This Paper Address?
Imagine writing a SQL query, running it, seeing a clean table of results, and still panicking that your code is broken. Surprisingly, LLM agents do this all the time. While we usually worry about LLMs hallucinating with unearned confidence, agents interacting with real environments suffer from severe underconfidence—frequently flagging their own right answers as wrong even after seeing concrete execution feedback. The author calls this persistent blind spot the reflection gap.
Why doesn't standard Reinforcement Learning (like GRPO, which rewards models based on final task outcomes) fix this? Because of a structural credit-assignment mismatch:
- Honest failure: If an agent writes a bad query and honestly flags it as wrong, the final task outcome is still zero. Standard RL penalizes the entire trajectory, effectively teaching the agent: never admit you failed.
- Doubtful success: If an agent gets the right answer despite flagging it as an error, the final outcome is a win. Standard RL rewards the whole trajectory, accidentally reinforcing neurotic self-doubt.
Standard RL makes the model a stronger coder, but leaves its ability to read the room—its post-feedback reflection—completely broken.
Methods
To fix this without hiring an expensive LLM judge or training a separate reward model, the author proposes RefGRPO, which augments a modernized GRPO baseline ($\text{GRPO}^+$) with two simple ingredients:
- A "Free" Calibration Bonus: At the end of an interaction, the agent outputs a binary reflection score ($1$ for "I solved it", $0$ for "I didn't"). During RL training, we already know the ground-truth outcome ($1$ or $0$). RefGRPO compares the two: if the agent's reflection matches reality, it gets a small bonus $\alpha(t)$ added to its reward. Now, an honest error flag beats a delusional failure, and a confident win beats a doubtful win.
- A Dynamic Schedule: If you reward calibration forever, the model spends a bit too much capacity being a good critic at the expense of raw task-solving. RefGRPO uses a two-stage schedule: it sets the bonus weight $\alpha = 0.1$ for the first two-thirds of training to "front-load" good calibration habits, then drops $\alpha$ to $0$ (while masking gradients on reflection tokens so they don't unlearn calibration) for the final stretch to focus purely on task accuracy.
To evaluate both task solving and self-awareness together, the paper also adapts the ChowScore from statistical learning—a unified metric that rewards correct answers when the agent commits, while giving partial credit ($\beta = 0.1$) when it honestly flags an error.
Datasets
No new datasets are introduced; the paper relies on established environments with verifiable binary outcomes:
- Text-to-SQL (Training): 4,660 problems sampled from Spider and SynSQL-2.5M.
- Text-to-SQL (Evaluation): Five standard benchmarks—Spider-Dev, Spider-DK (Domain Knowledge), Spider-Realistic, Spider-Test, and Bird-Dev.
- Wordle: Used to test out-of-domain transferability via the
prime-rlframework, evaluating on held-out five-letter secret words.
Key Insights and Ideas
- Standard RL breeds yes-men during self-improvement: If you try to train a standard RL agent further without ground-truth labels—using its own reflections as pseudo-rewards—it quickly collapses into asserting 100% confidence on everything. Because all rewards become constant, group-normalized advantages hit zero and learning flatlines. A RefGRPO-trained agent stays calibrated (committing ~83% of the time), allowing genuine verifier-free self-improvement.
- Agents can act as their own test-time verifiers: When sampling multiple candidate solutions at test time, you don't need an external verifier if the agent knows when it succeeded. Committing only to rollouts the agent flags as
1noticeably boosts accuracy over naive averaging. - Calibration front-loading sticks: Teaching an agent to accurately interpret environment feedback early in training creates a durable skill that persists even after you turn off the bonus to maximize raw task performance.
Key Results
Across Llama-3.2-3B and Qwen2.5-Coder (3B and 7B), RefGRPO consistently beats outcome-only $\text{GRPO}^+$:
- Crushing Underconfidence: On multi-turn text-to-SQL with Qwen2.5-Coder-7B, the base model's underconfidence rate is a whopping 54.3% (over half of its self-flagged "errors" were actually right!). $\text{GRPO}^+$ barely nudges this to 44.4%, whereas RefGRPO slashes it to 7.7%, while simultaneously lifting task accuracy from 75.1% to 76.5% and ChowScore from 73.0% to 76.5%. (On Qwen-3B single-turn, underconfidence drops to 1.3%!)
- Verifier-Free Self-Improvement: Using reflections as pseudo-rewards for 2 extra epochs lifts a RefGRPO checkpoint's accuracy by +2.8 points (67.1% $\rightarrow$ 69.9%), compared to just +0.5 points for $\text{GRPO}^+$.
- Test-Time Selective Prediction: Filtering 8 test-time rollouts using the agent's reflection boosts single-turn accuracy by +1.6% over the average rollout (vs. +0.6% for $\text{GRPO}^+$).
- Transfer to Wordle: Continuing RL on a 1.7B Wordle model for 200 steps boosts reflection accuracy from 33.1% to 70.8% and ChowScore from 23.6% to 66.8%, while edging up win rate (78.4% $\rightarrow$ 79.8%).
Limitations and Future Work
- Scale and Scope: Due to compute limits, experiments cap out at 7B parameters and focus on text-to-SQL and Wordle. Testing on larger frontier-scale models and broader tool-use or coding environments remains open.
- Schedule Tuning: The two-stage schedule introduces new hyperparameters ($\alpha_0, \alpha_1$, and the switch point $\gamma$) that may require tuning for new environments.
- Binary Reflections: A
0or1flag captures the direction of certainty, not its magnitude. Extending post-feedback reflection to continuous, real-valued probabilities is a natural next step—especially for harder guessing games like Wordle, where underconfidence remained above 70%.
Summary updated