Procedural Pretraining: Warming Up Language Models with Abstract Data

Liangze Jiang, Zachary Shinnick, Anton van den Hengel, Hemanth Saratchandran, Damien Teney

TL;DR

Before drowning large language models (LLMs) in web-scale text, "warming them up" on a tiny fraction (0.1–0.3%) of purely abstract, algorithmically generated data can massively accelerate their learning. This simple, lightweight pretraining step significantly boosts downstream performance in language, code, and mathematics, while slashing the required semantic training data by up to 45%.

What Problem Does This Paper Address?

When we train modern LLMs, we expect them to do two incredibly difficult things at once: absorb massive amounts of semantic world knowledge (facts, vocabulary, cultural context) and master abstract reasoning (logic, syntax, tracking long-range dependencies). This "knowledge-reasoning entanglement" often forces models to rely on superficial surface-level heuristics rather than robust, systematic reasoning.

Think of it like expecting a child to learn advanced physics before they've ever played with stacking blocks or learned basic arithmetic. The authors of this paper propose a solution: a lightweight "procedural pretraining" phase that builds foundational algorithmic scaffolding using non-semantic, rule-based data before exposing the model to real-world text.

Figure 1. (Left) We pretrain language models on procedural data before exposing them to standard datasets of language, code, or mathematics. The procedural data is generated with simple algorithms and aims to teach elementary skills to aid the acquisition of semantic knowledge. (Right) This lightweight initial step speeds up standard pretraining and improves performance on diverse domains, with different pretrained layers (MLP vs. attention) contributing differently to each domain.

Methods

The authors introduce a two-stage training pipeline:

  1. Procedural Pretraining: A standard GPT-2 style decoder-only transformer is trained from scratch on purely synthetic data generated by explicit algorithms. This data contains no natural language text.
  2. Standard Pretraining/Fine-tuning: The model's weights are transferred to learn standard semantic datasets (text, code, math) or specific diagnostic tasks.

Crucially, the authors experiment with different transfer mechanisms:

  • Full-model transfer: The standard approach of carrying over all weights.
  • Selective transfer: Reinitializing certain layers and only transferring either the Attention layers or the MLP (Feed-Forward) layers.

They also test two data configurations: an additive setting (adding a few procedural tokens on top of standard training) and a substitutive setting (replacing a large chunk of semantic data with a tiny amount of procedural data).

Datasets

The study leverages three distinct tiers of datasets:

  • Procedural Data (Generated): Algorithmic sequences including sequence transformations (e.g., SORT, REVERSE, SET deduplication), memory operations (STACK), formal languages (K-DYCK bracket matching), and cellular automata (ECA RULE 110).
  • Diagnostic Algorithmic Tasks: Used to probe specific capabilities, such as HAYSTACK (Needle-in-a-Haystack context retrieval), multi-digit ADDITION, MULTIPLICATION, and SORTING.
  • Semantic Corpora: Standard pretraining datasets including WIKITEXT and C4 (natural language), Github's JAVACORPUS (pure code), CODEPARROT (documented code), and DEEPMIND-MATH (informal mathematics).

Key Insights and Ideas

  • Specific Data Cultivates Specific Skills: Not all abstract data is created equal. Pretraining on K-DYCK (nested brackets) causes context retrieval accuracy in the HAYSTACK task to skyrocket from 10% to 98%, while cellular automata (ECA RULE 110) uniquely prepares models for reversed arithmetic.
  • Structure is Mandatory: Shuffling the procedural sequences (destroying the algorithmic rules while keeping token distributions identical) completely kills the downstream benefits, proving that the model is truly learning structural patterns, not just token frequencies.
Figure 2. Different types of procedural pretraining facilitate learning different algorithmic skills. If we remove the structure within the procedural data by shuffling the sequences (Best model shuffled), the performance falls to the baseline. We sort the types of data by increasing performance on each task (Best model shuffled always last, best performers mentioned in the titles). Reported values are the means over 10 seeds (full results with variance in Appendix N.1).
  • Pretrained Skills are Localized: One of the most fascinating "aha moments" is that different transformer components specialize in different domains. Attention layers are the primary drivers for structured, language-free domains like pure code. Conversely, MLP layers are highly effective for natural language.
  • Selective Transfer Can Outperform Full Transfer: For certain tasks, transferring only the attention layers and wiping the MLPs clean actually yielded significantly better results than transferring the whole model. This implies that full-model transfer can sometimes introduce conflicting inductive biases.
Figure 3. Selective transfer of MLP or attention layers can improve over full-model transfer, showing that procedural pretraining creates ‘modular’ structure localised in the selected model components. Reported values are means across 10 seeds (full results with variance in Appendix N.1).

Key Results

  • Massive Data Efficiency: By front-loading just 2.1 million procedural tokens (a trivial 0.1–0.3% of the total budget), models reached the same target loss on C4 using 45% less data, on CodeParrot using 33% less data, and on DeepMind-Math using 14% less data.
  • Downstream Persistence: The benefits aren't lost during the semantic training phase. A 124M CodeParrot model warmed up with procedural data achieved non-random accuracy on the MBPP (Mostly Basic Python Problems) benchmark, whereas the baseline model scored a flat 0%.
  • Scalability: The performance gains consistently held true as the authors scaled up the models to 1.3 billion parameters and 10.5 billion tokens.

Limitations and Future Work

While highly promising, the authors acknowledge a few limitations:

  1. Scale Gap: Though 1.3B parameters is substantial, it is still small compared to state-of-the-art frontier LLMs (which are hundreds of billions of parameters). Testing these priors on massive scales remains an open step.
  2. Data Mixture Optimization: The methods for combining different procedural data types (like mixing SET and UNION) were presented as a basic proof-of-concept. Future work will need to explore how to optimally balance or schedule a diverse portfolio of algorithmic warm-ups.

Summary updated

BibTeX
@inproceedings{jiang2026procedural,
  author = {Liangze Jiang and Zachary Shinnick and Anton van den Hengel and Hemanth Saratchandran and Damien Teney},
  title = {{Procedural Pretraining: Warming Up Language Models with Abstract Data}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=XFTTezxLdU},
}
Figure