cs.LGSep 26, 2026

The Geometry of Logic: Stratification Induces Semantic Structure and Robust Reasoning

Authors: Cristina V. Lopes, Yuangang Li, Justin Tian Jin Chen, Alberto Krone-Martins, Iris Ma, Md Rakib Hossain Misu

Organizations: University of California, Irvine · University of California, Davis

Abstract

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 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.

Figures & tables

Appendix figures & tables6 assets

Supplementary material from the paper’s appendix.

Appendix

Explore similar work

CardsList
  1. Transformers Provably Learn to Internalize Chain-of-Thought

    May 27, 2026Yixiao Huang, Hanlin Zhu, Zixuan Wang +4TransformerCoT Reasoning

  2. Feature Resemblance: Towards a Theoretical Understanding of Analogical Reasoning in Transformers

    Mar 5, 2026Ruichen Xu, Wenjing Yan, Ying-Jun Angela ZhangAnalogical ReasoningAnalogical Reasoning for Language Models

  3. Quantifying Logical Consistency in Transformers via Query-Key Alignment

    Sep 10, 2026Eduard Tulchinskii, Anastasia Voznyuk, Laida Kushnareva +4Transformer InterpretabilityLLM Evaluation