Nonconformal Distortion and Local Orientation Reversal in the Fourier Circuit of a Modular-Addition Transformer

Eduardo Fuentes, Gonzalo Riera, Héctor Allende-CidarXiv 2026

This paper bridges the gap between mechanistic interpretability—the "reverse-engineering" of neural networks—and quasiconformal geometry. While researchers have previously identified the high-level algorithms neural networks use to solve tasks like modular addition, we know very little about the local differential properties of these implementations.

The authors analyze a one-layer transformer to see how closely its internal "Fourier circuit" matches the ideal mathematical operations it is supposed to perform. They find that the model implements a "distorted" version of the math, characterized by nonconformal stretching and even regions where the internal mapping flips orientation.

TL;DR

By applying tools from complex analysis (the Beltrami coefficient), the authors show that a transformer's modular-addition circuit is a geometrically "squashed" version of ideal complex multiplication. Interestingly, this geometric distortion decreases early in training, well before the functional circuit actually forms, suggesting that geometric regularity may be a precursor to algorithmic learning.

What Problem Does This Paper Address?

In mechanistic interpretability, a classic success story is the discovery that transformers solve modular addition ($a + b \pmod P$) by learning a "Fourier algorithm." This algorithm uses trigonometric identities to map discrete tokens into a circular space where addition corresponds to rotating phases.

However, an "algorithm" is an abstraction. A neural network is a continuous, differentiable function. The gap the authors address is: How does the actual differentiable map of a trained circuit differ from the ideal mathematical reference? Even if a circuit "does" complex multiplication, is it doing it "cleanly" (preserving angles and orientation), or is it a messy, distorted approximation?

Methods

The authors use the Beltrami coefficient ($\mu$), a tool from the study of quasiconformal mappings.

  • Conformality: An ideal map (like complex multiplication) is "conformal," meaning it preserves angles. In this case, $|\mu| = 0$.
  • Distortion: If $|\mu| > 0$, the map distorts the space, turning infinitesimal circles into ellipses.
  • Orientation Reversal: If $|\mu| > 1$, the map actually flips the local orientation of the plane (the Jacobian determinant becomes negative).

The researchers "intervene" on a trained one-layer transformer by restricting the MLP's contribution to specific Fourier input planes. They then apply continuous perturbations to these inputs—even though the model was trained on discrete tokens—to calculate the derivatives needed for the Beltrami analysis. They compare the trained model's geometry against three baselines: the model at initialization, random input planes, and a theoretical "Gaussian bilinear" reference.

Datasets

The study uses a one-layer transformer trained on modular addition with $P=113$.

  • Training/Test Data: All $113^2 = 12,769$ possible pairs of numeric tokens.
  • Analysis Data: The authors evaluate the model across 500 checkpoints during training and perform high-resolution "pointwise" scans of the Fourier input planes (up to $128 \times 128$ grids) to visualize the geometry.

Key Insights and Ideas

  • The "Squashed" Circuit: The trained maps are significantly nonconformal. Instead of perfect circles, the model deforms inputs into ellipses with a median singular-value ratio between 1.87 and 2.60.
  • Local Orientation Reversal: Surprisingly, the model doesn't just distort the space; it occasionally "folds" it. In certain regions of the input torus, the local orientation is reversed. As seen in Figure 2, these regions are often concentrated along specific diagonals.
  • Geometric Precedence: One of the most striking findings is the timing. The reduction in geometric distortion (the drop in $|\mu|$) happens very early in training (around epoch 1,400), whereas the "functional" circuit—the part that actually explains the model's output—doesn't fully form until much later (around epoch 10,000).
  • ReLU as a Source of Discontinuity: The "sharp" boundaries in the distortion fields (see Figure 2C and 2D) align with changes in the ReLU activation patterns of the MLP, showing how the network's architecture directly imposes geometric structure on the learned algorithm.
Figure 2: Pointwise directional Beltrami field of the trained transformer (epoch 40,000; Regime A; 128 × 128 torus grid). (A, B) |µ| for k = 14 and k = 42 on the orientation-preserving locus; dark gray indicates |µ| ≥1 (1.27% and 21.45%, respectively). (C, D) arg µ on the same locus using a cyclic colormap. Sharp boundaries reflect the piecewise-analytic structure induced by ReLU activation regions.

Key Results

  • Distortion Reduction: The median $|\mu|$ across frequencies decreased from 0.939 at initialization to 0.390 after training.
  • Orientation Preservation: At initialization, the map preserved orientation only about 55% of the time (close to random). After training, this rose to ~91%.
  • Key Frequencies vs. Random: The five "key" Fourier frequencies identified by previous research showed significantly lower distortion (median $|\mu| \approx 0.30$–$0.44$) than random control planes (median $|\mu| \approx 0.70$).
Table showing median distortion and orientation preservation for key frequencies.

Limitations and Future Work

The authors acknowledge several limitations:

  1. Model Scale: The study is limited to a small, one-layer transformer. It remains to be seen if these geometric patterns hold in deeper, more complex models.
  2. Causality: While distortion decreases before the circuit forms, the authors found that local distortion magnitude does not predict the "correct-logit margin" for individual inputs. This suggests that while low distortion is a global property of the circuit, it might not be the primary driver of individual correct classifications.
  3. Conditioning: Differences in coordinate-frame conditioning between key frequencies and random planes might account for some of the observed separation.

Future work could involve using these geometric measurements as "regularizers" during training or using targeted interventions to see if "straightening" the geometry of a circuit actually improves its performance or robustness.

Summary updated

Abstract

We study the local differential geometry of a Fourier-based modular-addition circuit in a one-layer transformer whose algorithm has previously been reverse-engineered. For each of the five key Fourier frequencies, we restrict the model's multilayer perceptron (MLP) contribution to a corresponding Fourier input plane and readout, and measure its directional Beltrami coefficient under continuous input perturbations. Whereas nondegenerate restrictions of ideal complex multiplication are conformal, the trained maps exhibit nonconformal distortion (median $|μ|=0.304$--$0.446$), spatial organization in the Beltrami argument, and regions of local orientation reversal. The median across frequencies decreases from $0.939$ at initialization to $0.390$ after training. The key-frequency planes also show lower median distortion than most random-plane controls, although their distributions overlap and the coordinate frames differ in conditioning. Across 500 checkpoints in one training run, most of the aggregate reduction in Beltrami magnitude occurs before the principal increase in the measured Fourier-circuit formation. At the individual-input level, Beltrami magnitude shows negligible association with the correct-logit margin ($|ρ|\leq0.026$). Late-checkpoint measurements across six runs show comparable distortion for most selected frequencies. These results provide a quantitative characterization of local deformation in a frequency-projected component of an identified neural circuit, complementary to its algorithmic reconstruction.
BibTeX
@misc{fuentes2026nonconformal,
  author = {Eduardo Fuentes and Gonzalo Riera and Héctor Allende-Cid},
  title = {{Nonconformal Distortion and Local Orientation Reversal in the Fourier Circuit of a Modular-Addition Transformer}},
  year = {2026},
  eprint = {2611.00414},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.00414},
}
Figure