A microprobe analysis of a mineral grain produces a handful of spot measurements. Each spot is a vector of element concentrations taken at a known position in the core, mantle, rim, or an inclusion. The geological question is often about the grain as a whole. One example is whether a magnetite crystal was first grown from magma and later partly dissolved and regrown by hot fluids. The answer depends on a small number of spots, typically a magmatic-looking core together with a fluid-altered rim. That is a co-occurrence problem over a set of measurements. It has the same logical shape as the synthetic "do words A and B both appear" task used to prove that attention models train in two phases. In the first phase attention stays uniform and the model behaves like a classifier on the averaged input. In the second, attention abruptly concentrates on the few informative items.
This proposal uses that correspondence in both directions. It treats microprobe grain classification as a structured, real-data testbed for two-phase training theory, which so far has been proven only on toy tasks. It also uses the theory to give geochemists checkable predictions about when an attention model is worth training on spot data, when it is stuck, and when training it longer makes it fragile. The uniform-attention phase has a direct physical meaning here. A model stuck in it is doing what bulk whole-rock geochemistry does: averaging away the zoning.
Core Claim
We claim that, for grain-level labels defined by the joint presence of two spot types, a one-layer attention classifier over a grain's spot set will show a measurable plateau in which it matches a mean-pooled ("bulk-average") classifier. We further claim that the plateau lengthens as diagnostic spots become a smaller fraction of the grain. Escaping the plateau should coincide with a drop in the effective rank of the key–query matrices and with attention concentrating on the core–rim pair.
We make a second claim drawn from shallow-network margin theory. Spot compositions lie near a low-dimensional surface fixed by mineral stoichiometry, while the measured vector includes many noisy trace channels. Training past the point of separating the grains should therefore make the model increasingly sensitive to off-surface spots, such as mixed-phase analyses contaminated by sub-micron inclusions or voids. That sensitivity should grow with the number of noisy channels included.
Both claims are falsifiable on data that geochemists already produce. Neither has been tested outside synthetic symbol sequences.
Where This Sits
The mechanism comes from two proofs. Training Dynamics of Transformers to Recognize Word Co-occurrence via Gradient Flow Analysis proves, for a one-layer softmax-attention model with a linear output layer, a fast first phase in which the output layer aligns with the signal under uniform attention, followed by a slower phase in which keys and queries learn to multiply the margin. Its data are a 60-sample synthetic corpus. From Condensation to Rank Collapse proves a similar condensation-then-rank-collapse sequence under small initialization with linearized attention, checked empirically on WikiText. Related analyses by Lu et al., Jiang et al., and Wang et al. describe the attention–feature feedback loop. Huang et al. separate feature alignment from later confidence maximization. The emergence of sparse attention studies how the data distribution governs when sparse attention appears. We reuse their architectures and diagnostics, but we replace symbol tokens with real compositional vectors. Those vectors bring correlated features, compositional closure (oxides sum to roughly 100%), and heavy-tailed instrument noise, none of which the proofs assume.
The second claim builds on margin theory for shallow networks. Benign Overfitting … from KKT Conditions shows that long training on logistic loss drives two-layer leaky-ReLU networks toward maximum-margin solutions that absorb noise in near-orthogonal directions. Effect of Ambient-Intrinsic Dimension Gap splits such solutions into on-surface and off-surface weight components. It proves that the perturbation needed to flip a prediction shrinks as the gap between measured and intrinsic dimension grows. Both papers are feed-forward only and say nothing about when, during training, the off-surface components are acquired. We test that timing question on attention models.
The application motivation comes from microprobe studies and one ML failure. Zhibo magnetite and Fang'an pyrite both classify mineral generations by hand-drawn bivariate plots. The Zhibo study separates magmatic MagI from hydrothermal MagII across seven subtypes. Both papers also document mixed-phase spots and low analytical totals caused by inclusions and voids. Masked Mineral Modeling found that Vision Transformers underperform convolutional U-Nets on sparse, clustered mineral occurrences. Our framing offers a specific hypothesis for that failure: training ended inside the uniform-attention plateau. That hypothesis can be checked directly.
We set aside the idea that training phases "recover" geological stages. Nothing in the theory links optimization time to geological time.
Research Program
Data. We will compile the published spot analyses from the Zhibo and Fang'an studies, keeping each grain's spots together with their textural position (core, mantle, rim, inclusion-adjacent) and the authors' subtype labels. These sets are small, so the main experiments use a semi-synthetic generator fitted to them. Each subtype's composition is modeled as a multivariate Gaussian in centered log-ratio coordinates. Log-ratios respect compositional closure, which raw weight percentages do not.
A synthetic grain is a set of $L$ spots. It is labeled re-equilibrated if and only if it contains at least one spot drawn from a magmatic core subtype and at least one from a hydrothermal rim subtype; the other spots come from neutral subtypes. The generator exposes four controls:
- the fraction of diagnostic spots $\rho$, from roughly one in two down to one in fifty;
- the number of appended trace channels carrying pure measurement noise, which sets the dimension gap;
- the rate of contaminated spots, made by mixing a host composition with an inclusion phase;
- whether the diagnostic difference lies along single elements or along a multivariate direction (for example, a V–Cr–Ni-versus-Ti–Al contrast that no single oxide resolves).
Real grains from both studies are held out as a final test.
Models and measurements. The main model is a one-layer softmax-attention classifier over spot embeddings, with optional rim/core position features. It is trained by full-batch gradient descent from small and standard initializations. Throughout training we log:
- loss;
- attention entropy per grain;
- effective rank of the key–query product;
- agreement between the attention model's predictions and those of a mean-pooled classifier;
- attention mass on the true diagnostic spots.
The plateau is operationally defined as the interval in which attention entropy stays within a small tolerance of $\log L$ and predictions agree with the mean-pooled model. We then fit plateau length against $\rho$ and against the hidden width $m$. The theory gives an $O(1/m)$ first phase and a poly($m$) second phase, but no closed-form dependence on $\rho$, so measuring that dependence is itself a result.
Robustness. For the margin claim, we checkpoint models at separation and at several multiples beyond it. At each checkpoint we measure the smallest contamination mixing fraction that flips a correct prediction, sweeping the number of noise channels. We also test one remedy: projecting each spot onto the leading log-ratio principal components fitted on clean analyses before it enters the model, which removes the off-surface directions.
Baselines
The naive reference is a mean-pooled two-layer network, trained identically, that sees only the grain's average composition. It is the computational analogue of bulk analysis and exactly what the theory says the attention model reduces to during the plateau. Beating it is the minimum evidence that attention learned anything. For re-equilibration labels that require two distinct spot types it should sit near chance, because the averages of re-equilibrated and single-generation grains can overlap.
The strongest practical competitor is gradient-boosted trees on per-grain summary statistics: per-oxide minimum, maximum, mean, and spread, plus the same statistics by textural position. It receives the same grains and the same hyperparameter-search budget as the attention model, with model selection on a shared validation split. Trees are what a careful geochemist would actually try. Per-element extremes can express an axis-aligned AND directly. Beating trees means a statistically significant advantage in balanced accuracy on held-out grains, averaged over seeds.
The second strong competitor is multiple-instance learning with max pooling. A shared per-spot network scores each spot, and the grain score is the maximum. It gets the same per-spot capacity as the attention model. It isolates sparse spots without any attention dynamics, but one maximum cannot express a conjunction of two different spot types.
The domain baseline is a hand-rule bivariate classifier reconstructed from the published subtype boundaries. We fit thresholds that reproduce the authors' MagI/MagII assignment and declare a grain re-equilibrated when both types appear. There is no reported result on Lacuna for any ML method on microprobe grain classification. The closest numbers in the file come from a different modality: an SVM reached 88.43% against a 1D-CNN's 98.37% for Raman mineral identification on RRUFF in Rock Classification through Knowledge-Enhanced Deep Learning. We cite these only to show that shallow max-margin methods are credible competitors on mineral data, not as a target.
The key ablation is a frozen-uniform-attention model: the same architecture with keys and queries held at zero, so it can never leave phase one. Comparing it with the full model attributes any gain specifically to the second phase. A second ablation compares small against standard initialization, since the condensation analysis predicts that the plateau depends on initialization scale.
Why not just…?
Why not just use gradient-boosted trees on per-element minima and maxima? This is the real threat. When the diagnostic spots differ along a single element, max-of-V together with max-of-Ti may solve the task as well as attention does, and we expect that outcome. The generator's axis-aligned versus multivariate switch is built to settle the question. Our prediction is that trees match attention in the axis-aligned setting and fall behind when the core–rim contrast is a direction in log-ratio space that no single element captures. If trees tie in both settings, we will report that attention is unnecessary for this geochemical task. The theory test, which measures plateau length against diagnostic fraction on realistic compositions, does not depend on attention winning.
Why not just use max-pooled multiple-instance learning? It finds rare spots cheaply. However, a single maximum over one per-spot score cannot represent "type A present and type B present," because the score must fire on either type, so it also fires when only one is present. Multi-head max pooling could approximate the conjunction. We include a two-head variant so that the comparison isolates conjunctive reasoning rather than head count.
Why not just interpolate within the grain by kriging? Kriging fills in compositions between spots but produces no grain-level judgment. Masked Mineral Modeling reports that it fit training regions well yet failed to generalize to unseen test regions. It answers a different question, so we do not use it as a baseline.
Why not study a lazy-training or linearized-attention model, where the analysis is easier? The co-occurrence proof shows that the margin gain comes precisely from keys and queries moving far from initialization, which lazy models cannot do. The frozen-attention ablation is the empirical version of that argument.
Proposed Experiments
The decisive check for the first claim is a plot of plateau length against diagnostic-spot fraction $\rho$. During the plateau, predictions must agree with the mean-pooled baseline, and the plateau must end at the moment key–query effective rank drops and attention mass on the true core–rim pair rises. If no plateau appears at any $\rho$, or if attention sharpens on non-diagnostic spots, the two-phase account does not transfer to compositional data.
The decisive check for the second claim is whether the contamination fraction needed to flip a prediction shrinks with training time past separation and with the number of noise channels, and whether log-ratio projection restores it. A flat curve would show that the dimension-gap result does not govern this regime.
The real-grain test asks whether models trained on the semi-synthetic data reproduce the published Zhibo and Fang'an generation assignments better than the hand-rule baseline. We report balanced accuracy and the attention mass falling on the spots the original authors used.
As a transfer probe, we rerun a ViT on the Masked Mineral Modeling benchmark while logging attention entropy. The file records that benchmark's reported Dice as 0.31 ± 0.01 and recall as 0.22 ± 0.02, without recording which architecture produced them. The test is whether the ViT's poor showing coincides with near-uniform attention at the end of training, and whether longer or small-initialization training moves it out of the plateau. Consistent with the stated rule, we do not claim a target number beyond the reported ones.
References
- Training Dynamics of Transformers to Recognize Word Co-occurrence via Gradient Flow Analysis
- From Condensation to Rank Collapse: A Two-Stage Analysis of Transformer Training Dynamics
- On the Dynamics of Training Attention Models
- Unveil Benign Overfitting for Transformer in Vision: Training Dynamics, Convergence, and Generalization
- Transformers Provably Learn Sparse Token Selection While Fully-Connected Nets Cannot
- How Transformers Learn Regular Language Recognition: A Theoretical Study on Training Dynamics and Implicit Bias
- The emergence of sparse attention: impact of data distribution and benefits of repetition
- Benign Overfitting in Linear Classifiers and Leaky ReLU Networks from KKT Conditions for Margin Maximization
- Effect of Ambient-Intrinsic Dimension Gap on Adversarial Vulnerability
- Textures and Chemical Compositions of Magnetite from Zhibo Submarine Volcanic Iron Oxide Deposit, Xinjiang, China: Implications for Re-Equilibration Processes
- Typomorphic Characteristics of Gold-Bearing Pyrite and Its Genetic Implications for the Fang’an Gold Deposit, the Bengbu Uplift, Eastern China
- Masked Mineral Modeling: Continent-Scale Mineral Prospecting via Geospatial Infilling
- Rock Classification through Knowledge-Enhanced Deep Learning: A Hybrid Mineral-Based Approach