IntermediateEnglish23 lectures · 1h 55m

Build a Jev-Style Decision Model from Scratch

An LLM that returns calibrated probabilities, not text: architecture, PyTorch build, training, serving

Watch 3 lectures free

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

About this course

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 made confident errors on unseen intents rise 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 prove 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 in the lectures comes from notebooks you can run.

The on-screen presenter in the welcome and closing lectures is an AI-animated avatar.

Curriculum8 sections · 23 lectures · 1h 55m

Section 0. Welcome

Free preview

Section 1. Reference Demonstration

Free preview

Section 2. Architecture Analysis

  • 🔒the picture2:06
  • 🔒delimiters and encoding9:12
  • 🔒the mask5:36
  • 🔒shared positions6:00

Section 3. Implementation

  • 🔒the pointer head5:42
  • 🔒the model and first forward pass6:18
  • 🔒what an untrained head does6:18

Section 4. Training

  • 🔒data and licences6:06
  • 🔒training one epoch3:12
  • 🔒three question types5:54

Section 5. Calibration and Evaluation

  • 🔒accuracy is not enough6:48
  • 🔒harder questions7:00
  • 🔒train longer and temperature8:30
  • 🔒the permutation test6:24

Section 6. Production Comparison and Serving

  • 🔒kev and mojev2:18
  • 🔒serve your model3:30

Section 7. Deployment

  • 🔒decide or hand to a person7:36
  • 🔒recap and limits2:12

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, so only notebook 3 trains (334 s on an A100)

Who this 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

Read alongside the course

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.

Build a Jev-Style Decision Model from Scratch | SOTAAZ Blog