Back

The Model We Didn't Know We Wanted: Decision Models in a Live Class

Nov 1, 2026 (3d ago)

The way to make our classifier better had always been to make its prompt better. More rules, more edge cases, more examples of Hinglish spelled four different ways. In June we hardened all eight classifier prompts. It was careful work, and it had quietly turned a five-way choice into an 11,000-token essay that a model read in full for every chat message in every class.

We weren't shopping for a different kind of model. We didn't know there was one to shop for. Jev had been in early access for eleven days when we pulled 242 real chat messages, labeled them by hand, and ran it against what we had in production. This happened:

gpt-5.4-mini (prod) gpt-6-luna (latest from OpenAI) Jev
Accuracy (5 labels) 76.0% 84.7% 88.0%
Real doubts wrongly ignored 30% 25% 6%
Abusive messages caught 96% 98% 98%
Median response time 1.7 s 2.1 s 0.35 s
Cost per 1M messages $1,816 $651 $115

That table undersells the interesting part and oversells one thing, and I'll get to both. First, why a few hundred milliseconds and a label set were worth caring about at all.

The job: one chat message, five possible labels

Arivihan runs live classes for Indian board-exam students, Class 10 to 12. While a teacher is talking, students type into the chat: real doubts, greetings, "sir audio nahi aa raha", answers shouted back at the teacher, and sometimes abuse. Our AI service answers the real doubts in the class, right there in the chat.

Before anything can be answered, something has to decide what the message is:

Label What it means Illustrative message
academic_context Subject doubt about what's on screen right now "mitosis aur meiosis me antar kya hai" (during that slide)
academic_general Subject doubt about something else The same question during a different chapter
guidance How to study, use the app, or pick a batch "backlog kaise cover karu"
abusive A hard-core slur, in any spelling or script —
irrelevant Everything else "exam mein aayega kya", "phir se samjhao"

This looks easy until you read the real data. Messages are Hinglish, Hindi or English, often misspelled, frequently masked. "Chutti" means a holiday and looks uncomfortably close to a slur. "Sir ye log gali de rahe hai" (sir, these people are swearing) contains a complaint about abuse, not abuse. A bare "phir se samjhao" (explain again) goes to irrelevant, but naming a concept and asking about it makes it a doubt.

Each kind of mistake costs something different:

  • Wrongly ignore a real doubt, and a student who asked a genuine question in front of the whole class hears nothing back.
  • Answer the irrelevant, and you pay for a generation nobody wanted and fill the chat with noise.
  • Wrongly call someone abusive, and it's worse than noise: in our backend, abusive means an immediate block.

And it all happens in a burst, while the slide the student is asking about is still on screen. A classifier isn't the only latency in that path, but it runs on every message that survives the cheap skip checks.

What a decision model is

An LLM generates text one token at a time, and we had been using that machinery to emit one word. Structured outputs constrain the format of the answer, but the mental model stays the same: write instructions, get a completion, parse it.

A decision model starts from the other end. You describe a state and ask typed questions about it, and you get typed answers and probabilities back. There is no completion to parse, because there is no prose.

Jev is TypeSafe AI's first public model, and the first of what it calls System One models. The name borrows from Kahneman: chat LLMs are the slow, flexible System 2, and this is the fast, automatic System 1. It understands natural language, but it can't write a reply, produce code, or explain itself.

The API is one endpoint, POST /v1/systemone, and our request looks like this (trimmed):

{
  "model": "jev-1.13.0",
  "state": {
    "student_message": "...",
    "current_slide": "...",
    "teacher_audio": "..."
  },
  "questions": {
    "category": {
      "type": "choice",
      "instructions": "Classify a student's live-class chat message...",
      "criteria": {
        "academic_context": "A genuine school-subject doubt that matches the current slide or teacher audio...",
        "academic_general": "A genuine school-subject doubt NOT about what is being taught...",
        "guidance": "How to study, how to use the app, what batches exist...",
        "abusive": { "what": "...", "not_for": "...", "examples": ["..."] },
        "irrelevant": "Everything else..."
      }
    },
    "is_abusive": {
      "type": "noul",
      "instructions": {
        "question": "Does `student_message` contain a hard-core slur?",
        "focus": "Look for the slur itself, even abbreviated, misspelled, masked or in Devanagari."
      },
      "criteria": {
        "true": { "what": "...", "examples": ["..."] },
        "false": { "what": "...", "not_for": "...", "examples": ["..."] }
      }
    }
  }
}

There are three question types, and we use the first two:

Type Asks Returns
choice Which one of these options? One of your labels, with a probability per option
noul Is this true? The probability that it is, from 0 to 1
score Where does this sit on a scale? A position on the scale you defined

The response can't contain anything else: no preamble, no invented sixth category, no "Sure! Here's the classification:", no JSON repair step. That removes a class of bug, not wrong answers. Valid isn't the same as correct, and Jev still got 29 of our 242 messages wrong.

