Margin-Based Generalization for Quantum Machine Learning with Classical Data Encoding

Ju-Young Ryu, Tak Hur, Daniel K. ParkarXiv 2026

TL;DR

This paper introduces a new theoretical framework for understanding how well Quantum Machine Learning (QML) models generalize to new data, specifically when classical data is encoded into quantum states. By analyzing the "margin"—the confidence with which a model separates classes—the authors prove that margin-based metrics are far superior to simple parameter counts at predicting a model's performance on unseen data, even when the data encoding itself is trainable.

What Problem Does This Paper Address?

In machine learning, "generalization" is the holy grail: we want models that don't just memorize training data but actually learn patterns that apply to new examples. Traditionally, researchers used "uniform bounds" (like counting parameters) to estimate this. However, modern deep learning—and now QML—has shown that these bounds are often useless. A model can have a massive number of parameters, perfectly "memorize" random noise, and yet still generalize well on real data.

The challenge is even trickier in QML because classical data (like images) must be "loaded" into a quantum system via an encoding circuit. This encoding can be fixed or, increasingly, trainable (as in data re-uploading schemes). Previous work established margin-based bounds for quantum data, but this paper fills the gap for the more common scenario of classical data being mapped into the quantum realm.

Methods

The authors tackle the problem from both theoretical and empirical angles:

  1. Theoretical Bounds: They derive a new generalization bound for QNNs with trainable encodings. Using a "two-scale covering argument," they separate the complexity of the classifier from the complexity of the encoder. The resulting bound includes a margin-dependent term and an additive "encoding-capacity" term that scales with $\sqrt{L/m}$ (where $L$ is the number of encoding parameters and $m$ is the sample size).
  2. Large-Scale Simulation: To test their theory, they ran a massive empirical study involving 19,440 simulated training runs. They varied everything: circuit architectures (ansätze), encoding depths, qubit counts, and optimization hyperparameters like learning rate and batch size.
  3. Evaluation Criteria: They didn't just look at correlations. They used rigorous protocols from classical deep learning:
  4. Conditional Independence Test: Measures if a complexity metric provides information about the generalization gap after controlling for hyperparameters.
  5. Sign-Error Analysis: Quantifies how often a metric correctly predicts which of two models will generalize better.
Figure 1: Four-qubit embedding circuits with input ⃗x = [x0, x1, x2, x3]. (a) RX angle embedding. (b) RY angle embedding. (c) One IQP embedding layer. One- and two-layer variants are used.

Datasets

The study utilized three standard image-classification benchmarks, adapted for QML:

  • MNIST: Digits 1 vs. 6.

  • KMNIST: Kuzushiji (Japanese) characters 0 vs. 5.

  • Fashion-MNIST: Clothing items 4 vs. 9 (T-shirts vs. sandals). Images were preprocessed using PCA to reduce them to two dimensions before being tiled across the qubits.

Key Insights and Ideas

  • Margin is the "Aha!" Metric: The most important finding is that the inverse margin ($1/\gamma$) is a much more reliable predictor of generalization than counting parameters. While parameter counts are fixed by the architecture, the margin responds to the actual training process and optimization settings.
  • Trainable Encoders have a Quantifiable Cost: Learning how to represent data isn't "free." The authors' theory successfully quantifies the additional capacity (and potential for overfitting) introduced when you make the data-loading part of the circuit trainable.
  • Sensitivity to Optimization: Margin-based measures are sensitive to things like batch size and learning rate. As shown in Figure 3, these metrics correctly respond to changes in optimization that affect generalization, whereas parameter-based metrics are "blind" to these changes because the circuit size stays the same.
90th-percentile sign-error values. Lower values indicate better prediction of generalization. Margin-based measures (left columns) consistently outperform parameter-based ones (right columns).

Key Results

  • Superior Prediction: In the conditional independence test, the pure inverse margin ($1/m_\gamma$) achieved the highest score ($4.565 \times 10^{-3}$), significantly outperforming parameter-based baselines.
  • Robustness: In sign-error analysis, margin-based metrics achieved much lower 90th-percentile errors (around 0.71) compared to parameter counts (around 0.77).
  • Unified View: The results show that the margin-based framework developed for classical deep learning and quantum-data QML transfers effectively to the classical-data QML regime.
Distribution of accuracies and generalization gaps across the nearly 20,000 runs.

Limitations and Future Work

  • Hardware Noise: The study was conducted via simulation. In real-world "noisy intermediate-scale quantum" (NISQ) devices, hardware noise (like decoherence) tends to shrink margins. Understanding how noise interacts with these generalization bounds is a critical next step.
  • Complex Encoders: The current theory assumes a specific structure where trainable and data-dependent gates are somewhat separate. Future work could extend this to more complex, intertwined "neural quantum embeddings" or circuits where data and parameters are processed jointly.
  • Classical Pre-processing: The bound does not yet account for the complexity of classical neural networks used to pre-process data before it hits the quantum encoder.

Summary updated

BibTeX
@misc{ryu2026margin,
  author = {Ju-Young Ryu and Tak Hur and Daniel K. Park},
  title = {{Margin-Based Generalization for Quantum Machine Learning with Classical Data Encoding}},
  year = {2026},
  eprint = {2610.24426},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2610.24426},
}
Figure