En 30 secondes
Many steps in an AI product choose among known options rather than generate prose. Glean engineer Chinmay Goyal says replacing general-purpose language models with Jev, TypeSafe’s decision model, made expert routing about eight times faster and raised on-time follow-up suggestions from about 90% to 99.2%. In a separate security test, first-pass recall rose from 31.5% to 90.2%. He recommends testing a decision model when outputs can be listed in advance, while retaining generative models for open-ended text and considering fine-tuning when labels are stable.
- 1Many AI product steps are choices rather than writingGoyal lists query classification, expert routing and citation checks as bounded decisions. Jev produces a choice rather than free-form text, and its labels can be changed through the request without retraining.
- 2A no-training classifier approached a fine-tuned modelOn Glean’s query-classification test, Jev reached about 90% of the fine-tuned model’s agreement and nearly doubled the base model’s. The comparison avoids repeated training when the taxonomy changes.
- 3Expert routing became about eight times fasterIn Glean’s experiment, Jev had high precision and roughly eightfold lower routing latency than a general-purpose LLM. Goyal says the infrastructure changes were substantial, but worth the latency reduction.
- 4More suggestions arrived on time, with no invalid decisionsThe proportion arriving within the time budget rose from about 90% to 99.2%. Goyal reports zero invalid outputs in the Jev test, compared with roughly 90% valid suggestions from the LLM.
- 5Citation checks became more repeatableAcross repeated checks on about 28–30 cases, Goyal says Jev changed its answer in only one. This lets Glean spend less time rerunning evaluation on the same inputs.
- 6The security filter caught more cases in its first passOn Glean’s internal guardrail datasets, first-pass recall rose from 31.5% to 90.2% after replacing its old classifier. The slide reports precision changed from 92.7% to 90.8%.
À retenir
- Separate fixed-choice decisions from tasks that actually require new text.
- Compare decision models with fine-tuned classifiers when labels are stable and volume is high.
- Measure deadline compliance and invalid outputs as well as decision quality for user-facing ranking.
- Evaluate security filters on recall and precision together, and account for hosting and maintenance costs.
- Use model-generated scores to adjust decision thresholds to each deployment.
Lire le texte remanié, chapitre par chapitre
Why a fixed choice does not need a text generator
Goyal separates bounded decisions from open-ended generation and compares Jev with general models and fine-tuned classifiers. Changing a set of labels can be a prompt change rather than a retraining exercise.
I work on Glean Assistant as a product engineer. Many steps in an AI product are bounded decisions: classify a user’s intent, pick a suggestion from a list, check a citation, or route a query to an expert. Historically, we have paid the cost and waited for a general language model to answer these questions.
At Glean we use Jev, a decision model from TypeSafe, between general-purpose language models and fine-tuned classifiers. We have also tried an open model such as Llama and a fine-tuned version. A general LLM can generate prose but brings cost and latency; Jev chooses from options rather than producing generated text.
The categories we need to choose between can change. With a fine-tuned model, that can mean collecting and cleaning data and retraining; with Jev, we can change the prompt or options. Each approach has its own tradeoffs.
Evaluate changes before customer rollout
Glean uses reference evaluation sets, internal testing and customer A/B tests. Its first example compares query-classification quality against base and fine-tuned models.
We have millions of users, so we do not want a change to make the product worse. We maintain reference evaluation sets for areas that use generative AI or other intelligence. Changes then run internally in our own Glean instance for a couple of weeks, with feedback from employees, before customer A/B testing.
Our first example is query classification: identifying what kind of work users are asking Glean to help with. If more queries concern sales or engineering, that informs where we focus. We compared an open Llama model, Jev and a Llama model fine-tuned on our own compute.

In our test, Jev was our best option without training. Its agreement with production LLM labels was 66.8%, compared with 35.9% for the base model and 74.5% for the fine-tuned model. That is close to 90% of the fine-tuned model’s agreement, without the data preparation, training and hosting work.
Route each query to an expert faster
Glean tested Jev against a general-purpose LLM for expert routing. Goyal reports a large latency reduction and says it justified the integration complexity.
Next is expert routing. When a query arrives, Glean decides which expert should answer it. We previously used a general-purpose language model for that choice. In a test with multiple experts, Jev had high precision and reduced the routing call’s latency by roughly a factor of eight.

