Vibeleaderboard
← All Intel
Intel / post

Fine-tuning an open model on a docs agent's production traces

Source
x.com
Publisher
LangChain
Date
LangChain@LangChain

https://t.co/y4xEzc3TdG

Context

LangChain found that an , trained on its own docs assistant's traffic, could nearly match a frontier model on that assistant's job at a fraction of the cost. Chat LangChain answers questions about LangChain's software from its documentation. In a write-up, LangChain says a fine-tuned version of Z.ai's GLM 5.3 Flash now serves as its main model, after scoring 0.735 on an internal benchmark against 0.679 for the untuned model and 0.748 for OpenAI's GPT-6.1 Sol. It runs at 12 dollars per 1,000 questions, which LangChain says is 83% cheaper than GPT-6.1 Sol.

The benchmark is 128 held-out questions drawn from production traces, the recorded runs of the live agent. An answer scores 1 if correct and complete, 0 if it falls short and minus 0.5 if it is confidently wrong, averaged over 8 attempts, and the agent runs in a mocked copy of its production so scores reflect the model rather than changing tools. LangChain chose 78 of those questions because the base model struggled with them, so the set is harder than real traffic on purpose and the absolute scores should not be read as real-world accuracy.

The most useful finding is which training method worked. Copying a larger teacher model's full research steps raised the score by 0.052 but nearly tripled tool calls and pushed median latency from 17 to 75 seconds. Reinforcement learning, which rewards higher-scoring attempts, gained 0.037 and also made the model search more, with 42% more tool calls. The deployed version used answer-only DPO, which shows the model pairs of its own final answers and trains it to prefer the better one. It gained the most, 0.056, while adding only a third more tool calls. LangChain's explanation is that about one in five rejected answers wrongly claimed something does not exist after a shallow search, so the model learned not to stop early.

In a live test splitting traffic three ways, the 's answers were the most in the docs, and users asked a follow-up in 36% of threads against 41% for Google's Gemini 3.5 Flash Lite, the model it replaced. It answers about twice as slowly as Gemini but costs 12 dollars per 1,000 questions against 20. All of these results come from LangChain's own evaluations of one agent, so they show what tuning on an agent's own traces achieved here, not how the model performs elsewhere.

Terms in this piece · Glossary
  • Open-weight model — A model whose trained weights can be downloaded and run outside the maker's hosted API.
  • Setup — The combination of a model, a harness, its connections and the path the task's data takes, considered together for a task.
  • fine-tuning — Taking a trained model and training it a bit more on your own examples so it gets better at one specific job.
  • grounding — Tying a model's answers to checkable sources — retrieved documents, live data, tool results — instead of letting it answer from memory alone.

Get the Brief

A cited digest of what matters for people building with AI, every morning. Unsubscribe anytime. See today’s edition

More from LangChain
Recommended reads