Turning Database Grading into RL Rewards: Post-Training Agents with ThinkingBox

In this articleContentsWhat the benchmark found, in sixty secondsResults: the dependability column moved Database grading becomes training rewards in new Microsoft and…

By Vane October 22, 2026 4 min read
Turning Database Grading into RL Rewards: Post-Training Agents with ThinkingBox


Database grading becomes training rewards in new Microsoft and Hugging Face method

This is the follow up to our first blog post, The Agent Said It Was Done. The Database Disagreed. ThinkingBox-Training is now available on GitHub.

The team built ThinkingBox to evaluate an agent’s work by comparing the final database state with the expected outcome. They then used the same kind of executable signal as a reward on training tasks outside ThinkingBox-Bench. For Qwen3.8-27B, average success rose from 51.70% to 60.78%, while tasks completed correctly on all twenty attempts rose from 38 to 107 with 50 GRPO steps.

Figure 1. ThinkingBox turns executable checks of terminal database state into rewards for post-training agents on tasks outside ThinkingBox-Bench.

This is a joint blog by Microsoft and Hugging Face, special thanks to Mirco Milletari and Xiang Jiang from Microsoft, Sergio Paniego from Hugging Face and our former intern Zhuochun Li (University of Pittsburgh) for co-authoring/reviewing efforts.

The team built ThinkingBox to catch agents that say they are done when they are not.

Each of its 507 tasks in ThinkingBox-Bench (our benchmark dataset) hands an agent a real backend and a set of tools, lets it work, then checks what really changed in the database. In the first post, they caught a model closing a customer’s ticket as resolved while the carrier exception behind it was still open. Nine competent-looking tool calls, one wrong database row.

Then they noticed what they had built. For most tasks, an executable check can return 1 or 0 directly from the final database state. That is not just a grader. This can be a reward function.

So they constructed a training pool from ThinkingBox-format tasks outside the benchmark and used their executable outcomes as rewards. The catch was choosing which tasks are suitable for agent training: most tasks are either already solved or hopeless for the model in front of you, and both teach it nothing.

Difficulty is policy-relative: a task is hard for the current model only until that model learns it.

They call this offline policy-relative difficulty. They estimated each task’s success probability once using the base policy before training and kept the selected training pool fixed throughout the run.

What happened after training

They used offline policy-relative difficulty to build the training pool, then fine-tuned Qwen3.8-27B with GRPO for 50 steps. To recap, they evaluate each of the 507 benchmark tasks 20 times. pass@1 measures average success across all 10,140 attempts. pass@20 measures the share of tasks solved at least once. Observed 20/20 measures the share of tasks that pass every recorded attempt.

Table 1. Qwen3.8-27B results before and after 50 steps of GRPO on the offline-selected training pool.

MetricBaseRL fine-tunedChange
Observed 20/2038 (7.50%)→107 (21.10%)+69 tasks
pass@1 (successful attempts)5,242 (51.70%)→6,163 (60.78%)+9.08 pt
pass@20 (tasks solved at least once)453 (89.35%)→446 (87.97%)−7 tasks

Training sharply increased repeatable success, with a small decline in at-least-once coverage. The rest of the post explains how they selected practice tasks, built the reward loop, and measured that tradeoff.

What does that improvement look like on one task? A traveler requests a room downgrade, but company policy requires manager approval first. Before training, the agent changed the booking and issued refunds without approval in 15 of 20 attempts. After RL fine-tuning, it preserved the booking and payment state in all 20.

Figure 2. One corporate hotel-booking task, 20 attempts per model. The base Qwen3.8-27B model changed the booking without required manager approval in 15 attempts. The RL fine-tuned model preserved booking and payment state in all 20; all expected records matched in 19.

Contents

  • What the benchmark found, in sixty seconds
  • Results: the dependability column moved
  • Where the gains landed
  • What dependability costs
  • The training loop
  • Offline policy-relative difficulty
  • What earns a reward
  • Run the training stack
  • Where this goes next

In a hurry? The headline result is above. The implementation is in Run the training stack.

What the benchmark found, in sixty seconds

ThinkingBox-Bench grades agents on the database records they leave behind. Each of its 507 tasks starts a real backend, hands the agent a set of MCP tools and a simulated LLM user with private context, and at the end runs executable checks against the terminal database state. Checks are against the backend record that needs to be correct, not the specific tool calls. This incentivizes the model to discover possibly new solution paths rather than “rediscover” the human-backed solution, that might be suboptimal albeit correct.

In their first post they ran eighteen models through that benchmark twenty times each and reported a gap that headline accuracy hides. Kimi-K3 solved 93.89% of tasks at least once but completed only 68 of 507 tasks (13.41%) on all twenty recorded attempts. Claude Opus 5 inverted it: narrower coverage, far more consistency.

And bigger or better model did not close it. Claude Opus 5.5 scored 0.66 percentage points higher than Claude Opus 5 on pass@1, yet passed exactly the same number of tasks, 241, on all twenty attempts. That gain in headline accuracy bought zero additional dependability.

If you are choosing a model for work that touches production database records, pass@1 should not be read alone. Observed 20/20 shows which tasks succeed on every attempt, which is closer to what production reliability requires.

The executable terminal-state verdict was also the training reward. Before unpacking the training loop, here is what changed on the sealed benchmark.

Results: the dependability column moved

After training Qwen3.8-27B, they evaluated the selected step-50 checkpoint on the 507-task benchmark it had never trained on. The 507 tasks represent an out-of-distribution test set: their domains, databases, and most MCP tools were not encountered during RL training.

Table 2. ThinkingBox-Bench pass@1 (%) by domain, for selected models from our first blog’s Table 2 and our fine-tuned model for different domains and overall. Observed 20/20 numbers are over the entire benchmark with 507 tasks. Each model is evaluated on all 507 tasks for 20 repeated trials. Bold marks the column leader; underline marks the runner-up.

ModelRetailAuto insuranceTravelNeobankConsultingOverallObserved 20/20
Claude Opus 5.580.9768.4054.2871.2561.5867.16241 (47.53%)
Claude Opus 580.7165.8049.9570.6266.1966.50241 (47.53%)
GPT-5.476.3362.6568.1265.3454.6065.36128 (25.25%)
GPT-5.6 Sol67.6565.3060.3459.0957.5261.9182 (16.17%)
Qwen3.8-27B RLFT67.9156.4562.6962.4054.5160.78107 (21.10%)
Claude Sonnet 4.672.3554.4058.9456.3954.3159.19102 (20.12

Scroll to Top