Open Access Journal of Applied Science and Technology
Structural Isomorphism Between LLM Embedding Spaces and Quantum Mechanical Systems
Timo Aukusti Laine
Abstract
Large language models (LLMs) represent semantic information as high-dimensional embedding vectors, typically compared using cosine similarity. This paper establishes a structural isomorphism between LLM embedding spaces and quantum mechanical systems. We demonstrate that the transformed cosine similarity can be precisely mapped to a quantum mechanical measurement probability, governed by a rank-1 Hamiltonian and the Schrödinger equation, where the time parameter is identified as a gauge variable. A commutative diagram unifies four equivalent expressions for this similarity, spanning classical bilinear forms and quantum Born rule probabilities. Crucially, the quantum formulation reveals a local U(1) gauge symmetry, absent from classical descriptions, with an associated conserved semantic charge modeling contextual influence. A quantum circuit on logarithmically many qubits yields this similarity as a single measurement probability, a result confirmed by simulation. The isomorphism is structural, not physical: it highlights that the mathematical structures governing LLM embeddings are precisely those of quantum mechanics, and this correspondence is exact.