~/satyajit

bispectrum: a symmetry-invariant layer with no weights, and why it keeps the shape the power spectrum throws away

mdjsonmcp

2026-11-25 · 21 min · equivariance · geometric-deep-learning · computer-vision · signal-processing · geometry · pytorch

A 3:21 narrated explainer, drawn in code. Every number and picture in it is this article's own; the sources are below.

› transcript

A digit drawn on a sphere. Turn the sphere, and a network trained on upright digits changes its mind. The power spectrum gives the same answer at every angle. The wrong one. The bispectrum reads a two every time. I'm Phasor. Let's see what a shift does to a signal's Fourier coefficients, and which products of them it cannot touch. Slide a periodic signal. Each Fourier coefficient turns by its own frequency times the shift. The first harmonic turns once, the second twice, the third three times. The power spectrum keeps each coefficient's length and drops its phase. So it never moves. That is why it is invariant. It is also why it is lossy. This twin has the same three lengths and different phases. Same power spectrum, different signal. Multiply the first and second coefficients by the conjugate of the third. Their turns cancel exactly, so the product holds still, and it still remembers how the harmonics line up. The selective version keeps n products, not every pair. The first gives the mean coefficient. The second gives the length of the first harmonic. Its phase is the one thing no invariant can know, because it is the shift. Set it to zero. Now each remaining product has exactly one unknown, the next coefficient. Walk up the spectrum. The whole signal comes back, in one fixed pose. That is completeness, with a linear number of entries. Why it matters. The full bispectrum of one 256 by 256 image is 17 GB. The selective one is 0.5 MB, and the image is still determined up to a shift. The library does this for seven group actions: rings, circles, image grids, polygons, cube rotations, the disk and the sphere. Each one is a module with no weights. On the sphere, completeness is a conjecture. The evidence is reconstruction: from 380 numbers, a solver rebuilt every digit they tried, up to a rotation. Rotated Spherical MNIST. The bispectrum plus an MLP gets 95.8 percent. The spherical CNN and the tensor-product network get 96.1. At batch 16 on an H100, 0.257 milliseconds, against 1.02 and 93.7. The power spectrum, just as invariant, stops at 77.7. I ran the authors' script on a 3090. 95.74 against 96.11, the power spectrum at 77.90, the planar CNN at 13.47. Same table, one seed. The layer has no weights. The MLP behind it has more parameters than the spherical CNN. With less data, the learned spherical CNN wins. And on the sphere, selection only saves a factor of three. The speed comes from skipping learned tensor products. Triple products cancel the symmetry and keep the phases. A linear subset of them is enough to rebuild the signal. Invariant, complete, and small enough to use. See you next time. Every source is in the full article. I'm Phasor. Bye!

Why read this

Essentialtop 10%

Derives why the bispectrum is complete, runs the library's C_n formulas live, and reproduces the Spherical MNIST table and invariance on an RTX 3090.

  • Checked against the source
  • Interactive explanations
  • Runs on a consumer GPU

Developer tools & infraMITResearch tool

How this was scored
Is it new?
2 of 3: A real new idea, method or capability
Can I trust it?
3 of 3: Reproduces the headline result, or shows from primary files it is wrong
Can I run it?
2 of 3: Open code or weights with real limits
Will I understand it?
3 of 3: Mechanism carried by interactives built from real code or data
Can I act on it?
2 of 3: A concrete recipe, numbers or comparison
Will it last?
2 of 3: A reference for a year or more
Does it affect many?
1 of 3: A specialist community
Only here?
2 of 3: A teardown or measurement few others did

Score 76 of 100, ranked 53 of 784 rated articles. Each question is answered 0–3 by hand, and a 3 is rare. How articles are scored

Johan Mathe posted on 24 November: "Today we're introducing bispectrum: symmetry invariance, training-free, as a PyTorch library! Our layer without any weights + a small MLP lands within 0.3 pp of equivariant networks on rotated Spherical MNIST, and runs up to 360x faster!" The paper is arXiv 2605.07270, "bispectrum: Selective G-Bispectra Made Practical", by Johan Mathe (Atmo), Adele Myers Lantow and Nina Miolane (UC Santa Barbara) and Simon Mataigne (UCLouvain). It went up on 8 May, the version I read is v2 from 9 November, and it is a NeurIPS 2026 paper. The code is MIT and installs with pip install bispectrum. The authors also wrote an interactive explainer, which is good and worth a visit.

