Turning Database Grading into RL Rewards: Post-Training Agents with ThinkingBox
Back to Articles Turning Database Grading into RL Rewards: Post-Training Agents with ThinkingBox Enterprise Article Published October 22, 2026 Upvote - Tuhin Kundu tuhink Follow microsoft 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.We built ThinkingBox to evaluate an agent's work by comparing the final database state with the expected outcome.We 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.
We 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, we 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 we noticed what we 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 we 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.
We call this offline policy-relative difficulty.We 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 We used offline policy-relative difficulty to build the training pool, then fine-tuned Qwen3.8-27B with GRPO for 50 steps.To recap, we 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.Metric Base RL fine-tuned Change Observed 20/20 38 (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 we 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 our first post we 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, we 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.Model Retail Auto insurance Travel Neobank Consulting Overall Observed 20/20 Claude Opus 5.5 80.97 68.40 54.
28 71.25 61.58 67.16 241 (47.53%) Claude Opus 5 80.71 65.80 49.95 70.62 66.19 66.50 241 (47.53%) GPT-5.4 76.33 62.65 68.12 65.34 54.60 65.36 128 (25.25%) GPT-5.6 Sol 67.65 65.30 60.34 59.09 57.52 61.91 82 (16.17%) Qwen3.8-27B RLFT 67.91 56.45 62.69 62.40 54.51 60.78 107 (21.10%) Claude Sonnet 4.
6 72.35 54.40 58.94 56.39 54.31 59.19 102 (20.12%) GPT-6 Astra 71.73 46.55 55.87 60.87 56.83 58.31 231 (45.56%) Kimi-K3 82.24 50.80 61.83 41.35 51.63 57.37 68 (13.41%) Qwen3.8-27B 64.03 47.85 53.41 47.88 45.69 51.70 38 (7.50%) The headline result is the observed-20/20 row in Table 1.
A 27B model that initially completed 38 (7.5%) of ThinkingBox-Bench on every attempt now completes 107 (21.1%) on every attempt, almost thrice.For comparison, observed 20/20 for Kimi-K3 is 68, GPT-5.4 with 128, GPT-6 Astra has 231, and Claude Opus 5.5 leads with 241.
Average success and repeatability produce different orderings.In Table 2, we notice that GPT-5.6 Sol scored slightly higher on pass@1 than the RL fine-tuned Qwen3.8-27B (61.91% versus 60.78%) but passed fewer tasks on all 20 recorded attempts: 82 versus 107.Claude Sonnet 4.
6 scored lower on pass@1, at 59.19%, yet passed nearly the same number of tasks every time, at 102.Neither metric alone captures the full picture.The observed pattern is consistent with sharpening: repeatable success rose while at-least-once coverage fell slightly.This is in-line with prior work.
One explanation is that probability distribution moved toward trajectories that work repeatedly while some low-probability paths disappeared.Overall, the model did not become broader.It became more repeatable.The next question is where those gains landed.Where the gains landed Figure 3.
Domain-level base scores, RLFT scores, and percentage-point changes.Green change cells show gains and red cells show declines; blue shading indicates the score level within each metric.Pass@1 and observed 20/20 rose in all five domains.
Pass@20 was mixed: it increased in neobank and consulting, but declined in retail, travel, and auto insurance.Auto insurance had the largest breadth loss (−7.0 points), while retail had the largest observed-20/20 gain (+24.5 points).
What dependability costs The first post priced consistency using simple math: divide the estimated cost of the full 20-run campaign by the number of tasks the model passed every single time.
Cost per dependable task = estimated cost of the 507 × 20 campaign ÷ tasks passing 20/20 Applying the same cost math to the fine-tuned checkpoint's measured token usage: Table 3.Estimated evaluation cost and dependability for base and RL fine-tuned Qwen3.8-27B.
Cost per successful attempt divides total estimated campaign cost (507 x 20) by the number of passing attempts.Measure Base RL fine-tuned Change Campaign cost, 20 runs $925.80 → $855.58 −7.6% Cost per successful attempt $0.177 → $0.139 −21.4% Tasks passing 20/20 38 → 107 2.
8× as many Cost per dependable task $24.36 → $8.00 −67.2% At $8.00 per dependable task, the fine-tuned model came close to GPT-5.4 ($6.80), GPT-6 Astra ($7.45), and Claude Opus 5.5 ($7.80) in the companion comparison.The single-attempt view Figure 4 prices cost per successful attempt against pass@1.
Figure 4.The golden arrow traces Qwen3.8-27B base pareto cost position to the RLFT (diamond): pass@1 rises from 51.70% to 60.78% while estimated cost per successful attempt falls from $0.177 to $0.139.Ringed circles mark the Pareto cost frontier.
The move places the fine-tuned checkpoint close to GPT-5.6 Sol, although GPT-5.6 Sol remains cheaper and slightly higher on [email protected] models priced in our paper fall outside the plotted range.The dollar values are a comparative serving index, not invoice or cloud bills.
Serving the fine-tuned checkpoint would be the same as the base model.The calculation includes model inference cost, and excludes training run and policy-probe cost for curating the training dataset.These results tell us what moved.
The next sections explain the training loop and why selecting the right tasks matters the most.The training loop Figure 5.The six stages, now in context: candidate tasks feed in, the first three run once offline, the last three repeat for every group in the training run.
The trained checkpoint is evaluated against ThinkingBox-Bench.Selection runs once, offline, against the base policy model, i.e in this case Qwen3.8 27B; training then uses that fixed pool that has been curated.
The dashed amber arrow in Figure 5 marks the path we did not take: re-probing difficulty during the training run.Every rollout is a complete episode, not a text completion.It gets a fresh backend, an isolated MCP session, and GPT-5 Chat as the simulated user.
Most rewards come from deterministic terminal-state checks; a minority of narrow rubric requirements can invoke the configured judge (GPT-5 Chat).Training and evaluation must interpret Qwen output identically.
That includes reasoning extraction, tool calls, argument typing, rendering, and isolated task state.Otherwise the reward measures a different agent from the one evaluated.The shared interpretation code is in trainer/core/tb_interpret.py.
For the reference run, we ran full-parameter RL fine-tuned Qwen3.8-27B on 187 tasks using token-mean GRPO.Each update generated 18 groups of 8 rollouts, or 144 episodes, across 24 H100s.Training ran synchronously with parameter and optimizer offload; AdamW used a
Related
相關文章
Moonshot AI Releases Kimi K3.1 Pro: A 2.8T Total/104B Active Params (MoE) Model with 1M Context
Moonshot AI has just released Kimi K3.1 Pro, the first model in its K3.1 series. Kimi K3.1 Pro is a 3T-class open-weight model with a 1-million-token context window.
寧德時代董秘被打?知情人士回應;怕擔責先跑路?娃哈哈集團董事長許思敏離職;DeepSeek完成近1000億元融資,寧德時代、騰訊參投
要聞提示1.不少備孕人群購買!“好健康”牡蠣精被海關檢出汙染物,山姆緊急召回2.寧德時代董秘被打?知情人士回應3.怕擔責先跑路?娃哈哈集團董事長許思敏離職4.DeepSeek完成近1000億元融資,寧德時代、騰訊參投5.原“死了麼”APP公佈收費標準,創始人回應:最高收費199元/年,由政府集中採購6.
從技術首創到規模上車,華為乾崑車載激光投影以金輯獎印證技術領先
10月23日,在蓋世汽車主辦的第八屆金輯獎頒獎盛典上,HUAWEI XSCENE 華為乾崑車載激光投影憑藉在智能座艙視聽領域的技術突破與規模化商用落地,榮膺“金輯獎·2026最佳技術實踐應用獎”。過去幾年,智能座艙視聽解決方案的競爭一度集中在屏幕數量、芯片算力與配置清單的堆疊上;而今天,市場的天平正從“有沒有”轉向“好不好用”,用戶的體驗成為檢驗技術價值的最終標準。由汽車產業全媒體平臺蓋世汽車發起的“金輯獎·最佳技術實踐應用獎”,旨在尋找和表彰真正具有產業價值和全球潛力的創新成果。
WorldTUI:有人專門訓練小模型"演"終端,你敲命令它假裝執行
可它的真相相當荒誕——背後既沒有 Linux,也沒有文件系統,更沒有真正執行過任何一條命令,屏幕上跳出的一切,全是 AI 現場編出來的。這個名為 WorldTUI 的項目,做的最核心的一件事,就是訓練模型學會"演戲"。開發者 Simon Edwardsson 用 Qwen2.
月之暗面放 K3.1 預熱視頻,發佈日期仍捂著
信號很短,卻把"K3.1 要來了"擺到了臺前。伏筆其實從 9 月就埋下。多名開發者在月之暗面 API 平臺後臺撞見"kimi-k3-1"標識,說明模型已能經接口調用;同一天官方開放平臺也預告了 K3.1,主打 1M tokens 上下文。10 月 19 日凌晨,SGLang 倉庫新增一條提交,為 K3.
日本數字廳 AI 建站翻車:超 1.3 萬條隱私遭洩露
外洩的是民眾在 2021 年 5 月至 2023 年 3 月間,通過網頁表單提交的各種諮詢內容。拆開看:一般意見和建議約 8833 條,疫苗接種證明相關諮詢約 3661 條,工作坊活動信息約 462 條,招聘諮詢約 250 條,連借用吉祥物"麻衣娜醬"人偶服的詢問都有約 117 條。