Bellman Language Models: Solving the Recurring Decisions of LLM Agents
Organizations: Stevens Institute of Technology
Abstract
A general observation in agentic workflows, especially bounded ones, is that the decision space of the LLM, when we separate a decision from generation, starts approaching saturation: the agent meets the same states again and again, and after enough conversations it stops meeting new ones. LLMs generally don't treat these decisions as an optimization problem and instead re-derive them from their context/prompt on every turn. We show that treating decision making within reasonable bounds as an optimization problem, solving it once, and reusing the solved decisions can often make an agent faster, cheaper and more reliable. Our approach, which we call Discretize, Then Decide, starts from data such as the workflow's own logs or, when none exists, runs of the LLM agent itself. It reads each conversation into discrete states and estimates the probability of each outcome and the cost of each move, until no new states appear and the probabilities stop changing. It then solves the resulting Markov decision process. The solution runs as a controller around the model, sending moves whose content is fixed in the state, such as a tool call or a templated reply, and any state it hasn't seen is sent back to the LLM. We call an LLM run this way a Bellman language model (BLM), after Richard Bellman's equation for the best move in each state. On -bench telecom, the controller with no model solves 79% of tasks. As a BLM, Qwen3.8-27B, an open model, goes from 29% to 96% with 93% fewer model calls. For Claude Opus 5.5, which solves 96% of tasks on its own, running it as a BLM cuts model calls and cost per task by about 98% and lets it solve 2 more tasks. On InventoryBench, the solved policy with no model beats every published method. Where the hard part is writing content rather than choosing moves, such as resolving SymPy issues, few decisions can be solved in advance, and a BLM helps little.
Figures & tables
| Stage | Check | Fault rate | Turns | Rate per turn | Order: solved / Opus |
|---|---|---|---|---|---|
| 1 | Airplane mode | 0.49 | 1.09 | 0.45 | 1 / 1 |
| 1 | SIM card | 0.50 | 2.86 | 0.18 | 2 / 3 |
| 2 | Roaming (travel question) | 0.74 | 1.20 | 0.61 | 3 / 8 |
| 2 | Data usage | 0.51 | (1) | 0.51 | 4 / — |
| 2 | Mobile data | 0.50 | 1.36 | 0.37 | 5 / 2 |
| 2 | Network mode preference | 0.51 | 1.60 | 0.32 | 6 / 6 |
| Test set (controller) | Qwen alone | Qwen + BLM | Opus alone | Opus + BLM |
|---|---|---|---|---|
| Test set 1 (first), of 114 | 52 (17.9) | 94 (4.2) | 111 (15.6) | 114 (0.43) |
| Test set 2 (second), of 114 | 31 (18.4) | 102 (4.9) | 111 (17.0) | 113 (0.61) |
| Test set 3 (third), of 114 | 33 (20.9) | 109 (1.5) | 110 (16.9) | 112 (0.25) |
| Unseen-fault set 1 (first), of 60 | 22 (19.6) | 42 (6.4) | — | — |
| Test set 2, Opus customer (second), of 64 | 45 (19.9) | 63 (1.6) | 64 (17.0) | 64 (0.78) |
| Agent | pass 1 | pass 3 | Calls | Agent tokens |
|---|---|---|---|---|
| Qwen alone | 67.2% | 40.0% | 19.1 | 181k |
| Qwen + BLM | 97.8% | 93.3% | 0.97 | 11k |
| Qwen + BLM, thinking fallback | 100% | 100% | 0.32 | 3.2k |
| Opus alone (41 attempts) | 100% | — | 16.3 | 233k |
| Opus + BLM | 100% | 100% | 0.27 | 4.1k |
| Agent | Solved | Calls | Tokens (k) |
|---|---|---|---|
| Qwen alone | 31 | 18.4 | 174 |
| Qwen + BLM (solved order) | 102 | 4.9 | 59 |
| Qwen + BLM (QMDP / planning over beliefs) | 100 / 93 | 5.0 / 5.1 | 57 / 57 |
| Opus alone | 111 | 17.0 | 246 |
| Opus + BLM | 113 | 0.61 | 10 |
| The policy in the prompt | |||
| Batch | OR rule | Best published | BLM, QMDP | BLM, planning over beliefs |
|---|---|---|---|---|
| Real, lead 0 | 0.671 | 0.772 | 0.785 | 0.786 |
| Real, lead 4 | 0.302 | 0.308 | 0.359 | 0.421 |
| Real, stochastic | 0.210 | 0.353 | 0.445 | 0.454 |
| Synthetic, lead 0 | 0.818 | 0.860 | 0.865 | 0.865 |
| Synthetic, lead 4 | 0.536 | 0.558 | 0.651 | 0.662 |
| Synthetic, stochastic | 0.107 | 0.411 | 0.519 | 0.525 |
| Domain (measure) | Most likely / fixed order | QMDP | Planning over beliefs |
| CI triage ($ per failure) | 32.79 | 16.49 | 14.16 |
| InventoryBench (reward) | 0.546 | 0.610 | 0.626 |
| SymPy (solved of 63) | 17 | 16 | 19 |
| Telecom, test set 1 (solved of 114) | 94 | 86 | 88 |
| Telecom, unseen-fault set 1 (solved of 60) | 42 | 38 | 33 |
| Telecom, test set 2 (solved of 114) | 102 | 100 | 93 |
Appendix figures & tables6 assets
Supplementary material from the paper’s appendix.
Appendix
| Domain | Observed state | Hidden (prior from) | Reader | Moves | Cost unit | MDP / QMDP / POMDP as implemented |
|---|---|---|---|---|---|---|
| -telecom | kind of problem, fixed yet, checks left, what stops a fix; line, bill, usage, travel status | remaining fault set (fault-set frequencies per kind of problem, train split) | regular expressions; tool results | info.: lookups, travel question, re-asks; acting: check templates, payment, resume, refuel, roaming; terminal: hand-off, close | customer turns per check | fixed order by turns / check most likely to address a remaining fault / two-move lookahead |
| CI triage | platform, duration, suite, test label history, retrigger counts | regression vs intermittent (logistic prior, train window) | retrigger outcome (beta-binomial); LLM log verdict | info.: retrigger, LLM read; terminal: mark intermittent, back out, escalate | dollars | act on / best final move under / two-move search over beliefs |
| InventoryBench | on hand, outstanding orders and ages, demand history | lead-time distribution, arrival times, demand model | exact arrivals and demand | acting: order quantity (information arrives regardless) | reward sold stock | most likely arrivals and demand model / newsvendor quantity at arrival over the belief / rollout over sampled futures |
| SymPy | last test result, attempts, scope, step | agent’s phase before its first edit | Laya; frozen reproduction test | info.: search, read, run, defer; acting: edit; terminal: submit (executed) | billed tokens | table of move values for the most likely phase / move values weighted by the belief / defer when the expected value of perfect information exceeds 1,300 tokens, the cost of one agent step |
| What came in | State | What the controller sent |
|---|---|---|
| “I’m having trouble sending MMS messages…” | picture messages; unknown; airplane mode | Template: asks for the phone number. |
| “…my phone number is 555-123-2002.” | unchanged | Four lookups: the customer, two lines (to find the one with this number) and the line’s plan. |
| The lookup results | unchanged | Template: check airplane mode and the SIM card. |
| “I can’t perform multiple actions at once.” | unchanged | Template: check airplane mode alone. |
| “Airplane Mode was on, so I’ve turned it off.” | unknown; SIM card | Template: check the SIM card. |
| “My SIM card shows as active and working.” | unknown; roaming | Template: are you travelling outside your home country? |
| Domain (baseline) | Decidable | Executed | Calls |
|---|---|---|---|
| Telecom, Opus, test sets 1–3 | 98% [55–61, 97] | 97–99% | 96 to 99% |
| Telecom, Qwen, test sets 1–3 | 76–80% [26–31, 96–99] | 80–93% | 74 to 93% |
| SymPy, Qwen | 15–22% [1, 15] | 3% | 23% |
| InventoryBench, CI | 100% | 100% | all decision calls |
| Test set | Agent | Conversations | Unseen decision state | Unseen record of checks |
|---|---|---|---|---|
| Test set 1 | Qwen alone | 114 | 0 (0 of 2,038 turns) | 50 |
| Opus alone | 114 | 0 (0 of 1,779) | 43 | |
| Test set 2 | Qwen alone | 114 | 0 (0 of 2,095) | 65 |
| Opus alone | 114 | 0 (0 of 1,934) | 61 | |
| Test set 3 | Qwen alone | 114 | 0 (0 of 2,380) | 62 |
| Opus alone | 114 | 1 (1 of 1,923) | 62 |
| Policy | Real outcomes | Simulated: | Simulated: |
|---|---|---|---|
| (169 failures) | per-test rates | simpler model | |
| BLM, planning over beliefs: the controller we report | $14.16 | $8.70 | $9.79 |
| the same, without calibration | $16.18 | $7.85 | $10.10 |
| the same, recalibrated | $14.85 | $8.24 | $9.51 |
| the simpler controller | $14.98 | $10.06 | $9.62 |
| BLM, QMDP | $16.49 | $12.80 | $12.80 |
LLM Decision-Making
LLM decision-making studies how language models choose, act, seek information, and allocate resources under goals, uncertainty, constraints, and social pressures.
See all 229 papers