Wink Pings

LangChain Uses Online Errors to Train Open-Source Model, Replaces Gemini, Cuts Cost by 40%

They turned real production traces from Chat LangChain into a 128-question evaluation set and post-trained GLM 5.3 Flash. The fine-tuned version scores 0.735, close to GPT-6.1 Sol's 0.748, at 83% lower cost, and has already replaced Gemini 3.5 Flash Lite in production.

LangChain turned the production traces of Chat LangChain into an evaluation set, then used it to post-train GLM 5.3 Flash. This fine-tuned version has now replaced Gemini 3.5 Flash Lite and become the main model for the documentation Agent.

First, some context. Chat LangChain is an Agent that answers questions about LangChain documentation and the public support knowledge base. Production traces are the complete records of real user questions, the model calling tools, retrieving documents, and giving answers. The LangChain team grouped these traces into tasks with answer keys, then used an automatic grader verifier to score them. In the end, they held out 128 real user questions as a held-out benchmark. The scoring rules are straightforward: correct and complete gets 1 point, unacceptable gets 0, and confident wrong answers get -0.5. Each question is run 8 times and averaged.

Results: the fine-tuned version scores 0.735, base GLM 5.3 Flash scores 0.679, and GPT-6.1 Sol scores 0.748. The fine-tuned version is close to GPT-6.1 Sol in score while costing 83% less. The original article's figure shows the relationship between held-out score and cost per thousand questions; the link is at the end.

But scores are only the entry ticket. The LangChain team split traffic evenly among the fine-tuned version, base GLM 5.3 Flash, and Gemini 3.5 Flash Lite, and ran online evaluations in production. The fine-tuned version's answers led every day on grounding in documentation; its user follow-up rate was 36%, versus 41% for Gemini. The tradeoff is that responses are about twice as slow as Gemini's, and cost is $12 versus $20 per thousand questions.

There is a counterintuitive detail here. Among the three training methods, Answer-only DPO trains only on the final answer and gives no direct signal for research steps; it produced the largest score improvement, 0.056 above the base model, and was the version ultimately deployed. It increased tool calls by only 33% and turns by 25%. Teacher SFT improved the score by 0.052, but students' tool calls per question jumped to 14.5, versus 5 for the base model and 8 on average for the teacher; median offline latency went from 17 seconds to 75 seconds, which is hard to accept in a chat setting. GRPO improved by 0.037, increased tool calls by 42% and turns by 40%, and had higher training cost than SFT.

The LangChain team's explanation of DPO is worth noting: about one fifth of rejected answers were the model confidently saying something did not exist after only a shallow search. Learning to avoid such answers may incidentally teach the model not to stop searching too early. The original article's figures also show score changes and tool-call changes for each training method, as well as the structure of Chat LangChain's models, harness, tools, and data sources.

Production online evaluation also caught latency issues. In the first few days of testing, 18.7% of the fine-tuned version's runs exceeded 30 seconds. After adding an instruction to keep answers concise, this proportion dropped to 5.9% over the next six days; base GLM was 5.4%. They still chose the fine-tuned version, for a very practical reason: if a documentation assistant answers incorrectly once, a user may go develop against an API that does not exist, so waiting a few extra seconds is actually cheaper.

Next, LangChain will continue feeding new production traces and online evaluation results back into training data. The key to this process is a closed loop: online traces become an evaluation set that can be improved over time, the evaluation leaves room for improvement, the training and evaluation environments are aligned with production as much as possible, and after launch online evaluation continues to confirm results.

Original article and figures: LangChain article
LangChain tweet: link
Recommended by Xudong Han: link

发布时间: 2026-12-03 23:29