Add a training-free, closed-form MNIST robustness baseline - #1
Open
kayuksel wants to merge 1 commit into
Open
Conversation
A weightless random-convolution feature map (discovered by EvoForest, arXiv:2604.19761) + a closed-form GCV-ridge read-out. It is the single-shot, feature-space counterpart of Sheaf-ADMM's per-agent solve (whose x-solver is itself a closed-form ridge): decompose into many local views, solve in closed form, fuse. Fit on clean MNIST-train, it matches a CNN on clean accuracy and exceeds trained models under padding/noise shift, with no gradient steps. Exact evolved kernels are embedded (float16, base64) in robust_mnist_jax.py -- self-contained, no binary. Evaluates on the paper's robustness splits via the repo's ImageDataset. Additive under scripts/.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi — I really admired the Sheaf-ADMM paper; using a cellular sheaf to make heterogeneous agreement precise is elegant. Reading the solver, I noticed the per-agent x-update
(Q + rho*I) x = rho*(z - y) - qis a closed-form ridge, and got curious how much of the reported MNIST robustness a single such ridge already delivers — with no consensus iteration and no training. This PR adds that as a baseline. Happy to adjust the framing or scope.TL;DR
An evolutionary search — no gradient descent, no backprop — discovered a weightless collective of
12 random-feature "genes" that, fused by a single closed-form ridge solve, matches a strong CNN on
clean MNIST and dramatically exceeds trained models under distribution shift. It fits in seconds on a
CPU. We offer it as a baseline that maps the boundary between what needs learned coordination and what
emerges from structure — which we think sharpens exactly where Sheaf-ADMM's iterative machinery earns
its keep.
Results on the paper's own splits (full 50k/10k, via
ImageDataset)No training. The ridge sees only clean
train; everytest*split is a corruption of thedisjoint held-out
testimages — no image is shared between fit and eval, so there is no leakage.Relationship to Sheaf-ADMM (why this is the natural baseline)
The two methods are the same family — decompose the input into many local views, solve each in
closed form, and fuse — and reading your solver made that concrete:
DenseQuadraticXSolversolves(Q + rho*I) x = rho*(z - y) - qviajnp.linalg.solve— a Tikhonov / ridge step. The encoder emitsthe local quadratic
(Q, q); the z-step is the sheaf-constrained consensus; the whole thing isiterated and trained end-to-end.
feature-views (the "genes"), each a different random-conv projection of the image, fused by exactly
that closed-form ridge — computed once, with no consensus iteration and no learned encoder. Evolution
plays the role of expert selection (competing feature families, survivors kept); ridge is the
provably-optimal linear fusion.
So this baseline is a clean ablation of what the trained ADMM iteration buys: the same ridge primitive,
with vs. without the learned spatial-consensus loop.
More broadly it reflects a search-first stance — the learned object is a discovered computation (an
evolved feature program), not a trained weight matrix, and a parameter-light closed-form head is all that's
needed once the right computation exists. Where a mixture-of-experts routes to fixed experts, and your
agents share a fixed per-patch architecture refined by training, here the experts themselves are
searched and invented.
Two axes of decomposition — and we quietly use both
Robustness is redundancy, but there are two orthogonal kinds:
voting → padding / occlusion robustness.
compensate → a different robustness (noise, via the low-pass views).
The shipped model does both: the 12 genes are the feature-space axis, and each gene's adaptive-max
pool over a 2×2 grid is a (coarse) spatial axis — which is exactly why one closed-form solve inherits
your padding robustness (size-invariant spatial pooling) and strong noise robustness (blurred
feature-views). The natural extension — a full patch × feature-view expert grid — is strictly richer
than spatial-only agents and still closed-form; we'd be keen to explore whether it closes the gap on the
hard shifts (rotation / heavy occlusion) where your iterated agents still lead.
Honest by construction
On every reported condition the result is invariant to the random draw — re-seeding the kernels
(
--seed-offset) leaves clean / pad / noise≤0.2 unchanged (verified in__main__); we embed the specificevolved kernels so the extreme-σ tail is exact too. The robustness is a property of the architecture the
search discovered, not a lucky initialization.
What's in the PR
Purely additive, under
scripts/— no changes to existing code, configs, or training paths:robust_mnist_jax.py— the model (JAX, documented). The exact evolved kernels are embedded at thebottom of the file (float16, zlib+base64; ~72 KB of text, no binary, no RNG regeneration).
RobustMNIST().fit(X, y).predict(X).eval_closed_form_baseline.py— evaluates on every robustness split through the repo'sImageDataset,printing accuracy next to the paper's Table-4 numbers.
Run
Provenance
The 12-gene architecture was discovered by EvoForest [arXiv:2604.19761], an evolutionary feature-map
search whose fitness is held-out robustness — selecting from a vocabulary of conv scales, dilations,
pooling geometries, and Gaussian-blur bandwidths. The exact evolved kernels are embedded (float16,
zlib+base64) in
champion_weights.py; re-deriving them from the genome seeds (--seed-offset, numpy)reproduces every reported-condition number, confirming the robustness is a property of the discovered
architecture rather than the specific draw.