# Traces are the new oil. Here’s how we refined ours into a model that matches Sonnet at 1/30th the cost.

- **Published:** 2026-12-02
- **Updated:** 2026-12-02
- **Authors:** Fuad Ali
- **Canonical:** <https://arize.com/blog/post-training-on-your-own-traces/>

---

![Arize x Baseten. Traces are the new oil: refining our own traces into a model](https://arize.com/wp-content/uploads/2026/12/post-training-traces-hero-arize-baseten-v2.png)

We fine-tuned a small open model on a month of our own Alyx traces. It matched a frontier model on the job at a fraction of the cost. Here is the workflow and the CLI we built from it.

## **The market figured out what traces are worth before most enterprises did**

A company called San Francisco Data went from $0 to about $60M in revenue in three months this summer. They don’t build models. They don’t sell compute. They buy production traces from companies running AI agents, turn them into training tasks, and sell them to frontier labs. Their own framing is “a Glencore for production traces.”

Contractor-written training data is a race to the bottom. The record of an AI doing real work for a real user, with the request, the context, the tool calls, and whether it worked, is the thing labs can’t generate themselves.

Jaya Gupta at Foundation Capital, a sharp voice in enterprise AI investing (and an investor in Arize), made the same point from the other side last December. Her essay on [context graphs](https://foundationcapital.com/ideas/context-graphs-ais-trillion-dollar-opportunity) argues that the decision traces an agent leaves behind become “the single most valuable asset for companies in the era of AI.” Jason wrote a [response](https://arize.com/blog/how-context-graphs-turn-agent-traces-into-durable-business-assets/) in January that we still think holds: the reasoning behind what your agents did is becoming a first-class asset, not debug output.

If a lab will pay for your traces, they’re worth something. Sell them and you get paid once. Train on them and you get a model nobody else has. If traces are the new oil, the margin is in refining it yourself.

## **Why enterprises should be training on their own traces**

Three reasons, in order of how often we hear them.

**Cost.** Most production agents run every step through a frontier model. For the narrow, repetitive steps (classify this, extract that, write this query) a frontier model is a very expensive way to do a small job. A small model trained on your own examples of that job is usually 10 to 30x cheaper and several times faster.

**Independence.** When a model provider changes prices, deprecates a model, or tightens rate limits, your product changes with it, on their schedule. True vendor independence means owning a model you can deploy wherever you want.

**Defensibility.** Your competitors can call the same frontier models you do. They can’t train on your traces. A model trained on them is hard for anyone else to copy.

The usual objection is that training is hard, evals are harder, and most teams don’t have an ML platform team. That used to be a good reason not to try. We don’t think it is anymore, and below we’ll explain why.

## **What we did with Alyx**

Alyx is our AI engineering agent inside Arize AX. One of the things people ask it to do most is build a filter for querying their traces. A user types “find me traces where latency is over 2 seconds and the user mentioned a refund” into the search bar, and Alyx writes the query. Alyx uses this in nearly all of its analyses.

We were running that flow on a frontier model inside a tool loop: the model proposes a filter, a validation tool checks it against the project’s schema, the model revises, and so on until it finalizes or hands off to chat. It works. It’s also the single most common Alyx interaction, and we were paying frontier-level prices and latency for a job that is, essentially, structured text generation against a known schema.

We wanted to know whether a small open model trained on our own Alyx traces could do that job. Not as a research exercise, but as a real comparison, with the same evaluator we already run in production as the judge.

Here’s the workflow, from traces to a tested model.

**1. Export the traces.** Thirty days of search-bar turns from our own Alyx usage, pulled from Arize with a span filter on the router type. Every LLM span in Arize already records the full input messages, the tools, the output, token counts and cost. That turned out to matter a lot: we rebuilt every training example verbatim from the spans.

**2. Build tasks.** One task per turn. Prompt is the system prompt plus the user’s request plus the recorded column list for that project. Target is the final tool call the agent made (the finished filter, or the handoff to chat if the request wasn’t answerable as a filter). We dropped the intermediate validate/revise steps from the targets on purpose. The small model learns to answer in one shot; validation still happens server-side at inference.

A task looks like this (illustrative, in the real format):

```json
{
"messages": [
{"role": "system", "content": "<Alyx search-bar system prompt>"},
{"role": "user", "content": "errors in the last hour\n\nAvailable columns in this project:\n- status_code\n- latency_ms\n- attributes.input.value\n- ..."}
],
"target": "{\"tool_calls\": [{\"name\": \"finalize_filter\", \"arguments\": {\"filter_string\": \"status_code = 'ERROR'\"}}]}"
}
```

**3. Split and grade.** We held out 15% of sessions (by session, not by turn, so the same conversation can’t leak across the split). For the grader we cloned the AQL filter evaluator we already run in production and pointed it at single turns. Then we had a human label 100 turns blind, and checked the judge against the human: 88 to 90% agreement, which is good enough to trust the judge for training and keep the human for the final read.

**4. Train.** LoRA (Low-Rank Adaptation) supervised fine-tune on Qwen3.5-9B, rank 16, one epoch, about 1,800 examples. Then a GRPO (Group Relative Policy Optimization) reinforcement-learning pass on the turns where the SFT model was inconsistent, with the grader as the reward. Total training spend across every run, including the ones that didn’t work: a bit under $100.

**5. Evaluate on the holdout.** Each candidate model runs over the held-out turns, the output is logged to Arize as an experiment on the holdout dataset, and the production evaluator scores it. Same judge, same examples, every model side by side.

## **Results**

On the 598-turn holdout, scored by the production evaluator:

![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](https://arize.com/wp-content/uploads/2026/12/post-training-holdout-results-v2.png)Filter correctness and cost per turn on the 598-turn holdout.



| Model | Filter correct | Median latency | Cost per turn |
|---|---|---|---|
| Recorded production (frontier model, tool loop) | 63.9% | 6.6s | $0.042 |
| Claude Sonnet 5, single shot | 85.7% | 1.7s | $0.030 |
| Qwen3.5-9B, SFT on Alyx traces | 83.9% | 0.9s | $0.002 |
| Qwen3.5-9B, SFT + GRPO | 83.4% | 0.8s | $0.002 |
| Qwen3.6-35B, SFT on Baseten serverless Loops | 86.2% | 1.6s | under $0.001 |

On the 100 turns a human labeled by hand, the picture was the same:

| Model | Filter correct (human label) |
|---|---|
| Recorded production (frontier model, tool loop) | 50% |
| Claude Haiku | 45% |
| Claude Sonnet 5 | 77% |
| Qwen3.5-9B, SFT on Alyx traces | 76% |
| Qwen3.5-9B, SFT + GRPO | 79% |
| Qwen3.6-35B, SFT on Baseten serverless Loops | 84% |

The Qwen3.6-35B row is a later run: the same training examples, fine-tuned through the CLI on Baseten’s serverless Loops in about 25 minutes for about $31.

Three things surprised us.

**A 9B model matched a frontier model on our task.** Not on everything. On this task, trained on about 1,800 examples of this task, it was within two points of Sonnet 5 at roughly a fifteenth of the cost and half the latency. The larger Qwen3.6-35B, trained on the same examples, matched Sonnet 5 outright.

**The tool loop was most of the problem, not the model.** Sonnet 5 answering in a single shot beat Sonnet 5 running the multi-step loop by more than twenty points, and was four times faster. The loop added latency and cost and also added failure modes (handoffs, retries, giving up). Half our “model quality” problem was an architecture problem we only saw because we had the traces to measure it.

**RL bought less than we expected.** GRPO on the inconsistent examples nudged the human-labeled number up three points and the judged number down half a point. The SFT pass did almost all the work. If you only have time for one thing, do the SFT and spend the saved effort on a better grader.

## **Traces made all of this possible**

Apart from the GPU time, we already had everything this took, because we trace our agents. The spans became the training examples and the holdout dataset. Our production evaluator did the grading, an annotation queue collected the human labels, and experiments held the results. We had been treating all of that as observability. It also turned out to be most of a post-training pipeline.

Most teams who trace their agents in production are sitting on exactly this. They have the inputs, the outputs, the tool calls, the evals, and usually some human feedback. What they don’t have is a path from “this is in my observability tool” to “this is a model I own.”

## **The CLI**

So we built the path. `ax post-train` is a new command group in the [Arize AX CLI](https://arize.com/docs/api-clients/cli/overview) that runs the workflow above against any project in your space.

```bash
# 1. export every span of the traces matching a filter
ax post-train export my-agent --space $SPACE --days 30 \
--filter "attributes.metadata.step = 'classify'"

# 2. one training example per LLM span, split by session
ax post-train build --target tool-call --holdout 0.15
ax post-train plan # rows, tokens, dollars. no network.

# 3. holdout dataset in Arize, plus an optional blind labeling queue
ax post-train dataset --name my-agent-holdout --gold-queue --sample 100

# 4. LoRA fine-tune on your training provider
ax post-train train --provider baseten \
--base-model Qwen/Qwen3.5-9B \
--output-model my-agent-classify-v1 --wait --confirm

# 5. serve it briefly, run the holdout, grade with your production evaluator
ax post-train deploy --hours 2 --confirm
ax post-train eval --name my-agent-classify-v1 --evaluator $EVALUATOR_ID --confirm
ax post-train undeploy

# or the whole thing, resumable, with undeploy in a finally block
ax post-train run my-agent --space $SPACE --filter "..." --evaluator $EVALUATOR_ID --confirm
```

A few design choices worth calling out.

**The grader is yours.** Scores come from an evaluator in your Arize space, run as an evaluation task on the experiment. Not a grader we wrote. If you trust the eval to catch regressions in production, you can trust it to score a candidate model, and if you don’t, that’s the thing to fix first. The way we did it: have a human label a hundred examples blind, compare the evaluator against those labels, and adjust its prompt until the two agree often enough to trust.

**Training runs where you choose.** You choose your training provider, Baseten or Fireworks, with a flag. On Baseten the CLI drives the LoRA training loop itself through Baseten Loops, which gives full control over loss masking and the optimizer steps. Nothing about the workflow depends on the provider, and we expect to add more.

**Every step writes a manifest.** Dataset ids, job ids, model ids, experiment ids all land in `post-train.json`, so you can stop, inspect the holdout in the Arize UI, label a few more examples, and resume. You can also skip the CLI for any step and do it in the UI.

**It stops before it spends.** Anything that costs money (training, deploying) refuses to run without `--confirm`, and `plan` tells you the row count, token count, and estimated dollars with no network calls.

## **How to get started**

If you’re running an agent in production and tracing it, you have a post-training dataset. Here’s how we’d start.

1. **Pick a narrow use case,** not the whole agent. Start with the high-volume step where a frontier model is doing a small job, like classification, extraction, query generation, or routing.
2. **Make sure you have an eval for it.** If you don’t, build that first. Everything downstream depends on having a judge you believe.
3. **Run `ax post-train plan`.** It costs nothing and tells you how many examples you have, how many tokens that is, and what a fine-tune would cost.
4. **Train, evaluate, compare.** Side by side with your current model, scored by the same evaluator, on the same held-out examples. Then decide.

A month of our own traces, about 1,800 examples, and under $100 of training got us a model that matches a frontier model on the job we run most. Everything else it took (the spans, the evaluator, the holdout) we already had from tracing.

Next up for the CLI is RL (we ran the GRPO pass above by hand), along with more training providers. We also want to try this on steps harder than writing a filter, and we’ll write up what we find.

The labs know what traces are worth. So do the data brokers. If you’re tracing an agent in production, you’re already sitting on the crude, and `ax post-train plan` will tell you what refining it would cost.

---

[More blog posts](https://arize.com/blog/sitemap.md)