Integrating Jev into this stage required substantial changes to our implementation and infrastructure. We generally try to keep systems simple, but judged that this latency improvement justified the extra complexity.
Deliver follow-up suggestions on time
A ranking stage selects among suggestions from multiple sources. Its deadline and valid-output checks make latency and constrained outputs important.
We also rank follow-up suggestions, which help users discover what they can ask next. Our internal system, Q, receives candidates from roughly 10 to 15 independent sources. Language models generate the candidate queries, and the ranker selects using those candidates, the original question and Glean’s answer as context.
A suggestion is useful only if it arrives promptly: we cannot show an answer and then make someone wait five seconds for a follow-up. We set a time limit of roughly 1.5 to 2 seconds for this step. Jev improved both quality and latency compared with the general-purpose LLM.

In that comparison, we delivered a suggestion within the time limit in 99.2% of cases, versus about 90% with the LLM. The slide also shows fewer suggestion-engine timeouts and more turns on which a suggestion appeared.
We apply checks to catch output errors. With the general model, roughly 90% of suggestions were valid; some answers used the wrong language or failed programmatic criteria. We saw no invalid outputs with Jev in the comparison. The prompts differed somewhat, though we tried to keep them as similar as possible.
The ranker also gives scores for its possible outputs instead of only a yes-or-no answer. We can tune thresholds for a particular deployment. A self-learning system adjusts them based on how a customer uses Glean, rather than applying one threshold everywhere.
Check citations with a repeatable judge
Glean tests whether cited documents support an answer’s claims. More consistent decisions reduce the need to repeat identical evaluations.
We use models as judges in our development pipeline as well. A judge examines an input and output and assesses quality. Because an LLM’s answers vary, we normally repeat evaluations to account for that variability.
One evaluation asks whether the document cited by a Glean answer actually supports its claim. This is a bounded yes-or-no question. Jev lowered latency and cost in our comparison and was more consistent across repeated runs than the general model used for comparison.

Goyal says that across approximately 28 to 30 cases, Jev changed its judgment in only one. The slide specifies one of 28 paragraphs across three identical runs; it distinguishes repeatability of judge scores from accuracy. Repeating fewer identical checks saves time when an evaluation contains thousands of entries.
Faster development evaluations can improve the rate at which engineers ship changes. I see the benefit as more than a single product improvement: saving time in a pipeline used by hundreds of engineers can compound across many future changes.
Catch more security violations in the first pass
A lightweight first stage flags items for a heavier model. Glean replaced per-customer classifiers and measured changes in recall, precision and resource cost.
Security checks are another use. We check inputs and outputs from tools and models in two phases: a first pass designed for high recall, followed by a heavier LLM for flagged cases. These calls run in parallel with the actual tool input and output calls.
Previously, we hosted a classifier on T4 GPUs for each customer. Glean uses separate deployments and resources per customer, so maintaining that classifier at scale meant maintaining many copies. Replacing it with Jev reduced that operational work.

On our internal guardrail datasets, the first-pass classifier’s overall recall rose from 31.5% to 90.2% with Jev. The slide gives precision of 92.7% for the previous classifier and 90.8% for Jev. It also shows internal resource spending falling from $4,000 to $2,100 a month, before counting engineering time.
We no longer need two or three engineers working full time on maintaining those classifiers and GPUs across customer deployments. Counting the engineering work as well as resource costs, I estimate savings exceed 50%.
Choose a model based on the output
Goyal recommends a decision model when the available outputs can be listed ahead of time. Free text and stable high-volume labels may call for a generator, fine-tuned classifier or hybrid.

The rule we use is to ask whether all possible outputs can be listed in advance. If not, use a model capable of free-form generation. If they can, test a decision model. When labels are stable and volume is high, also consider a fine-tuned classifier; when labels change frequently, a model whose options can be edited is useful.
For a task that needs both a decision and dynamic text, a hybrid can use the decision model to choose a tool and a language model to write the arguments. Goyal points to a blog post with the detailed results and invites further questions.
Sur la même chaîne
20:05EN
19:26EN
18:03EN
18:43EN
18:01EN
22:29EN