betaFeedback

WorksPhysics and Astronomy

Periodic Readout Induces a First-Order Generalization Transition in a Quantum Perceptron

Abstract

Variational quantum classifiers can generate highly structured decision boundaries through the Fourier dependence of observable expectation values on circuit parameters. We show that expressivity can come at a sharp statistical cost, by considering a quantum perceptron whose readout is the simplest periodic classifier, namely a square-wave function of the weighted inputs, and determine its typical generalization in the thermodynamic limit using a teacher-student replica-symmetric theory. Above a critical oscillation frequency, increasing the training load induces a first-order transition from weakly to strongly teacher-aligned phases, resulting in a discontinuous improvement in generalization. At fixed load, however, increasing the frequency eventually drives the equilibrium generalization error to chance level, despite perfect classification of all the training examples. Thus, the same periodic structure that enhances random-label storage can delay the onset of learning. Our results expose a quantitative tradeoff between memorization and generalization generated purely by periodic readout, and provide a benchmark for understanding Fourier-rich variational quantum classifiers.

Introduction

Parametrized quantum circuits are the workhorse of near-term quantum machine learning [1, 2, 3, 4, 5]. Their predictions are expectation values of quantum observables on the output of the circuit, which admit a Fourier representation in terms of trigonometric polynomials in the rotation angles used in the circuit, with frequencies set by the spectra of the gate generators [6, 7]. This oscillatory response to the trainable parameters, a direct consequence of unitary rotations followed by a projective measurement, is usually regarded as a source of expressivity. For the capacity to store random input-label associations, the role of the oscillation is known for a minimal quantum perceptron: a higher readout oscillation frequency λ\lambda increases the storage capacity [8]. Its effect on learning from data is much less understood: generalization bounds for quantum models [9, 10, 11] are worst-case statements, while the statistical mechanics of learning has shown that typical learning curves of even the simplest networks can be qualitatively different [12, 13, 14, 15, 16].

Here we address the question of rule inference, in the teacher-student scenario in which a student perceptron must reproduce the labels of a teacher of identical architecture from P=αNP=\alpha N examples, where NN is the dimensionality of the data. We find that the same frequency that enlarges the storage capacity has the opposite effect on learning: (i) the initial alignment with the teacher is exponentially suppressed in λ2\lambda^2; (ii) for λ>λc≃1.944\lambda>\lambda_c\simeq1.944 learning occurs through a first-order transition; (iii) the transition load grows only logarithmically with λ\lambda, whereas a weakly aligned metastable phase survives up to loads ∼eλ2/λ4\sim e^{\lambda^2}/\lambda^4, opening a wide region that is expected to be hard for efficient inference algorithms; (iv) the asymptotic learning curve is nonetheless λ\lambda independent.

Model

The input register consists of NN qubits prepared in ∣x⟩=∣x1⟩⊗⋯⊗∣xN⟩|x\rangle=|x_1\rangle\otimes\cdots\otimes|x_N\rangle, where x∈{±1}Nx\in\{ \pm1\}^N, so that σz(j)∣x⟩=xj∣x⟩\sigma_z^{(j)}|x\rangle=x_j|x\rangle. The readout qubit is prepared in ∣+1⟩|+1\rangle; see Figure 1(a). The trainable gate

Figure 1. (a) Quantum perceptron: basis-encoded input, trainable gate (1), and σx\sigma_x readout. (b) Readout (2) (gray), square-wave classifier sλs_\lambda (orange, λ=3\lambda= 3), classical perceptron sgn⁡(h)\operatorname{sgn}(h) (dashed black), and the Gaussian distribution of the fields hh (shaded).

Uλ(w)=exp⁡(−i2λw^⋅σz⊗σx(out)),w^=w∥w∥,(1)U_\lambda(\mathbf{w})=\exp\left(-\frac{\mathrm{i}}{2}\lambda\widehat{\mathbf{w}}\cdot\boldsymbol{\sigma}_z\otimes\sigma_x^{(\mathrm{out})}\right),\qquad\widehat{\mathbf{w}}=\frac{\mathbf{w}}{\lVert\mathbf{w}\rVert}, \tag*{(1)}

