Not every AI answer needs a paragraph: Hugging Face makes decision models a first-class citizen ๐ฏ
A lot of what we ask LLMs to do in real software isn't writing at all. Which team should handle this ticket? How urgent is it? Is the customer asking for a refund? Usually we prompt a chatbot to answer in JSON and hope it sticks to the schema. On 10 November, Aritra Roy Gosthipaty, Lysandre, Pedro Cuenca and Tom Aarsen published a post on the Hugging Face blog that takes a cleaner route: decision models, now with proper support across the Hugging Face ecosystem.
What a decision model does
The interface is simple: state plus questions plus allowed answers go in, decisions plus probabilities come out. No text is generated. You hand the model some context (a string or a JSON object), name your questions, and it scores the answers your application already understands. There are three primitives:
- Choice picks one option and returns the full probability distribution.
- Score rates something on an ordered scale and reports the expected value, so an urgency of 1.7 on a 0 to 2 scale means "probably high, maybe medium".
- Noul (from Bernoulli) returns the probability that a yes/no statement is true.
Choice and Score also return a normalized confidence value, which is 0 for a uniform guess and 1 when all belief sits on one option. In the blog's example request, the response reports 148 input tokens and 0 output tokens.
Why I like the approach
The authors are honest that classification with probabilities, or labels you define at request time, is nothing new; zero-shot classifiers have done that for years. What's new is a shared contract: several typed questions in one request, non-generative scoring, and room for architectures trained specifically for calibrated decisions. Hugging Face's stated goal is a common interface without forcing a common implementation, and the pieces are already landing:
- Transformers has a
decisionpipeline,AutoModelForDecision,DecisionConfig, and a/v1/systemoneendpoint intransformers serve. - llama.cpp serves the same
/v1/systemoneAPI, for example with theggml-org/Kev-4B-GGUFmodel. - The Hub has a
decision-modeltag, covering encoder models like ModernBERT as well as larger generative backbones. - Training works with the regular
Trainerand a plain cross-entropy loss over the options, TRL support is in an open pull request, and Unsloth has a LoRA recipe to turn a generative model into a decision model.
My favourite detail: the same API also works with compatible ordinary autoregressive LLMs. Transformers builds the decision prompt, reads the logits of the answer labels in one batched forward pass and applies softmax. So you can try the interface today with a model you already run, without training anything new.
Why this matters for agents
Agents are full of small decisions: route this, escalate that, call a tool or don't. Getting real probabilities instead of a confident-sounding sentence means your code can set thresholds, ask a human when confidence is low, and log why it did what it did. For a learning platform, I can picture questions like "which topic is this student stuck on?" answered in milliseconds on modest hardware. I covered the Swift side of this idea in October; seeing it arrive in Transformers and llama.cpp feels like the moment it becomes a normal building block.
Give the decision pipeline a try on one of your own routing problems. It might be the most boring, and most useful, upgrade your agent gets this month. ๐
Reacties
Een reactie posten