Manifold Pretraining Engineering

Right Geometry, Right Time, Right Place

Overview

Interpretability research has found that language models represent concepts on geometric shapes, such as a helix for numbers. We turn these shapes into a training technique:

manifold prior

an extra training loss that pulls a model's internal representations of a concept towards a target shape (a manifold), each item towards its own point on it.

Key results

Arithmetic is our main testbed, because its structure is known and every answer can be checked; result 02 extends the prior to six concepts, from physical dimensions to cities and countries.

  1. 0118%→70%average accuracy on unseen arithmetic problems during training, without → with the priorLearns within the budget, with scarce data
    • pretraining from scratch with only 2% arithmetic in the text, each model at its own best learning rate
    • without the prior, no 53M model reaches 90% within 300M tokens (0 of 8 seeds)
    • at 505M: 0 of 8 seeds without the prior, 8 of 8 with it
    8/8 seeds
  2. 026/6concepts that improve when their six priors are trained togetherPriors that help each other
    • by the end, dimensions is 25.0 points higher than with its own prior alone (7 of 8 seeds, one tie)
    • with the priors on until the end, all six beat the best model without priors
    8/8 seeds
  3. 03≤ 11%→99%accuracy on problems with numbers never seen in arithmetic, without → with the priorWhat 4× the data does not teach
    • some three-digit numbers appear only in ordinary text, never in an arithmetic problem
    • with the prior, the model learns to add them: 99% correct (700–999)
    • without it, about 11% at most in every setting we tried, even with 4× the training data
    4/4 seeds
  4. 0453%→89%average accuracy on unseen arithmetic problems at 1.07B parameters, without → with the priorHolds up to 1.07B parameters
    • +36.1 points at 1.07B, the largest model we trained
    • the prior helps at every size we tried, from 53M up
    8/8 seeds
  5. 05≈ 5×soonerto reach 90% on unseen problemsFine-tuning a 7B model
    • an early checkpoint of OLMo-2-7B learning two-digit addition
    • reaches 90% about five times sooner
    • ends at 100%, against about 95% without the prior
    30-epoch runs
  6. 06+43.5pointsmore average accuracy on unseen arithmetic problems, 190M modelWorks even in plain web text
    • the prior is applied only to numbers in ordinary web text
    • never to the arithmetic problems themselves
    8/8 seeds

When it helps: the right geometry, at the right time, in the right place

Scope: whole-number tokenizers (as in OLMo-2), pretraining from scratch at 53M–1.07B parameters, and LoRA fine-tuning of OLMo-2 and Pythia checkpoints (160M–32B).

When pretraining data contain little arithmetic, the prior decides whether a model learns it within its training budget

With only 2% of the pretraining text being addition, and every model at its own best learning rate, the prior lifts the average accuracy on new problems over training from 18% to 70% (8 seeds). At one shared learning rate, a model without the prior ends at 17%, and one with the prior on numbers in web text ends at 96%. With 7% addition every model learns, and the prior makes it happen sooner, unless the helix is shuffled.

The race in pretraining. Held-out accuracy on unseen sums while a 53M model is pretrained from scratch on 300M tokens with 2% arithmetic, each model at its own best learning rate. The prior acts on the operands from 5% to 40% of training (shaded). Averaged over training, accuracy is 70% with the prior and 18% without; a shuffled helix of the same strength stays low. mean of 8 seeds
The helix forms while the prior is on. Layer-4 states of the numbers 0–999 as operands, at six points of pretraining from 0 to 300M tokens, without (left) and with (right) the prior. With the prior, their CKA to the helix reaches 0.96 by 60M tokens; without it, 0.62 at the end. 1 seed
Scarce data: 2% arithmetic
operands 0–999 · 8 seeds per curve
“From step 0”: a self-timed prior run from the first step. A shuffled helix in the same window gives no gain.curves: learning rate 10⁻³
More data: 7% arithmetic
prior on the operands in context, throughout · 8 seeds per curve
◆ on the 90% line: median tokens to 90%. The shuffled helix has the same dose and lowers the curve average by 23.6 points.learning rate 10⁻³

Setup: a 53M-parameter OLMo-2-style model pretrained on 300M tokens of FineWeb-Edu with addition problems (operands 0–999); accuracy on held-out problems. With each model at its own best learning rate and 7% arithmetic, the prior reaches 90% 3.7× sooner at 53M and 3.9× sooner at 190M over 8 seeds.

