Udemy
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Build a Jev-Style Decision Model from Scratch
New
6 students

Build a Jev-Style Decision Model from Scratch

An LLM that returns calibrated probabilities, not text: architecture, PyTorch build, training, serving · Build track
Created byOC OC
Last updated 10/2026
English
English

What you'll learn

  • Explain how a decision model returns a probability distribution over supplied options without generating text
  • Implement delimiters, an option-isolating attention mask, shared position ids and a pointer head in PyTorch
  • Train yes/no, choice and ordered-score questions with LoRA and one cross-entropy loss
  • Measure calibration (reliability diagrams, ECE, Brier, confident errors) and fix overconfidence with temperature scaling
  • Prove option-order invariance with a permutation test
  • Serve a model behind a SystemOne-compatible API and route low-confidence cases to people

Course content

8 sections • 23 lectures • 1h 57m total length
  • Welcome and course overview1:16

Requirements

  • Python 3.12 and comfort reading Python code
  • Basic PyTorch (tensors, nn.Module, a training loop)
  • An NVIDIA GPU with bfloat16 support (Ampere or newer). The lectures use one A100; trained checkpoints are included

Description

This course contains the use of artificial intelligence.

AI-generated narration disclosure. The voice-over in this course is synthesized with a text-to-speech model from scripts written and reviewed by the instructor, and the on-screen material (notebooks, code, slides) is the instructor's own work. This is disclosed in line with Udemy's policy on AI-generated content.


Jev, released by TypeSafe in September 2026, answers questions without writing a word: you send a message and typed questions, and it returns a probability for every option you gave it. Open models such as Kev and MoJev reproduce the idea. This course builds one from scratch, small enough to read end to end, and then measures whether its probabilities deserve trust.


We start by running Kev locally and making the honest case for and against decision models, using measurements from real benchmarks: when a small trained classifier is the better tool, and when a decision model earns its place. Then we build the design in PyTorch on a 0.6-billion-parameter Qwen base: borrowed special tokens as delimiters, an attention mask that keeps options from seeing each other, shared position ids that make option order irrelevant, and a pointer head that scores each option against a decide token. We train it with LoRA on public data (BANKING77, CC-BY-4.0) plus generated data, for three question types: yes/no, choice and ordered score.


Then the part most tutorials skip. We measure calibration with reliability diagrams, ECE, Brier score and confident-error rates; show that training longer raised the share of answers that were wrong at 90% confidence or more, on unseen intents, from 2.7% to 9.7% while in-distribution numbers looked better; largely correct it with a single temperature (back to 3.0%, though the one-epoch model stays better calibrated); and verify option-order invariance in float32. Finally we serve the model behind the same API shape as Jev and Kev, call it with the official TypeSafe SDK, and use its probabilities to route work between automatic decisions and people, with every case logged.


This course is not affiliated with or endorsed by TypeSafe AI; "Jev" names the model the course explains. Jev's internals are not public: the course builds the inferred design that open models follow, and says so. Every number we measure comes from notebooks you can run; figures from TypeSafe, Kev and published benchmarks are labelled with their source.


Datasets: BANKING77 (PolyAI, CC BY 4.0) and CLINC150 (Clinc, CC BY 3.0), used with attribution; question formats and splits are ours.

Who this course is for:

  • ML engineers who route, classify or triage with LLMs and want calibrated probabilities instead of text
  • Developers evaluating Jev, Kev or similar decision models who want to know how they work and where they fail
  • Anyone who wants to build and measure a model rather than call an API