Why is it so fast? TypeSafe doesn't disclose the architecture. The common explanation is that it scores all of a call's questions in one parallel pass instead of producing tokens one after another. TypeSafe also says the model is trained for calibrated probabilities, with the caveat that calibration is measured across groups of predictions and doesn't guarantee any individual answer.

Separating state from questions is a small idea that does a lot of work. The slide and the transcript are facts. The label rules are the question. We had been stuffing both into one enormous string.

Two questions beat one

Our first Jev run used a single Choice over five labels and scored 84.7%, with an abusive F1 of 0.92. That's already well above the old 76%, but the abuse number wasn't good enough for something that blocks people.

So we split the question. The Choice still picks the label, but a separate Noul asks only one thing: is there a slur in this message? It decides abuse on its own:

def _combine(answers):
    """The is_abusive Noul decides abuse; the Choice decides everything else."""
    category = answers.get("category") or {}
    choice = category.get("choice") or ""
    noul = (answers.get("is_abusive") or {}).get("noul")
    if noul is None:
        return choice
    if noul >= 0.5:
        return "abusive"
    if choice == "abusive":
        # The Choice called it abuse but the slur check found none:
        # take the Choice's next-best label instead.
        probs = {k: v for k, v in (category.get("probabilities") or {}).items() if k != "abusive"}
        return max(probs, key=probs.get) if probs else "irrelevant"
    return choice

Both questions go out in one request. That took abusive F1 from 0.92 to 0.99 and irrelevant from 0.80 to 0.87, and overall accuracy to 88%. Across the 242 messages it produced zero false abuse flags, and the Noul separated slurs from clean messages with an AUC of 1.000 on this set.

The lesson generalizes. A label set often hides several independent decisions, and when they're fused into one Choice, a judgment about toxicity competes with a judgment about topic. Asking them separately costs little here: Jev's output is free, and input grew by about a quarter, from $91 to $115 per million messages. The guidance around Jev says the same thing: it reads questions literally, so compound judgments should be split.

The part the first table leaves out

Here is every serious run, including the one that complicates the story:

gpt-5.4-mini, prod prompt gpt-6-luna, prod prompt gpt-6-luna, constrained Jev, two questions
Accuracy 76.0% 84.7% 88.0% 88.0%
Real doubts wrongly ignored 30.0% 25.0% 2.1% 6.4%
Abusive caught 96% 98% 96% 98%
Clean messages flagged abusive 2 0 0 0
Median latency 1.72 s 2.10 s 1.33 s 0.35 s
p95 latency 5.09 s 4.02 s 2.50 s 0.58 s
Cost per 1M messages $1,816 $651 $133 $115
Avg input tokens 10,728 10,728 1,268 2,733

"Constrained" is GPT-6 Luna over chat completions with reasoning off, temperature 0, a short question, and a strict schema that only permits the five labels. In other words, we made Luna behave like a decision model, and it tied Jev on accuracy while ignoring fewer real doubts. On five-way accuracy, each got 15 messages right that the other missed.

So the honest headline isn't "Jev is smarter than GPT-6". It's closer to this:

Asking a decision-shaped question was most of the win. Jev is what made that shape fast and cheap enough to be the default.

The same pattern shows up in the other direction. We also gave Jev our old prompt verbatim, and it scored 76.0%, exactly where gpt-5.4-mini started, at $550 per million messages. Jev isn't magic. Hand it the old prompt and it does about as well as the last model that read it.

Three things had been holding our accuracy back, and only one of them was the model:

  1. The format. Free text invites a model to reason its way out of a rule. Closed labels don't.
  2. The prompt. All that hardening had made it long, not clear. Condensing it to its rules helped both Jev and Luna.
  3. The model. A real factor, but not the only one.

Between Jev and constrained Luna, what's left is mostly speed and failure profile. Jev is about 4x faster at the median and 14% cheaper. Its p95 of 0.58 s is below Luna's median by more than a factor of two, and tight tails matter when a whole class hits send at once. Luna ignored fewer real doubts, though most of its misses were academic_context called academic_general, which get answered either way. It also let two slurs through.

For a live class, the case for Jev is latency, tail and abuse behaviour. If you're already all-in on one provider and a second vendor is a problem, constrained Luna at $133 is a fine answer.

What it unlocked

The numbers matter less than what they changed about how we build.

The cost stopped being a design constraint. The old pipeline dropped single-word messages before classification, which also dropped lone slurs. At $115 per million, that skip is gone, and one-word messages reach the classifier like any other.

Classification became something you can just do. When a yes/no question over a message costs a hundredth of a cent, you stop rationing them. A new question is a small addition to the request rather than a prompt-engineering project and a budget conversation.

The rules became legible. what, not_for and examples per label is a structure a teammate can review, which is hard to say about an 11,000-token prompt.

The contract got smaller. There's no output parser, no retry for malformed JSON, no fallback for a hallucinated label beyond one guard clause.

This is what I mean by something we didn't know we wanted. We'd have told you we wanted a better prompt or a cheaper LLM. We'd never have asked for "a model that can't write". It turned out to be exactly right for a job that never needed writing in the first place.

What we kept on the LLM side

