Fine-Tuned Qwen 9B Matches Sonnet at a Fraction of Cost

Fine-tuning a small model on agent traces to match a frontier model

Arize has trained a small open model on its own agent traces and gotten it within two points of Sonnet 5 on a real production task. The 9B-parameter model costs roughly a fifteenth as much to run and answers in about half the time. Total training spend, including failed runs, came to a bit under $100.

The company says the approach is open to any team that already records its agents’ runs.

Why traces have value

The pitch rests on a market signal. A company called San Francisco Data reportedly went from $0 to about $60 million in revenue in three months this summer. It buys production traces from firms running AI agents, turns them into training tasks and sells them to frontier labs. Traces record a request, the context, the tool calls and whether the job worked. Labs can’t generate that record themselves.

Arize argues that selling traces pays once, while training on them gives you a model nobody else has. It names three reasons to do it:

  • Cost: narrow steps such as classify or extract often run 10 to 30 times cheaper on a small model, and several times faster.
  • Independence: you own a model that is not tied to a provider’s pricing, deprecations or rate limits.
  • Defensibility: rivals can call the same frontier models but can’t train on your traces.
Holdout results: recorded production 63.9% at $0.042 per turn, Claude Sonnet 5 single shot 85.7% at $0.030, Qwen3.5-9B SFT 83.9% at $0.002, Qwen3.5-9B SFT + GRPO 83.4% at $0.002, Qwen3.6-35B SFT 86.2% at under $0.001
Image: Arize AI

The test case

The task was the search bar in Alyx, Arize’s AI engineering agent. A user types something like find traces where latency is over 2 seconds and the user mentioned a refund, and Alyx writes a filter query. It is the most common Alyx interaction. It had been running on a frontier model in a tool loop that proposes a filter, validates it against the project schema and revises until done.

The five-step workflow

First, Arize exported 30 days of search-bar turns. Every LLM span already stored the full inputs, tools, outputs, token counts and cost, so each training example could be rebuilt exactly. Second, each turn became one task, with the finished filter or a handoff to chat as the target. Intermediate validate and revise steps were dropped so the small model answers in one shot, while validation still runs server-side.

Third, 15% of sessions were held out, split by session so no conversation leaks. The grader was a clone of the production filter evaluator. A human labeled 100 turns blind, and the judge agreed with them 88% to 90% of the time.

Fourth, the team ran a LoRA supervised fine-tune of Qwen3.5-9B, rank 16, for one epoch on about 1,800 examples. A reinforcement-learning pass with GRPO followed on turns where the model had been inconsistent. Fifth, every candidate ran over the 598-turn holdout and was scored by the production evaluator.

What the results showed

The 9B model landed within two points of Sonnet 5. A larger Qwen3.6-35B, trained on the same examples through Baseten’s serverless Loops, matched Sonnet 5 outright. That run took about 25 minutes and cost about $31.

Two other findings stood out:

  • Sonnet 5 answering in a single shot beat Sonnet 5 inside the multi-step loop by more than 20 points and ran four times faster. Retries and handoffs were adding failures.
  • Reinforcement learning added little. The human-labeled score rose three points and the judged score fell half a point. The supervised pass did almost all the work.

Arize’s advice is to do the supervised step first and put spare effort into a better grader.

A new command for the workflow

Arize packaged the process as ax post-train, a command group in its AX CLI. Commands cover exporting spans, building examples, creating a holdout dataset, training through a provider such as Baseten, deploying briefly, evaluating and tearing down. A single run command chains them and can resume.

The grader stays the customer’s own evaluator, which means the human-labeling check described above is the thing to get right first. Teams without an ML platform group are the intended users, though results from one narrow task won’t transfer to every agent step.

Source: Arize AI

Written by

Saksham Bhargava

Saksham Bhargava runs Alteroid and has been writing about consumer technology for over five years, covering iPhone, Android, Windows, AI tools and gaming. With an MCA and six years of hands-on web development experience, he tests the features he writes about on his own devices and focuses on clear, practical guides that solve real problems. Away from the screen, he enjoys travelling to places most tourists skip.