PSD-Safe Bernstein Distance Kernel
Implementation & benchmark of arXiv:2608.04836 — Preservation of Positive-Definiteness by Bernstein Operators on the Circle
Source paper: Preservation of Positive-Definiteness by Bernstein Operators on the Circle arXiv:2608.04836 ⓘ · analyzed Aug 31, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Replace an unconstrained learnable distance-bias function in a graph neural network or distance-aware attention layer by a Bernstein approximation of a positive-definite circular kernel. The resulting kernel is a degree-n polynomial in normalized distance while preserving positive semidefiniteness of every finite Gram matrix on the circle, preventing training from producing an invalid covariance-like similarity structure.
Formulas
Mathematical statement
For points z,w on the unit circle S^1, let d_{S^1}(z,w) in [0,pi] be geodesic distance. A continuous function f:[0,pi]->R is positive-definite isotropic when, for every finite set z_1,...,z_N, the matrix [f(d_{S^1}(z_p,z_q))]_{p,q=1}^N is positive semidefinite. The paper proves that the degree-n Bernstein operator preserves this cone: B_n[f] is positive-definite whenever f is positive-definite. With u=x/pi, B_n[f](x)=sum_{k=0}^n binom(n,k)u^k(1-u)^(n-k)f(k*pi/n). The circle characterization represents f as f(x)=a_0+sum_{m>=1}a_m cos(mx), where a_m>=0 and the coefficients are summable; the proof reduces preservation to nonnegative cosine coefficients of Q_{n,m}=B_n[cos(m dot)]. In the neural version, set a_m=softplus(theta_m)+epsilon for m=0,...,M, define f_theta(x)=a_0+sum_{m=1}^M a_m cos(mx), and use g_theta=B_n[f_theta]. The theorem gives the PSD guarantee for exact circular geometry; for arbitrary graph distances this becomes an empirical inductive bias rather than a formal guarantee.
Implementation notes
1. Integration point: use this scalar distance kernel inside a graph message-passing layer or as a relative-distance bias in attention. For a controlled implementation, embed each node on the unit circle with angle phi_i, compute x_ij=min(|phi_i-phi_j|,2*pi-|phi_i-phi_j|), and multiply messages by g_theta(x_ij). In attention, use g_theta(x_ij) as a multiplicative gate; only add log(epsilon+g_theta(x_ij)) to logits if a strictly positive gate is required. 2. Pseudocode: initialize theta[0:M]. Compute a_m=softplus(theta[m])+epsilon. Precompute T[k,m]=cos(m*pi*k/n) for k=0,...,n and m=0,...,M. For every distance x, compute u=x/pi, Bernstein weights w_k=binom(n,k)*u^k*(1-u)^(n-k), evaluate f_k=a_0+sum_{m=1}^M a_m*T[k,m], and return g_theta(x)=sum_{k=0}^n w_k*f_k. Backpropagate through theta; cache T and, for fixed angular coordinates, cache pairwise x and w. 3. The paper supplies the exact cone-preservation result on S^1 and the nonnegative spectral-coefficient mechanism for Q_{n,m}; no theorem constants need to be estimated. Empirically form K for random angle batches and check its smallest eigenvalue, allowing a tolerance such as -1e-6 for floating-point error. For non-circular graph distances, report PSD violations as an empirical diagnostic and do not claim the circle theorem applies. 4. Cheap experiment: train a 3-layer GCN or small graph transformer on synthetic circle-coordinate node classification and a two-moons graph dataset. Compare an unconstrained two-layer MLP distance kernel, a direct nonnegative cosine-spectrum kernel f_theta, and the Bernstein kernel for n in {8,16,32}. Measure validation accuracy, training-loss variance, gradient-norm spikes, smallest Gram eigenvalue, and the fraction of batches with negative eigenvalues. Success means zero or near-machine-precision PSD violations on circle data, fewer optimization instabilities, and equal-or-better accuracy at comparable parameter count and FLOPs.
Verification
This idea has not been verified yet.
Verification happens in two stages: Stage 1 — a mechanism check on a toy system confirms the claimed mathematical phenomenon reproduces; Stage 2 — a benchmark implements the idea on a real (small) neural network task and compares it against a tuned baseline over 8 paired seeds with a permutation test.
Artifacts
Artifacts unavailable.