Decision models don't replace LLMs. They take a job LLMs were overqualified for.

Answering the doubt is still a GPT job: explaining a concept in Hindi, using the slide and what the teacher just said, is generation. So is the web-search path for general questions. NEET classes stayed on the OpenAI classifier too, since Jev was only evaluated on board classes.

Jev also gives you a probability rather than a written reason. If you need the model to justify its decision to a human, you'll need something else alongside it. And it has limits worth knowing before you adopt it:

  • English comes first. TypeSafe's model page says English is the primary training language and accuracy is best there, and advises testing other languages on your own content. Hinglish in Devanagari and misspelled Roman script is about as far from that as it gets, which is why our slur criteria spell out the variants and why we wouldn't have trusted any benchmark but our own.
  • No fine-tuning. Jev isn't tuned on customer data, so all your domain knowledge has to live in the question.
  • Text only. Teacher audio reaches Jev as a transcript.
  • Weak at some reasoning. Promptfoo's docs call 1.13 unreliable at arithmetic, counting and date comparisons. None of those matter for us, but they might for you.
  • It's a black box. With an undisclosed architecture, the only way to check a probability is against outcomes, after the fact.

The open-weights question

Since Laya speaks the same API, we self-hosted it and pointed the same payloads at it. A free, local decision model would have been lovely. Its best run scored 32.2% on five labels (chance is 20%), and its slur check came out at AUC 0.505. A one-off probe with Laya-style short questions didn't rescue it.

That's not a knock on Laya. Its own model card calls the base checkpoints near chance on zero-shot typed decisions and describes them as a base to specialise. Getting it working for us would mean fine-tuning on far more labeled data than we have. Zero-shot quality on messy Hinglish is apparently the hard part you're paying for.

How much to trust these numbers

I'd want to know all of this if I were reading someone else's post:

  • It's 242 messages. They're real, from 21 Hindi-medium board classes, and hand-labeled with the slide and audio context in view (6 guidance messages were hand-written, because real ones were scarce). The 95% interval on 88% runs from about 83% to 92%.
  • Jev vs. the old prod setup is a real difference. Jev was right on 46 messages the old classifier missed, and the reverse was true for 17 (exact McNemar p ≈ 0.0003). Jev vs. Luna with the prod prompt is not significant on overall accuracy (26 vs. 18, p ≈ 0.29), and Jev vs. constrained Luna is a dead tie.
  • There's no held-out set. I compared prompt variants on the same messages I'm reporting, so 88% is somewhat optimistic for every system tuned on them.
  • The sampling isn't neutral. The set was balanced by hand across labels, so it doesn't reflect real traffic mix, and the percentages above aren't production rates. Academic rows came from messages the old classifier had already called academic, which if anything favours it.
  • Latency was measured from a dev machine, not from a pod. Compare the ratios and don't quote the absolutes.
  • Hindi-medium only. English-medium classes get the same question with the medium swapped, and they need their own spot-check.
  • These are POC results, not production metrics.

A hosted model is also a moving target, so we pinned JEV_MODEL to the exact version we evaluated, jev-1.13.0. That has already mattered: Jev 1.14 arrived on October 14, and jev-latest, the SDK default, moved with it. These results don't cover 1.14, and we'd re-run the eval before moving. When we first wired Jev into the Python worker, we also added a test that fails if the production question drifts from the one the eval scored, plus a config flag that rolls classification back to the old prompt without a code change. A vendor shouldn't get to silently redefine your classifier.

Everyone else noticed too

Three days after our first runs, OpenAI announced a Decisions API at DevDay, built around the same idea: one question, a closed list of answers, and context on the side. Our key got a 403 at the time, which is why our Luna numbers use chat completions as a stand-in. It has reportedly opened up since, and OpenAI claims around 150 ms. I haven't measured it, so it isn't in these tables, and the eval harness is ready for when I do. Vendor benchmarks point the same way as ours, for what they're worth: DataCamp's comparison, as reported by DigitalOcean, had Jev at 67.8% against 67.9% for GPT-5.6 Terra on one workflow. Decision models don't seem to be winning by being smarter. They're winning by matching on accuracy at a fraction of the time and cost.

I like the timing as a data point. We backed into this from a chat classifier for Hindi-medium students, and meanwhile the industry was arriving at the same conclusion from the top down: a lot of what we call "AI features" are decisions wearing a completion API's clothes.

If you have an LLM classifier in production

  1. Look at your output tokens. If your model reads thousands of tokens to write ten, you probably have a decision problem.
  2. Label a couple of hundred real messages by hand. That's a few focused sessions, and it's what made every comparison above possible.
  3. Constrain your current model first. Closed labels, reasoning off, short rules. That may be most of the win, and it costs an afternoon.
  4. Split your label set into separate questions wherever one decision has different stakes from the others. Ours was abuse.
  5. Then try a decision model, and judge it on latency, tail and cost once accuracy is tied. Report the run that hurts your favourite too.

We set out to improve a prompt and ended up deleting most of it. That's the best kind of engineering result.