Quantum Maximum Likelihood Prediction via Hilbert Space Embeddings

Sreejith Sreekumar, Nir Weinberger · DOI

TL;DR

This paper provides a novel theoretical framework for understanding In-Context Learning (ICL) in Large Language Models (LLMs) by treating it as a quantum statistical inference problem. By mapping probability distributions to quantum density operators via "covariance embeddings," the authors show that ICL can be modeled as a Quantum Maximum Likelihood Prediction (QMLP) task, offering a unified explanation for both classical and quantum language models.

What Problem Does This Paper Address?

Modern LLMs exhibit a remarkable ability to perform "In-Context Learning"—learning to solve a task just by seeing a few examples in a prompt—without any parameter updates. Classically, statistical theory suggests that prediction performance should degrade as the number of parameters increases (the "curse of dimensionality"). However, LLMs have billions of parameters and massive vocabularies, yet they excel at ICL.

The authors aim to bridge this gap by providing an information-geometric perspective. They seek to explain how embedding discrete tokens into a continuous Hilbert space (a standard practice in transformers) changes the geometry of the prediction problem and why this leads to efficient learning rates that avoid the pitfalls of classical high-dimensional statistics.

Methods

The paper introduces a conceptual model based on Hilbert Space Embeddings:

  1. Covariance Embedding: Instead of the standard "mean embedding," the authors use a second-order covariance embedding (inspired by Bach [2023]). This maps a probability distribution over tokens to a quantum density operator (a positive semi-definite matrix with unit trace).
  2. Quantum Maximum Likelihood Predictor (QMLP): The model interprets ICL as finding a density operator within a specified class that minimizes the quantum relative entropy (the quantum version of KL divergence) relative to the empirical distribution of the prompt.
  3. Quantum Pythagorean Theorem: The authors derive a refined version of this theorem to provide a geometric interpretation of the QMLP, showing how the "projection" of a data state onto a model class behaves.
  4. Information Geometry: They prove that under certain symmetries (like unitary invariance), the complex quantum optimization problem simplifies to a classical maximum likelihood problem over the eigenvalues of the operators.

Datasets

This is a theoretical paper focused on mathematical proofs and statistical frameworks. No empirical datasets or benchmarks were used for training or evaluation.

Key Insights and Ideas

  • Alleviating the Curse of Vocabulary: In classical models, the "alphabet size" (vocabulary) can be astronomical. By embedding tokens into a Hilbert space of dimension $d$ (where $d \ll$ vocabulary size), the complexity of the prediction task becomes dependent on $d$ rather than the total number of possible tokens.
  • Similarity as Geometry: The Hilbert space provides a natural geometry where token similarity is quantified by inner products. The authors show that a "good" embedding is one where neighboring symbols are aligned such that the minimal eigenvalue of the resulting density operator is boosted, which directly improves the convergence rate of the predictor.
  • Unified Framework: The math works for both classical LLMs (where we use embeddings to help classical computers) and "Quantum LLMs" (where the states are actual quantum systems), providing a single language to describe both.
  • The "Aha" Moment on Convergence: The paper shows that for sufficiently expressive model classes, the error rate drops at a speed of $O(1/n)$ (where $n$ is prompt length), which is significantly faster than the $O(1/\sqrt{n})$ rate typically found in more constrained or less expressive settings.

Key Results

  • Proposition 1: Establishes that if the model class is "unitarily invariant" and "closed under pinching," the quantum prediction objective is mathematically equivalent to a classical KL divergence objective on the eigenvalues.
  • Theorem 2 (Performance Guarantees): The authors provide non-asymptotic upper bounds for the QMLP error:
  • Trace Norm Error: Converges at a rate of $\tilde{O}(d/\sqrt{n})$ in general, but improves to $\tilde{O}(d^3/n)$ for expressive models.
  • Relative Entropy Error: Converges at a rate of $\tilde{O}(d/\sqrt{n})$ generally, and $\tilde{O}(d^2/n)$ for expressive models.
  • Concentration Inequalities: They derive high-probability bounds showing that the predictor's performance is stable and doesn't deviate wildly from the expected rates.

Limitations and Future Work

  • I.I.D. Assumption: To keep the math tractable, the authors assume the prompt consists of independent and identically distributed (i.i.d.) samples. Real-world language is highly dependent and sequential, which the current model simplifies.
  • Computational Tractability: While the paper provides the existence of these predictors and their rates, it does not provide a specific, efficient algorithm for solving the QMLP optimization in all cases, noting that this remains a direction for future research.
  • Injectivity of Embeddings: The authors acknowledge that for the model to be fully effective, the embedding must be "injective" (unique for different distributions). They suggest further study into which specific kernels/embeddings satisfy this for practical language subsets.
  • Gap to Architecture: The model is a "bird's-eye view" of ICL. Connecting these information-geometric bounds directly to specific transformer components (like multi-head attention weights) is a suggested next step.

Summary updated

BibTeX
@misc{sreekumar2026quantum,
  author = {Sreejith Sreekumar and Nir Weinberger},
  title = {{Quantum Maximum Likelihood Prediction via Hilbert Space Embeddings}},
  year = {2026},
  eprint = {2602.18364},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2602.18364},
}

Loading related content...

Figure