Quantum LLMs Using Quantum Computing to Analyze and Process Semantic Information
Timo Aukusti Laine · 2025
Read Quantum LLMs Using Quantum Computing to Analyze and Process Semantic Information by Timo Aukusti Laine (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2512-02619.txt.
Introduction
Timo Aukusti Laine maps the meaning spaces of large language models onto quantum circuits. Language models store word and sentence meaning as points in a high dimensional space, called embeddings. Quantum mechanics also works with complex valued states and their overlaps.
Laine links the two views directly, treating semantic closeness as a quantum style measurement. The study shows that estimating how similar two meanings are is feasible on quantum hardware. Such mappings could one day let quantum machines help sort and compare meaning, though the field remains young and exploratory. The map from words to states is still rough, but it gives both fields a shared tongue to test.
Catalog record
| CREATOR | Timo Aukusti Laine |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 62 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2512-02619
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Quantum LLMs Using Quantum Computing to Analyze and Process Semantic Information Timo Aukusti Laine Abstract We present a quantum computing approach to analyzing Large Language Model (LLM) embeddings, leveraging complex-valued representations and modeling semantic relationships using quantum mechanical principles. By establishing a direct mapping between LLM semantic spaces and quantum circuits, we demonstrate the feasibility of estimating semantic similarity using quantum hardware. One of the key results is the experimental calculation of cosine similarity between Google Sentence Transformer embeddings using a real quantum computer, providing a tangible demonstration of a quantum approach to semantic analysis. This work reveals a connection between LLMs and quantum mechanics, suggesting that these principles can offer new perspectives on semantic representation and processing, and paving the way for future development of quantum algorithms for natural language processing. I Introduction Large Language Models (LLMs) have achieved remarkable success in natural language processing, yet their underlying mechanisms remain only partially understood. This paper explores a fundamental question: Can quantum mechanics, as a theoretical framework, provide valid and useful insights into the structure and behavior of LLMs? We hypothesize that quantum mechanics, with its inherent ability to represent complex relationships and probabilistic behavior, can offer a valuable lens for understanding and potentially manipulating LLM semantic spaces. This is particularly relevant given the increasing computational demands of LLMs, which motivates the exploration of alternative computational paradigms. Furthermore, we envision that quantum algorithms may offer significant advantages, such as the potential for exponential speedups in calculating semantic similarity within high-dimensional embedding spaces if more efficient quantum algorithms can be developed, or the ability to uncover subtle semantic relationships that are difficult to detect using classical methods. However, we acknowledge that current quantum hardware and algorithms face significant limitations, particularly in terms of qubit scaling and coherence. Current LLMs primarily rely on real-valued embeddings, which may limit their capacity to capture subtle semantic nuances such as antonymy, sentiment, or relational information. To address this, we introduce an approach that incorporates complex-valued embeddings, leveraging principles from quantum mechanics to represent semantic information with both magnitude and phase. This framework establishes a direct mapping between LLM semantic spaces and quantum circuits, enabling the potential application of quantum algorithms to language-based tasks. This work aims to address the following research questions: 1. Can quantum mechanics, as a theoretical framework, provide valid and useful insights into the structure and behavior of LLMs, leading to a deeper understanding of their emergent properties? 2. How accurately can quantum circuits compute semantic similarity between LLM embeddings compared to classical methods, providing concrete evidence for the applicability of quantum principles to semantic analysis? 3. What are the key challenges and opportunities in utilizing current real quantum computers for natural language processing tasks involving LLM embeddings, considering the limitations of qubit availability and coherence? One of the key contribution of this paper is the demonstration, using a real-world LLM (Google’s Sentence Transformer), of a direct, experimentally verifiable connection between LLM embedding spaces and quantum circuits. We leverage this connection to explore real embedding spaces and calculate semantic similarity on a real quantum computer. We illustrate the principles of our approach by simulating the double-slit experiment within a quantum circuit, providing a tangible demonstration of quantum mechanics applied to semantic modeling. This provides evidence supporting the validity of a quantum-inspired approach to LLMs. The paper is structured as follows: We begin by reviewing relevant background on LLMs, complex embeddings, and quantum mechanics. We then describe our approach for mapping LLM embeddings to quantum circuits and calculating semantic similarity. Next, we present the results of our experiments on a real quantum computer, comparing them with classical calculations. Finally, we discuss the implications of our findings, limitations, and future research directions, focusing on the broader potential of quantum mechanics as a framework for understanding and enhancing LLMs. II Background and Related Work Large Language Models (LLMs) have revolutionized Natural Language Processing (NLP), achieving state-of-the-art results in various tasks such as text generation, translation, and question answering. At the heart of these models lies a sophisticated mechanism for representing text: high-dimensional vector embeddings. These embeddings map words, phrases, and even entire documents into a continuous semantic space, where geometric relationships reflect semantic similarities. The Transformer architecture ref_vaswani , with its self-attention mechanisms, has been key to capturing long-range dependencies in text and enabling LLMs to scale to unprecedented sizes, as seen in models like BERT ref_devlin and GPT-3 ref_brown . While these embedding spaces are often treated as continuous for practical purposes, a fundamental aspect of LLMs hints at an underlying discreteness: their reliance on a finite vocabulary of tokens. This discrete foundation suggests that the seemingly continuous semantic space might possess a quantized structure, analogous to the discrete energy levels observed in quantum systems. This inherent quantization prompts a compelling question: can we leverage the theoretical frameworks of mathematical physics and tools of quantum mechanics to gain a deeper understanding of the organization and dynamics of these semantic spaces, and potentially uncover previously hidden relationships? Several approaches have been proposed for analyzing LLM embedding spaces. Dimensionality reduction techniques, such as Principal Component Analysis (PCA) ref_jolliffe and t-distributed Stochastic Neighbor Embedding (t-SNE) ref_maaten , are often used to visualize the embedding space in lower dimensions. Geometric analysis techniques, such as calculating cosine similarity between vectors ref_salton , are used to quantify the semantic similarity between words and phrases. These approaches have provided valuable insights into the organization of semantic information in LLMs, but they often fail to capture more nuanced relationships such as antonymy, analogy, or hierarchical structures. The geometry of these embedding spaces has been explored by researchers like Mimno and Thompson ref_mimno , while Tenney et al. ref_tenney have investigated how context influences these embeddings. The field of quantum computing offers a different paradigm for computation, leveraging the principles of quantum mechanics to solve problems intractable for classical computers ref_nielsen . Quantum circuits, composed of qubits and quantum gates, are used to implement quantum algorithms ref_divincenzo . Key quantum algorithms, such as Shor’s algorithm for factoring ref_shor and Grover’s algorithm for searching ref_grover , demonstrate the potential for speedups in certain computational tasks. The development of quantum hardware is rapidly advancing, with increasing qubit counts and improved coherence times ref_arute . However, the noisy intermediate-scale quantum (NISQ) era presents significant challenges for realizing the full potential of quantum algorithms ref_bharti . Quantum-inspired models have also found applications in cognitive science, offering a framework for representing concepts and relationships in a more flexible manner than traditional models. These models have been used to address phenomena such as contextuality and ambiguity in human cognition ( ref_bruza ; ref_busemeyer ; ref_atmanspacher ; ref_khrennikov ) . Approach utilizes quantum formalism to represent uncertainty and superposition in cognitive processes. Furthermore, the use of complex embeddings in machine learning, particularly in knowledge graph embedding models like ComplEx ( ref_trouillon ) , RotatE ( ref_sun ) , and QuatE ( ref_zhang ) , provides a richer representation of data by encoding both magnitude and phase information. More recently, the field of quantum machine learning (QML) has emerged, exploring the potential of quantum algorithms to enhance machine learning tasks. Variational Quantum Algorithms (VQAs) ref_bharti are a prominent approach, using parameterized