The teaser from the authors' post: a CNN on pixels changes its answer as the digit turns, the power spectrum gives the same wrong answer at every angle, and the bispectrum reads 2 every time. The rebuilt S at the end is the case for completeness. Video from @johmathe's post on X.

I read the paper, the library's cn_on_cn.py and the Spherical MNIST experiment code at commit fbda28f (11 November), then ran the library and the authors' experiment scripts on an RTX 3090. The mechanism is old and lovely, the library is careful, and the headline numbers check out, against the paper's own tables and in my run, with two qualifications I get to below: the "weightless" layer is followed by an MLP with more parameters than the spherical CNN it is compared with, and the sphere is where completeness is conjectured rather than proven.

geometric-intelligence/bispectrum@fbda28f · snapshot 2026-11-25

Fast, exact, lossless symmetry invariants for PyTorch.

stars
19
license
MIT
branch
main
forks
1
open issues
0
source
1.2 MB
commit date
2026-11-11
source by language
Python1.1 MBShell82.0 kBTeX11.0 kB
bispectrumequivariancegeometric-deep-learninggroup-theoryinvarianceneurips-2026pytorchspherical-harmonics

Read at fbda28f (11 November 2026). The cyclic module is src/bispectrum/cn_on_cn.py (forward, _forward_selective, invert); the sphere is src/bispectrum/so3_on_s2.py; the Spherical MNIST run is experiments/spherical_mnist/train.py with model.py and baselines.py; end-to-end latency is experiments/tooling/benchmark_smnist_models.py.

GitHub REST API, 2026-11-25 — branch, commit, commitDate, createdAt, description, forks, homepage, languages, license, openIssues, pushedAt, stars, topics

The problem with an invariant that forgets

A digit on a sphere is still the same digit after you rotate the sphere. A classifier should not care, and there are three usual ways to make it not care. The thread puts the first two plainly: "Data augmentation: the network learns invariance approximately and only from the poses it has seen. Max pooling / power spectrum: exact, but lossy. Different inputs can end up with the same features." The third is an equivariant network (a spherical CNN, a tensor-product network built with e3nn) that carries the rotation through every layer and then still needs an invariant pooling step at the end. The paper's introduction makes the point that the common pooling choices, norm, gate and max, are all incomplete: "max pooling over GG keeps only the largest response across the group, so two feature maps that share their maximum but differ everywhere else are mapped to the same invariant descriptor."

So there are two properties you want from the last step, and the paper's explainer states them as one line:

β(x)=β(y)  ⟺  y=g⋅x for some g∈G.\beta(x) = \beta(y) \iff y = g \cdot x \text{ for some } g \in G.

The right-to-left direction is invariance: every pose of a signal gets the same features. The left-to-right direction is completeness: two signals get the same features only if one is a transformed copy of the other. Max pooling and the power spectrum have the first. The bispectrum has both.

Shifts, and the phase that the power spectrum drops

Start with the simplest group, the cyclic group CnC_n acting on a periodic signal of nn samples by shifting it. Write the discrete Fourier transform as

Fk=∑t=0n−1f(t) e−2πikt/n.F_k = \sum_{t=0}^{n-1} f(t)\, e^{-2\pi i k t / n}.

Shift the signal by ss samples and every coefficient picks up a phase that depends on its own frequency:

Fk  ↦  e−2πiks/nFk.F_k \;\mapsto\; e^{-2\pi i k s / n} F_k .

The magnitude does not change, so the power spectrum ∣Fk∣2|F_k|^2 is invariant. That is the whole trick behind "Fourier magnitudes" as an invariant feature, and it is why the power spectrum is lossy: the phases carry where each harmonic's peaks sit relative to the others, and the power spectrum throws every one of them away. Two signals with the same ∣Fk∣|F_k| and different phases have the same power spectrum and can look nothing alike.

The bispectrum keeps a product of three coefficients whose shift phases cancel:

βk1,k2=Fk1 Fk2 Fk1+k2‾.\beta_{k_1,k_2} = F_{k_1}\, F_{k_2}\, \overline{F_{k_1+k_2}} .

Under the shift, the three factors pick up e−2πik1s/ne^{-2\pi i k_1 s/n}, e−2πik2s/ne^{-2\pi i k_2 s/n} and e+2πi(k1+k2)s/ne^{+2\pi i (k_1+k_2) s/n}, and those multiply to 1. So β\beta is invariant, exactly. What survives is the phase combination φk1+φk2−φk1+k2\varphi_{k_1} + \varphi_{k_2} - \varphi_{k_1+k_2}, which is a statement about how the harmonics line up with each other, the thing the power spectrum lost. This is Tukey's bispectrum from 1953; the paper's contribution is not the idea.

Why a linear subset is enough

The full bispectrum on CnC_n has a coefficient for every pair (k1,k2)(k_1, k_2): CnonCn(selective=False) keeps the upper triangle, n(n+1)/2n(n+1)/2 entries. That is where the quadratic cost in the thread comes from. But you do not need all the pairs to pin the signal down. The library's selective forward keeps exactly nn entries, the index set {(0,0),(0,1),(1,1),(1,2),…,(1,n−2)}\{(0,0), (0,1), (1,1), (1,2), \dots, (1,n-2)\}, and its inversion shows why those suffice. From cn_on_cn.py:

# k = 1,...,n-2: beta_{1,k} = fhat[1] * fhat[k] * conj(fhat[k+1])
beta[:, 2:] = fhat[:, 1:2] * fhat[:, 1 : n - 1] * torch.conj(fhat[:, 2:n])