The prior helps at every model size we pretrained, from 53M to 1.07B parameters

With each model at its own best learning rate, the prior keeps its advantage at every size we tested. At 1.07B it raises the average accuracy over training from 53% to 89%, by 36.1 points (8 of 8 seeds). How the gain changes with size depends on what is held fixed: with the same amount of training data, the gain increases with model size (nine sizes); when larger models also get proportionally more data, there is no consistent trend.

Nine sizes, one recipe: 300M tokens, 7% arithmetic
each arm at its own learning rate · means over 8 seeds · the number is the gain
With the number of tokens fixed, the gain increases with model size, though not monotonically: on the eight sizes run on L40S GPUs, a pre-registered test finds +1.66 points per e-fold of non-embedding parameters (two-sided p = 0.096). The increase comes from the model without a prior getting weaker, while the prior stays at 89–90%; along the ladder, tokens per parameter fall from 21 to 0.5. The three sizes never seen before the test do not show the increase on their own, so they say only that the new sizes did not fall below the earlier trend.
Paper Figure 2: gain of the helix prior against model size with 300M tokens, 0.745 tokens per parameter or 0.318 tokens per parameter (7% arithmetic), and with 2% arithmetic in its own panel, every seed shown as a dot
Paper Figure 2. How the gain changes with model size depends on what is held fixed. Gain of the helix prior (mean of 8 paired seeds with 95% interval; dots: seeds). Top: at 300M tokens, the solid line joins the eight sizes run on L40S GPUs and a dashed segment leads to 1.07B on B200 GPUs (sizes in millions of parameters). Bottom: with 2% arithmetic and 300M tokens on one cluster, the prior adds 48.0 to 53.0 points at each of five sizes from 53M to 505M (8 of 8 seeds at each size). A pre-registered test finds the gain rising with log size, by 1.27 points per e-fold of parameters; this is a partial confirmation, because three of the five sizes were seen before the test, and the rise above 190M comes from the model without the prior getting weaker. pre-registered

The two results fit together because the gain varies mainly with the number of training tokens: within one size it first rises and then falls, peaking roughly between 70M and 130M tokens with 7% arithmetic, and with more tokens the model without a prior catches up.

Six priors trained together improve all six concepts, and the model reaches the final accuracy of a model without priors after only 8–30% of training

With the six priors together, all six concepts beat the model without priors at every one of the six learning rates we tried; against the best of these rates, the average accuracy over training rises by 5.8 to 46.9 points (table below). The model also learns faster: it reaches the final accuracy of the best model without priors after only 8–30% of training, in every seed, and gets 90% of the way there from chance 2.1 to 5.0 times sooner.

Six priors in one 53M pretraining run
curve-average held-out accuracy · means over 8 fresh seeds · the number is the gain
The torus and the grid gain mainly while their priors are on. Their mean curves peak near the close of the window at 98.2% and 83.3%, above the peak of the model without priors at any rate (94.6% and 58.5%). pre-registeredpeaks: post hoc
ConceptNo priorsSix priorsGain (points)At the endSpeed-upTogether vs. alone
Numbers23.6%70.5%+46.9+33.93.9×−0.5
Dimensions47.3%81.2%+33.9+30.74.4×+13.5
Cities86.3%92.6%+6.3+3.72.6×+1.7
Countries89.3%95.1%+5.8+3.72.1×+1.2
Torus63.0%85.0%+22.0−3.04.1×+4.4
Grid41.0%60.6%+19.7−1.65.0×+7.4

Average accuracy on new problems during training (53M model, 8 new seeds, pre-registered); without priors, each concept uses its best of six learning rates. Gain: how many points the six priors add; the bar shows the 95% interval over the seeds, and the gain is positive in all 8 seeds for every concept. At the end: the gain at the end of training. Speed-up: how many times sooner the six priors get 90% of the way from chance to the final accuracy without priors. Together vs. alone: the six priors minus that concept's prior alone (both at learning rate 2×10⁻³); the grey line is zero. Except for numbers, the targets encode the answers.

