Table of Contents
Fetching ...

Quantum Machine Learning via Contrastive Training

Liudmila A. Zhukas, Vivian Ni Zhang, Qiang Miao, Qingfeng Wang, Marko Cetina, Jungsang Kim, Lawrence Carin, Christopher Monroe

TL;DR

Quantum machine learning often suffers from limited labeled data as models scale. The paper demonstrates a hardware-implemented self-supervised pretraining via contrastive learning to learn quantum representations from unlabeled data, encoding classical images as quantum states on a trapped-ion processor and using state overlaps as a hardware-measured similarity. The two-stage pipeline—pretraining on unlabeled data and fine-tuning on a small labeled set—yields higher mean test accuracy and lower run-to-run variability than fully supervised training, especially in low-label regimes. The results, including robustness to initialization and generalization of learned invariances, suggest a practical, label-efficient pathway for quantum-native datasets and scalable quantum representations.

Abstract

Quantum machine learning (QML) has attracted growing interest with the rapid parallel advances in large-scale classical machine learning and quantum technologies. Similar to classical machine learning, QML models also face challenges arising from the scarcity of labeled data, particularly as their scale and complexity increase. Here, we introduce self-supervised pretraining of quantum representations that reduces reliance on labeled data by learning invariances from unlabeled examples. We implement this paradigm on a programmable trapped-ion quantum computer, encoding images as quantum states. In situ contrastive pretraining on hardware yields a representation that, when fine-tuned, classifies image families with higher mean test accuracy and lower run-to-run variability than models trained from random initialization. Performance improvement is especially significant in regimes with limited labeled training data. We show that the learned invariances generalize beyond the pretraining image samples. Unlike prior work, our pipeline derives similarity from measured quantum overlaps and executes all training and classification stages on hardware. These results establish a label-efficient route to quantum representation learning, with direct relevance to quantum-native datasets and a clear path to larger classical inputs.

Quantum Machine Learning via Contrastive Training

TL;DR

Quantum machine learning often suffers from limited labeled data as models scale. The paper demonstrates a hardware-implemented self-supervised pretraining via contrastive learning to learn quantum representations from unlabeled data, encoding classical images as quantum states on a trapped-ion processor and using state overlaps as a hardware-measured similarity. The two-stage pipeline—pretraining on unlabeled data and fine-tuning on a small labeled set—yields higher mean test accuracy and lower run-to-run variability than fully supervised training, especially in low-label regimes. The results, including robustness to initialization and generalization of learned invariances, suggest a practical, label-efficient pathway for quantum-native datasets and scalable quantum representations.

Abstract

Quantum machine learning (QML) has attracted growing interest with the rapid parallel advances in large-scale classical machine learning and quantum technologies. Similar to classical machine learning, QML models also face challenges arising from the scarcity of labeled data, particularly as their scale and complexity increase. Here, we introduce self-supervised pretraining of quantum representations that reduces reliance on labeled data by learning invariances from unlabeled examples. We implement this paradigm on a programmable trapped-ion quantum computer, encoding images as quantum states. In situ contrastive pretraining on hardware yields a representation that, when fine-tuned, classifies image families with higher mean test accuracy and lower run-to-run variability than models trained from random initialization. Performance improvement is especially significant in regimes with limited labeled training data. We show that the learned invariances generalize beyond the pretraining image samples. Unlike prior work, our pipeline derives similarity from measured quantum overlaps and executes all training and classification stages on hardware. These results establish a label-efficient route to quantum representation learning, with direct relevance to quantum-native datasets and a clear path to larger classical inputs.

Paper Structure

This paper contains 19 sections, 6 equations, 9 figures, 1 table.

Figures (9)

  • Figure 1: Overview of the contrastive learning workflow implemented on the trapped-ion quantum processor. First, we encode each 4 × 4 binary image as a parameterized four-qubit circuit, where the rotation angles represent pixel patterns. When each image is mapped to a circuit, we learn a quantum representation that captures essential differences and similarities of selected classes. For this, each pair of unlabeled images is compared directly on hardware by executing a single circuit, and the results of such comparison over all pairs are aggregated on the classical optimizer to compute the contrastive loss. During each step, the classical optimizer updates the gate angles in the shared representation. By training the model with a chosen circuit structure, we are able to discover a representation where images from the same class cluster together even when they differ by rotation, while images from different classes are pushed apart. Finally, we evaluate the test accuracy on the quantum processor.
  • Figure 2: Constructing a contrastively learned quantum feature space for classical images. We first take $N_U$ classical images, apply augmentation (such as 90-degree rotations) to each image to obtain an image set of $2N_U$. We then learn a quantum representation of these classical images, where augmented (distinct) images form positive (negative) example pairs that are similar (dissimilar) in the representation space. This process does not rely on data labels. The image set shown here ($N_U = 5$) contains binary images where orange (1) and blue (0) indicate the binary pixel values.
  • Figure 3: Encoder training results and circuit structure. a) Encoder training loss. The light blue solid line represents a noiseless simulation using exact statevector evaluation. The blue curve shows experimental results on the quantum processor. b) Circuit structure for the encoder training: the variational unitary $U_\theta$ and the data-encoding unitary $A_\gamma(x)$ are parameterized circuits acting on four quantum bits. $A_\gamma(x_i)$ and $A_\gamma(x_j)$ are learnable quantum encoding of classical images $x_i$ and $x_j$. Utilizing "all-to-all" connectivity on the trapped-ion quantum processor, we impose operator T on qubit pairs, which contains alternating $\mathbf{R}_x$ and $\mathbf{R}_z$ single-qubit operations followed by a fixed-angle entangling gate. We encode variational parameters into the single-qubit operations while all two-qubit gate operations are performed with a fixed angle of $\pi/2$.
  • Figure 4: Classification stage results on the trapped-ion quantum processor. We present classifier test accuracy as a function of the number of training examples. Solid blue and orange lines represent average simulated performance with and without contrastive pretraining, while the markers indicate experimental results on the quantum processor. Shaded regions represent $1\sigma$ standard deviation across 500 balanced train/test data partitions. In simulation, we sample multiple balanced training subsets for each dataset size, train both model types with identical circuit structure, and present the mean and standard deviation of test accuracy. A single dataset is used to evaluate both models on the quantum processor.
  • Figure 5: Robustness to initialization and the effect of pretraining. The graph shows test accuracy versus the number of training examples in the classification stage. Solid lines represent average simulated performance with and without contrastive pretraining over 500 sets of randomly chosen initial parameters for each number of training examples; shaded regions indicate one standard deviation across all chosen parameter sets. Blue color represents the model without contrastive pretraining, while orange color represents a model initialized with a pretrained encoder. Orange squares show hardware results for four sets of randomly chosen initial parameters.
  • ...and 4 more figures