Hybrid Quantum-Classical Attention Mechanisms for Parameter-Efficient Transformers in Natural Language Processing
Transformer architectures have become the foundation of modern natural language processing systems. Despite their empirical success, the standard self-attention mechanism suffers from quadratic computational complexity with respect to sequence length and accounts for a substantial fraction of trainable parameters. Quantum computing, through superposition, entanglement, and interference, offers a different computational paradigm that may supply novel inductive biases for representation learning and sequence modeling. We introduce the Hybrid Quantum-Classical Transformer (HQCT), which integrates variational quantum circuits into the multi-head attention mechanism of a classical Transformer. We investigate two designs: Quantum Projection (HQCT-P), which replaces the classical linear maps that produce queries and keys with parameterized quantum circuits, and Quantum Kernel Attention (HQCT-K), which retains classical projections but substitutes the scaled dot-product similarity with a quantum kernel defined by the squared fidelity of quantum states. In both cases the value projection, feed-forward sub-layers, and residual connections remain classical. Experiments on AG News, IMDB, SST-2, and MultiNLI show that HQCT-K matches or slightly exceeds the accuracy of a matched classical Transformer while using approximately fourteen percent fewer classical parameters. In a few-shot regime with only sixteen labeled examples per class, the quantum-kernel model exhibits a clear advantage. Ablation studies isolate the effects of qubit number, variational ansatz depth, and simulated depolarizing noise. The results indicate that hybrid quantum-classical attention is a realistic direction for bringing quantum resources into practical NLP systems in the NISQ era.
Authors
- Amisha Singh (ORCID: https://orcid.org/0000-0003-4456-3510)
Institutions
- The NorthCap University (IN)
Publication Details
- Journal
- Research Square
- Published
- 2026-12-01
- DOI
- https://doi.org/10.21203/rs.3.rs-11371769/v1
- Primary Topic
- Quantum Computing Algorithms and Architecture
- Type
- preprint