acts on the input and readout register, jointly prepared in ∣x⟩⟨x∣⊗∣+1⟩⟨+1∣|x\rangle\langle x|\otimes|+1\rangle\langle+1|, as a rotation of the readout register by the angle λw^⋅x\lambda\widehat{\mathbf{w}}\cdot\mathbf{x}. Then, the expectation value of measuring σx(out)\sigma_x^{(\mathrm{out})} is (Appendix A)

fλ(x,w)=Tr⁡[(Uλ(w)∣x⟩⟨x∣⊗∣+1⟩⟨+1∣Uλ(w)†)I⊗σx(out)]=sin⁡(λw⋅x∥w∥).(2)f_\lambda(\mathbf{x},\mathbf{w})=\operatorname{Tr}\left[(U_\lambda(\mathbf{w})|x\rangle\langle x|\otimes|+1\rangle\langle+1|U_\lambda(\mathbf{w})^\dagger)\mathbb{I}\otimes\sigma_x^{(\mathrm{out})}\right] =\sin\left(\lambda\frac{\mathbf{w}\cdot\mathbf{x}}{\lVert\mathbf{w}\rVert}\right). \tag*{(2)}

Since the readout depends only on the direction of w\mathbf{w}, we fix the redundant radial degree of freedom by imposing ∥w∥2=N\lVert w\rVert^2 = N. For delocalized weights and independent Rademacher inputs, the local field h=w⋅x/Nh = w \cdot x/\sqrt{N} is of order one. We define the classifier

sλ(h):=sgn⁡(sin⁡(λh))(3)s_\lambda(h) := \operatorname{sgn}(\sin(\lambda h)) \tag*{(3)}

in terms of the local field h=w⋅x/Nh = w \cdot x/\sqrt{N}. The decision boundaries are given by the parallel hyperplanes h=kπ/λh = k\pi/\lambda, k∈Zk \in\mathbb{Z}, so that λ\lambda fixes their density as seen by the O(1)O(1) fields (see Figure 1(b)), and λ→0+\lambda\to0^+ recovers the classical perceptron sgn⁡(h)\operatorname{sgn}(h). We assume the ability to estimate expectation values with no errors, i.e., we neglect shot noise associated to finite-sampling. Note that the circuit does not generate entanglement on basis inputs and is classically simulable: The effects investigated below therefore stem solely from the periodic structure of the quantum readout, not from some inherently quantum property.

Teacher-student setting

We formulate learning in the teacher–student framework, which provides a controlled setting for studying how examples constrain an unknown classification rule [15, 16]. A teacher generates the training labels, and the student has access to the labeled examples but not to the teacher’s parameters. The question is how much these examples reveal about the underlying rule, and whether this information allows the student to predict labels on previously unseen inputs.

In our model, the teacher weight vector w∗w^* is drawn uniformly from the sphere ∥w∗∥2=N\lVert w^*\rVert^2 = N. Independently of the teacher, we draw PP inputs xμx^\mu whose entries are independent and take the values ±1\pm1 with equal probability. The corresponding labels are generated according to

ξμ=sλ(w∗⋅xμN),μ=1,…,P.(4)\xi^\mu= s_\lambda\left(\frac{w^* \cdot x^\mu}{\sqrt{N}}\right), \qquad\mu= 1,\ldots,P. \tag*{(4)}

We write X=(x1,…,xP)X = (x^1,\ldots,x^P) and ξ=(ξ1,…,ξP)\xi= (\xi^1,\ldots,\xi^P) for the training inputs and labels and with TP={(xμ,ξμ)}μ=1P\mathcal{T}_P = \{(x^\mu,\xi^\mu)\}_{\mu=1}^P the whole training set.

For a given training set, every weight vector that reproduces all observed labels remains a possible explanation of the data. These compatible weights form the version space of the student, that is assumed to use the same classification rule and the same spherical prior as the teacher. Thus:

V(TP)={w∣∥w∥2=N, sλ(w⋅xμN)=ξμ for all μ}.(5)\mathcal{V}(\mathcal{T}_P) = \left\{w \mid\lVert w\rVert^2 = N,\ s_\lambda\left(\frac{w \cdot x^\mu}{\sqrt{N}}\right) = \xi^\mu\ \text{for all }\mu\right\}. \tag*{(5)}

An incompatible weight vector has zero likelihood, while every compatible vector has likelihood one. Bayes’ rule therefore restricts the prior to the version space and normalizes the resulting measure. If dμ(w)\mathrm{d}\mu(w) denotes the normalized uniform measure on the sphere, the posterior distribution is (Appendix B)

