arXiv:2610.34492quant-phOct 2026

Manuscript Offprint

arXiv:2610.34492

Wave Is All You Need: A Quantum Language Model Based on Fully Connected Quantum Boltzmann Machine

Jun Liu

Liu Jun ∗^{*}

School of Economics, Hunan University of Finance and Economics, Changsha 410205, China

To address the limitations of the classical self-attention mechanism, this work proposes a self-attention mechanism based on the fully connected quantum Boltzmann machine (FC-QBM), and further constructs a fully connected quantum Boltzmann machine language model (FC-QBM-LM) using the mechanism as the core engine. By performing unitary evolution on semantic quantum states, the mechanism implicitly implements positional encoding and self-attention computation, eliminating the need to decompose continuous semantic streams into discrete matrices for explicit matrix multiplication, with the measurement results naturally satisfying the normalization condition. Specifically, this work rigorously derives the computational principle of the self-attention mechanism based on FC-QBM. It demonstrates that this mechanism, in which FC-QBM encodes token positions and interactions and RYR_{Y} gates perform differentiated information extraction, is mathematically equivalent to the classical self-attention mechanism. The mathematical principles governing the training and generation of FC-QBM-LM are thoroughly derived, and the two corresponding algorithms are subsequently developed. An 8-qubit FC-QBM-LM is finally constructed and trained on the corpus of Three Hundred Tang Poems, followed by computational experiments using the model. Under the 8-qubit setting, the quantum layer implements the entire positional encoding and self-attention computation pipeline with only 44 parameters. In the noiseless scenario, the model exhibits favorable convergence. Furthermore, the quantum circuit proposed in this work, which terminates with RYR_{Y} gates, achieves better convergence than the counterpart terminating with RXR_{X} gates. Under the small-sample regime and across eight distinct noise intensity levels, the model demonstrates strong noise robustness, retaining over 99% of its noiseless convergence performance. Experiments on five-character quatrain generation reveal that the model preliminarily exhibits three core capabilities: associative and divergent thinking, content generation across imagery and human-aligned word ordering, validating the effectiveness of the proposed self-attention mechanism based on FC-QBM.

Keywords: Fully Connected Quantum Boltzmann Machine; Quantum Machine Learning; Quantum Self-Attention Mechanism; Quantum Language Model; Three Hundred Tang Poems; Noise Robustness; Energy-Based Generative Model; Natural Language Processing

I. INTRODUCTION

The evolution of language models is essentially a process of continuous advancement in semantic modeling capabilities. Early rule-based language models relied on manually constructed formal grammars and dictionaries[1]. Constrained by scalability bottlenecks, they struggled to characterize the complex properties of real-world language. In the 1990s, statistical language models exemplified by n-gram and hidden Markov models (HMMs) enabled probabilistic prediction of word sequences using large-scale corpora and greatly improved the performance of tasks such as machine translation[2]. Nevertheless, they were plagued by the curse of dimensionality. At the beginning of the 21st century, neural network language models pioneered vector representations. Bengio et al. (2003) first mapped words into a low-dimensional continuous vector space[3]. Recurrent neural networks (RNNs) and long short-term memory networks (LSTMs) captured long-range dependencies through gating mechanisms[4]. However, sequential computation hindered parallel processing, and long-term memory decay also limited model scaling. In 2017, the transformer architecture adopted the self-attention mechanism to implement parallel modeling of global sequence dependencies[5], thoroughly breaking the performance bottleneck of recurrent architectures and directly promoting the explosive development of large language models (LLMs).

However, the classical self-attention mechanism suffers from two fundamental limitations. First, within the conventional framework, the computation of semantic interactions between tokens can only be realized through large-scale matrix operations. Such matrix computation based on discrete token sets inherently undermines the continuity and integrity of semantic representations. A study indicates that the underlying semantics of natural language

essentially lie on a continuous manifold, and discretization leads to the loss of manifold smoothness[6]. Second, the implementation approach of the classical self-attention mechanism, which relies on massive matrix operations, further introduces substantial computational overhead. The mechanism requires repeated execution of numerous matrix multiplications, and its time and space complexity grows quadratically with the sequence length. Notably, even approximate computation, as a common strategy to reduce such quadratic overhead, faces theoretical constraints. Under the strong exponential time hypothesis, it is impossible to construct subquadratic approximate self-attention algorithms with rigorous error guarantees[7]. Given the current technical conditions, training and inference typically rely on large-scale or even ultra-large-scale GPU clusters, resulting in prohibitive computational resource consumption.

To address the aforementioned limitations of the classical self-attention mechanism, continuous semantic modeling has emerged as an important breakthrough direction. Diffusion-LM pioneered research on diffusion language modeling in the embedding space[8], while Dillermer proposed an improved scheme addressing critical drawbacks such as training instability exhibited by Diffusion-LM[9]. Hu et al. (2026) proposed embedded language flows (ELF), which constructs diffusion language models within the continuous embedding space and maps continuous vectors to discrete tokens only at the final generation step. This design preserves the continuity of semantic representations and enables direct transfer of well-established diffusion techniques from the vision domain, achieving substantial improvements in generation quality and sampling efficiency over discrete diffusion language models[10]. While these attempts mitigate the loss of semantic continuity induced by matrix operations based on discrete token sets, they remain largely rooted in the transformer architecture and fail to substantially address the computational complexity bottleneck.

