Published 3 December 2026. Every figure below was read on 3 December 2026 from the source linked beside it, and every result quoted is the publisher's own measurement of its own agent.
Fine-tuning a small open model on your agent's production traces pays off when one narrow step runs thousands of times a day on a frontier model, you have an eval for that step you already trust, and the base small model scores low enough on it to leave room to improve. Two teams published the same kind of result at the start of December 2026. LangChain Labs fine-tuned GLM 5.3 Flash on tasks built from Chat LangChain's traces and scored 0.735 on a 128-question held-out benchmark, against 0.679 for the base model and 0.748 for GPT-6.1 Sol, at $12 per 1,000 questions in production against $20 for the Gemini 3.5 Flash Lite model it replaced. Arize trained Qwen models on a month of traces from its Alyx agent's search-bar step, and a fine-tuned Qwen3.6-35B got 86.2% of filters right on a 598-turn holdout, against 85.7% for Claude Sonnet 5, at under $0.001 a turn against $0.030.
Both are self-measured on one task each, and both teams sell the tooling for this workflow, so read them as worked examples rather than proof that it will work for you. What they do show, together with a Datadog write-up from 18 November, is the recipe: pick one step, build the benchmark from real traffic before you train anything, keep the test environment identical to production, and let online evals on a slice of real traffic decide whether the model ships. The part none of them covers is what training on traces copies into the weights. Traces carry your users' names, accounts and questions, and once that text has shaped a model's weights there is no row to delete when one of those users asks you to erase them.
When is fine-tuning on your own traces worth it?
It is worth it when three conditions hold at once, and each of the published cases met all of them.
One narrow, high-volume step. Arize did not fine-tune Alyx; it fine-tuned the one step that turns a sentence typed into a search bar into a trace filter, which it calls the single most common Alyx interaction. Datadog fine-tuned only the summarizer inside its Patterns feature, the step that condenses each sampled interaction into one sentence before clustering, and which Datadog measured at about 80% of a Patterns run's p99 cost and 50% of its p90 latency. Arize's own advice is to start with "the high-volume step where a frontier model is doing a small job, like classification, extraction, query generation, or routing."
A frontier model that costs too much per call. LangChain's numbers show the gap: on its docs agent, Sonnet 5.5 cost $192 per 1,000 questions and Opus 5.5 cost $330, against $20 for Gemini 3.5 Flash Lite and $9 for base GLM 5.3 Flash. Frontier models answered well, but not at a price the team would pay on every question.
A benchmark with headroom. If the base small model already scores close to the frontier model on your eval, training has nothing to show, and if your eval cannot tell a strong model from a weak one, you will not know whether training helped. LangChain built its held-out set to be harder than production on purpose: it picked 78 of the 128 tasks because the base model struggled with them.
If your agent's cost is spread across many different steps, or the step that costs the most changes shape every week, the case is much weaker. A model trained on one instruction learns that instruction, which is why Datadog built its summarizer dataset from runs that used several different clustering instructions.
What have teams actually measured?
Each of these numbers is the publisher's own measurement on its own agent, with its own grader. None was independently reproduced.
| Team (date) | Task | Base model trained | Held-out set and scoring | Result |
|---|---|---|---|---|
| LangChain Labs (2 Dec 2026) | Chat LangChain, a docs and support Q&A agent | GLM 5.3 Flash | 128 real user questions; 1 if correct and complete, 0 if it falls short, −0.5 if confidently wrong; mean of 8 attempts per question; automated verifiers grade against an answer key | 0.735 fine-tune, 0.679 base, 0.748 GPT-6.1 Sol; LangChain says the fine-tune is 83% cheaper than GPT-6.1 Sol |
| Arize (Dec 2026) | Alyx search bar: natural language to a trace filter | Qwen3.5-9B and Qwen3.6-35B | 598 held-out turns graded by Arize's production filter evaluator, plus 100 turns labeled blind by a human | Filter correct: 86.2% Qwen3.6-35B, 85.7% Claude Sonnet 5 single shot, 83.9% Qwen3.5-9B SFT, 63.9% the recorded production setup |
| Datadog (18 Nov 2026) | Patterns summarizer: one sentence per interaction | Qwen 3.5 9B | 150 held-out cases from five traces kept out of training, LLM judge decides whether each summary is an acceptable substitute for the frontier model's | 93.3% pass (140 of 150) fine-tune, 44.7% (67 of 150) base |
Cost and speed moved further than accuracy. Arize reports $0.002 a turn and 0.9 seconds median for its fine-tuned 9B model against $0.030 and 1.7 seconds for Sonnet 5 answering in a single shot, and $0.042 and 6.6 seconds for the recorded production setup. Datadog's average generation time per case fell from 44.7 seconds to 0.89 seconds. LangChain went the other way on speed: its fine-tune answers about twice as slowly as Gemini 3.5 Flash Lite, and the team shipped it anyway because, for a docs assistant, a confidently wrong answer costs the user more than a few seconds.
On Arize's 100 human-labeled turns the order held: 84% for Qwen3.6-35B, 79% for Qwen3.5-9B after SFT and GRPO, 77% for Claude Sonnet 5, 50% for the recorded production setup and 45% for Claude Haiku. A hundred turns is a small sample, so a gap of a few points there is noise; the 30-point gap between the fine-tunes and the old production setup is not.
How do you turn traces into a benchmark and training tasks?
Build the benchmark first, train second. Every team that published followed the same order, and it is the order that keeps you honest.
- Pull the spans for one step. Arize exported 30 days of search-bar turns with a span filter; every LLM span already held the input messages, tools, output, token counts and cost, and the team rebuilt each training example verbatim from those spans. Datadog pulled its summarizer's spans the same way, one training conversation per span with the same input messages and the summary as the target.
- Make one task per decision, with an answer key. Arize's prompt is the system prompt, the user's request and the recorded column list for that project; the target is the final tool call the agent made. It dropped the intermediate validate-and-revise steps on purpose, so the small model learns to answer in one shot. LangChain had an internal agent group its traces into usage patterns and built tasks from each group, so the benchmark covers how people actually use the agent, and every task has an answer key that automated graders it calls verifiers score against.
- Split by session or trace, never by row. Arize held out 15% of sessions so the same conversation cannot appear on both sides; Datadog assigns all rows of one trace, and repeated copies of the same request, to the same split. A row-level split leaks near-duplicates into the test set and makes the result look better than it is.
- Make the held-out set hard on purpose. LangChain's 78 deliberately difficult tasks out of 128 are what let a 0.056 gain show up at all.
- Calibrate the benchmark before trusting it. LangChain checked that its benchmark ranks stronger models above weaker ones, that the verifiers give the same score when they grade the same run twice, and had a model review the verifiers' decisions, fixing tasks and verifiers until a review run surfaced no errors.
- Check the judge against people. Arize had a human label 100 turns blind and measured 88 to 90% agreement with its evaluator before using it for training. Datadog's judge has to pass a sanity check first: on up to four test cases it must accept the recorded answer and reject two deliberately corrupted versions of it.
The answer key in most of these setups is what the frontier model did in production. That makes the fine-tune an imitation of the current system, and it inherits the current system's mistakes unless you filter them out. LangSmith's Smithtune docs say this directly: its evaluation scores "measure how closely each model matches the recorded behavior, not whether it completes tasks end to end," and it does not execute the tool calls the model generates. Arize's recorded production setup scored 63.9%, so a model that copied it perfectly would have been worse than Sonnet 5 answering in one shot.
Which training method should you use?
Start with supervised fine-tuning of a LoRA adapter on your best examples, and only add reinforcement learning if the SFT model is inconsistent on a measurable slice. That is where the evidence points, with one important exception for multi-step agents.
Arize trained a rank-16 LoRA on Qwen3.5-9B for one epoch on about 1,800 examples, then ran a GRPO pass on the turns where the SFT model was inconsistent, with the grader as the reward. GRPO moved the human-labeled score up three points and the judged score down half a point, and Arize's conclusion is that "the SFT pass did almost all the work." Datadog also trained a LoRA adapter, stopping when validation loss stopped improving and keeping the best epoch.
LangChain's multi-step docs agent is the exception, because there the method decides how much searching the model learns to do:
| Method (LangChain) | Score change vs base | Side effect on research |
|---|---|---|
| SFT on trajectories from the larger GLM 5.3 as teacher | +0.052 | 14.5 tool calls per question against 5 for the base model and 8 for the teacher; median latency in LangChain's offline setup went from 17 to 75 seconds |
| Self-distillation (base model trains on its own trajectories) | +0.014 | Little change in behavior |
| GRPO | +0.037 | 42% more tool calls and 40% more turns; hard caps on calls pushed the score below the base model's |
| Answer-only DPO, the version deployed | +0.056 | 33% more tool calls and 25% more turns |
Answer-only DPO trains only the final answer, so the research steps get no direct signal. LangChain built its pairs from the base model's own attempts, because the best of four attempts at each question scored 0.914 against about 0.7 for a single attempt, and some hand annotation plus a council of judge models picked the better answer in each pair. About one in five rejected answers was a confident claim that something does not exist after a shallow search, and LangChain's best explanation is that learning to avoid those taught the model not to stop searching early.
The lesson for a tool-using agent is that imitating a larger model's whole trajectory copies its habits, including how many tools it calls, and you pay for those habits in latency. Measure tool calls per task and latency on every candidate, not only the score.
Why must the training and eval environment match production?
Because a change in score has to come from the model and nothing else. LangChain had its agent build a mocked environment that mirrors how Chat LangChain is configured in production, since agent runs are hard to compare when the tools and data they depend on keep changing. Arize used the evaluator it already runs in production as the grader, and Datadog built its training conversations from the exact input messages the summarizer saw.
Small mismatches are enough to fake a result. Shuhui Qu's October 2026 review of training agents on logs lists the mistakes from the author's own project, including evaluation prompts rendered differently from training prompts and a gain that appeared only on the trained tasks with nothing held out. If your production prompt, tool schemas, retrieval index or post-processing differ from the training harness, the offline number describes a different system from the one you will deploy.
How do you roll it out without betting the product on an offline score?
Put the fine-tune in front of a slice of real users next to the model it would replace, score every response with online evals, and promote it only when it wins on the measures you care about. LangChain split Chat LangChain's traffic evenly between the fine-tune, base GLM 5.3 Flash and Gemini 3.5 Flash Lite. The fine-tune led on groundedness every day of the test; users asked a follow-up question in 36% of threads against 41% with Gemini; and where the three answers differed in substance, a model judge picked a GLM model 82% of the time across 119 comparisons.
Online evals also caught what the offline benchmark missed. In the first days, 18.7% of the fine-tune's runs took longer than 30 seconds; an instruction to keep answers concise brought that to 5.9% over the next six days, close to base GLM's 5.4%. That is the kind of regression you want to find on a third of the traffic, not all of it.
Keep the loop running after launch. LangChain says it will keep feeding new production traces and online eval results back into the training data, and Datadog notes that calls to the deployed model are recorded as spans, so the next dataset comes from the fine-tune's own production behavior. Each retrain needs the same held-out benchmark rerun before it ships, otherwise you lose the ability to tell whether a new version is better.
What should you try before you train?
Fix the architecture and the prompt, and check whether retrying is cheaper. Arize found that Sonnet 5 answering in a single shot beat the same model running its multi-step validate-and-revise loop by more than twenty points and was four times faster, and called half its "model quality" problem an architecture problem. Datadog found that 78 of the base model's 83 failures came from running out of tokens or producing unparsable output, not from bad summaries; the model could already do the task, just not briefly enough.
Retrying is the other alternative. LangChain's base model scored about 0.7 on a single attempt and 0.914 on the best of four, and Qu's review cites work showing that standard fine-tuning can raise a model's single-attempt accuracy while lowering its best-of-many accuracy (Chen et al., arXiv 2502.07154). If you can verify answers cheaply, sampling a few times and keeping the best may beat training; if you cannot, as in a chat product, training is what lets you capture that gap in one attempt.
How much data and money does it take?
Arize's case is the only one with published training costs: about 1,800 examples from 30 days of traces, a bit under $100 across every training run, including the ones that did not work; its later Qwen3.6-35B run on the same examples took about 25 minutes and about $31 on Baseten's serverless Loops. Datadog's held-out set was 150 cases. The expensive parts are the grader you trust, the held-out set built from real traffic, and the online eval that decides the rollout, and a team that already traces its agent and runs evals in production has most of that already.
Compare cost on the unit your business pays for: cost per 1,000 questions, as LangChain does, or cost per turn, as Arize does, measured on the same held-out set for every candidate. A cheaper model that needs a second turn or a human fallback more often is not cheaper.
What goes into the weights, and what must stay in memory?
Training on traces puts task skill into the weights: the format of a good answer, which tool to call and when, how far to search before answering, and how to read your product's schema. Those are stable across users and change only when your product changes, so baking them into a fine-tuned model is the right call.
Per-user facts are the opposite. A customer's plan, their open ticket, the project they switched to this morning or a preference they corrected last week are true for one person, change without warning and have to be replaced rather than averaged. A model trained on last month's traces has last month's version of those facts spread across its weights with no owner, no date and no way to correct one of them. That is the same distinction we drew in agent traces vs agent memory: a trace records what happened in one run, and memory is what you decided to keep, with conflicts resolved, a scope and an owner.
So the split we recommend is skills in the weights, facts in an external memory store the agent reads at runtime. Maximem Synap stores five kinds of self-contained statement (facts, preferences, episodes, emotions and temporal events), each with a confidence score, a scope, and when the thing described actually happened, so that when something about a person changes, the agent stops repeating what is no longer true. A fine-tuned model reading from that store gets cheaper and better at the job without being made responsible for remembering who said what. We went further into what in-model memory can and cannot do in memory-native model vs external memory.
Traces hold user data: filter and redact before you train
A production trace contains whatever your users typed and whatever your tools returned, which in practice includes names, emails, account numbers, health or payment details and secrets pasted into a chat. Training on those traces copies that text into model weights, where it cannot be erased one item at a time. If a user exercises a right to erasure, you can delete their rows from your trace store and their facts from a memory store, but removing their influence from a trained model means retraining without their data. Our guide to GDPR-compliant agent memory covers why erasure has to reach derived data, and a model's weights are about as derived as data gets.
Three controls belong before the training step, not after it.
- Filter by purpose and consent. Train only on traces from steps and users where you have a basis to use the data for training. LangChain's Smithtune data-rights terms put it plainly: permission to access a trace "does not necessarily include permission to use its contents" for training, evaluation and deployment.
- Redact before export. Strip credentials, personal identifiers and free-text fields the task does not need. Arize's search-bar task needed the request and the column list, not the user's identity; many narrow steps are like that, which is one more reason to train on one step rather than whole conversations.
- Check your model provider's terms. The same Smithtune document warns that the agreements governing the services that generated your data "may restrict distillation, training competing models, or other uses of model outputs," and that choosing an open-weight target model does not by itself make the use permitted. If your answer keys are a frontier model's outputs, read that provider's terms before you train on them.
Keep a record of which trace IDs went into each training run. It costs nothing at build time, and it is the only way to answer a regulator or a customer who asks whether their data shaped a model you ship.
Frequently asked questions
Can you fine-tune a model on agent traces without an ML team?
For one narrow step, it is realistic. Arize, Datadog and LangChain each describe a workflow run largely by a coding agent or a command-line tool, with LoRA training on a hosted provider, and Arize spent under $100 on training in total. What you cannot skip is an evaluator you have checked against human labels and a held-out set split by session.
Is fine-tuning on traces the same as distillation?
When the answer keys are a larger model's outputs, it is a form of distillation, and LangChain's teacher SFT run trained GLM 5.3 Flash on trajectories from the larger GLM 5.3. Answer-only DPO on the base model's own best attempts, which LangChain deployed, is not distillation from a teacher. Either way, check the terms of the model whose outputs you train on.
How many examples do you need to fine-tune on production traces?
Arize trained on about 1,800 examples from one month of traces and matched Claude Sonnet 5 on its task with Qwen3.6-35B. That is one data point on one structured task; a broader task will need more, and the held-out benchmark is what tells you whether you have enough.
Should I use SFT, DPO or GRPO?
Start with SFT on a LoRA adapter. Arize found SFT did almost all the work and GRPO added little. On a multi-step agent, watch tool calls and latency: LangChain's teacher SFT nearly tripled tool calls and pushed median latency from 17 to 75 seconds, and answer-only DPO gave the largest gain with the smallest increase in research.
Can I delete one user's data from a fine-tuned model?
No, not one item at a time. Training spreads what the model learned from a trace across its weights, so removing one user's influence means retraining without their traces. Redact personal data before training, keep per-user facts in an external memory store where they can be deleted, and record which traces went into each run.



