When BERT Meets Quantum Temporal Convolution Learning for Text Classification in Heterogeneous Computing

Chao-Han Huck Yang, Jun Qi, Samuel Yen-Chi Chen, Yu Tsao, Pin-Yu Chen

This paper explores the intersection of two cutting-edge fields: Transformer-based language models and quantum computing. The researchers introduce BERT-QTC, a hybrid classical-quantum architecture designed for text classification that prioritizes both performance and data privacy.

TL;DR

The authors propose a hybrid model that combines pre-trained BERT embeddings with a novel Quantum Temporal Convolution (QTC) decoder. By utilizing randomized variational quantum circuits within a vertical federated learning framework, they achieve state-of-the-art results in intent classification while significantly enhancing data isolation and protection against model inversion attacks.

What Problem Does This Paper Address?

While models like BERT have revolutionized Spoken Language Understanding (SLU), they come with significant baggage: high computational costs and serious privacy concerns. Large-scale language models are prone to "data leakage," where sensitive personal information used during training can potentially be extracted by attackers.

Furthermore, as we move toward heterogeneous computing—where tasks are split between CPUs, GPUs, and specialized hardware—ensuring data security across these interfaces becomes critical. The authors aim to leverage the unique properties of quantum computing, specifically its ability to represent features in high-dimensional Hilbert spaces and its potential for parameter isolation, to build a more secure and efficient text classifier.

Methods

The BERT-QTC model follows a hybrid classical-quantum pipeline, as illustrated in the overall architecture:

Fig. 1: BERT-QTC for vertical federated [11] text classification.
  1. Classical Embedding: A pre-trained, frozen BERT model acts as a universal encoder on a classical machine, turning text sequences into dense vector embeddings.
  2. Quantum Temporal Convolution (QTC): Instead of a standard neural network decoder, the authors use a QTC layer. This layer uses a sliding window (similar to a classical CNN) to feed segments of the embeddings into a Variational Quantum Circuit (VQC).
  3. Random Circuit Learning: Crucially, the parameters within the quantum circuit are randomly initialized and not trained. This "randomized" approach acts as a security feature; because the parameters are unknown to potential attackers at the classical interface, it becomes much harder to perform model inversion attacks to steal data.
  4. Quantum Processing: The VQC uses angle encoding to map classical data to quantum states, entangles them using CNOT gates, and finally performs Pauli-Z measurements to produce a feature vector for classification.
Fig. 2: The BERT-QCC comprises with (a) BERT and (b) quantum temporal convolutional (QTC) learning with random circuits.

Datasets

The model was evaluated on two prominent Spoken Language Understanding (SLU) benchmarks:

  • Snips: A dataset of spoken utterances for personal voice assistants (e.g., music search, smart home requests) containing 7 intent classes.
  • ATIS (Airline Travel Information System): A widely used NLU corpus for flight reservations. The authors focused on a subset called ATIS7, which includes the top 7 intent classes to account for the qubit limitations of current quantum hardware.
Fig. 5: ATIS7 Dataset for BERT-QTC experiments.

Key Insights and Ideas

  • Quantum as a Feature Projector: The core "aha moment" is treating the quantum circuit not just as a black-box optimizer, but as a temporal convolutional feature projector. It maps classical text embeddings into a high-dimensional quantum space that captures semantic nuances more effectively than some classical counterparts.
  • Security through Randomness: By using non-trainable, randomized quantum parameters, the authors create a "parameter isolation" layer. This is particularly effective in a vertical federated learning setting, where the data owner (classical side) and the quantum hardware provider (quantum side) don't need to share sensitive model weights directly.
  • Efficiency on NISQ Hardware: The design is specifically tailored for Noisy Intermediate-Scale Quantum (NISQ) devices. It requires only 4 to 9 qubits, making it feasible to run on currently available commercial quantum computers like IBM-Q or via simulators on Amazon Braket.

Key Results

The hybrid BERT-QTC model outperformed several baselines, including those using classical Temporal Convolutional Networks (TCN) and Word2Vec embeddings:

  • Accuracy: BERT-QTC achieved an average accuracy of 96.62% on Snips and 96.98% on ATIS7.
  • Performance Boost: Compared to existing quantum circuit-based language models, BERT-QTC showed relative improvements of 1.57% (Snips) and 1.52% (ATIS7).
  • Complexity: The use of QTC allowed for lower model complexity compared to deep classical neural network decoders while maintaining or improving performance.

Limitations and Future Work

The primary limitation is the qubit constraint of current NISQ hardware. Because each intent class or feature dimension often requires dedicated quantum resources, the model is currently limited to classification tasks with a small number of labels (e.g., the 7-9 classes tested here).

The authors note that current hardware limits prevent the model from tackling more granular "word-level slot-filling" tasks, which can involve over 100 classes. Future work will likely focus on scaling these architectures as more powerful, error-corrected quantum devices become available, and exploring how to further integrate quantum advantages into the training process itself rather than just the decoder.

Summary updated

BibTeX
@inproceedings{yang2022when,
  author = {Chao-Han Huck Yang and Jun Qi and Samuel Yen-Chi Chen and Yu Tsao and Pin-Yu Chen},
  title = {{When BERT Meets Quantum Temporal Convolution Learning for Text Classification in Heterogeneous Computing}},
  booktitle = {IEEE International Conference on Acoustics, Speech and Signal Processing},
  year = {2022},
  url = {https://openreview.net/forum?id=Dp4_9bME39-},
}
Figure