
Build a Jev-style decision model from scratch, with deterministic scoring, caching, and visible components—delimiters, attention mask, pointer head, training, and probability calibration—in a reference demo.
Explore why prompting can break by contrasting constrained, probabilistic Jev-style decision models with traditional zero-shot and labelled-data methods, emphasizing probabilities you can trust, cost efficiency, and scalable multi-label decisions.
Explore constructing an attention mask for causal attention that isolates options and lets the decide token see all candidates, using a role matrix and block rules.
Demonstrate order-invariant decision making by using shared positions and a masking scheme to isolate options. Validate consistency by comparing the encoder output for reversed option lists.
Turn public datasets into typed questions by validating licences upfront, generating choice, noul, and score questions from BANKING77 and CLINC150, and prepare 8,000 labeled records for one-epoch training.
Harder questions with close options and unseen intents reduce accuracy, while calibration varies by dataset and depends on measuring ECE and confident error rate.
Serve your model behind a real api, calibrating probabilities for typed questions (choice, yes/no, score), using epoch 3 with 1.5 temperature on port 8020 and the type-safe Python sdk.
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.