Learning Reasoning World Models for Parallel Code

Gautam Singh, Arjun Guha, Bhavya Kailkhura, and Harshitha Menon, 2026

Large language models can generate serial code effectively, but parallel code remains challenging because training data is scarce and external analysis tools are expensive or impractical to call repeatedly. We introduce Parallel-Code World Models (PCWMs), reasoning models trained to predict the results of parallel-code analysis tools directly from source code.

To train these models, we sample diverse parallel-programming problems and candidate implementations, execute them with tools that expose data races and performance profiles, and synthesize hindsight reasoning traces that connect source code to the observed tool outcomes. Fine-tuning on this data improves race-outcome prediction and performance-profiling accuracy, and PCWM feedback helps open-weight models fix data races more effectively than self-feedback.

PDF available on arXiv

@misc{singh:parallel-world-models,
title = {Learning Reasoning World Models for Parallel Code},
author = {Gautam Singh and Arjun Guha and Bhavya Kailkhura and Harshitha Menon},
year = {2026},

}