A Theory of Diversity for Random Matrices with Applications to In-Context Learning of Schrödinger Equations
Frank Cole, Yulong Lu, Shaurya Sehgal
TL;DR
This work introduces a notion of diversity for random matrix distributions via the triviality of a matrix centralizer, linking this property to the transferability of transformer-based in-context learning for discretized Schrödinger operators. It proves two main results: (i) an augmented-sample centralizer-triviality bound for matrices of the form $\mathbf{A}=\mathbf{K}+\mathbf{V}$, and (ii) a vanilla-sample bound under diagonal randomness, both yielding exponential-in-$N$ probability guarantees. The results are specialized to finite difference and finite element discretizations of random Schrödinger operators, enabling rigorous generalization guarantees for transformers solving linear PDEs and providing empirical validation through 1D and 2D experiments that show robust in-domain and out-of-domain generalization. The work highlights a blessing of dimensionality phenomenon in the finite difference setting and outlines open directions for extending the theory to broader operators and improving dependence on dimension, with potential impact on data-efficient scientific ML models. All mathematical statements are presented with explicit $\,p$- and $d$-dependent bounds, and numerical evidence supports the theoretical claims about diversity and generalization across discretizations and potential distributions.
Abstract
We address the following question: given a collection $\{\mathbf{A}^{(1)}, \dots, \mathbf{A}^{(N)}\}$ of independent $d \times d$ random matrices drawn from a common distribution $\mathbb{P}$, what is the probability that the centralizer of $\{\mathbf{A}^{(1)}, \dots, \mathbf{A}^{(N)}\}$ is trivial? We provide lower bounds on this probability in terms of the sample size $N$ and the dimension $d$ for several families of random matrices which arise from the discretization of linear Schrödinger operators with random potentials. When combined with recent work on machine learning theory, our results provide guarantees on the generalization ability of transformer-based neural networks for in-context learning of Schrödinger equations.
