[Paper Review] Quantum Vision Transformers
This paper proposes quantum vision transformers using shallow, NISQ-friendly parametrized quantum circuits with quantum attention mechanisms, including a novel compound matrix-based transformer. It demonstrates competitive classification performance on medical image datasets via simulation and initial hardware experiments, with theoretical speedup in attention computation and significantly fewer parameters than classical models.
In this work, quantum transformers are designed and analysed in detail by extending the state-of-the-art classical transformer neural network architectures known to be very performant in natural language processing and image analysis. Building upon the previous work, which uses parametrised quantum circuits for data loading and orthogonal neural layers, we introduce three types of quantum transformers for training and inference, including a quantum transformer based on compound matrices, which guarantees a theoretical advantage of the quantum attention mechanism compared to their classical counterpart both in terms of asymptotic run time and the number of model parameters. These quantum architectures can be built using shallow quantum circuits and produce qualitatively different classification models. The three proposed quantum attention layers vary on the spectrum between closely following the classical transformers and exhibiting more quantum characteristics. As building blocks of the quantum transformer, we propose a novel method for loading a matrix as quantum states as well as two new trainable quantum orthogonal layers adaptable to different levels of connectivity and quality of quantum computers. We performed extensive simulations of the quantum transformers on standard medical image datasets that showed competitively, and at times better performance compared to the classical benchmarks, including the best-in-class classical vision transformers. The quantum transformers we trained on these small-scale datasets require fewer parameters compared to standard classical benchmarks. Finally, we implemented our quantum transformers on superconducting quantum computers and obtained encouraging results for up to six qubit experiments.
Motivation & Objective
- To design quantum neural network architectures that extend classical vision transformers using quantum computation for improved performance.
- To develop quantum attention mechanisms that are natively quantum, leveraging unitary and orthogonal operations for enhanced expressivity.
- To reduce model complexity by using fewer parameters (thousands vs. millions) while maintaining or improving classification accuracy.
- To enable scalable, differentiable quantum circuits using amplitude encoding and Hamming-weight preserving gates for NISQ-era hardware.
- To demonstrate feasibility and performance advantages on real and simulated quantum hardware using medical image benchmarks.
Proposed method
- Proposes three types of quantum transformers: Orthogonal Patchwise, Orthogonal Transformer, and Compound Transformer, each using parametrized quantum circuits for attention computation.
- Employs amplitude encoding to map image patches into quantum states, enabling efficient representation of input data in superposition.
- Uses Hamming-weight preserving quantum gates to ensure scalability and reduce circuit depth, avoiding general variational ansatzes with poor scalability.
- Introduces quantum orthogonal layers that perform trainable matrix multiplication via unitary operations, enabling backpropagation and gradient computation.
- Applies compound matrix multiplication in the Compound Transformer using Clifford algebra operations, which are classically intractable but quantum-natively efficient.
- Employs quantum circuits with logarithmic depth (e.g., butterfly circuits) for efficient implementation of large matrix operations on quantum hardware.
Experimental results
Research questions
- RQ1Can quantum transformers with natively quantum attention mechanisms achieve competitive or superior performance on image classification tasks compared to classical transformers?
- RQ2Does the use of quantum orthogonal layers and compound matrix operations provide a computational advantage in attention layer complexity over classical equivalents?
- RQ3Can quantum vision transformers generalize well with significantly fewer parameters (thousands vs. millions) and mitigate overfitting?
- RQ4To what extent do current NISQ devices support the execution of quantum vision transformers, and what are the limitations due to noise and qubit count?
- RQ5How does the performance of quantum transformers scale with increasing qubit count and circuit depth, and what hardware requirements are needed for competitive results?
Key findings
- The Compound Transformer achieves a theoretical quadratic speedup in attention computation compared to classical methods, with complexity scaling favorably with image patch count and dimension.
- Quantum vision transformers achieved competitive or better classification accuracy than state-of-the-art classical models on MedMNIST datasets in numerical simulations.
- The models required only 60 to 600 RBS gates and 16–32 qubits to achieve competitive performance, indicating low parameter count and hardware efficiency.
- Hardware experiments on superconducting quantum processors showed promising results for up to six qubits, though noise increased with circuit size and qubit count.
- The use of Hamming-weight preserving gates and amplitude encoding enabled scalable, differentiable quantum circuits that are more suitable for NISQ devices than general variational quantum circuits.
- The Compound Transformer’s use of higher-dimensional compound matrices enables operations that are infeasible for classical computers, providing a unique quantum advantage in model expressivity.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.