LangChain switches its docs assistant to a cheaper, slower fine-tuned model
The company says its customized GLM 5.3 Flash gave better-supported answers than Gemini in production tests. Training it to search more carefully also added delay.
Loading page…
The company says its customized GLM 5.3 Flash gave better-supported answers than Gemini in production tests. Training it to search more carefully also added delay.
Listen to this story
LangChain is betting that more grounded documentation answers justify extra latency: its tuned assistant costs $12 per 1,000 questions, compared with $20 for the Gemini model it replaced. The fine-tune scored 0.735 on LangChain’s held-out benchmark, above its base model’s 0.679 but below GPT-6.1 Sol’s 0.748. Those results came from an intentionally difficult question set, not a representative sample of everyday traffic, so the production trade-off—not the benchmark ranking alone—is the key signal.
Answer-only direct preference optimization produced the largest benchmark gain, 0.056, while increasing tool calls by 33% and turns by 25%.
After LangChain added an instruction for concise answers, runs exceeding 30 seconds fell from 18.7% to 5.9% over six days.
The fine-tune had follow-up questions in 36% of threads, versus 41% for Gemini 3.5 Flash Lite.
LangChain has made a customized GLM 5.3 Flash the main model behind Chat LangChain, its documentation assistant, after training it on real user interactions. In the company’s production test, it delivered better-supported answers than the Gemini model it replaced, at lower running costs but roughly twice the wait.
Chat LangChain answers questions using LangChain’s documentation and public support knowledge base. The company built training tasks from production traces—records of the assistant’s work—and tested whether those examples could close the gap between an inexpensive base model and stronger models that cost more to run.
The winning method trained only the final answer, rather than directly rewarding the assistant’s research steps. Called answer-only direct preference optimization, or DPO, it used pairs of candidate answers from the base model. Human annotation and a panel of judge models helped select the better answer in each pair.
LangChain compared three approaches. Each improved the benchmark score, but they taught the assistant different habits about how much research to do:
About one in five rejected answers confidently claimed that something did not exist after only a shallow search. LangChain’s explanation is that learning to avoid those answers also taught the model not to stop searching early. That is the company’s interpretation of the behavior, not a separate demonstrated mechanism.
The offline benchmark held back 128 real user questions from training. LangChain used a simulated environment matching the production setup to keep changing tools and data from distorting comparisons. Automated graders awarded one point for a correct, complete answer, zero for an inadequate answer and minus 0.5 for a confidently wrong one. Scores averaged eight attempts per question.
The base model’s average score in LangChain’s evaluation.
The deployed fine-tune’s average score in the same evaluation.
GPT-6.1 Sol’s average score in LangChain’s evaluation.
This was not a random sample of everyday questions: LangChain deliberately selected 78 tasks because the base model struggled with them. That left room to measure improvement. The resulting scores describe performance on this documentation benchmark, whose question mix was intentionally harder than ordinary production traffic.
LangChain then split live traffic evenly among the fine-tune, base GLM 5.3 Flash and its previous model, Gemini 3.5 Flash Lite. Its automated production evaluations found the fine-tune led every day on groundedness: whether retrieved documentation supported an answer. Follow-up questions occurred in 36% of its threads, versus 41% for Gemini.
Running costs were $12 per 1,000 questions, against Gemini’s $20. Slow responses still needed attention. Initially, 18.7% of fine-tune runs exceeded 30 seconds. After LangChain added an instruction to keep answers concise, that share fell to 5.9% over the next six days, near base GLM’s 5.4%.
LangChain accepted the remaining delay because a wrong documentation answer could send a user building against an API that does not exist. It says new production traces and evaluation results will continue feeding the model’s training data.
Loading discussion...
Join the conversation
Explain when the extra wait would be worth it.
Be the first to share a perspective or an experience.
Reader comments
Newest comments first. Replies stay oldest first.