With the six priors at 10⁻³, the language-modelling loss carries 71% of the gradient norm during the window, and the final validation loss, 1.213 bits per byte, lies within 0.4% of the best model without priors.

Kept on until the end, the six priors lead on all six

Kept on until the end of training, the six priors give the highest end-of-training accuracy of all our runs on all six manifolds, above the model without priors even at its best rate in each seed (8 of 8 seeds each); the torus ends at 99.8%. Their final validation loss, 1.2112 bits per byte, is 0.1% above that of the model without priors at its best rate for this loss and below that of the window run.

Numbers98.3%+31.4
Dimensions96.5%+35.2
Cities96.9%+2.5
Countries98.4%+2.1
Torus99.8%+4.1
Grid91.4%+33.2

End-of-training held-out accuracy with the priors on from 5% of training to the end, and its lead in points over the model without priors at its best learning rate in each seed. Post hoc, 8 seeds.

Trained together, the priors help each other

At 2×10⁻³, joint training costs at most 0.5 points on any manifold relative to its prior alone and lifts dimensions by 13.5 points (8 of 8 seeds). Interference is thus not detected for any of the six. The lift grows after the priors switch off: at the end of training the six lead the prior alone by 25.0 points on dimensions (7 of 8 seeds, one tie) and 11.7 on the torus (8 of 8; post hoc). This lift needs the torus and grid priors, which are structurally similar to dimensions. Without them, joint training lifts dimensions by only 1.5 points over its prior alone (12.0 points less than with them, 7 of 8 seeds).

Why the prior alone falls behind. What the dimensions prior alone loses after the window is not the representation. In two re-drawn pairs of runs, the lattice coordinates of the items stay linearly decodable at layers 2–6 in both models (R² 0.96–0.99), and at the answer position layers 5–6 decode the correct answer at every saved checkpoint, also on the questions the model with the prior alone answers wrongly; the loss lies in the step from this state to the output token.

Not through later practice. About three-quarters of the lift survives removing the torus and grid problems as soon as the window closes: the six then still end 19.1 points above the dimensions prior alone (7 of 8 seeds), 77% of the lift, although the model stops answering torus and grid questions within about 400 steps. A rerun that replaces the removed problems in place by text of the same length, so that every other problem keeps its position, retains 82% (8 of 8 seeds; 95% interval 0.65–1.06); the change of position had no measurable effect (−1.3 points, 95% interval −7.7 to +5.4). Inside the joint model, dimension answers use a code shared with the torus: at the answer position, removing the torus answer subspace at layer 5 cuts dimensions accuracy by 44–46 points, against 1.5–5 with the dimensions prior alone, and removing the dimensions subspace cuts the torus by 44–45 points (against 7–10). These reads use two re-drawn pairs of the runs that keep the problems, so it is an inference that this code is why the lift survives.

Training a single prior also raises the CKA of structurally similar domains to their own targets, although their tokens do not overlap: the grid prior alone raises the CKA of dimensions by 0.16 and the dimensions prior that of the grid by 0.18, and the city and country priors raise each other's by 0.22 and 0.24 (8 of 8 seeds each; post hoc). CKA measures how close a domain's representations are to its target geometry (1 = identical).

With the prior, an early OLMo-2-7B checkpoint reaches 90% on two-digit addition about five times sooner

With the helix prior, an early OLMo-2-7B checkpoint reaches 90% on two-digit addition about 5× sooner (in 30-epoch runs), and its numbers settle into a clean helix.

The race. Held-out accuracy on 1,000 unseen two-digit sums while fine-tuning OLMo-2-7B (checkpoint after 9B pretraining tokens). The helix prior reaches 50% after 900 steps, no prior after 4,150; a shuffled helix stays near chance. mean of 3 seeds
From a rough coil to a clean helix. Layer-16 states of the numbers 10 → 99, without (left) and with (right) the prior. The model's own number geometry is about 0.70 helix-like (CKA), and the prior makes it regular. 1 seed
Numbers that share a last digit snap together. Same run: the mean state of each last digit (big dots) and the 90 numbers (small dots), PCA of layer 16, without (left) and with (right) the prior. 1 seed
Paper Figure 1: target helix, the model's own number manifold, the manifold with the helix prior, and learning curves, for pretraining from scratch (top) and fine-tuning OLMo-2-7B (bottom)
Paper Figure 1. A helix manifold prior shapes how a model represents numbers, and the model learns addition faster.

