Microsoft and Hugging Face have released a new method for training AI agents using real-world database outcomes as rewards. The approach, called ThinkingBox-Training, turns database state checks into training signals that improve an agent’s consistency and reliability.
What the Benchmark Found
ThinkingBox-Bench evaluates agents by running real backend databases and tools. It checks the final state of the database after an agent completes a task. This reveals whether the agent actually achieved the correct outcome.
Early results showed a gap between headline accuracy and real-world dependability. Claude Opus 5.5 scored slightly higher on pass@1 but passed the same number of tasks on every attempt.
These results show that a model’s success rate alone does not reflect reliability. The metric observed 20/20—the number of tasks passed on every attempt—better reflects real-world performance in production environments.
Results After Training
After fine-tuning Qwen3.8-27B with 50 GRPO steps using a curated training pool, the model improved significantly.
- Observed 20/20 increased from 38 to 107 tasks—almost triple the number.
- Pass@1 improved from 51.70% to 60.78%.
- Pass@20 slightly declined from 453 to 446 tasks.
The improvement is not just in average success. It shows a sharp rise in repeatable performance. The model now consistently completes tasks, even in complex domains like travel, auto insurance, and consulting.
Where Gains Were Made
Improvements were seen across all domains, but with notable variation.
- Travel saw a +24.5 point gain in observed 20/20.
- Auto insurance lost 7.0 points in pass@20, indicating a drop in consistency.
- Neobank and consulting showed gains in pass@20.
These results suggest that the model improved in some areas but lost reliability in others. The gains were not uniform, highlighting domain-specific challenges.
Cost and Efficiency
The training improved efficiency. The cost per successful attempt dropped from $0.177 to $0.139.
Cost per dependable task fell from $24.36 to $8.00—a 67.2% reduction. This makes the model more cost-effective for real-world deployment.
When compared to other models, the fine-tuned Qwen3.8-27B came close to GPT-5.6 Sol and GPT-6 Astra in cost per dependable task. It outperformed the base model in both dependability and cost efficiency.
How the Training Loop Works
ThinkingBox-Training uses a six-stage loop to build a training pool and refine agent behavior.

- Candidate tasks are screened using a base policy model.
- Each task is run multiple times to estimate success probability.
- Tasks are grouped by difficulty using a posterior probability filter.
- Rollouts are performed with real backend databases and simulated users.
- Terminal database states are evaluated using deterministic checks.
- GRPO updates the model based on reward signals from the final state.
Only tasks with mixed success rates—some passes, some failures—are included in training. Tasks that always succeed or always fail are excluded because they provide no learning signal.
Offline Policy-Relative Difficulty
Before training, the base model is tested on candidate tasks. The success rate is modeled using a Jeffreys posterior distribution: success probability | k successes in n probes ~ Beta(k + ½, n − k + ½).
Tasks are categorized into five difficulty bands:
- Rarely solved (0–0.08): dropped.
- Difficult (0.08–0.40): kept.
- Intermediate (0.40–0.60): kept.
- Frequently solved (0.60–0.90): kept for full-parameter training.
- Nearly always solved (0.90–1): dropped.
This filter ensures that only tasks with potential for learning are included. It avoids training on tasks that are already mastered or too hard to learn.
One Task, End to End
One example task shows how the process works. A traveler requests a room downgrade, but company policy requires manager approval first.
Before training, the base model changed the booking and issued refunds in 15 of 20 attempts—violating policy. After training, the model preserved the booking and payment state in all 20 attempts.
On 19 of 20 attempts, all expected records matched the correct outcome. This shows a significant improvement in reliability and adherence to business rules.
What Earns a Reward
The reward is not based on reasoning or tool use. It is derived from the final database state.
After each episode, the system checks whether the database matches the expected outcome. If the state is correct, the reward is 1. If not, it is 0.
For most tasks, this is a deterministic check. A minority use an LLM judge to evaluate narrow rubric requirements that cannot be captured in database state.
How to Run the Training Stack
The full training stack is available on GitHub at microsoft/thinkingbox-training.
Users need:
- NVIDIA GPUs with CUDA/NCCL support.
- Python 3.12 and uv.
- A local Qwen3.8-27B model checkpoint.
- OpenAI-compatible endpoints for simulated users and judges.
Steps include:

- Clone the three repositories into a workspace.
- Create a virtual environment with Python 3.12.
- Install dependencies and verify the patched Verl version.
- Prepare training data using the data preparation script.
- Launch the training job with 50 GRPO steps.
- Evaluate the trained model using ThinkingBox-Bench.
For evaluation, the model must be served via vLLM with specific configurations. The agent entry in thinkingbox.yaml must be updated to point to the trained checkpoint.
Why This Matters
ThinkingBox-Training provides a practical method for building reliable AI agents that interact with real databases.
It shifts focus from average success to repeatable performance. This is critical in enterprise settings where database integrity and policy compliance matter.
Teams can now probe their own task sets before training to identify which tasks offer learning value. This reduces wasted training cycles and improves model reliability.
Limitations and Open Questions
The benchmark is out-of-distribution. The training tasks differ in domain, database, and tools from the evaluation set.
Training gains are not universal. Some domains, like auto insurance, saw a drop in consistency.
There is no guarantee that improvements in one domain will transfer to others. The model may become more repeatable but not more general.
Training data must be carefully curated. Poorly selected tasks can lead to overfitting or failure to learn.
What to Watch Next
Future work will focus on expanding the training pool to include more diverse domains and tools.
Teams should:
- Probe their own task sets with a base model to assess difficulty distribution.
- Verify that training and evaluation parsers extract identical tool calls and arguments.
- Report both pass@1 and observed 20/20 metrics when evaluating models.
More details are available in the original paper, the GitHub repository, and the ThinkingBox-Bench dataset viewer.
ThinkingBox is built by the Microsoft Copilot Studio team in partnership with Toloka and interns from the University of Pittsburgh, Northwestern University, Columbia University, and UC Irvine.
Sources & further reading
Featured image: original publisher image. Via original publisher. Image source

