TRANSFORMER BASELINE
A shared representation
Routing and numerical values occupy the same representation.

STRATStratified Registers And Types
A Transformer architecture that separates data from control, inducing semantic structure and improving generalization on logical tasks with limited training data.
1 University of California, Irvine2 University of California, Davis
THE CENTRAL IDEA
STRAT partitions the residual stream into orthogonal Data and Type subspaces.
TRANSFORMER BASELINE
Routing and numerical values occupy the same representation.
STRAT
Dataout=Datain+g ⊙ v′
Updated Type controls the gate. The gated transform is added back to Data.
Simplified STRAT block from Paper §5.2. Attention updates Type only; the gate scales the Data transform elementwise (⊙). Both updates are residual. Follow the computation
01 / Overview
Can separating values from the types that control them make logical mechanisms easier to learn?
STRAT makes this separation an architectural primitive. It partitions the residual stream into orthogonal Data and Type subspaces. Type-based attention and gating govern Data transformations, keeping numerical values separate from routing decisions.
We study small Transformer-based models on arithmetic and logical tasks. The resulting architecture learns interpretable computational structure and generalizes from limited training data.
Transformer-based language models perform well on symbolic tasks, yet it remains unclear whether they learn generalizable rules or rely on statistical shortcuts. Mechanistic studies link algorithmic behavior to structured internal representations, motivating the hypothesis that robust reasoning benefits from separating values from the types that control their manipulation. Can making this separation an architectural primitive improve the learnability and generalization of logical mechanisms? We introduce STRAT (STratified Registers And Types), which partitions the residual stream into orthogonal Data and Type subspaces and uses Type-based attention and gating to govern Data transformations. Controlled arithmetic ablations identify three failure modes associated with data-control interference: the Linear Trap, Gradient Wall, and Open Gate Trap. Mechanistic analysis reveals interpretable logical structure, and in arithmetic, STRAT reduces median out-of-distribution (OOD) error 35-fold relative to a Transformer baseline. On each of 11 datasets spanning 10 tasks, STRAT outperforms the Transformer baseline in mean accuracy, by 26 percentage points on average, with both models trained from 10 base examples per dataset using identical task-specific augmentation where applicable. Under distribution shift, STRAT's mean accuracy drops by only 2.39 percentage points, compared with 11.75 for the Transformer.
02 / Architecture
Values and types occupy orthogonal subspaces. Numerical inputs enter the Data stratum; type embeddings carry control information.
Attention reads and updates the Type stratum. Data values remain unchanged during this phase.
A Type-conditioned gate controls a learned Data transformation. The result is added back through a residual connection.
Inside the representation
When Type embeddings are learned, the model discovers structure tied to functional roles.
In arithmetic, addition and subtraction embeddings become approximately antipodal. In selective summation, two distractor categories cluster together, apart from the target category.
PCA of learned Type embeddings · Paper §5.4

03 / Results
Eleven datasets. Ten paired runs per dataset.
The same base examples and task-specific augmentations for both models.

Under rule-preserving distribution shifts, STRAT's macro-average accuracy drops by 2.39 percentage points, compared with 11.75 for the Transformer baseline.
Evaluation uses task-specific Type encodings. Training augmentations, shift constructions, model configurations, and per-task results are detailed in the paper and appendix.
@unpublished{lopes2026strat,
title = {The Geometry of Logic: Stratification Induces
Semantic Structure and Robust Reasoning},
author = {Lopes, Cristina V. and Li, Yuangang and
Chen, Justin Tian Jin and Krone-Martins, Alberto and
Ma, Iris and Misu, Md Rakib Hossain},
year = {2026},
note = {Preprint}
}