Typed decision models as zero-shot value functions
1 Introduction
Typed decision models return calibrated probabilities over a fixed set of options instead of free text. This makes them natural candidates for zero-shot evaluation of actions: write the state as text, ask which action?, and act on the returned distribution. We ask whether such a model, TypeSafe's Jev, can serve as a policy and value function without any training. We test it in two settings that stress different abilities: goal-reaching in a large maze, which needs spatial reasoning over an ASCII map, and state-based Flappy Bird, which needs frame-level control learned from 10–50 in-context expert demonstrations. In the maze, a short memory and a list of blocked moves raise success from 54% to 74%. In Flappy Bird, the choice of in-context demonstrations dominates: if we include examples from the 10 nearest expert transitions it reaches ~58% of expert performance.
Takeaways. (1) With in-context examples and/or history, Jev's action probabilities correlate with the true value function, and Jev reaches ~60–75% of oracle or expert performance. (2) Through the same API, Jev is ~6× faster than Claude Haiku 5.5 and ~20× faster than Claude Opus 5.5 (~4–150× cheaper per decision); Opus solves the maze but does not beat Jev in Flappy Bird.
2 Method
At each step we encode the state as a typed object xt=ϕ(st)x_t = \phi(s_t) and add a context ctc_t. In the maze, ctc_t holds the last kk (state, action, outcome) tuples and a hint: which moves are blocked. In Flappy, it holds 10–50 expert (state, action) demonstrations. A typed decision model ψ\psi (here Jev; GPT-6 Luna Decisions in §4.5) answers one Choice question whose options are the actions, and we read the log of its answer as an action-value estimate, Q^(st,a,ct)=logψ({xt,ct},choice(A))[a]\hat{Q}(s_t, a, c_t) = \log \psi(\{x_t, c_t\}, \texttt{choice}(\mathcal{A}))[a] (a value function up to a per-state constant). We sample actions with probability ∝expQ^\propto \exp \hat{Q} in the maze and take argmaxaQ^\arg\max_a \hat{Q} in Flappy (§4.2).

3 Experiments
Maze. PointMaze_Large_Diverse_GR-v3 (9×12). Each action moves the agent one cell, and the state is an ASCII map with 1 character per cell. 50 random start–goal pairs, 100-move budget, success rate and SPL.
Flappy Bird. PLE with 8 state features. The context holds 10 or 50 expert (state, action) pairs drawn at random (10 ex.) or retrieved as the nearest neighbours of the current state (10 / 50 kNN ex.). 50 episodes of ≤1000 frames; we report pipes passed and frames survived.
Baselines. Random; Jev with no additions; OpenAI's decision model GPT-6 Luna Decisions and Claude Haiku / Opus 5.5 given the same state and question (§4.5); BFS oracle and DQN expert as privileged upper bounds. In the tables, indented rows (↳) each add one change to the row above.




4 Ablations
4.1 Memory × hints (maze). Each helps alone (53% → 60%), and together they reach 80%. Longer memory does not help (63–67% at k=10k=10).

4.2 Sample vs argmax. The two environments want opposite decoding. In the deterministic maze, argmax repeats the same mistake forever (53% → 7%), and memory partly fixes this (47%). In Flappy, sampling and argmax are equally poor with random examples (65 vs 59 frames). With nearest-neighbour examples, argmax survives 6× longer (86 → 488 frames), because one sampled flap at the wrong frame is fatal.


4.3 In-context examples (Flappy). Zero-shot Jev cannot separate flap from no-flap states (balanced accuracy 0.52). 50 random demonstrations raise this to 0.60, and the 50 nearest ones to 0.81. In closed loop, the expert flaps on only 16% of frames, so random sets are dominated by do nothing. 10 random or 10 flap-balanced examples survive 115–123 frames. Swapping the same 10 for the nearest neighbours of the current state gives 463 frames, as good as 50 kNN examples (488). Balanced sets need 200 examples to reach 273 frames: relevance matters far more than count or balance.


4.4 Value-function quality. We collect 100 states per environment from noisy expert rollouts (30% random moves in the maze, 20% in Flappy; one state per episode) and ask every model about the same states. In the maze, the true value of a move is −(1 + shortest-path distance to the goal after the move). We report Kendall τ between a model's 4 action probabilities and these values (averaged over states) and the probability it puts on the optimal move. In Flappy, we report Spearman ρ between P(flap) and the DQN advantage. The true value function scores 1 (dashed). Context = memory + blocked moves (maze) or 10 kNN examples (Flappy).
With context, Jev reaches τ = 0.32 (0.66 on the optimal move) and ρ = 0.37, on par with Claude Haiku 5.5 (0.28 / 0.76 / 0.36). Claude Opus 5.5 is best (0.60 / 0.97 / 0.59). OpenAI's decision model GPT-6 Luna Decisions is weaker in the maze (0.12 / 0.45) and slightly higher in Flappy (0.44). Zero-shot, Jev and Haiku have no positive signal in Flappy (ρ = −0.14 and 0.01) and Luna is anti-correlated (ρ = −0.32). In the maze, blocked-move hints lower τ, because walls get ~0 probability but a wall bump ranks above a step away from the goal, while they raise the mass on the optimal move.

