Stop Paying LLM Prices for Yes-or-No Answers — Chinmay Goyal, Glean
Talk notes · AI Engineer ·A close reading of the source at youtube.com: what it says, what it means for someone who builds with AI, and which claims are the publisher’s own.
Decision Models (System One)Fine-TuningMixture of ExpertsOpen-Weight ModelsEvalsGPUs & AI Chips
Problem
Chinmay Goyal, a software engineer on Glean Assistant, says most steps in an AI product are bounded decisions, not generation: classify a query, route to an expert, pick the best of N suggestions, check that a citation holds up. Glean had been paying full LLM cost and latency for all of them (0:01). He shows what changed when Glean moved these steps to Jev, TypeSafe's decision model, which returns the odds of each allowed answer in one pass and writes no text.
Approach
- Compare four ways to classify. A general LLM costs time and money. An open model (Llama) is cheaper but weaker. A fine-tuned open model is good but needs data, training and re-training. A decision model gives no generated text, and when the taxonomy of the decision space changes Glean edits the prompt instead of fine-tuning again (0:57).
- Evaluate before every rollout. A golden eval set for every place with generative AI, a soak of a couple of weeks inside Glean (about 1,500 people), then A/B tests with customers (2:27).
- Query classification. On Glean's test bed Jev nearly doubles the quality of a base Llama and reaches about 90% of a fine-tuned Llama, with no data collection, training or hosting (3:12).
- Expert routing. Routing a query to the right expert moved off a general LLM. Goyal reports higher precision and an almost 8x cut in latency, and says the infrastructure had to change a lot to fit it (3:57).
- Ranking follow-up suggestions. Ten to fifteen sources write suggestions; a ranker picks one inside a 1.5 to 2 second limit. With Jev 99.2% of suggestions arrived in time, against almost 90% with a general LLM, and zero outputs failed Glean's programmatic checks, against about 90% valid before (5:27, 7:46). He says the prompts were made as alike as possible, but not identical.
- Self-tuning thresholds. Because the ranker gets a probability for each option, Glean tunes the cutoff per customer deployment with a self-learning system (8:31).
- A judge for citations. Does the cited document support the claim, yes or no? Jev was faster and cheaper, and across the 28 or 30 test cases only one run gave a different answer. Goyal says this makes the team's own experiments about 5x quicker (10:01).
- Security. In the first, recall-heavy pass of a two-phase check, a per-customer classifier hosted on T4 GPUs was replaced by Jev. Recall rose from 31.5% to 90.2%, savings were above 50%, and two or three engineers no longer had to run classifier fleets for every single-tenant customer (12:16).
Lessons learned
- A rule for when to use one. Can the output be listed in advance? If not, it is free-form generation: use an LLM. If yes, use a decision model. If labels are stable and volume is high, a fine-tuned model also works; labels change often, so lean on the decision model (14:31).
- Complexity was worth it once. Glean tries to keep systems simple; expert routing was one of the rare places where the integration work paid off.
- Cheap, consistent judges compound. A development loop that is 5x faster is not a linear gain for a team of hundreds of engineers (Goyal's claim).
- Check the claim. All numbers are Glean's own, on its own test beds and with a slightly different prompt for the LLM baseline; there is no outside replication in the talk.
Theme
Model Architectures / decision models.