dμTP(w)=1V(TP)(w)VN(TP) dμ(w),(6)\mathrm{d}\mu_{\mathcal{T}_P}(w) = \frac{\mathbf{1}_{\mathcal{V}(\mathcal{T}_P)}(w)}{V_N(\mathcal{T}_P)}\,\mathrm{d}\mu(w), \tag*{(6)}

where 1A\mathbf{1}_A denotes the indicator function of the set AA (1A(w)=1\mathbf{1}_A(w) = 1 if w∈Aw \in A and zero otherwise) and

VN(TP)=∫V(TP)dμ(w)(7)V_N(\mathcal{T}_P) = \int_{\mathcal{V}(\mathcal{T}_P)} \mathrm{d}\mu(w) \tag*{(7)}

is the volume of the version space, also called Gardner volume: The fraction of the original weight space that remains compatible with the training set [17, 18, 19, 20]. Thus, sampling the posterior amounts to drawing a student uniformly from the compatible weights; we refer to such a posterior sample as a Gibbs student.

The prior and labeling rule used for inference match those that generated the data, which is the setting commonly called Bayes-optimal inference [21]. Its connection to statistical mechanics is expressed by the Nishimori condition, often described as being on the Nishimori line [22, 23]. The relevant consequence here can be understood directly from Bayes’ rule. That is, conditioned on the observed training set, the unknown teacher has exactly the same distribution as a posterior-sampled student. The teacher and independent posterior samples can therefore be exchanged in statistical averages. This property underlies the Nishimori identities used below.

The Gardner volume also has a direct probabilistic interpretation. Before the teacher weights are known, the probability of observing the complete label sequence ξ\xi at fixed inputs XX is obtained by integrating the teacher prior over all weights that produce those labels. Consequently, VN(TP)=P(ξ∣X)V_N(\mathcal{T}_P) = \mathbb{P}(\xi\mid X). In Bayesian terminology, this probability is the evidence (Appendix B). The same quantity therefore measures both the fraction of compatible weights and the probability assigned to the observed labels.

To characterize its behavior at large NN, we consider the quenched entropy density, obtained by computing the logarithm of the volume for each fixed training set and then averaging over the teacher and inputs. The evidence interpretation gives E[ln⁡VN]=−H(ξ∣X)\mathbb{E}[\ln V_N] = -H(\xi\mid X), the conditional (Shannon) entropy of ξ\xi given XX. Moreover, the labels are completely determined by the teacher and inputs, so H(ξ∣w∗,X)=0H(\xi\mid w^*, X) = 0. Hence, the conditional entropy H(ξ∣X)H(\xi\mid X) equals the conditional mutual information I(w∗;ξ∣X)I(w^*; \xi\mid X), and, in the limit N,P→∞N, P \to\infty at fixed training load α=P/N\alpha= P/N,

ϕ(α,λ):=lim⁡N→∞1NE[ln⁡VN]=−lim⁡N→∞1NI(w∗;ξ∣X),(8)\phi(\alpha,\lambda) := \lim_{N\to\infty} \frac{1}{N}\mathbb{E}[\ln V_N] = -\lim_{N\to\infty} \frac{1}{N}I(w^*;\xi\mid X), \tag*{(8)}

provided the limit exists. Thus, −ϕ-\phi measures the information about the teacher supplied by the labels per weight. Since each binary label conveys at most ln⁡2\ln2 nats of information, this immediately yields

−αln⁡2≤ϕ≤0.(9)-\alpha\ln2 \le\phi\le0. \tag*{(9)}

Replica-symmetric solution

We evaluate ϕ\phi with the replica method, in which the pattern average reduces to an average over Gaussian local fields whose covariance is the replica overlap matrix, and we impose replica symmetry (RS) together with the Nishimori identity, which equates the teacher-student and student-student overlaps (Appendices B1 and B3). The resulting RS prediction is

ϕRS(α,λ)=max⁡0≤r<1Fλ(r;α)(10)\phi_{\mathrm{RS}}(\alpha,\lambda) = \max_{0\le r<1}\mathcal{F}_{\lambda}(r;\alpha) \tag*{(10)}

with

Fλ(r;α)=12ln⁡(1−r)+r2−αEt∼N(0,1)H2(ψλ(r,t)).(11)\mathcal{F}_{\lambda}(r;\alpha) = \frac{1}{2}\ln(1-r) + \frac{r}{2} - \alpha\mathbb{E}_{t\sim\mathcal{N}(0,1)}H_2(\psi_{\lambda}(r,t)). \tag*{(11)}

Throughout the paper, ln⁡\ln denotes the natural logarithm; we will use φ(x)=e−x2/2/2π\varphi(x) = e^{-x^2/2}/\sqrt{2\pi} and Φ(x)=∫−∞xφ(u) du\Phi(x) = \int_{-\infty}^{x}\varphi(u)\,\mathrm{d}u for the standard normal probability density and the cumulative distribution function, respectively; we will use Dt=φ(t) dt\mathop{\mathrm{D}}t = \varphi(t)\,\mathrm{d}t for the standard Gaussian integration measure. The function H2(p)=−pln⁡p−(1−p)ln⁡(1−p)H_2(p) = -p\ln p - (1-p)\ln(1-p) denotes the binary entropy in nats, while N(μ,v)\mathcal{N}(\mu,v) will be reserved for a normal distribution with mean μ\mu and variance vv.

The function ψλ(r,t)\psi_{\lambda}(r,t) appearing in (11) is defined by

ψλ(r,t)=Pz∼N(0,1)[sin⁡λ(r t+1−r z)>0];(12)\psi_{\lambda}(r,t) = \mathbb{P}_{z\sim\mathcal{N}(0,1)}\left[\sin\lambda\left(\sqrt{r}\,t+\sqrt{1-r}\,z\right)>0\right]; \tag*{(12)}

it is the probability that a student with an overlap r=w⋅w∗/Nr = w\cdot w^*/N with the teacher outputs +1+1, given the Gaussian mode tt it shares with the teacher. The maximizer r⋆r_\star of (10), whenever it exists and is unique, is the RS prediction for the typical teacher-student overlap. The corresponding generalization error, defined as the error of a Gibbs student on a fresh input, is (see Appendix D)

References

  1. [1]J. Biamonte, P. Wittek, N. Pancotti, P. Rebentrost, N. Wiebe, and S. Lloyd, Quantum machine learning, Nature 549, 195 (2017).DOI
  2. [2]M. Cerezo, A. Arrasmith, R. Babbush, S. C. Benjamin, S. Endo, K. Fujii, J. R. McClean, K. Mitarai, X. Yuan, L. Cincio, and P. J. Coles, Variational quantum algorithms, Nat. Rev. Phys. 3, 625 (2021).DOI
  3. [3]M. Benedetti, E. Lloyd, S. Sack, and M. Fiorentini, Parameterized quantum circuits as machine learning models, Quantum Sci. Technol. 4, 043001 (2019).DOI
  4. [4]K. Mitarai, M. Negoro, M. Kitagawa, and K. Fujii, Quantum circuit learning, Phys. Rev. A 98, 032309 (2018).DOI
  5. [5]E. Farhi and H. Neven, Classification with quantum neural networks on near term processors (2018), arXiv:1802.06002 [quant-ph].arxiv.org/abs/1802.06002
  6. [6]M. Schuld, R. Sweke, and J. J. Meyer, Effect of data encoding on the expressive power of variational quantum-machine-learning models, Phys. Rev. A 103, 032430 (2021).DOI
  7. [7]A. Pérez-Salinas, A. Cervera-Lierta, E. Gil-Fuster, and J. I. Latorre, Data re-uploading for a universal quantum classifier, Quantum 4, 226 (2020).
  8. [8]F. Benatti, M. Gharahi, G. Gramegna, S. Mancini, and V. Parisi, Pseudo quantum advantages in perceptron storage capacity, J. Phys. A: Math. Theor. 59, 145203 (2026).DOI
  9. [9]M. C. Caro, H.-Y. Huang, M. Cerezo, K. Sharma, A. Sornborger, L. Cincio, and P. J. Coles, Generalization in quantum machine learning from few training data, Nat. Commun. 13, 4919 (2022).DOI
  10. [10]L. Banchi, J. Pereira, and S. Pirandola, Generalization in quantum machine learning: A quantum information standpoint, PRX Quantum 2, 040321 (2021).DOI
  11. [11]E. Gil-Fuster, J. Eisert, and C. Bravo-Prieto, Understanding quantum machine learning also requires re-thinking generalization, Nat. Commun. 15, 2277 (2024).
  12. [12]G. Györgyi, First-order transition to perfect generalization in a neural network with binary synapses, Phys. Rev. A 41, 7097 (1990).pubmed.ncbi.nlm.nih.gov/9903140
  13. [13]H. Sompolinsky, N. Tishby, and H. S. Seung, Learning from examples in large neural networks, Phys. Rev. Lett. 65, 1683 (1990).pubmed.ncbi.nlm.nih.gov/10042332
  14. [14]H. S. Seung, H. Sompolinsky, and N. Tishby, Statistical mechanics of learning from examples, Phys. Rev. A 45, 6056 (1992).pubmed.ncbi.nlm.nih.gov/9907706
  15. [15]T. L. H. Watkin, A. Rau, and M. Biehl, The statistical mechanics of learning a rule, Rev. Mod. Phys. 65, 499 (1993).DOI
  16. [16]A. Engel and C. Van den Broeck, Statistical Mechanics of Learning (Cambridge University Press, Cambridge, 2001).DOI
  17. [17]E. Gardner, Maximum storage capacity in neural networks, Europhys. Lett. 4, 481 (1987).DOI
  18. [18]E. Gardner, The space of interactions in neural network models, J. Phys. A: Math. Gen. 21, 257 (1988).DOI
  19. [19]E. Gardner and B. Derrida, Optimal storage properties of neural network models, J. Phys. A: Math. Gen. 21, 271 (1988).
  20. [20]E. Gardner and B. Derrida, Three unfinished works on the optimal storage capacity of networks, J. Phys. A: Math. Gen. 22, 1983 (1989).
  21. [21]L. Zdeborová and F. Krzakala, Statistical physics of inference: thresholds and algorithms, Adv. Phys. 65, 453 (2016).DOI
  22. [22]H. Nishimori, Statistical Physics of Spin Glasses and Information Processing: An Introduction (Oxford University Press, Oxford, 2001).
  23. [23]Y. Iba, The Nishimori line and Bayesian statistics, J. Phys. A: Math. Gen. 32, 3875 (1999).
  24. [24]J. Barbier, F. Krzakala, N. Macris, L. Miolane, and L. Zdeborová, Optimal errors and phase transitions in high-dimensional generalized linear models, Proc. Natl. Acad. Sci. U.S.A. 116, 5451 (2019).DOI
  25. [25]D. L. Donoho, A. Maleki, and A. Montanari, Message-passing algorithms for compressed sensing, Proc. Natl. Acad. Sci. U.S.A. 106, 18914 (2009).
  26. [26]S. Rangan, Generalized approximate message passing for estimation with random linear mixing, in Proceedings of the 2011 IEEE International Symposium on Information Theory (ISIT) (2011) pp. 2168–2172.arxiv.org/abs/1010.5141
  27. [27]F. Ricci-Tersenghi, E. Semerjian, and L. Zdeborová, Typology of phase transitions in Bayesian inference problems, Phys. Rev. E 99, 042109 (2019).
  28. [28]M. J. Song, J. Zadik, and J. Bruna, On the cryptographic hardness of learning single periodic neurons, in Advances in Neural Information Processing Systems, Vol. 34 (2021) arXiv:2106.10744.arxiv.org/abs/2106.10744
  29. [29]J. Bruna, O. Regev, M. J. Song, and Y. Tang, Continuous LWE, in Proceedings of the 53rd Annual ACM SIGACT Symposium on Theory of Computing (STOC) (2021).
  30. [30]M. Benedetti, A. Bogdanov, E. M. Malatesta, M. Mézard, G. Perrupato, A. Rosen, N. I. Schwartzbach, and R. Zecchina, Overlap gap and computational thresholds in the square wave perceptron, J. Stat. Mech. 2025, 123303 (2025).arxiv.org/abs/2506.05197
  31. [31]D. Gamarnik, The overlap gap property: A topological barrier to optimizing over random structures, Proc. Natl. Acad. Sci. U.S.A. 118, e2108492118 (2021).DOI
  32. [32]Y. V. Fyodorov, Multifractality and freezing phenomena in random energy landscapes: An introduction, Physica A: Statistical Mechanics and its Applications 389, 4229 (2010), arXiv:0911.2765 [cond-mat.dis-nn].DOI

Paper details

vlnc:W_ap5aukvb
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Physics and Astronomy

Not recorded for this paper

View statement
Looking for related papers…
Contents