CWM: An Open-Weights LLM for Research on Code Generation with World Models
Open accessAbstract
We release Code World Model (CWM), a 32-billion-parameter open-weights LLM, to advance research on code generation with world models. To improve code understanding beyond what can be learned from training on static code alone, we mid-train CWM on a large amount of observation-action trajectories from Python interpreter and agentic Docker environments, and perform extensive multi-task reasoning RL in verifiable coding, math, and multi-turn software engineering environments. With CWM, we provide a strong testbed for researchers to explore the opportunities world modeling affords for improving code generation with reasoning and planning in computational environments. We present first steps of how world models can benefit agentic coding, enable step-by-step simulation of Python code execution, and show early results of how reasoning can benefit from the latter. CWM is a dense, decoder-only LLM trained with a context size of up to 131k tokens. Independent of its world modeling capabilities, CWM offers strong performance on general coding and math tasks: it reaches pass@1 scores of 65.8% on SWE-bench Verified (with test-time scaling), 68.6% on LiveCodeBench, 96.6% on Math-500, and 76.0% on AIME 2024. To support further research on code world modeling, we release model checkpoints after mid-training, SFT, and RL.
Integrity signals
Registry
Cites
Statistics
Claims the paper makes
Claims other papers make about this one
Each is checked against this paper’s own text: does it say what the citing paper says it does?
Code World Model (CWM) learns predictive world models directly from program traces, enabling the agent to anticipate future environment states through executable dynamics.
“Building on this perspective, Code World Model (CWM) [37] learns predictive world models directly from program traces, enabling the agent to anticipate future environment states through executable dynamics.”
From Code as Agent Harness (2026) · cites this paper as [37]
In code-centric settings, deep telemetry traces are especially valuable because program execution already exposes state transitions through logs, tests, diffs, and runtime behavior.
“In code-centric settings, these traces are especially valuable because program execution already exposes state transitions through logs, tests, diffs, and runtime behavior [128, 96, 37].”
From Code as Agent Harness (2026) · cites this paper as [37]
Cites
Still being checked.
Cited by
Sorted by citations
SWE-EVO: Benchmarking Coding Agents in Long-Horizon Software Evolution Scenarios
Le, T., Thai, M. V. T., Manh, D. N., Nhat, H. P., & Bui, N. D. Q. (2025) · arXiv · doi:10.48550/arxiv.2512.18470
“1 (DeepSeek AI, 2025), MiniMax M1/M2 (Chen et al., 2025), Kimi K2 (Kimi Team, 2025), and Code World Model (CWM) (Carbonneaux et al., 2025).”
Live-SWE-agent: Can Software Engineering Agents Self-Evolve on the Fly?
Xia, C. S., Wang, Z., Yang, Y., Wei, Y., & Zhang, L. (2025) · arXiv · doi:10.48550/arxiv.2511.13646 · Cited by 2 · see citing works
“5 [13], and Code World Model (CWM) [9].”
Self-citationSWE-Master: Unleashing the Potential of Software Engineering Agents via Post-Training
Song, H., Huang, L., Sun, S., Jiang, J., Le, R., Cheng, D., Chen, G., Hu, Y., Chen, Z., Jia, Y., et al. (2026) · arXiv · doi:10.48550/arxiv.2602.03411
“To evaluate SWE-Master, we compare its performance against leading open-source code agents [4, 30, 23, 18, 42, 24, 8, 43, 35, 44, 45, 7, 11, 40, 46, 47, 48, 49], and frontier open-source foundations [50, 51, 52, 53, 27, 54].”
Ning, X., Tieu, K., Fu, D., Wei, T., Li, Z., Bei, Y., Zou, J., Ai, M., Liu, Z., Li, T.-W., et al. (2026) · arXiv · doi:10.48550/arxiv.2605.18747
Self-citationSERA: Soft-Verified Efficient Repository Agents
Shen, E., Tormoen, D., Shah, S., Farhadi, A., & Dettmers, T. (2026) · arXiv · doi:10.48550/arxiv.2601.20789
- Authors
- FAIR CodeGen team, Copet, J., Carbonneaux, Q., Cohen, G., Gehring, J., Kahn, J., Kossen, J., Kreuk, F., McMilin, E., Meyer, M., Wei, Y., Zhang, D., Zheng, K., Armengol-Estapé, J., Bashiri, P., Beck, M., Chambon, P., Charnalia, A., Cummins, C., Decugis, J., Fisches, Z. V., Fleuret, F., Gloeckle, F., Gu, A., Hassid, M., Haziza, D., Idrissi, B. Y., Keller, C., Kindi, R., Leather, H., Maimon, G., Markosyan, A., Massa, F., Mazaré, P.-E., Mella, V., Murray, N., Muzumdar, K., O'Hearn, P., Pagliardini, M., Pedchenko, D., Remez, T., Seeker, V., Selvi, M., Sultan, O., Wang, S., Wehrstedt, L., Yoran, O., Zhang, L., Cohen, T., Adi, Y., & Synnaeve, G.
- ORCID
- Venue
- arXiv
- Publisher
- arXiv
- Published
- 2025
- ISSN
- 2331-8422 (ISSN-L)
- arXiv
- 2510.02387
- OpenAlex
- W4417107321
- Cited by
- 0
- References
- 0
- Type
- posted content
- Language
- en
- Open access
- green
- arxiv.org
- Locations
- arXiv (Cornell University) (submittedVersion)
- arXiv (Cornell University)
- Topics
- Physical Sciences › Computer Science › Information Systems › Software Engineering Research
- Physical Sciences › Computer Science › Artificial Intelligence › Topic Modeling
- Physical Sciences › Computer Science › Computer Science Applications › Teaching and Learning Programming
- Keywords
- world models, code generation, agentic coding, Python interpreter, SWE-bench Verified, mathematical reasoning, multi-agent reinforcement learning
About these checks
Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.
Statistics and arithmetic are recomputed, not judged.
Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.
What counts as a claim ›How we measure confidence ›How we check this ›
Are you an author, or do you see a problem with this page? Request a review