4.5 Jev vs other models. We run OpenAI's decision model, GPT-6 Luna Decisions, through the same OpenRouter Decisions API and schema as Jev. We give Claude Haiku 5.5 and Claude Opus 5.5 (via OpenRouter) the exact same state and question, and ask for the same probabilities as JSON.
In the maze, Opus solves every episode (100% vs 74% for Jev, 56% for Haiku and 48% for Luna). Luna refused to answer in 4 of 50 maze episodes, always in a dead end; these count as failures. In Flappy with 10 kNN examples, Jev survives longest (581 frames), ahead of Luna (465) and Opus (355, 10 episodes), and Haiku fails (69). Per 1,000 decisions, Jev costs ~$0.05–0.08, Luna ~$0.07–0.11, Haiku ~$0.2–0.3 and Opus ~$8–12. Through OpenRouter, Jev answers in ~0.2 s (0.05 s on TypeSafe's own API), Luna in ~0.3 s, Haiku in ~1 s and Opus in ~3–5 s.
Why is Jev cheaper and faster? Jev doesn't write an answer: it reads the state once and gives back a score for each action. Frontier models have to write their answer out word by word (Opus has to think first), and you pay and wait for every word.


5 Using typed decision models as cost in model predictive control
Setup. CarRacing-v3: a car on a random looping track, with continuous steering, gas and brake, controlled at 50 Hz (100 fps, each action held for 2 frames).
- State sts_t: 8 features (speed, offset from the centre line, heading error, distance to each road edge, road position 4 / 8 / 16 track points ahead).
- Actions u1,…,u44u_1,\dots,u_{44}: a fixed list of action vectors [steer, gas, brake] (11 steering values × 4 pedal settings). ψ chooses the whole action.
- Dynamics model ff: a small neural network trained on 40k transitions from separate tracks, using the car's full dynamic state (forward and sideways velocity, yaw rate, wheel angle). It predicts the next state s^i′\hat{s}'_i after 0.32 s for each action, written with the same 8 features as sts_t.
- Expert: a PPO policy trained on the same state and actions (97% of the track, almost never off the road). Expert data D\mathcal{D}: 50 (state, expert action) pairs from one noisy expert rollout, with exact float actions.
- Context ctc_t: the 10 (state, expert action, predicted next state) triples in D\mathcal{D} nearest to sts_t; optionally a typed on-road constraint (both edge distances ≥ 1).
- Typed decision model ψ\psi: input {st,ct}\{s_t, c_t\} and one choice question over the 44 actions, each written as (ui,s^i′)(u_i, \hat{s}'_i). Q^(st,ui,ct)=logψ({st,ct},choice{uk:(uk,s^k′)})[ui]\hat{Q}(s_t, u_i, c_t) = \log \psi(\{s_t, c_t\}, \texttt{choice}\{u_k: (u_k, \hat{s}'_k)\})[u_i]; we apply argmaxiQ^\arg\max_i \hat{Q} for one step and re-plan (Algorithm 2).

Results. With 10 retrieved expert pairs, Jev drives as well as the PPO expert: 98.8% of the track, 18 of 20 laps, off the road on 0.8% of decisions. Copying the nearest expert action without ψ reaches 60%, and putting all 50 pairs in context 47%.


Ablations (10 random expert pairs instead of retrieval). Predicted next states are essential: without them Jev covers 3% of the track. The typed on-road constraint lifts 33% to 79% and cuts off-road decisions from 62% to 1%. Without examples Jev stays on the road but drives slowly (41%); adding the constraint does not help there (37%). GPT-6 Luna Decisions covers 51% but refuses and ends 9 of 20 episodes.

6 Jev for bandits
Can ψ improve from its own experience, with no expert examples? We give Jev an 8-armed Bernoulli bandit: arm k pays 1 with a fixed unknown probability μk∼U(0,1)\mu_k \sim U(0, 1) and 0 otherwise, for 100 pulls, on 20 bandits shared by every method. Its input is the setup, the objective, each arm's pulls, total reward and mean so far, and the full history of (arm, reward). It returns ψ over the 8 arms and we sample the arm with probability ∝expQ^\propto \exp \hat{Q}.
Results. After 100 pulls Jev's regret is 9.1, below the two asymptotically optimal algorithms, KL-UCB (11.6) and Thompson sampling (12.1), and below UCB1 (25.5) and random (39.8), for $0.17 over all 2,000 decisions. Claude Opus 5.5, given the same state and question and asked for probabilities, reaches 10.3 for $27 (~160× the cost). Jev commits fast: by pull 10 ψ puts ~0.9 on one arm, and it tries a median of 5.5 of the 8 arms. That usually finds the best arm (median regret 5.1 vs 10.1 for Thompson), but in 3 of 20 bandits it settles early on a good arm that is not the best (worst regret 28.9, the same as Thompson's worst).


6.1 32 arms (Chapelle & Li setting). With uniform μ and many arms, several arms are nearly as good as the best, so we follow the benchmark of Chapelle & Li (2011): one best arm pays with probability 0.5 and the other 31 with 0.4, over 2,000 pulls on 20 bandits. Jev sees the same setup, the per-arm statistics over all pulls, and only the last 50 pulls (the full history would be ~100k tokens). A gap of 0.1 among 32 arms needs more than 2,000 pulls to resolve, so every method is still mostly exploring: regret is out of a maximum of ~194. Jev has the lowest mean regret, 172.6 ± 13.0, against Thompson sampling 180.4, KL-UCB 185.4, UCB1 190.3 and random 193.4 ($5.7 for 40,000 decisions), but its spread overlaps Thompson's.

7 Choosing among a video world model's plans: RoboCasa
Setup. Cosmos Policy (NVIDIA, ICLR 2026) is one video model that is a policy, a world model and a value function at once: from the current camera views it samples an action chunk (32 steps; the robot executes 16, then re-plans), the camera views it predicts after the chunk, and a predicted value. Its best-of-N planner samples N chunks and executes the one with the highest predicted value. We keep the policy and world model and replace only that last step: ψ sees the task, the current views and, for each candidate, the views predicted after its chunk, and we execute argmaxiQ^(s,ai,c)\arg\max_i \hat{Q}(s, a_i, c). Success is measured in the RoboCasa simulator (24 kitchen tasks with held-out objects) using NVIDIA's released RoboCasa checkpoint.
Querying ψ. One choice question over all candidates does not work: Jev picks whichever candidate is listed first 75% of the time (559 decisions, order shuffled). So we ask one yes/no question per candidate — does executing this chunk make progress toward the task? — and set Q^(s,ai,c)=logψ({s,s^i′,c},choice{yes,no})[yes]\hat{Q}(s, a_i, c) = \log \psi(\{s, \hat{s}'_i, c\}, \texttt{choice}\{\text{yes}, \text{no}\})[\text{yes}]. The 16 questions run in parallel. The context cc is empty (zero-shot), or 4 (views now, views 16 steps later) pairs from successful expert demonstrations of the same task, chosen at random or as the nearest to the current views.


Results. The direct policy reproduces the paper (67.2% over 24 tasks × 50 trials; paper 67.1%). Picking among candidates by Cosmos's predicted value does not beat picking at random, with 4 or with 16 candidates: the candidates are near copies, and their predicted values differ by less than 0.01 in 93% of decisions. ψ separates them more (P(yes) often spans 0.3), but on the 8 hardest tasks every way of choosing lands within a few episodes of the direct policy (24–26 of 63), with ψ and retrieved expert examples highest at 26. The bottleneck is the candidates, not the chooser: 16 samples from this policy rarely contain a much better chunk.



8 Work in progress (temporary)
Not part of the main results yet. Two open questions: does ψ beat a simple vote over the examples it is given, in a model-free setting (Flappy); and does it improve from its own experience without expert data (CarRacing)?
Beating the vote (Flappy). Voting over the 10 nearest expert examples survives 668 frames (18.1 pipes); Jev 1.14 with the same 10 examples survives 590. Adding per-example distances, relative gap features, the recorded next state or the expert's Q-values brings Jev to 553–610 frames, and a typed constraint or the episode's last 5 frames lowers it to ~390. With a mixed-quality pool (the expert taking 0, 10 or 30% random actions), the vote survives 418 frames; Jev given which player made each example survives 250, and Jev or an outcome-weighted vote given each example's outcome survive ~50, because an outcome reflects the player's later random actions more than the decision itself. So far Jev never beats the vote.

Self-improvement (CarRacing, no expert data). Jev drives 12–16 episodes in a row on one track, starting from an empty context; its context is the 50 of its own past decisions on that track nearest to the current state (action and the state 0.32 s later), optionally with Q, the discounted reward that followed (γ=0.98\gamma = 0.98). Over 10 tracks, coverage rises from 50% to ~59% without Q and stays at ~59% with Q. A task-matched reward (−1 per off-road decision) and the typed on-road constraint make the first episodes stall (2%) and end at 53%; sampling actions from ψ instead of argmax ends at 16%. For reference, sampling helps zero-shot Jev (37% → 56%) but hurts Jev with expert pairs (79% → 28%, 99% → 83%).


Limitations. 50 episodes per main-table row (Opus Flappy rows: 10, for cost), but 30 for the maze ablations; one model version (jev-1.13; main table and comparisons through OpenRouter, §4.1–4.3 ablations on TypeSafe's API); Flappy performance is still below the expert on average (15.6 vs 28 pipes).