Decision Models for AI Agents: Outputting Option Probabilities in a Single Forward Pass
Most large language models are built for open-ended text generation, which creates structural problems in high-frequency agent decision-making scenarios. This article introduces decision-type models that compute the selection probability of each candidate option in a single forward pass without generating any tokens. It explains two common implementation approaches (label-token and option-representation methods), compares generative and decision-type models across key dimensions, and details an evaluation framework covering latency percentiles, Expected Calibration Error (ECE), and option capacity, along with a post-training engineering path starting from open-source base models.
1. Why Agents Need Decision-Type Models
Most large language models today are designed for open-domain text generation. Given a prompt, the model decodes a natural-language response token by token. This approach works well for dialogue, writing, and summarization, but it has structural problems in the high-frequency decision-making scenarios that agents face.
When executing tasks, an agent must make choices repeatedly and quickly: which tool to call, which branch to take, which item to pick from a candidate set. These decisions are essentially classification or ranking problems. When handled with a generative model, the typical workflow is to have the model first output text expressing its choice, then let an external program parse it. This introduces three problems.
- Compounding latency: Decoding time is proportional to output length. Even when the answer is just an option index, the model may write out a paragraph of reasoning first, pushing latency from tens of milliseconds to several seconds.
- Unstable parsing: Free-form text requires format constraints and parsing fault tolerance. If the output does not conform to the expected format, the entire decision pipeline fails.
- Confidence is hard to recover: It is difficult to reliably read the model’s confidence in each option from generated text, yet agent risk control often depends on exactly this information.
Decision-type models bypass token-by-token generation and instead model the decision problem directly as structured computation over “state, options, probabilities.”
2. Core Principle: One Forward Pass, Probabilities Out
The core mechanism of a decision-type model is this: given the current state and candidate options as input, the model computes the probability of each option being selected in a single forward pass, without generating any tokens.
A common industry practice is post-training on top of an open-source decoder base model, with two concrete implementations.
The first is the label-token method. Each option is assigned a label, such as A, B, or C. The prompt ends by asking the model to answer with one of these labels, and only the logits corresponding to those label tokens are taken and normalized. This method is simple to implement and reuses the original language model head. However, the number of options is limited by the number of labels, and mutual interference between options is hard to control.
The second is the option-representation method. The text of each option is placed into the same input sequence, the hidden state of each option’s final token is taken, and a lightweight scoring head is attached. Illustrative code:
def decide(model, scoring_head, state, question, options):# options: K option textsprompt, option_end_pos = build_prompt(state, question, options)hidden = model.encode(prompt).last_hidden_state # [seq_len, dim]option_repr = hidden[option_end_pos] # [K, dim], one vector per optionscores = scoring_head(option_repr).squeeze(-1) # [K]probs = softmax(scores, dim=-1) # normalized over the K optionsbest = int(probs.argmax())return best, probs # returns both the choice and confidence
build_prompt needs to record the position of each option’s final token in the sequence to produce option_end_pos. If options are long, you can instead apply mean pooling over all tokens within each option to obtain its vector.
Latency needs to be stated clearly. The scoring head’s computation scales roughly with the number of options, but this overhead is small. The main cost is encoding the input sequence. In the second method, more and longer option texts mean a longer sequence, and the cost of attention computation grows accordingly. Therefore, latency is not independent of the number of candidates. Only when options are very short and the label-token method is used does latency grow relatively flatly with candidate count.
3. Generative vs. Decision-Type Models
| Dimension | Generative Model | Decision-Type Model |
|---|---|---|
| Output format | Natural-language text requiring parsing | One probability value per option |
| Inference steps | Increases token by token with output length | One forward pass |
| Latency factors | Output length, decoding strategy | Total input length, number of options |
| Confidence | Indirectly estimated from text or logits | Directly output |
| Option capacity | Constrained by context length and parsing difficulty | Constrained by input length and position encoding |
| Typical failure modes | Format errors, reasoning drift, parsing failure | Overconfident probabilities, option-order bias, long candidates truncated |
4. Evaluation Framework: Three Metrics
Evaluating a decision model cannot rely solely on how often it picks the correct option. The standard practice is to look at three categories of metrics simultaneously.
1. Latency: Median and Tail Percentiles
Agents invoke decisions at high frequency, and long-tail latency can drag down overall throughput. Reports should include both P50 and P95 or P99. Measurement conditions must be documented: model parameter scale, hardware model, input length, candidate count, concurrency, and whether warm-up requests are excluded. Latency figures without these conditions are not comparable.
2. Calibration Error: Expected Calibration Error (ECE)
ECE answers the question: when the model says it is 90% confident, is it actually correct on roughly 90% of those samples? The calculation steps are as follows.
- Divide the predicted confidence (the probability of the selected option) into several equal-width bins, commonly 10.
- Within each bin, compute the average confidence conf(B) and the actual accuracy acc(B).
- ECE = Σ (|B| / n) × |acc(B) − conf(B)|, where n is the total number of samples.
Example: a validation set has 100 samples; 40 of them fall in the 0.9–1.0 confidence bin, with an average confidence of 0.95 and an actual accuracy of 0.90. This bin contributes 40/100 × |0.90 − 0.95| = 0.02. The other bins are accumulated in the same way.
There is no universal passing threshold for ECE. The threshold should be determined by the business’s risk tolerance and compared against the previous model version or a baseline method. For agents, well-calibrated probabilities are the prerequisite for fallback strategies. For example, you can select a confidence threshold on a validation set such that decisions above the threshold meet the business’s accuracy requirement, while those below it fall back to human review or an alternative approach. The threshold must be determined on an independent validation set, not tuned on the test set.
3. Option Capacity: The Maximum Number of Options Evaluable in One Pass
The number of options varies greatly across scenarios. Tool routing usually involves only a few candidates, while retrieval reranking may involve tens to hundreds. When testing option capacity, fix the model and hardware, gradually increase the candidate count, and record accuracy, ECE, and latency along the way. The “limit” here refers to the maximum candidate count at which accuracy and calibration metrics remain within an acceptable range—not the maximum candidate count the model can technically run.
5. Post-Training Engineering Path
Starting from an open-source base model and performing post-training is a path most teams can reuse. The typical process is as follows.
- Base model