How it works: an extra loss pulls a concept's representations towards a target shape

Take the hidden states H of a concept's items (for example, the numbers 0–999), choose a target shape F, and add one minus their linear CKA, a similarity score between 0 and 1, to the training loss. CKA ignores rotation and overall scale, so the loss is low only when the representation itself has the target's shape, with each item at its own target point.

L = Ltask + Σk λk,t · Lgeo(k),    Lgeo = 1 − CKA(HL, FG)
Targeta helix for numbers (periods 2, 5, 10, 100, 1000), a circle for cycles, a line for orders, or a geometry read out of a trained model
Scheduleλt on throughout, in a window [w0, w1) of training (most runs: 5%–40%), or self-timed by training accuracy
Siteseparate prompts of the items, the items where they occur in the training data, or numbers in ordinary web text
Multiple priorsone per concept: one weight divided among them (λ / K) or a weight for each
ConceptTargetSettingEffect of the priorNote
Numbershelixpretraining 53M, 2% arithmetic18.4% → 69.9%8 seeds
fine-tuning OLMo-2-7B, 9B tokens90% ≈ 5× sooner30-epoch runs
Monthscirclefine-tuning 7B, 210B tokens+21.6 pointsstep task
Weekdayscircle on answer statesfine-tuning 7B, 210B tokens+32.6 pointstransfer across equivalent shifts
S4 groupmatrix representationpretraining 53M, six priors+26.3 pointstarget encodes the table; not shown in a later combination
Dimensions, cities, countries, ℤ₆² group, grid sumslattice, spheres, torus, gridpretraining 53M, six priors together+5.8 to +33.9 points8 fresh seeds; targets carry the answers
Exponent vectorscoordinatesone-layer toy, 6.7% of the table0/5 → 5/5 reach 95%target encodes the whole table; 0 of 5 in each of 28 settings without a prior

The settings in the table above differ, so its rows are not comparable. In the screen of all 36 domains, among targets that do not encode the answer the geometry helped only numbers (42B) and months (210B).

All 36 concept domains (fine-tuning screen)

42B / 210B: gain of the prior in held-out accuracy (points) when fine-tuning OLMo-2-7B at that checkpoint (3 seeds); shaded: robust gain or loss. Task step: “k steps after x”, where the target carries no answer; order: which of two items is larger or earlier; anchor: which of two items is closer to a third, where the target coordinates imply the answers. f/c: accuracy without the prior at floor / ceiling. Decodable: number of eight final models in which the target coordinates can be read out linearly.

A model's number representations form long before it can add, and the prior helps while it is still learning

Number representations form long before the ability to add, and the prior helps while the model is still learning the task; once the model has learned it, the prior stops helping.

Representations come before abilities

In OLMo-2-7B the helix of numbers reaches half its final strength between 9B and 21B pretraining tokens; few-shot addition only between 84B and 210B.

Geometry vs ability across 11 checkpoints
random init → 3.9T tokens, then “main” (shown apart: it adds mid-training)
number geometry (helix R² above null)3-shot addition (0 = chance, 1 = perfect)
The number manifold at each checkpoint
layer 16 · “The number x” · x = 10…99
last digit0 → 9

When the prior helps

In fine-tuning, the gain is largest while the model is learning the task. In pretraining, starting the prior at 5% of training is faster than starting at the first step or at 20%, and costs far less language-modelling quality than starting at the first step.

In fine-tuning: gain vs the model's own accuracy
OLMo-2-7B · addition, subtraction, number words, Roman numerals, weekdays, months, letters
one domain × checkpoint (3 seeds)mean gain per accuracy bin
x: held-out accuracy without the prior; y: gain with the domain's geometry (points). The gain is an inverted U: small while the model cannot do the task, largest while it learns, negative once it has learned.
In pretraining: when to switch it on
7% arithmetic · prior on numbers in web text until 40% of training · 4 seeds
◆: median tokens to 90%. Starting at the first step costs 0.064 bits per byte of validation loss, starting at 5% 0.008.learning rate 10⁻³
Paper Figure 4: held-out accuracy of OLMo-2 1B, 7B, 13B and 32B on two-digit addition at each pretraining checkpoint without and with the helix prior, the gap shaded blue where the prior helps and orange where it hurts; and the mean gain per bin of capability across seven domains of OLMo-2-7B
Paper Figure 4. The benefit window. (a)–(d) OLMo-2 1B–32B on two-digit addition at each pretraining checkpoint; the shaded gap is the gain of the helix prior. (e) OLMo-2-7B, seven domains.
The same window in Pythia 160M–12B
Paper appendix figure: the benefit window for Pythia 160M, 410M, 1.4B, 6.9B and 12B on two-digit addition, without and with the helix prior
Paper appendix figure. The benefit window for Pythia 160M–12B on two-digit addition, drawn as in Figure 5a–d (3 seeds).

