Papers › Inverting the Bellman Equation: From Q-Values to World Models

Inverting the Bellman Equation: From Q-Values to World Models

19 Jun 2026arXiv:2606.21173added by Syntology

Alistair Letcher, Mattie Fellows, Alexander D. Goldie, Jonathan Richens, Jakob N. Foerster, Oliver Richardson

Title, abstract, authors and date from arXiv's metadata (CC0); this paper is not in the Papers with Code archive (frozen 2025-07-28).

Model-based and model-free reinforcement learning are traditionally viewed as separate paradigms: instead of learning a model of the transition kernel P, model-free agents typically estimate value functions tied to a specific policy and reward. In this paper, we challenge this dichotomy by proving that value-based agents trained on a sufficiently rich set of reward functions, e.g. using goal-conditioned RL, implicitly encode a unique and accurate world model. To extract this model in practice, we introduce \textit{P-learning}, an inverse analogue to Q-learning that samples from an agent's Q-values, policies and rewards to decode its internal model of the environment. We then provide sufficient conditions on the type and number of goals for which agents encode the true kernel P, covering both stochastic and deterministic MDPs over finite or continuous state spaces. Even when our assumptions are violated, we empirically demonstrate that agents trained on a handful of reward functions encode accurate dynamics in Reacher, MountainCar and stochastic variants of FourRooms. Surprisingly, we find that policies trained exclusively on a \texttt{Reacher} agent's implicit world model are quasi-optimal on out-of-distribution, velocity-based goals despite position-only training -- suggesting that agents contain hidden generalisation capabilities and providing a new lens into the connection between model-based, model-free, and goal-conditioned RL.

PaperPDFCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2606.21173")

Code

Syntology Ran 10 of 11 code samples harvested from 1 repository linked to this paper; 1 has no recorded run. Of those that ran: 1 ran · honoured contract; 4 ran · our draft was wrong; 2 ran · fixture could not drive it; 3 ran with no contract checked.

By repository: found in paper text by Syntology: 11 samples from 1 repository, 10 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

aletcher/inverting-bellman found in paper text by Syntology report

Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

11 samples harvested; 10 ran; 1 honoured the contract we drafted; 1 has no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · honoured contract
4ran · our draft was wrong
2ran · fixture could not drive it
3ran
1unverified

Licence: 0 of the 11 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from aletcher/inverting-bellman. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

ContinuousGoal aletcher/inverting-bellman/training/wm.py found in paper text by Syntology ran · metamorphic tier: deterministic MIT (permissive) · 8b28b8605c55063e · report
QNetwork aletcher/inverting-bellman/training/wm.py found in paper text by Syntology ran · metamorphic tier: deterministic MIT (permissive) · 549021cbd6349871 · report
WorldModel aletcher/inverting-bellman/training/wm.py found in paper text by Syntology ran · metamorphic tier: deterministic MIT (permissive) · 7f3428c1d86ea919 · report
_residual_loss aletcher/inverting-bellman/training/wm.py found in paper text by Syntology ran · our draft was wrong MIT (permissive) · bb004af58345169b · report
_wrap_angle aletcher/inverting-bellman/training/wm.py found in paper text by Syntology ran · honoured contract fingerprinted MIT (permissive) · 277e4f29cf1d948a · report
apply_wm aletcher/inverting-bellman/training/wm.py found in paper text by Syntology ran · fixture could not drive it MIT (permissive) · 2f12e5c52bf3aca4 · report
compute_reward aletcher/inverting-bellman/training/wm.py found in paper text by Syntology ran · our draft was wrong MIT (permissive) · 558feeda58f8f8b0 · report
goal_achieved aletcher/inverting-bellman/training/wm.py found in paper text by Syntology ran · fixture could not drive it MIT (permissive) · 3363b6be1ccdd4d6 · report
make_q_network aletcher/inverting-bellman/training/wm.py found in paper text by Syntology ran · our draft was wrong MIT (permissive) · dcca8d69ef2ddfe1 · report
make_world_model aletcher/inverting-bellman/training/wm.py found in paper text by Syntology ran · our draft was wrong MIT (permissive) · e6b68123583448f4 · report
world_model_loss_sampled aletcher/inverting-bellman/training/wm.py found in paper text by Syntology unverified MIT (permissive) · 3e078645516d88c3 · report

Results from the paper

The Papers with Code archive ends with its 2025-07-28 snapshot. This paper's arXiv identifier, 2606.21173, was issued in June 2026, after that date, so the archive has no leaderboard rows for it.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections