Michael Krebsbach, Florentin Reiter, Thomas Wellens, Hagen-Henrik Kowalski, Ali Abedi
8 min
Abstract
Generative quantum machine learning models are trained to deduce the probability distribution underlying a given dataset, and to produce new, synthetic samples from it. The majority of such models proposed in the literature, like the Quantum Circuit Born Machine (QCBM), fundamentally work on a binary level. Real-world data, however, is often numeric, requiring the models to translate between binary and continuous representations. We analyze how this transition influences the performance of quantum models and show that it requires the models to learn correlations that are solely an artifact of the way the data is encoded, and not related to the data itself. At the same time, structure of the original data can be obscured in the binary representation, hindering generalization. To mitigate these effects, we propose a strategy based on Gray-codes that can be implemented with essentially no overhead, conserves structures in the data, and avoids artificial correlations in situations in which the standard approach creates them. Considering datasets drawn from various one-dimensional probability distributions, we verify that, in most cases, QCBMs using the reflected Gray code learn faster and more accurately than those with standard binary code.
Alex: And they measure success with samples only, since full probabilities are hard to know?
Sam: Yes, using a sample-based check called maximum mean discrepancy—or MMD squared for short—which compares how alike two batches of points are by smoothing them through kernel functions, like blurring photos to spot overall shape matches. It avoids needing every exact probability. The hardware-efficient circuit they use layers simple rotations on each qubit with paired links between neighbors, keeping things shallow and real-world feasible. For this symmetric data, reflected Gray code's built-in bias toward mirrors and local changes explains the edge—no extra circuit depth required.
Alex: So it's not just any neighbor-preserving code; the reflection aligns with the data's own balance, making training straightforward.
Alex: So for that single centered bell curve, the reflected Gray code's mirror match gives it a real edge, even on very shallow setups. But what happens when the data loses that perfect symmetry?
Sam: The paper tests that next by mixing in multiple bell curves—specifically three narrow ones placed randomly across the range. This breaks the overall mirror shape while keeping each curve symmetric on its own. They also scale up the qubit count from six to sixteen and train circuits up to six layers deep, averaging results over ten runs each time.
Alex: Right, so now it's a bumpier landscape without the neat center. Do the other codes catch up, or does the reflected one still lead?
Sam: The random code and monotone version falter badly—they can't capture the structure, and performance drops as qubits increase, hitting a barren plateau. That's a flat spot in the training landscape where changes to the model's settings barely budge the results, like wandering a vast desert with no hills to guide you. Reflected and standard codes avoid that trap up to sixteen qubits, but reflected pulls ahead in most tests. It shines most at shallow depths under three layers, where standard needs more to compensate.
Alex: Why do deeper models sometimes do worse there?
Sam: Even starting near uniform probabilities, extra layers can shift the initial setup subtly off-course through accumulated tiny effects, or optimizing them disrupts the whole balance. But with structure-preserving codes like reflected Gray, shallow models match or beat deeper ones without those issues. The histograms confirm this—synthetic samples closely hug the training bumps for reflected code.
Alex: Okay, that makes the case stronger—not just for perfect data, but practical bumpy ones too. They push it further with sawtooth shapes—those are like repeating ramps or triangles instead of smooth bells, right? To strip away even local mirrors?
Sam: Yes, three of these sawtooth patterns, each a straight-line rise and fall over a set width, placed at random spots to fully break any overall mirror. The width varies from tiny spikes covering just a few data points to broader ones filling much of the range. With twelve qubits and up to six layers, they average over ten such random setups each time. Random and monotone codes lag far behind, as expected. Standard code wins in some extremes—super-narrow or very broad—where neighbor closeness matters less. But reflected leads in most cases. The histograms show synthetic samples hugging the training ramps closely.
Alex: So for in-between widths, where the ramps need real structure capture, reflected Gray takes over?
Sam: Yes. This proves the neighbor-preserving setup gives a built-in lean toward smooth changes—like assuming data flows steadily without jumps—which speeds training across varied shapes, without locking the model to only continuous ones.
Alex: So no one-size-fits-all, but for typical hardware and data flows, this neighbor trick with reflection symmetry is a solid, low-cost boost. The paper notes limits, though—for very narrow peaks or extremely broad spreads, the edge shrinks because closeness matters less there. Standard encoding catches up. It also needs the circuit's qubits wired in a straight line to match the code's order—like a chain where each link talks only to neighbors.
Sam: Precisely. The study suggests this approach makes generative quantum models viable on noisy near-term hardware for tasks like financial modeling or physics simulations—without redesigning the whole circuit structure. Overall, it highlights encoding as a simple lever to unlock better training, preserving data's natural flow. This paper shows thoughtful data prep can bridge the gap to useful applications.
Alex: That's a clear step forward in making quantum models work with everyday numbers. Thanks for breaking it down, Sam. That's our look at encoding numerical data for generative quantum machine learning.