Quantum computing, leveraging superposition and entanglement, opens up a new avenue for performance breakthroughs in language models. Research on quantum language models has grown rapidly in recent years, yet most mainstream works remain limited to peripheral enhancement and partial substitution within the classical transformer framework. A survey has systematically summarized the acceleration potential of quantum computing in the training, inference and optimization of machine learning models[11]. Hybrid quantum transformers represented by HyQuT integrate variational quantum circuits into the transformer framework to achieve local parameter compression[12]. Nevertheless, their self-attention computation still follows classical schemes and does not redefine the matrix operation logic for token interactions. Another review in quantum natural language processing also notes that most existing quantum language models fail to innovate upon the underlying computational framework of classical LLMs[13]. Overall, existing quantum language models mostly leverage quantum computing to assist and augment the original classical processing pipeline, leaving the core architecture and computational logic of the self-attention mechanism fundamentally unaltered, thus rendering it infeasible to resolve the two inherent limitations of classical self-attention at their root.

By contrast, in the fields of probabilistic graphical models and energy-based learning (EBL), Boltzmann machines (BMs) offer an alternative route for global dependency modeling distinct from matrix dot-product operations. The foundational work on BMs originates from Hinton and colleagues[14, 15]. The original fully connected Boltzmann machine (FC-BM) proposed in 1985 can theoretically fit any finite discrete joint distribution via bidirectional coupling among units[15]. Nevertheless, computing the partition function and performing Gibbs sampling incur overheads scaling exponentially with the number of units, making FC-BMs impractical for deployment on classical computing hardware. To mitigate this bottleneck, Smolensky (1986) proposed the restricted Boltzmann machine (RBM) by introducing a bipartite graph topology without intra-layer connections, substantially reducing the model's computational complexity[16]. Building upon this, Hinton et al. (2006) constructed deep belief networks (DBNs) by stacking RBMs layer-wise, fueling the resurgence of deep learning[17]. However, while simplifying the structure to enable feasible training, RBMs abandon the inherent pairwise coupling among units in fully connected architectures and partially lose the capacity to directly characterize high-order variable correlations. Recently, Kim and Park (2026) proposed Boltzmann attention, which introduces learnable Ising couplings into the transformer framework[18]. They conducted experiments with exact Boltzmann computation on small-scale tasks, yet the exponential cost still prevents scaling toward large sequences. It follows that although FC-BMs possess prominent theoretical potential for interaction modeling, they have long been constrained by the inherent limitations of classical computing.

Quantum Boltzmann machines (QBMs) offer a viable route to tackle the aforementioned dilemma. Wiebe et al. (2014) demonstrated that quantum approaches can not only accelerate the training of deep RBMs but also enable efficient training of multi-layer FC-BMs[19].

Benedetti et al. (2017) further illustrated the feasibility of embedding probabilistic graphical models into quantum-assisted learning hardware[20]. Amin et al. (2018) replaced classical binary units with qubits and leveraged quantum annealing to achieve efficient sampling from the Boltzmann distribution[21]. They also explored the possibility of verifying the model's generative modeling capability on quantum annealing hardware. Liu (2026) proposed a bilevel optimization training scheme based on the quantum approximate optimization algorithm (QAOA)[22]. Breaking the constraint of the fixed target Hamiltonian in standard QAOA, the scheme simulates the contrastive divergence learning through inner-loop and outer-loop computational procedures, enabling the training of fully connected quantum Boltzmann machines (FC-QBMs) using only a single layer of QAOA while delivering favorable noise robustness in noisy simulation settings. These studies indicate that quantum computing holds the potential to resolve the training bottleneck of FC-BMs. Nevertheless, to date, no work has deeply integrated FC-QBMs with the self-attention mechanism to reconstruct the computational architecture of attention.

Based on the above discussions, this paper attempts to reconstruct the classical self-attention mechanism at the fundamental level to overcome its inherent limitations. Specifically, a novel self-attention mechanism based on FC-QBM is designed, and a quantum language model is further constructed using the proposed mechanism as its core engine. The organization of this paper is as follows. First, on the basis of a brief review of the classical self-attention mechanism, the computational principle of the FC-QBM self-attention mechanism is derived, and its functional equivalence to the classical counterpart is mathematically proven. Second, the construction and implementation processes of the quantum language model based on FC-QBM are elaborated; the mathematical principles underlying model training and text generation are derived; and the corresponding algorithms are developed. Third, a fully connected quantum Boltzmann machine language model (FC-QBM-LM) with eight qubits is constructed based on the proposed algorithms. Finally, the model is trained on the corpus of Three Hundred Tang Poems via the PennyLane quantum simulation platform and the PyTorch machine learning framework, followed by a comprehensive evaluation of its three core properties: convergence performance, noise robustness and five-character quatrain generation capability.