WorksComputer Science
Decoding Transformer Dynamics via Koopman Subspaces
Abstract
We apply Koopman operator theory and Dynamic Mode Decomposition (DMD) to characterise how large language models (LLMs) process different input topics. Treating the layer-to-layer evolution of hidden states as a dynamical system, we fit a linear Koopman operator and take the subspace spanned by its dominant modes as a per-topic spectral fingerprint. Four findings emerge. First, the depth map is near-linear: a single linear operator predicts each next-layer state to within approx. 18% relative error (interior variance explained approx. 0.99). Second, over the 57 MMLU subjects the fingerprint is topic-discriminative, matching the MMLU taxonomy at 0.72 nearest-neighbour purity and each subject's semantic neighbourhood at 0.75 any-hit@3. Third, it is a reproducible signature (split-half self-retrieval approx. 0.97$). Finally, these findings are consistent across seven base models (Qwen2.5 0.5-7B, Llama-3 1-8B), with a suggestive trend of alignment rising with MMLU accuracy. The spectral fingerprint thus provides a probe of how transformers process different topics across depth. Code is available at https://github.com/DeepK/koopman-llm-eacl27.
Introduction
Large language models process all inputs through the same fixed sequence of transformer layers, regardless of input complexity or domain. While prior work has studied how much and how fast each layer changes a representation (via cosine similarity between consecutive hidden states (Men et al., 2025), angular distance (Gromov et al., 2025), or velocity and acceleration profiles (Fernando and Guitchounts, 2025)), these measures do not capture how the representation is transformed: which directions it moves along, and whether features are amplified, suppressed, or mixed together. They therefore cannot tell whether two inputs are transformed in the same way or only by the same amount.
We propose a different lens: the hidden states a prompt produces across layers form the trajectory of a dynamical system, and Koopman operator theory gives its spectral structure. The Koopman operator linearises nonlinear dynamics by acting on observable functions, and its eigenvalues describe the fundamental modes of the system. Applied to an LLM, the corresponding modes are feature directions in hidden-state space along which representations are transformed across depth.
Our central object is the spectral fingerprint: the subspace spanned by a topic’s dominant Koopman modes, an embedding-like signature of how the model processes that topic. We obtain it from linear DMD, which we show captures the one-step layer-to-layer dynamics well, suggesting that the bulk of the LLM’s layers are nearly linear. Comparing these mode subspaces across topics defines a dynamics space in which two topics are “close” if the model transforms them along similar directions, regardless of whether they are semantically related. This lets us ask questions that magnitude measures cannot: which topics a model processes alike, including some that are not semantically close (§ 5.3); whether a topic has a stable processing signature at all (§ 5.5); and where in depth a linear description holds and where it breaks down (§ 5.1).
Contributions.
We introduce the mode-subspace spectral fingerprint, a per-topic representation built from a Koopman operator fitted along depth, together with a Grassmann distance for comparing fingerprints across topics.
The transformer’s depth map is near-linear: a single linear operator captures each layer transition (interior ) and outperforms
a nonlinear kernel lift, with nonlinearity concentrated at the input and output boundaries, so its Koopman spectrum is a well-grounded description of the one-step dynamics.
On Qwen2.5-3B over 57 MMLU subjects the fingerprint carries topic identity: its neighbourhoods are category-aligned with the MMLU taxonomy (0.72 1-NN purity) and overlap semantic neighbourhoods at nearly chance, and where it departs from semantics it groups subjects by computation (quantitative subjects clustering around machine learning).
We show the fingerprint is a reproducible signature (split-half self-retrieval 0.97) that is consistent across seven base models spanning Qwen and Llama and 0.5-8B in scale, with a suggestive upward trend in alignment with the models’ MMLU accuracy.
Related Work
Transformers as Depth-Wise Dynamical Systems
Viewing deep networks as discretised ordinary differential equations (ODEs) has a rich foundation (E, 2017; Chen et al., [6]); for Transformers, this lens treats the residual stream’s layer-wise updates as a trajectory in representation space. Recently, Fernando and Guitchounts (2025) formalise the residual stream as a spatial dynamical system, reporting systematic velocity and acceleration profiles across depth. These measures describe how much and how fast representations change; we instead fit an explicit linear operator to each topic’s transitions and use its dominant modes to identify the directions of change. A complementary line finds consecutive layers near-linearly related and partly redundant: adjacent representations align almost perfectly under a linear map (Razzhigaev et al., 2024), and many layers can be removed with little loss (Gromov et al., 2025; Men et al., 2025), which has motivated architectures that allocate depth conditionally per token (Elhoushi et al., [9]; Raposo et al., 2024). These results motivate treating each layer-to-layer step as approximately linear, which our fingerprint exploits.
Dynamic Mode Decomposition and Koopman Theory in language models
DMD and Koopman theory are increasingly used to study foundation models, though along dimensions orthogonal to ours. One line models physical or fluid dynamics with attention-based architectures (Nagdi et al., 2026). Closer to text, Akrout [1] applies DMD to extract semantic modes from embeddings across sequence length, detecting structural drift and hallucination, and Kayal and Tsatsaronis (2019) apply higher-order DMD across word sequences to build spectral sentence embeddings. Most related, Kim et al. (2026) profile the Koopman spectrum of a transformer’s residual dynamics at initialisation to predict training instability, treating depth-wise evolution as a dynamical system whose spectrum is diagnostic.
The first two works apply spectral analysis along the sequence dimension (token-to-token or sentence-to-sentence). Like Kim et al. (2026), we apply DMD along the depth dimension (layer-to-layer) within a single forward pass; they fit a separate operator per layer as a training-stability diagnostic, whereas we fit one operator across all layers of a trained model, per input topic, so that topics can be compared in a common dynamics space.
Depth-Wise Spectral Analysis and Model Compression
Depth-wise DMD has emerged in computer vision for architectural efficiency: recent work applies it to Vision Transformers (ViTs) to test whether sequential non-linear blocks can be approximated by a low-rank linear operator for block pruning and compression (Aswani and Jabari, [2]). We use the same depth-wise decomposition for a different purpose. That work fits the operator to replace blocks of layers and so compress the model; we fit it per topic and compare the resulting fingerprints.
Mechanistic and Structural Interpretability
Our fingerprints relate to work mapping how internal representations evolve across layers. Structural probes such as the Logit Lens (nostalgebraist, 2020) and Tuned Lens (Belrose et al., [3]) decode hidden states by projecting them into vocabulary logit space, and representation engineering (Zou et al., 2025) isolates directional vectors for high-level concepts. Whereas these identify what a layer contains, typically per concept, our approach models how representations are transformed between layers and summarises this for a whole topic.
Methodology
Koopman Operator Theory
Consider a nonlinear dynamical system where . The Koopman operator (Koopman, 1931) is an infinite-dimensional linear operator that acts on observable functions :
is linear even when is nonlinear; linearity is achieved by lifting into the (infinite-dimensional) space of observables. Its spectral decomposition underpins modern operator-theoretic analysis of dynamical systems [5] (Mezić 2005). The Koopman eigenvalues and eigenfunctions satisfy:
We interpret the transformer’s layer-to-layer map as , with hidden states as the state at “time” (depth) . Each eigenfunction is paired with a Koopman mode , an eigenvector in hidden-state space that identifies a coherent feature direction the dynamics act on.
Relation to the layer Jacobian. A more familiar linearisation of a layer is its Jacobian , the first-order Taylor approximation of layer around a single hidden state . It is accurate near that state but changes from input to input, so it describes the layer at one point. The DMD operator (§ 3.2) is instead the least-squares best linear map over all of a topic’s layer transitions, across every prompt and depth. Its modes are therefore the directions along which the model transforms that topic on average, which makes them a topic-level descriptor where a pointwise Jacobian is not.
Dynamic Mode Decomposition (DMD)
DMD (Schmid, 2010) provides a finite-dimensional approximation to the Koopman operator from data (Rowley et al., 2009); our formulation follows exact DMD (Tu et al., 2014). Given snapshot pairs where :
Data construction. For a set of input prompts with hidden states at layers, we form:
where is the total number of transition samples.
Whitened DMD. To ensure scale invariance across hidden dimensions, we apply whitening before decomposition. Let . The whitening transform is:
We then compute and . We apply whitening for numerical conditioning; for linear DMD it is a similarity transform of the fitted operator (modes are mapped back to the original space), so it leaves the fingerprint unchanged (§ 5.2).
Rank-truncated SVD. Compute (rank- truncation). The reduced Koopman operator is:
Eigendecomposition. Solving yields DMD eigenvalues and modes , mapped back to original space via .
Spectral Fingerprinting
For a topic with prompts , we extract the full-depth trajectory and apply linear DMD (§ 5.2) to obtain eigenvalues and modes . We project every snapshot onto the modes, , so that row holds mode ’s coefficient on each of the snapshots across all prompts and layers. The energy of mode is , its total contribution to reconstructing the trajectories, rather than its amplitude in the initial state alone.
Fingerprint (mode subspace). The fingerprint is the subspace spanned by the top- modes ranked by energy:
represented by an orthonormal basis (from a QR factorisation). This is an embedding-like object (akin to a word vector, but a -dimensional subspace rather than a single direction) and it is invariant to each mode’s arbitrary scale, complex phase, and ordering.
Dynamics-space distance. Similarity between two fingerprints is the Grassmann (principal-angle) distance [4, 8] between their subspaces:
where are the singular values of the cross-basis matrix and the principal angles. Equivalently one may use the projection cosine .
Surface-space distance. As a semantic reference we embed each subject’s label text with a sentence-transformer (Reimers and Gurevych, 2019) and take cosine distance, .
Experiments
Setup
Models. We evaluate seven base models across two axes (results in § 5.6):
Scale: Qwen2.5-0.5B / 1.5B / 3B / 7B
Family: Qwen2.5, Llama-3.2 (1B, 3B), Llama-3.1-8B
Data. We use MMLU (Hendrycks et al., 2021) with its 57 subjects spanning STEM, humanities, social sciences, and other categories. We extract 100 prompts per subject from the test split: we cap at 100 because the smallest subject’s test set contains only 100 examples, so 100 is the largest sample size available uniformly across all 57 subjects.
Compute. All experiments run on a single CPU machine (32-core Intel Xeon, 64 GB RAM).
Research Questions
We organise the study around the following research questions.
RQ1. Can a Koopman/DMD operator capture the layer-to-layer dynamics of a transformer?
RQ1a. Is a linear operator sufficient?
RQ2. Does the mode-subspace fingerprint encode meaningful semantic structure?
RQ2a. How many modes does a stable fingerprint need?
RQ2b. Is the resulting fingerprint a reliable, reproducible signature?
RQ3. Is the fingerprint’s quality consistent across model families and scales? That is, is a reproducible, category- and semantically-aligned fingerprint present in every model tested, or only in a particular family or size?
Results and Analysis
How Well Does a Koopman Operator Capture the Dynamics? (RQ1)
We quantify how well the fitted operator captures the layer-to-layer dynamics with a mean per-step prediction error: each layer transition is predicted from the true previous state and the relative error is averaged over depth, so errors do not compound. This isolates the one-step dynamics, the property relevant to a meaningful eigenvalue spectrum. Because the operator is fitted jointly to every transition of every prompt, a low error means that one shared linear map fits the whole distribution of a topic’s layer transitions. This is a stronger statement than linearity near a single state (the Jacobian view of § 3.1). On Qwen2.5-3B (36 layers, , 100 prompts per subject), linear DMD (rank 100) applied to all 57 MMLU subjects attains a mean per-step error of 0.184 (range 0.121-0.207, median 0.184), a per-step variance explained () of 0.91 averaged over layers (range 0.87-0.94).
Interpreting the error. A per-step error of 0.184 means that, given the true hidden state at a layer, the operator predicts the next layer’s state to within relative error on average. Because consecutive residual-stream states are similar (), part of this accuracy reflects representational continuity; we quantify this with an identity baseline that predicts . On the five subjects used for the decomposer comparison (§ 5.2), where linear DMD’s error is 0.190 (vs. 0.184 over all 57), the identity baseline yields 0.245; linear DMD improves on it by (consistent across topics, 20-25%), which is transformation beyond continuity.
Depth structure. Table 1 breaks the error down by layer, averaged over subjects. The first transition () has variance explained near zero (slightly negative): mapping raw token embeddings into the residual stream is a large, strongly nonlinear “ingestion” step that a single linear operator fit to the whole trajectory cannot capture. The final transition () is also markedly less linear (), consistent with output-oriented reshaping in the last layer. Between these, layers 3–33 are captured at : the transformer’s depth map is near-linear in its bulk and concentrates its nonlinearity at the input and output boundaries, a structural property the fingerprint summarises. This interior near-linearity is independently corroborated by Razzhigaev et al. (2024), who find near-perfect linear alignment (Procrustes similarity ) between adjacent decoder-layer representations, strongest in the middle layers. Figure 1 shows the same profile for all seven models (§ 5.6).
| Depth transition | Variance explained |
| (embedding ingest) | |
| interior () | |
| (final layer) | |
| interior mean (steps 1–34) |
Table 1. Per-step variance explained by linear DMD on Qwen2.5-3B, averaged over all 57 subjects.
Figure 1. The layer-to-layer map is near-linear in the interior across all models. Per-step variance explained (top) and relative prediction error (bottom) of the linear Koopman operator, averaged over the 57 MMLU subjects, against relative depth (input transition at 0, output at 1) for the seven base models (Qwen2.5 in blue, Llama in orange). The interior is flat at (5–15% error) for every model, while both boundaries (embedding ingestion and final-layer projection) are strongly nonlinear.
Is a Linear Operator Sufficient? (RQ1a)
Since each transformer layer is nonlinear, one might expect a single linear operator to be inadequate and a nonlinear lift to help. We therefore compare linear DMD against kernel DMD (Williams et al. (2015a,b)), which lifts the data into a reproducing-kernel Hilbert space (RKHS) where the dynamics may become more linear. With a Gaussian RBF kernel and Gram and cross-kernel matrices and , the kernel-DMD eigenvalues solve , with regularising the (possibly ill-conditioned) Gram matrix. Using the same per-step prediction error, we sweep the kernel bandwidth (as a multiple of the median heuristic) and global state whitening, with per-state normalisation disabled throughout, on five randomly chosen MMLU subjects (Table 2).
| Configuration | no whiten | whiten |
| Linear DMD | 0.190 | |
| Kernel, | 0.64 | 0.98 |
| Kernel, | 0.81 | 0.93 |
| Kernel, | 2.92 | 1.13 |
| Kernel, | 5.66 | 5.60 |
| Kernel, | 11.83 | 4.66 |
Table 2. Mean per-step prediction error on five random subjects, lower is better. Linear whitening is omitted as it is a basis change that leaves the original-space operator, and hence the error, unchanged (0.190 either way). The five-subject linear value (0.190) is close to the all-57 mean (0.184, § 5.1).
Linear DMD outperforms kernel DMD (0.190 vs. a best kernel of 0.64): the RBF lift does not help. We therefore use linear DMD for fingerprinting; it is also the simplest choice.
Does the Fingerprint Encode Meaningful Semantic Structure? (RQ2)
We test this on Qwen2.5-3B with modes (§ 5.4). MMLU groups its 57 subjects into four top-level categories (STEM, humanities, social sciences, other) through the official categories.py mapping; Table 3 lists them with their subject counts. We use this grouping as a coarse semantic ground truth: if the fingerprint is meaningful, subjects in the same category should have more similar fingerprints than subjects in different ones.
| Category | Subcategories | # |
| STEM | physics, chemistry, biology, comp. sci., math, engineering | 18 |
| Humanities | history, philosophy, law | 13 |
| Social sciences | politics, culture, economics, geography, psychology | 12 |
| Other | health, business, miscellaneous | 14 |
Table 3. The 57 MMLU subjects grouped into four top-level categories (official categories.py mapping), with the number of subjects in each. Chance 1-NN category purity is ≈ 0.24.
Category alignment. We quantify category coherence with 1-NN purity. For each subject we compute the Grassmann distance between its top-50 mode subspace and that of every other subject, identify its single nearest neighbour, and check whether that neighbour belongs to the same category; the 1-NN purity is the fraction of subjects for which it does (chance ≈ 0.24, given the category sizes). The fingerprint reaches a 1-NN purity of 0.72: a subject’s nearest neighbour in dynamics space usually belongs to the same MMLU category. A two-dimensional t-SNE of the fingerprint distances (Figure 2) makes this visible: same-category subjects occupy distinct but overlapping regions.
Figure 2. Mode-subspace fingerprints of the 57 MMLU subjects. Two-dimensional t-SNE of the fingerprint (Grassmann) distances among the 57 subjects for Qwen2.5-3B, with every subject labelled and coloured by top-level category. Same-category subjects largely group together (history at the bottom, physics and chemistry upper-left, medicine and biology upper-centre, pure mathematics at the right), but the salient structure is cross-category: the quantitative/algorithmic subjects (machine learning, computer science, computer security, econometrics, statistics, and the economics subjects) form a single cluster, and electrical engineering joins the physics group.
Dynamics space vs. semantic space. Category labels are coarse, so we also compare the fingerprint against a continuous semantic reference: does similarity in dynamics space (fingerprints) match similarity in semantic space? We embed each subject’s label text (underscores replaced by spaces, e.g. “high school european history”) with a sentence-transformer (all-MiniLM-L6-v2; Reimers and Gurevych (2019)) and take cosine distance, a semantic representation independent of the LLMs under study. Taking each subject’s nearest semantic neighbours as a reference set, we ask how many of its nearest fingerprint neighbours fall in that set (Table 4): the top-1 agreement (whether the single nearest fingerprint neighbour is also the nearest semantic neighbour) and the any-hit@3 rate (the fraction of subjects for which at least one of the three nearest fingerprint neighbours is also among the three nearest semantic neighbours).
| Representation | top-1 | any-hit@3 |
| Mode subspace (fingerprint) | 0.33 | 0.75 |
| chance | 0.02 | 0.16 |
Table 4. Overlap between dynamics-space (the mode-subspace fingerprint) and semantic (label-embedding) neighbourhoods over 57 subjects. “top-1” is the fraction sharing the single nearest neighbour; “any-hit@3” is the fraction of subjects with ≥ 1 of their top-3 dynamics neighbours among their top-3 semantic neighbours. Chance rows give the expected overlap under random labelling.
The two spaces are aligned well above chance at both granularities: top-1 agreement is 0.33, about the 0.02 chance rate, and any-hit@3 is 0.75, nearly the 0.16 chance rate. Table 5 shows where the two spaces agree and where they differ. Partial agreement is the expected outcome: there is
| Subject | Semantic top-3 | Dynamic top-3 (mode subspace) |
| Agreement | ||
| college biology | HS biology, coll. medicine, coll. chemistry | HS biology, coll. medicine, medical genetics |
| college chemistry | HS chemistry, coll. physics, coll. biology | HS chemistry, coll. physics, HS physics |
| clinical knowledge | prof. medicine, coll. medicine, anatomy | coll. medicine, anatomy, nutrition |
| formal logic | logical fallacies, jurisprudence, concept. physics | jurisprudence, moral disputes, philosophy |
| Divergence | ||
| college CS | HS CS, coll. math, coll. physics | HS CS, computer security, machine learning |
| econometrics | HS macroecon., HS microecon., HS statistics | machine learning, HS statistics, HS microecon. |
| computer security | security studies, coll. CS, HS CS | coll. CS, machine learning, public relations |
| HS geography | HS world hist., HS math, HS US hist. | security studies, public relations, sociology |
Table 5. Top-3 nearest neighbours of each subject in semantic vs. mode-subspace dynamics space (, Qwen2.5-3B). Agreement cases are tight same-family clusters; among the divergences, quantitative/algorithmic subjects have machine learning among their nearest dynamics neighbours. “HS” = high school, “coll.” = college, “CS” = computer science.
no single ground truth for semantic similarity, and a label embedding is only one proxy for it. This is why we test against two independent references, the MMLU taxonomy and label embeddings. The alignment also holds over the full distance matrices: across all 57 subjects, fingerprint and semantic distances are positively correlated (Mantel test, Mantel, 1967; Spearman correlation 0.20, , 5000 permutations), so it is not confined to selected subjects.
Interpretation. The two spaces agree where a subject sits in a tight, hierarchical family (biology, chemistry, medicine, logic), which the model both represents and processes similarly. Among the divergences, one pattern stands out: semantically distinct quantitative/algorithmic subjects (college computer science, econometrics, computer security) all have machine learning among their nearest dynamics neighbours, and machine learning’s own nearest dynamics neighbours are exactly these subjects. One reading is that the model applies a shared quantitative-reasoning computation to them regardless of domain. High school geography similarly groups with social and political subjects (security studies, public relations, sociology) rather than the history subjects it is closest to semantically. The fingerprint thus tracks surface semantics closely but, where it departs, groups subjects by how the model computes over them rather than by lexical similarity.
How Many Modes Does the Fingerprint Need? (RQ2a)
The fingerprint is a -dimensional subspace; how large must be? Table 6 sweeps from 1 (a single mode) to 100 (the full operator rank) for Qwen2.5-3B, reporting category 1-NN purity and the semantic any-hit@3 (fraction of subjects with
| (modes) | cat. 1-NN | any-hit@3 |
| 1 | 0.44 | 0.19 |
| 2 | 0.42 | 0.21 |
| 3 | 0.49 | 0.35 |
| 5 | 0.51 | 0.32 |
| 10 | 0.65 | 0.61 |
| 20 | 0.61 | 0.65 |
| 30 | 0.72 | 0.74 |
| 50 | 0.72 | 0.75 |
| 70 | 0.68 | 0.74 |
| 100 | 0.72 | 0.74 |
Table 6. Effect of subspace dimension on Qwen2.5-3B. Category 1-NN purity (chance ) and semantic any-hit@3 (fraction of subjects with shared top-3 neighbour; chance ). Both rise sharply up to ; any-hit@3 peaks around and plateaus.
shared top-3 neighbour).
A single mode is insufficient: at the any-hit@3 rate (0.19) is near chance, and the leading conjugate pair () is no better. Discriminative structure emerges at : category 1-NN purity rises from 0.44 to and any-hit@3 from 0.19 to , with most of the gain by and a plateau from . The fingerprint therefore needs to be a subspace: topic information is spread over many mode directions, not concentrated in the dominant one. We adopt throughout.
Is the Resulting Fingerprint a Reliable, Reproducible Signature? (RQ2b)
A fingerprint is only useful if it reflects a stable property of a topic rather than the particular prompts used to compute it. We test this with a split-half reproducibility check on Qwen2.5-3B. For each subject we randomly partition its 100 prompts into two disjoint halves and fit an independent fingerprint from each. We then perform self-retrieval: for each half-A fingerprint we find its nearest neighbour among all 57 half-B fingerprints (by Grassmann distance) and ask whether it is the same subject. We report the split-half self-retrieval rate (the fraction of subjects recovered as their own nearest neighbour; chance ) and the mean self-retrieval rank (1 = perfect).
On Qwen2.5-3B (top-50 subspace), split-half self-retrieval is 0.97 with a mean self-rank of 1.0, against a chance level of 0.02: for almost every subject, the nearest half-B fingerprint to its half-A fingerprint is its own, and in the few misses the correct subject ranks close to the top. A fingerprint estimated from 50 prompts is therefore already specific to its topic, out of 57 candidates. § 5.6 shows the same for all seven models.
Is Fingerprint Quality Consistent Across Models? (RQ3)
We extend the analysis to seven base models spanning scale (Qwen2.5 0.5/1.5/3/7B) and family (Qwen2.5, Llama-3.1/3.2). Each model is fingerprinted identically (linear DMD, rank 100, top-50 subspace, 100 prompts/subject) and run through the same category, semantic-overlap, and split-half analyses (§ 5.3 and § 5.5). Table 7 reports the metrics with published 5-shot base MMLU.
| Model | MMLU | split-half | cat 1-NN | any-hit@3 | med. VE |
| Qwen2.5-0.5B | 47.5 | 0.95 | 0.67 | 0.67 | 0.990 |
| Qwen2.5-1.5B | 60.9 | 0.97 | 0.68 | 0.75 | 0.997 |
| Qwen2.5-3B | 65.6 | 0.97 | 0.72 | 0.75 | 0.992 |
| Qwen2.5-7B | 74.2 | 1.00 | 0.74 | 0.78 | 0.998 |
| Llama-3.2-1B | 32.2 | 0.93 | 0.63 | 0.68 | 0.993 |
| Llama-3.2-3B | 58.0 | 1.00 | 0.74 | 0.73 | 0.990 |
| Llama-3.1-8B | 66.7 | 1.00 | 0.74 | 0.75 | 0.987 |
Table 7. Per-model fingerprint metrics at , grouped by family and ordered by size within each family (MMLU shown as context). split-half: fingerprint self-retrieval top-1 (chance 0.02); cat 1-NN: category nearest-neighbour purity (chance 0.24); any-hit@3: fraction of subjects with of their top-3 dynamic neighbours among their top-3 semantic neighbours (chance 0.16); med. VE: median per-step variance explained.
Fingerprint quality is consistent across the seven models tested. Every model is highly reproducible (split-half 0.93–1.00 vs. 0.02 chance), category-coherent (1-NN purity 0.63–0.74 vs. 0.24), and semantically aligned (any-hit@3 0.67–0.78 vs. 0.16), with a near-linear interior throughout (median per-step variance explained 0.987–0.998). These ranges span both families and more than an order of magnitude in scale (0.5-8B). We do not test whether two models assign similar mode subspaces to the same topic; the consistency is in the quality of each model’s fingerprints. The evidence also covers only dense, decoder-only Qwen and Llama models, and the two families differ in detail, for example in the shape of the variance-explained profile near the output (Figure 1).
Fingerprint quality and capability. We also compare the fingerprint metrics with the models’ measured capability. Within each family both metrics rise monotonically with size (cat 1-NN 0.67→0.74 and any-hit@3 0.67→0.78 for Qwen 0.5–7B; 0.63 → 0.74 and 0.68 → 0.75 for Llama 1–8B), and across all seven models they track published 5-shot MMLU: the rank correlation with MMLU is Spearman for cat 1-NN and for any-hit@3. With only seven models this is suggestive rather than conclusive, and the correlations rest heavily on the lowest-MMLU model (Llama-3.2-1B); we therefore treat the link between fingerprint quality and capability as a hypothesis for larger model sets.
Conclusion
We fitted a linear Koopman operator to the layer-to-layer evolution of hidden states in seven transformer language models and used its dominant mode subspace as a per-topic spectral fingerprint. The depth map was found to be near-linear in its interior, with its nonlinearity concentrated at the input and output layers. The resulting fingerprint is topic-discriminative: aligned with both the MMLU taxonomy and semantic neighbourhoods, while grouping quantitative subjects across categories. The spectral fingerprint can, therefore, be seen as a probe of the structure beneath a model’s behaviour, and a starting point for future interventions. A natural extension is to fit separate operators to blocks of layers, which could separate the roles of different stages of the network, such as the nonlinear input and output stages and the near-linear interior we observe.
Limitations
Untested model classes. Our cross-model evidence covers seven dense, decoder-only base models from two families, up to 8B parameters. We leave models with substantially different attention or normalisation designs, mixture-of-experts models, instruction-tuned or RLHF-trained variants, and larger models as future work.
Design choices and causality. The operator rank (100) and the fingerprint dimension () are empirical choices; was selected from a sweep on one model and then applied to all, rather than tuned per model. Our evidence is correlational throughout: we show that fingerprint geometry aligns with taxonomic and semantic structure, but we do not intervene on the identified directions, so we cannot establish that the model causally relies on them. All experiments use English; whether the results transfer to other languages is an open question.
Static baselines. We do not compare the fingerprint against static topic representations that ignore the layer-to-layer pairing, such as the mean hidden state of a topic or the principal subspace of its hidden states. Such representations may also recover the taxonomic and semantic alignment we report. The dynamic analysis, however, required for the one-step near-linearity and interior-boundary findings (§ 5.1), which static representations cannot express.
References
- [1]Mohamed Akrout. 2023. Representations matter: Embedding modes of large language models using dynamic mode decomposition. Preprint, arXiv:2309.01245.
- [2]Nishant Suresh Aswani and Saif Eddin Jabari. 2026. Dynamic mode decomposition along depth in vision transformers. Preprint, arXiv:2605.07556.arxiv.org/abs/2605.07556
- [3]Nora Belrose, Igor Ostrovsky, Lev McKinney, Zach Furman, Logan Smith, Danny Halawi, Stella Biderman, and Jacob Steinhardt. 2025. Eliciting latent predictions from transformers with the tuned lens. Preprint, arXiv:2303.08112.arxiv.org/abs/2303.08112
- [4]Åke Björck and Gene H. Golub. 1973. Numerical methods for computing angles between linear subspaces. Mathematics of Computation, 27(123):579–594.DOI
- [5]Steven L. Brunton, Marko Budisić, Eurika Kaiser, and J. Nathan Kutz. 2022. Modern Koopman theory for dynamical systems. SIAM Review, 64(2):229–340.arxiv.org/abs/2102.12086
- [6]Ricky T. Q. Chen, Yulia Rubanova, Jesse Bettencourt, and David Duvenaud. 2018. Neural ordinary differential equations. In Advances in Neural Information Processing Systems, volume 31. Curran Associates, Inc.arxiv.org/abs/1806.07366
- [8]Alan Edelman, Tomás A. Arias, and Steven T. Smith. 1998. The geometry of algorithms with orthogonality constraints. SIAM Journal on Matrix Analysis and Applications, 20(2):303–353.arxiv.org/abs/physics/9806030
- [9]Mostafa Elhoushi, Akshat Shrivastava, Diana Liskovich, Basil Hosmer, Bram Wasti, Liangzhe Lai, Anas Mahmoud, Bilge Acun, Saurabh Agarwal, Ahmed Roman, Ahmed Aly, Beidi Chen, and Carole-Jean Wu. 2024. LayerSkip: Enabling early exit inference and self-speculative decoding. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 12622–12642, Bangkok, Thailand. Association for Computational Linguistics.

