Interpretability papers routinely report that a language model "stores syntax in its middle layers" or "reasons in a shared semantic space." These claims usually come from a single model family, and they disagree when the family changes. Encoder models such as BERT appear to place syntax in intermediate layers. Probes of the autoregressive GPT-2 put it noticeably higher. Nobody can yet say whether these differences are real differences in how the models compute, or artifacts of the probe and of quirks specific to each architecture. We propose to borrow the central tool of adversarial domain adaptation to answer this. That tool is a domain discriminator: a small classifier that tries to tell which data source a representation came from, while the representation is trained to fool it. Here we treat which architecture produced a hidden state as the domain. Hidden states from different models (an encoder, a decoder, a state-space model, a mixture-of-experts model) are mapped into a shared space by small learned projectors. A shared probe reads syntax from that space. A discriminator tries to recognize the source architecture, and its gradient is reversed so the projectors learn to hide it.
The point is measurement, not building a better aligned model. Sweeping the strength of the adversarial pressure traces a curve. On one axis is how well the probe still decodes syntax; on the other is how well the architecture can still be identified. The probe accuracy that remains once the discriminator is at chance estimates the part of the structure that is genuinely shared across architectures. The accuracy that disappears estimates the part that is architecture-specific. We also find which layer of model A matches which layer of model B under this criterion. That directly tests whether the encoder/decoder layer mismatch reflects different function or a probe artifact. The final test is whether the invariant probe transfers zero-shot to an architecture it never saw.
Core Claim
A cross-architecture interpretability claim should be stated as a quantity: decodable structure that survives the erasure of architecture identity, measured against an untrained-model control. We claim three things about this quantity. It can be estimated by architecture-adversarial training of a shared probe. It separates layer-placement disagreements caused by the probe from those caused by the model. Its value at matched layers predicts whether a probe trained on some architectures transfers to a held-out one.
The work sits between two literatures that have not met. Domain-Adversarial Training of Neural Networks introduced the gradient reversal layer. This layer passes features forward unchanged and multiplies the discriminator's gradient by $-\lambda$ on the way back, so the feature extractor learns to remove whatever distinguishes source from target data. We reuse that mechanism unchanged. What we change is the "domain": it becomes architecture rather than data source, and the feature extractor becomes several frozen models of different design, each with its own trainable projector. Adversarial Feature Adaptation for Cross-lingual Relation Classification aligned an English encoder with a Chinese encoder through a language discriminator. It tested CNN and BiLSTM encoders, but only ever ran the adversarial game between two copies of the same architecture. We pit different architectures against each other. Cross-Architecture Knowledge Distillation is the closest prior use of a discriminator across architectures. It trains a CNN student to fool a discriminator that compares its features with a frozen ViT teacher, with the goal of a better student on CIFAR-100 and ImageNet. Our design differs in three ways. It is symmetric, with no teacher. Every model stays frozen. The output is a diagnostic curve, not a deployable network.
What the Mechanistic Literature Motivates and Constrains
The motivating contradiction comes from two papers. BERT Rediscovers the Classical NLP Pipeline found parts of speech early, syntax in the middle and semantics late in BERT. Probing via Prompting probes GPT-2 through learned prompt prefixes instead of an attached classifier, and found syntax in higher layers. It also showed that ordinary multilayer-perceptron probes reach about 48% part-of-speech accuracy even on randomly initialized weights, against about 13% for its prompting probe. This means a probe can learn the task itself. We therefore report every number relative to a random-weight copy of each architecture.
A second constraint comes from When Does Syntax Mediate Neural Language Model Performance? Evidence from Dropout Probes. That paper shows that redundant representations make probes "lazy," so they latch onto non-causal directions. Dropout on the probe input fixes this. With it, the authors showed that nudging representations along probe directions changes BERT's SQuAD 2.0 answers but not its MNLI or HANS answers. This matters for us because an adversarial objective could remove the causal copy of syntax and leave a non-causal copy behind. We apply probe dropout throughout, and we use their nudging test as the arbiter of whether the invariant direction is the one each model actually uses.
The multilingual analyses suggest that shared spaces do exist, at least within a single family. Converging to a Lingua Franca shows that middle layers of BLOOM and LLaMA2 become language-agnostic as the models scale. How do Large Language Models Handle Multilingualism? finds a translate–reason–translate pipeline concentrated in roughly 0.13% of neurons in dense decoders. Both papers leave open whether such shared spaces extend across architectures. Mixture-of-experts models route each token to different sub-networks, and state-space models process context through a recurrent state instead of attention. Our discriminator addresses this question at the level of distributions, so it does not require the localized neurons that the neuron-deactivation method of the multilingualism paper depends on.
Research Program
The setup uses four frozen pretrained models of roughly comparable size: BERT-base, GPT-2, an open state-space language model, and an open mixture-of-experts model. Each tokenizes differently. To compare them on the same text, we pool every model's hidden states to the word level on the same Penn TreeBank sentences, so every word yields one vector per layer per model. For a chosen layer $\ell_a$ in each model $a$, a small two-layer projector $P_a$ maps that model's vectors into a shared 256-dimensional space. A single probe $f$ predicts syntactic targets from the shared space: part of speech, depth in the parse tree, and pairwise tree distance. A discriminator $D$ predicts the architecture $a$ through a gradient reversal layer. The training objective for the projectors and probe is
$$\min_{\{P_a\}, f} \max_D \; \sum_a \mathbb{E}_{x}\big[\mathcal{L}_{\text{syn}}(f(P_a(h_a^{\ell_a}(x))), y)\big] - \lambda \, \mathcal{L}_{\text{arch}}(D(P_a(h_a^{\ell_a}(x))), a).$$
Here $h_a^{\ell_a}(x)$ is model $a$'s word representation at layer $\ell_a$, $y$ is the syntactic label, $\mathcal{L}_{\text{syn}}$ is the probe loss, $\mathcal{L}_{\text{arch}}$ is the cross-entropy of the architecture discriminator, and $\lambda$ sets how hard identity is erased. Training this with a minimax objective is known to be unstable, and the DANN paper notes that choosing $\lambda$ is hard. We exploit this rather than fight it. We sweep $\lambda$ across a range and record, for each value, held-out probe accuracy against held-out discriminator accuracy. The discriminator is retrained from scratch after training ends so that it is not fooled merely by co-adaptation. Each run produces one point, and the sweep traces a frontier.
The summary statistic is the invariant selectivity at a layer tuple: probe accuracy at the point where a freshly retrained discriminator falls to chance, minus the same quantity computed on random-weight copies of all the models. A layer-matching search then repeats this for pairs of models over all layer pairs. If BERT's middle layers and GPT-2's upper layers maximize invariant selectivity together, the placement disagreement is real but the content is shared. If invariant selectivity peaks at the same relative depth in both models, the original disagreement came from the probes. If no layer pair keeps syntax above the random-weight control at chance discriminability, the two models encode syntax in incompatible ways.
Two follow-up analyses make the measurement consequential. The first is held-out architecture transfer. We train projectors and the probe on three architectures and then fit only a projector for the fourth, using the reconstruction-free adversarial objective with no syntax labels. We then measure the shared probe's accuracy on the fourth architecture. This is unsupervised domain adaptation in the strict sense, with the architecture as the target domain. The second is a causal check. Following the dropout-probe paper, we nudge each model's representation along the gradient of the invariant probe and check whether SQuAD 2.0 answers on syntactically hard questions change. If they change in the encoder but not the decoder, the shared direction is decodable everywhere but used only in some models. A secondary run repeats the whole pipeline on the parallel Bible sentences from the Lingua Franca study. There it asks whether the language-agnostic middle-layer space is shared across dense and mixture-of-experts models, with the language label held out from the discriminator.
Baselines
The naive reference point is a probe trained on one architecture and applied to another after only a linear map fitted on paired sentences, with no adversarial term ($\lambda = 0$). It shows how far plain alignment gets. Any invariant-selectivity claim must also beat the random-weight control. The relevant published numbers here are the roughly 48% (multilayer-perceptron probe) versus 13% (prompting probe) part-of-speech accuracy on random GPT-2 weights reported in Probing via Prompting. We reproduce that control for every architecture instead of borrowing it.
The strongest competitor is paired orthogonal or Wasserstein Procrustes alignment. Because we feed identical sentences to every model, we have free word-level correspondences. Unsupervised Alignment of Embeddings with Wasserstein Procrustes reports 82.8% precision-at-1 English-to-Spanish on MUSE without any adversarial training, and found it more stable than adversarial alignment. We run Procrustes, and a regularized canonical correlation variant for unequal dimensions, on the same projected 256-dimensional inputs and the same sentences. We then attach the same probe and the same freshly retrained discriminator, so each competitor yields a point on the same frontier. Beating it means the adversarial method reaches strictly higher probe accuracy at chance discriminability, or Procrustes never reaches chance discriminability at all. No reported result found on Lacuna for any alignment method on cross-architecture syntactic probing, so these numbers will be produced here.
A third baseline is paired mean-squared-error regression of each model's projected states onto a fixed reference model. This is the distillation-style alternative that Cross-Architecture Knowledge Distillation reports as weak across architectures. The fixed reference also exposes how asymmetric the one-way setup is.
The key ablation removes the discriminator but keeps everything else: same projectors, same probe, same dropout, same tuning budget. This isolates erasure of architecture identity as the active ingredient. A second ablation drops probe dropout to test whether lazy probes inflate invariant selectivity.
All methods get the same number of hyperparameter trials, chosen on a validation split of PTB sections. No target-architecture labels are used for selection in the transfer experiment.
Why not just…?
Why not just use Procrustes on paired sentences, since the inputs are already aligned? This is the real threat, and we do not argue around it. Paired linear alignment may well match the adversarial method wherever representations are close to linear transforms of one another, which is plausible for BERT versus GPT-2. Our contribution then becomes the frontier measurement and the random-weight-controlled invariant selectivity, with Procrustes as the aligner. The adversarial method earns its place only where Procrustes keeps low paired error yet leaves architecture-identifying structure that a retrained discriminator detects. That pattern is expected for state-space and mixture-of-experts models, given the non-isometric mismatches between architectures that the cross-architecture distillation paper had to bridge with nonlinear projectors. The adversarial method is also needed in the held-out-architecture transfer, where its projector is fit without supervised alignment to a reference model. The frontier comparison in the Baselines section settles which case holds, and we will report it either way.
Why not just use probing via prompting, which already avoids the probe learning the task? It reads knowledge through the model's own language-modeling head and verbalizer tokens. That makes it inapplicable to BERT without a generative head and awkward for intermediate layers. It also gives no common space in which to compare architectures. We use its random-weight finding as our control and, for GPT-2, compare our layer placements with the ones it reports.
Why not just locate shared neurons by deactivation, as in the multilingual workflow analysis? That method assumes the function sits in a small, fixed set of neurons, which is the 0.13% result from How do Large Language Models Handle Multilingualism?. That assumption is precisely what is in doubt for routed and recurrent models. Our measure works on distributions of hidden states and needs no localization. Where localization does hold, in dense decoders, we check that ablating the identified neurons removes the invariant probe's accuracy.
Decisive Checks
The proposal fails if, on PTB, invariant selectivity at chance discriminability is indistinguishable from the random-weight control for every layer pair. Erasing architecture identity would then erase syntax, and cross-architecture syntax claims would rest on fingerprints. It is redundant if Procrustes plus a retrained discriminator reaches the same frontier as adversarial training for all four architectures. It succeeds if two things hold together. First, the layer-matching search reproduces a stable encoder/decoder layer offset, with confidence intervals over five seeds. Second, the shared probe transferred to the held-out state-space or mixture-of-experts model beats the paired-regression baseline, with the causal nudging test showing whether the transferred direction is used or merely readable.
References
- Domain-Adversarial Training of Neural Networks
- Adversarial Feature Adaptation for Cross-lingual Relation Classification
- Cross-Architecture Knowledge Distillation
- BERT Rediscovers the Classical NLP Pipeline
- Probing via Prompting
- When Does Syntax Mediate Neural Language Model Performance? Evidence from Dropout Probes
- Converging to a Lingua Franca: Evolution of Linguistic Regions and Semantics Alignment in Multilingual Large Language Models
- How do Large Language Models Handle Multilingualism?
- Unsupervised Alignment of Embeddings with Wasserstein Procrustes