Vibeleaderboard
← All Intel
Intel / article

Build your own decision model

Source
nishtahir.com
Author
softwaredoug
Date
From the Daily Brief

Decision models have been a recurring release category this month, with hosted products from several providers aimed at classification and routing. This post shows the core idea is reproducible with a small open model and a few lines of code. Rather than asking the model to generate a JSON answer token by token, it masks the vocabulary to the allowed answer options, runs a single forward pass and reads the probabilities off the logits. For fixed-choice questions that means one pass instead of one per generated token, which matters when an agent makes many small yes, no or category calls. The author is careful about the limits: the resulting scores are token probabilities, not calibrated confidence, so a 0.9 should not be read as a 90% chance of being right without checking it against labeled data. The working code makes it a reasonable starting point for anyone who wants a cheap local router before paying for a hosted one.

Read the 2026-10-11 Brief →

Context

A can choose among fixed answers without generating a full sentence. This decision-model tutorial uses Qwen3-1.7B, a small model from Qwen, to score five answer labels in one forward pass, masks out every other output and selects the highest-scoring label.

The resulting score still needs testing before it can be treated as confidence in correctness. In the tutorial's reported highest-confidence group, the average score was about 99%, but answers were correct about 70% of the time. The tutorial then applies scaling, which spreads the probabilities out so they better match observed accuracy. Restricting the answer format and calibrating confidence are separate tasks.

Terms in this piece · Glossary
  • Large language model — A model trained on large amounts of data to process and generate language.
  • Sampling controls — Parameters that shape how deterministic or varied model generation becomes.
  • Token — A piece of text, such as a word, part of a word or a punctuation mark, that a language model represents as numbers and handles as a unit.
  • structured output — Forcing a model's response to match a schema, so downstream code can parse it instead of guessing at prose.

Get the Brief

A cited digest of what matters for people building with AI, every morning. Unsubscribe anytime. See today’s edition

Read the source nishtahir.com
Recommended reads
Comments

Checking sign-in…

Loading comments…