---
title: "Turning Database Grading into RL Rewards: Post-Training Agents with ThinkingBox"
description: "Executable checks on terminal database state, originally built to grade agents in ThinkingBox-Bench, double as binary RL rewards for post-training tool-using agents."
url: "https://swe.quest/articles/turning-database-grading-into-rl-rewards-post-training-agents-with-thinkingbox-9126975f97c5fba4"
canonical: "https://huggingface.co/blog/microsoft/thinkingbox-training"
source: "Hugging Face"
published: "2026-10-22"
difficulty: "hard"
kind: "Research"
reading_minutes: 18
tags: ["model-training","ai-agents","evals","llms"]
---

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

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2026-10-22, 18 min read, Research. Original: [https://huggingface.co/blog/microsoft/thinkingbox-training](https://huggingface.co/blog/microsoft/thinkingbox-training)

## Summary

Executable checks on terminal database state, originally built to grade agents in ThinkingBox-Bench, double as binary RL rewards for post-training tool-using agents. Fine-tuning Qwen3.8-27B with token-mean GRPO for 50 steps on 187 out-of-distribution tasks raised pass@1 from 51.70% to 60.78% and tasks solved on all 20 attempts from 38 to 107, while pass@20 coverage dipped slightly, consistent with sharpening. The key lever is offline policy-relative difficulty: candidate tasks are probed against the base policy, a Jeffreys Beta posterior estimates success probability, and only tasks likely to yield mixed reward groups (non-zero GRPO advantage) are kept. Cost per dependable task fell from $24.36 to $8.00, approaching frontier models.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [Model training](https://swe.quest/tags/model-training.md) (AI & ML)
- [AI agents](https://swe.quest/tags/ai-agents.md) (AI & ML)
- [Evaluation](https://swe.quest/tags/evals.md) (AI & ML)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)

## Prerequisites

- reinforcement learning basics ([easy posts on Model training](https://swe.quest/tags/model-training.md?difficulty=easy))
- GRPO
- LLM tool-calling agents ([easy posts on LLMs](https://swe.quest/tags/llms.md?difficulty=easy))
- pass@k metrics ([easy posts on Observability](https://swe.quest/tags/observability.md?difficulty=easy))

## Keywords

ThinkingBox, ThinkingBox-Bench, GRPO, Qwen3.8-27B, DAPO, MCP, Jeffreys prior

## Related posts

- [Jupyter Agents: training LLMs to reason with notebooks](https://swe.quest/articles/jupyter-agents-training-llms-to-reason-with-notebooks-1236432acb183b7c.md): Hugging Face · 2025-09-10 · Hard · 14 min read · AI agents, Model training, LLMs, Evaluation, Data pipelines
  Fine-tuning Qwen3-4B on 51k synthetic Jupyter notebook traces, combined with a minimal ~200-line two-tool scaffold (code execution plus final\_answer), raised its DABStep easy-split accuracy from 38.67% to 75%.
- [ReasoningBank: Enabling agents to learn from experience](https://swe.quest/articles/reasoningbank-enabling-agents-to-learn-from-experience-c24d005f6ce31b05.md): Google Research · 2026-04-21 · Hard · 5 min read · AI agents, LLMs, Evaluation
  ReasoningBank is an agent memory framework that distills generalizable reasoning strategies from both successful and failed trajectories, stored as structured items (title, description, content) in a closed loop of retrieval, LLM-as-a-judge self-assessment, extraction and append-only consolidation.
- [Fine-tuning open LLM judges to outperform GPT-5.2](https://swe.quest/articles/fine-tuning-open-llm-judges-to-outperform-gpt-5-2-fdf1c14f4206aa6b.md): Together AI · 2026-02-02 · Medium · 10 min read · Evaluation, Model training, LLMs
  DPO fine-tuning open-weight LLM judges on RewardBench 2 preference data lets them match or beat GPT-5.2 at agreeing with human preference labels.
- [The Agent Said It Was Done. The Database Disagreed.](https://swe.quest/articles/the-agent-said-it-was-done-the-database-disagreed-7d8a074883d7b348.md): Hugging Face · 2026-10-03 · Medium · 16 min read · Evaluation, AI agents, LLMs
  ThinkingBox grades AI agents on the terminal database state and side effects they leave behind rather than their tool calls or final responses, running each of 507 stateful business workflows 20 times from a clean backend via isolated MCP sessions.
- [DaisyRose-27B: Pushing the Frontier of Post-Training Efficiency](https://swe.quest/articles/daisyrose-27b-pushing-the-frontier-of-post-training-efficiency-d0f8a1d5a44a14e8.md): Hugging Face · 2026-11-18 · Hard · 6 min read · Model training, AI agents, LLMs, Sandboxing & isolation, Evaluation
  DaisyRose-27B is an RL post-trained version of Qwen3.8-27B, trained with the Miles framework on about 1,200 curated long-horizon agent tasks over 18 days on 144 H200s.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