Read it as a chain. β0,0=∣F0∣2F0\beta_{0,0} = |F_0|^2 F_0 gives F0F_0. β0,1=F0∣F1∣2\beta_{0,1} = F_0 |F_1|^2 then gives ∣F1∣|F_1|. The phase of F1F_1 is the one thing no invariant can know, because it is the shift itself, so the inversion sets it to zero ("Phase of fhat[1] fixed to 0 (absorbed by the character action indeterminacy)", in the code's comment). After that, every β1,k=F1FkFk+1‾\beta_{1,k} = F_1 F_k \overline{F_{k+1}} has one unknown, Fk+1F_{k+1}, and the recursion

Fk+1=(β1,kF1 Fk)‾F_{k+1} = \overline{\left(\frac{\beta_{1,k}}{F_1\, F_k}\right)}

walks up the spectrum. nn numbers in, the whole spectrum out, up to the shift you gave away. The recursion divides by every FkF_k up to k=n−2k = n-2, which is the "generic signal" condition in the completeness theorem (Mataigne et al., ICML 2024): a signal with a Fourier coefficient that is exactly zero falls outside it, and the code raises instead of producing infinities.

The widget runs those formulas on a 16-sample signal, the library's selective forward and its invert, computed in your browser. Shift the signal and the Fourier needles spin, each at its own rate, while the power-spectrum bars and all 16 bispectrum dials hold still. Switch to the twin, which I built by keeping every ∣Fk∣|F_k| and moving the phases: the power spectrum matches the original bar for bar, the waveform is different, and the bispectrum says so. "Rebuild from β" inverts the 16 numbers and draws the waveform it gets back, and it always lands in the same pose whatever shift you set: completeness and invariance at once. One detail the code's docstring is candid about: the recursion recovers the spectrum up to a phase ramp Fke−ikθF_k e^{-ik\theta} over k=0,…,n−1k = 0, \dots, n-1, "in the complex signal model even if the original signal was real-valued". For a real signal the widget applies one more ramp, δ=−arg⁡Fn−1/n\delta = -\arg F_{n-1} / n, which makes the spectrum conjugate-symmetric again, and what comes out is an integer cyclic shift of the original.

From shifts to other groups

For a non-commutative group the Fourier coefficients are matrices, one per irreducible representation, and the scalar product becomes a Kronecker product with a Clebsch–Gordan change of basis (the paper's Equation 2). The structure is the same: a product of transforms whose group action cancels. The selective idea carries over too. For finite groups, Mataigne et al. (2024) find a linear-size complete subset by a breadth-first search over the group's table of which irreducibles appear in each tensor product. The paper's example: the octahedral group drops "from 576 to 172 scalars". For images on a disk under rotation, Myers Lantow and Miolane (2026) keep one product per disk-harmonic coefficient, O(m)O(m) instead of O(m5/2)O(m^{5/2}), and prove that complete as well.

The library wraps seven of these as torch.nn.Modules named {Group}on{Domain}, with no trainable parameters, the transform tables precomputed as buffers, and the same three methods on each: forward, fourier and invert.

The seven group actions, one module each. The thread: 'Each one is an nn.Module that has been CUDA-optimized.' Video from @johmathe's post on X.
ModuleGroup acting on domainOutputProven complete?
CnonCnCnC_n on itself (cyclic shifts)selective + fullyes, generic signals
SO2onS1rotations of the circleselective + fullas CnonCn on its samples (it subclasses it)
TorusOnTorusTd\mathbb{T}^d, translations of images and gridsselective + fullyes
DnonDndihedral group DnD_nselectiveyes
OctaonOctachiral octahedral group OO (24 rotations of a cube)selectiveyes
SO2onDiskrotations of the diskselectiveyes
SO3onS23D rotations of the sphereselective + fullconjectured

What the selective trick saves, in bytes

The thread's size claim is "one 256x256 image = 2.1B entries = 17 GB", against 0.5 MB selective. That is an image on the torus: ∣G∣=2562=65,536|G| = 256^2 = 65{,}536 translations. The full upper triangle is 65,536×65,537/2=2,147,516,41665{,}536 \times 65{,}537 / 2 = 2{,}147{,}516{,}416 entries, and at 8 bytes per complex64 entry that is 17.2 GB. The selective version keeps one entry per translation, 65,536×8=524,28865{,}536 \times 8 = 524{,}288 bytes, 0.5 MB. My arithmetic, the post's numbers, the same answer. The paper's Appendix B states the ratio as "32,768× fewer coefficients" at that size, which is (∣G∣+1)/2(|G|+1)/2 rounded down.

Two log-scale charts. Left: entries against image side from 8 to 256 pixels; the full bispectrum line rises steeply and crosses a 24 GB GPU line near 256, while the selective line rises slowly. Right: entries against band limit L from 1 to 64 for the sphere, full and selective, as numbers and as terms, with the signal's own size as a dashed line just below selective.
Full against selective, on the torus (left) and the sphere (right). 'One 256 × 256 image: 17 GB of full bispectrum, 0.5 MB of selective bispectrum, and the signal is still determined up to its symmetry.' Image from @johmathe's post on X.

On the sphere the saving is much smaller, and that matters for reading the speed numbers. The paper's Table 5: at band limit L=15L = 15, the classifier's setting, the augmented selective spherical bispectrum has 380 real entries and the full one 1,124. Three times fewer. The asymptotic win is Θ(L2)\Theta(L^2) against Θ(L3)\Theta(L^3), a factor of LL, not of the pixel count.

The sphere, where the paper adds something

Spherical harmonics play the role of frequencies on S2S^2. A signal band-limited at degree LL has one coefficient vector Fℓ\mathbf{F}_\ell of length 2ℓ+12\ell + 1 per degree, and a rotation multiplies each by its Wigner D-matrix. The power spectrum here is ∥Fℓ∥2\lVert \mathbf{F}_\ell \rVert^2 per degree: 16 numbers at L=15L = 15, which is the "power spectrum (16 features)" row in the paper's capacity table. The bispectrum couples three degrees (ℓ1,ℓ2,ℓ)(\ell_1, \ell_2, \ell) through Clebsch–Gordan coefficients (Equation 5), and the full set has Θ(L3)\Theta(L^3) entries.

The existing completeness theorem (Kakarala, 2012) needs full-rank matrix coefficients, and on the sphere they are vectors, so it does not apply. The paper's new piece, the augmented selective spherical bispectrum, is built degree by degree so that each new degree is pinned down by the ones below it. At each degree it takes 2ℓ+12\ell + 1 bispectral entries (one per real unknown in Fℓ\mathbf{F}_\ell), adds some self-couplings and up to seven "CG-power" scalars ∥(Fℓ1⊗Fℓ2)∣ℓ∥2\lVert(\mathbf{F}_{\ell_1} \otimes \mathbf{F}_{\ell_2})|_\ell\rVert^2, and drops entries that vanish identically on real signals. The test suite checks that the Jacobian of each degree's entries has full rank 2ℓ+12\ell + 1 for 4≤ℓ≤204 \le \ell \le 20. It also has to tell a signal from its mirror image, which is not a rotation of it; the paper shows the first entry that can is β2,3,4\beta_{2,3,4}, and includes it.

Full rank is local, so it does not prove completeness. The evidence is reconstruction: at L=15L = 15, a degree-by-degree Levenberg–Marquardt solver recovered all 32 targets they tried (8 digits in two orientations each, and 16 random band-limited signals) from the 380 numbers alone, invariants matched "to better than 10−1310^{-13}", and "No run found two signals in different orbits with equal invariants." Plain gradient descent from noise recovered 9 of 16 digits and none of the random signals, which the authors put down to the optimizer. Their conclusion is careful and I would keep it that way: "This does not prove completeness. We conjecture that Φsel\Phi_{\mathrm{sel}} is generically complete."

Two rows of six spheres seen from above. Top row: target digits 0 to 5 drawn on the sphere. Bottom row: the same digits reconstructed from 380 invariants, rotated onto the target, with relative image errors of 0.002 for five of them and 0.004 for the 3.
Spherical MNIST digits (top) and their reconstructions from the 380 augmented selective bispectrum coefficients alone, rotated onto the target (bottom). The remaining error is the grid interpolation of the alignment rotation (bispectrum paper, Figure 2).

Spherical MNIST: 95.8% and the latency behind "360x"

The experiment: MNIST digits stereographically projected onto a 64×12864 \times 128 grid on the sphere, trained upright and tested on randomly rotated digits (the NR/R protocol of Cohen et al., 2018), five seeds. The bispectrum model computes the 380 invariants at L=15L = 15, applies sign(x)log⁡(1+∣x∣)\mathrm{sign}(x)\log(1+|x|) to the real and imaginary parts (760 channels, half of them identically zero by parity, which the paper admits it keeps "for simplicity"), and feeds a three-layer MLP. The comparisons are matched in size and run in the same pipeline.

A table of five models with parameters, rotated test accuracy and latency. Selective bispectrum + MLP: 230K, 95.8%, 0.257 ms. Spherical CNN: 155K, 96.1%, 1.02 ms. Tensor-product network: 386K, 96.1%, 93.7 ms. Power spectrum + MLP: 11K, 77.7%, 1.68 ms. Planar CNN: 185K, 13.4%, 0.20 ms.
The thread's results table: rotated-test accuracy and H100 latency, batch 16, spherical grid in and logits out. Image from @johmathe's post on X.
Three panels. (a) Test accuracy under three protocols for five models: the planar CNN drops to 13% when trained unrotated and tested rotated; the others hold steady near 96%, except the power spectrum near 78%. (b) Rotated-test accuracy against H100 latency on a log axis from 0.1 to 100 ms: the bispectrum star at 230K parameters sits near 0.26 ms, the S2CNN near 1 ms, the tensor product near 94 ms. (c) Rotated-test accuracy against training examples from 100 to all: S2CNN+BN leads at small sizes, the bispectrum catches up at the full set.
Accuracy under each train/test protocol, accuracy against latency, and accuracy against training-set size (bispectrum paper, Figure 4).

The numbers, from the paper's Section 6.2 and Figure 4:

Two qualifications. First, "without any weights" is true of the layer, not of the model: the MLP behind it has 230K parameters against the spherical CNN's 155K. The comparison is fair (the paper calls them matched in size), but the bispectrum model is not the small one. Second, the learned network is more sample-efficient. S2CNN leads at every training-set size below the full set, "by 13.0 pp at n=100n{=}100". A fixed invariant plus an MLP has to learn from 760 numbers what a spherical CNN learns from the grid with rotation built into every filter. The paper says this itself in "When not to use the bispectrum", which is a section I wish more papers had.

Where the speed comes from is also worth getting right. The selective layer is fast, but at L=15L = 15 it is only three times smaller than the full set; what makes the model 364 times faster than the tensor-product network is that it computes the invariant once, with no learned tensor products, and then runs a small dense MLP. The tensor-product network does Clebsch–Gordan products in every layer. The paper's Table 3 makes the per-layer point: SO3onS2 at L=16L = 16 takes 0.63 ms with autograd (0.20 ms in inference mode, where it replays a CUDA graph) and the full version 53.61 ms. Appendix B adds that at batch 16 the cheap modules are "bound by host-side kernel launches rather than by the GPU", which is why the consumer RTX 4090 is 1.5 to 1.7 times slower than the H100 on most of them and slightly faster on the sphere.

Beyond digits

On finite groups the paper puts the selective bispectrum at the end of GG-equivariant CNNs in place of max or norm pooling. On PatchCamelyon (C8C_8) it matches every baseline. On OrganMNIST3D (the octahedral group) it beats max pooling on the same backbone by 5.0 pp at full data, 78.54% against 73.56%. Across 46 seed-level comparisons it is "never significantly worse than any baseline". That is a modest, honest result: it is a better pooling layer, not a new state of the art, and its gain should grow with how much the pooling it replaces throws away (max keeps one of ∣G∣|G| values, so more is lost at ∣G∣=24|G| = 24 than at 8).

The same run on an RTX 3090

I ran the library on an RTX 3090 (24 GB, CUDA 13.0, PyTorch 2.11.0, bispectrum 0.5.1 from PyPI, the experiment code at fbda28f). Everything below is one job, about 20 minutes of GPU time, plus a short CPU check of the inversion, and one seed where training is involved. The paper averages five.

Rotated Spherical MNIST, trained upright, seed 42, the paper's tuned settings (bispectrum batch 32 at lr 10−310^{-3}, S2CNN+BN batch 32 at lr 5×10−35 \times 10^{-3}, 30 epochs, best-validation checkpoint), through the authors' own train.py:

ModelParametersUpright testRotated testPaper, rotated (5 seeds)Training time
Selective bispectrum + MLP229,77095.70%95.74%95.8%259 s
S2CNN + BatchNorm154,75096.99%96.11%96.1%453 s
Power spectrum + MLP11,46677.87%77.90%77.7%80 s
Planar CNN184,77899.18%13.47%13.4%147 s

That reproduces the paper's Figure 4 to within a tenth of a point on every row, including the shape of it: the bispectrum loses nothing between upright and rotated (95.70 against 95.74), the spherical CNN gives up 0.88 points, and the planar CNN falls off a cliff. I did not train the tensor-product network; at the latency below, 30 epochs would have taken hours.

End-to-end latency (the authors' benchmark_smnist_models.py: spherical grid in, logits out, float32 inference, batch 16, median), with the tensor product at the paper's 24 channels:

ModelRTX 3090Paper, H100
Selective bispectrum + MLP0.669 ms0.257 ms
S2CNN + BatchNorm3.297 ms1.02 ms
Tensor-product network190.146 ms93.7 ms
Power spectrum + MLP5.014 ms1.68 ms
Planar CNN0.523 ms0.20 ms

On the 3090 the bispectrum model is 4.9 times faster than the spherical CNN and 284 times faster than the tensor-product network (my arithmetic: 3.297 / 0.669 and 190.146 / 0.669). So the ordering holds and the gap to e3nn is the same order of magnitude; "360x" is an H100 number. One oddity: the power-spectrum model, which computes less, is seven times slower than the bispectrum model here. Version 0.5.1 wraps the bispectrum modules' forward in a captured CUDA graph (@cuda_graphed in cn_on_cn.py and its siblings), and the power-spectrum baseline is plain PyTorch, so it pays every kernel launch. That is the launch-bound behaviour Appendix B describes, showing up as a ranking.

Per module, at the paper's Table 3 sizes and batch 16. The authors' device script in inference mode gives, in milliseconds: CnonCn 0.061, TorusOnTorus 0.049, DnonDn 0.073, SO2onDisk 0.111, SO3onS2 0.307, OctaonOcta 0.082. All under a millisecond, as claimed, and several are below the H100 row of the README, which was measured on 0.4.x; I would not read a 3090-beats-H100 result into that, only that 0.5.1 graphs more of the work. With autograd on, as in training, my own torch.utils.benchmark timing is slower and still small: 0.536 ms for CnonCn, 1.442 ms for SO3onS2, 2.689 ms for OctaonOcta. The full bispectrum, where the library has one, is where the cost shows: CnonCn at n=128n = 128 takes 27.551 ms for its 8,256 entries, SO3onS2 at L=16L = 16 196.327 ms for 1,341.

Invariance, checked numerically. For each finite group I applied every group element (127 shifts on C128C_{128}, 77 translations on a 32×3232 \times 32 torus, all 63 rotations and reflections of D32D_{32}, the 23 non-identity rotations of the octahedral group, the three quarter turns of the disk) and took the largest relative change in the output. In float32 it is at most 5.4×10−75.4 \times 10^{-7}; in float64, at most 9.7×10−159.7 \times 10^{-15}. That is "invariant up to floating-point error", literally. On the sphere, a rotation about the pole is an exact shift of grid columns, and it moves the 380 features by 3.3×10−73.3 \times 10^{-7}. A random 3D rotation has to resample the grid, and that moves them by up to 2.5%, which is the "few percent, the grid's resampling error" the post's code example warns about: the invariance is exact, the rotated input is not.

The power-spectrum collision. On a 128-sample random signal I kept every ∣Fk∣|F_k| and replaced the phases with random ones. The two power spectra agree to 4.0×10−164.0 \times 10^{-16} relative; the selective bispectra differ by 0.85 relative. The widget above, at full size.

The inversion. I fed the library's own CnonCn.invert four random signals each at n=16n = 16 and n=128n = 128, in float64 on CPU. Undoing the phase ramp e−ikθe^{-ik\theta} gives back the original spectrum to 2.5×10−152.5 \times 10^{-15} relative at n=16n = 16 and 1.9×10−141.9 \times 10^{-14} at n=128n = 128. Applying the widget's extra ramp and searching the cyclic shifts, the rebuilt real signal matches the original to 8.9×10−168.9 \times 10^{-16} and 3.1×10−153.1 \times 10^{-15} absolute. Completeness on the cyclic group is not a statistical claim; this is just the recursion, run.

Sizes. TorusOnTorus(ns=(256, 256)) returns 65,536 complex64 entries for one image, 524,288 bytes, and the full count is 2,147,516,416 entries, 17,180,131,328 bytes by the formula; I did not try to allocate that. The full bispectrum at 64×6464 \times 64, which the library does compute, has 8,390,656 entries, the paper's number for that size, and takes 67 MB.

A pooling layer I would try first

The library is the contribution, and it is a good one. The bispectrum has been around for seventy years and keeps getting re-implemented, one group and one codebase at a time; seven groups behind one tested interface, sub-millisecond, with invert where it exists, is what makes it something you try in an afternoon instead of a reimplementation project. The sphere result is the scientific novelty, and it is stated as a conjecture with reconstruction evidence, which is the right status for it.

Would I use it? For a pipeline where the symmetry is known and exact (signals on a ring, rotations of a sphere, the 24 rotations of a voxel grid) and the network is small, yes: it is a free, complete invariant, and the widget above is the whole argument for preferring it to a power spectrum. For a problem where the symmetry is approximate, or where data is scarce, the paper's own data-efficiency curve says a learned equivariant network still wins. And on a band-limited sphere at L=15L = 15, remember that "selective" buys you a factor of three in size; the 360× is about skipping learned tensor products, not about the selection.

Cite this article

For attribution, please use the following reference or BibTeX:

Satyajit Ghana, "bispectrum: a symmetry-invariant layer with no weights, and why it keeps the shape the power spectrum throws away", ai.satyajit.si, November 2026.

bibtex
@misc{ghana2026bispectrumselectivegbispectra,
  author = {Satyajit Ghana},
  title  = {bispectrum: a symmetry-invariant layer with no weights, and why it keeps the shape the power spectrum throws away},
  url    = {https://ai.satyajit.si/articles/bispectrum-selective-g-bispectra},
  year   = {2026}
}
share