A helix with its numbers shuffled does not help, and each part of the helix contributes

The same loss with the helix positions assigned to the wrong numbers does not help: it slows fine-tuning and lowers pretraining accuracy. Within the helix, every part contributes.

A shuffled helix does not help

Same dimensionality, loss scale and gradient, but the coordinates go to the wrong numbers.

Fine-tuning OLMo-2-7B (21B-token checkpoint)
7,000 training sums · LoRA · 10 epochs · 3 seeds per curve
◆ on the 90% line: first step at which the seed-mean curve reaches 90%.

Which parts of the helix matter

  • The whole helix, not its partsFourier spikes without separability give no gain; separability alone gives 25–40% of the helix's gain, about as much as a digit code.3 seeds
  • The more regular, the betterAdding noise to the helix lowers the gain monotonically; targets less regular than the model's own geometry (CKA ≈ 0.70) hurt.3 seeds
  • Matched to the computationThe helix helps addition and subtraction and hurts multiplication; with digit tokens, which already give place value, the prior adds little.

Apply the prior to the numbers themselves, wherever they appear, even in ordinary web text

For numbers up to 999, the prior works about as well on numbers shown on their own as on the numbers inside the addition problems, and it still works on numbers in ordinary web text, which needs no knowledge of the task data. A shuffled helix of the same strength, on numbers shown on their own, hurts.

Where the prior acts
7% arithmetic · window 5%–40% · λ = 5 · 4 seeds
Accuracy averaged over the training curve. With several operations, the prior belongs within the operations whose computation the geometry matches.learning rate 10⁻³

What the prior does not do

It speeds up learning that is already happening. Only once, in a one-layer toy model, did it make a task learnable that no setting without it learned, and there the target gave away the whole answer table.

  • It supplies values; it does not teach themWe hold three-digit numbers out of every arithmetic problem, so that they appear only in web text. On the held-out numbers from 700 to 999, every configuration we tested without a prior ends at or below 11%; while a helix prior keeps their coordinates in place, accuracy on them is 99%. Once the prior stops maintaining their coordinates, they are overwritten.
  • It does not fix a geometry the computation does not useNo target we tried, whether the logarithm, prime exponents or per-place codes, helps multiplication in the training format; in pretraining, the calendar priors do not help their own tasks.
  • It does not help when imposed only at inferenceSnapping representations onto the ideal manifold at inference never helps (at three OLMo-2 sizes); the prior acts on learning.

What it costs

In pretraining, against models without a prior at the same learning rate and seeds, no comparison on five zero-shot benchmarks shows a decline that is both significant and larger than one point.

CostSettingEffect
Of the prior itself
General abilitypretraining 505M and 190M, 4 seedsNo significant decline larger than 1 point on five zero-shot benchmarks in 15 comparisons; one small cost (LAMBADA at 505M, −0.63)
Language modellingpretraining, window from 5%0.6–0.9% higher bits per byte after 300M tokens, not detectable after 1.2B
At the wrong time
Prior from the first steppretraining 53M and 505MAbout eight times the language-modelling cost of the window (0.064 against 0.008 bits per byte)
With the wrong geometry
Wrong geometrypretraining 53MShuffled helix: −23.6 points of curve-average accuracy (same dose, lower in 8 of 8 seeds)

BibTeX

@article{hong2026manifold,
  title   = {Manifold Pretraining Engineering: Right Geometry, Right Time, Right Place},
  author  = {Hong, Yihuai and Ma, Hanxi and Zhao, Chen},
  journal = {arXiv preprint},
  year    = {2026}
}