Post
CommunityJev Guides & Articles
Build your own decision model
Nish Tahir's tutorial on how decision models like Jev work: mask an LLM's vocabulary to the option tokens, read the softmax as a probability, then measure calibration and add temperature scaling, using Qwen3-1.7B.
- Format
- Post
- Reading time
- 2 min
- Published by
- Community
- Author
- Nish Tahir
- Last verified
- Oct 2026
- Languages
- Python
Highlights
- Explains the single-pass trick: mask the vocabulary to the option tokens, pick the highest-probability one, and read the softmax as its score.
- Provides a Python script that loads Qwen/Qwen3-1.7B, constrains decoding to options A to E, and prints the prediction with probabilities.
- Reports 725/1221 = 0.5938 accuracy and 0.5844 macro F1 on a CommonsenseQA holdout, rising to 0.6241 accuracy after a fine-tune.
- Shows the calibration gap: in the 0.90-1.00 confidence bin the model was right only 70.09% of the time, motivating temperature scaling.
Watch out
Grounded in the truncated post capture from 2026-10-15; the temperature-scaling section is cut off mid-sentence, and the CommonsenseQA figures are the author's own single run, used to illustrate calibration rather than to benchmark Jev or any other model.
Questions about this entry
Short answers drawn from the linked project or page.
Nish Tahir explains what decision models like Jev do, return calibrated probabilities over fixed options in a single pass, and shows how to emulate the behaviour by constraining a small language model's output tokens.
A normal model generates one token per pass, and the post's example needs 11 passes for its output. A decision model masks the vocabulary to the allowed options, so one pass returns the answer and its probabilities.
Qwen/Qwen3-1.7B, loaded with transformers. The script builds a prompt from a JSON question, restricts decoding to options A through E, and prints the prediction with a probability for every option.
On a random holdout it scored 725/1221 = 0.5938 accuracy with macro F1 0.5844, and a quick fine-tune on the dataset lifted accuracy to 762/1221 = 0.6241, which the post calls not bad for a 1.7B model.
The post bins confidence against accuracy: in the 0.90 to 1.00 bin the model was correct only 70% of the time and in the 0.80 to 0.90 bin about 40%, so its probabilities were overconfident and needed temperature scaling.
No. The post warns that without additional training, the option-token probabilities reflect the model's confidence in the next token, not the chance the answer is correct, which is exactly the gap calibration is meant to close.
Yes, it is Python using torch and transformers, taking an --input JSON file with a question and options A to E. The digest capture truncated the temperature-scaling fix that follows the evaluation section.
From the Jev guides
Original write-ups on what this entry is for.
From the Jev AI model community
Posts from builders shipping with Jev right now.