Sound Pruning and a Capacity Law for Weightless Classifiers

Weightless neural networks are classifiers with no multiply-accumulate arithmetic. They store each class's training data as bits in lookup tables, and they classify by counting how many table entries a test input "hits." They train in one pass and run in a few clock cycles on an FPGA. They also share a failure mode with every associative memory, meaning any system that stores patterns and recalls the nearest one. As more training data is written, the tables fill with ones, every class starts to hit on every input, and discrimination collapses. Compressed variants that replace tables with Bloom filters (compact, hashed set-membership structures that can return false "yes" answers) reach this point sooner. So far the field has treated saturation empirically. Practitioners tune table sizes by trial and error, prune nodes with data-driven scores, and disagree about whether Bloom false positives help or hurt.

This note proposes two linked contributions. The first is an exact, data-free pruning rule borrowed from the logic-programming idea of discarding facts that cannot affect a query's answer. A table entry that is set identically in every class contributes the same amount to every class's score. It therefore cannot change the predicted class, and it can be deleted with zero change to any prediction. The second is a signal-to-noise capacity law, built in the style of classical associative-memory analysis. It predicts, from per-node occupancy statistics measured on real data, where a weightless discriminator's accuracy falls off a cliff. It also predicts how far the exact pruning pushes that cliff out by removing the shared load that drives saturation. The result is a principled answer to how large each table must be and which entries must be stored.

Background and the gap

A WiSARD-style weightless network binarizes the input (for example by thermometer encoding), splits the bits into fixed random groups of $n$, and uses each group as an address into a RAM node, which is a table of $2^n$ bits. Training sets the addressed bit to one in the discriminator, meaning the set of nodes, belonging to the example's class. At test time each discriminator sums its hits, and the largest sum wins. The architecture's strengths are documented by França et al., who report training orders of magnitude faster than deep ensembles. Bacellar et al. make these networks differentiable, and Bacellar et al. run them as 1–3 cycle FPGA controllers. That work also flags a "capacity bottleneck" on HalfCheetah-v4 without characterizing it.

Two papers attack the memory problem directly, and they motivate this proposal. Santiago et al. replace each table with a Bloom filter. Their Bloom WiSARD cuts Letter memory from over 10 GB to about 91 KB, matches standard WiSARD on MNIST (91.5% vs 91.7%), and argues that false positives act as a dropout-like regularizer. Susskind et al. prune whole RAM nodes using a data-driven response score and recover accuracy by fine-tuning. On MNIST they go from 373 KiB at 98.49% to 112 KiB at 97.91%. Neither paper models saturation as a capacity phenomenon. The Bloom paper's "false positives regularize" claim sits in direct tension with the associative-memory results discussed below, and Susskind et al.'s pruning is lossy, works only at node granularity, and requires labelled data plus retraining.

The associative-memory literature constrains what a theory must look like. Mimura and Okada supply the method we reuse: a self-consistent signal-to-noise analysis that locates the Hopfield critical load near $0.138$. Marcus and Westervelt show that recall degrades gradually, with basins fracturing well before the nominal capacity limit. They also show that removing the right connections can stabilize the memory without costing capacity. Chou proves exponential capacity for Kanerva's sparse distributed memory, which is structurally a weightless address-decoding memory. Exponential Capacity of Dense Associative Memories maps the "retrieval cliff" in dense memories. Both of these last two analyses assume independent random patterns, and both note that the bounds degrade unpredictably on structured data. A weightless classifier on MNIST or Adult is exactly such a structured-data memory, so we cannot import their numbers. We can only import their method.

Logic-program pruning supplies the pruning principle. Fierens et al. build a Relevant Ground Program, the subset of ground facts and rules that can influence a query, before compiling ProbLog programs. This shrinks formulas by up to 90% with no change to the answer. Erdem et al. get a similar sound reduction to about 14% of a 3.6M-rule biomedical program through dependency reachability. The defining property is soundness: the pruned program gives the same answer. Nothing in the weightless literature has a pruning rule with that property.

Core Claim

A trained weightless discriminator can be read as a ground logic program whose facts are $\mathrm{mem}(j, a, c)$, meaning "address $a$ of node $j$ was written for class $c$." The classification query asks which class maximizes its count of satisfied facts. Relative to that query, any address whose class-indicator vector is constant across classes is irrelevant, because it shifts every score equally. This generalizes to the counter variant of WiSARD, where tables store write counts. Subtracting the per-entry minimum across classes from every class's counter preserves every argmax exactly, including ties. We call this common-mode elimination. It is the weightless analogue of a relevant ground program: sound, computed from the trained tables alone, needing no data, and applicable at single-entry rather than whole-node granularity.

The claim that makes this more than bookkeeping is that the shared entries are precisely the load that saturates memory. For example, on images, background pixels produce the same addresses for every digit class. Our hypothesis is that removing these entries reduces the effective load on each Bloom filter enough to move the accuracy cliff substantially. A capacity law computed from measured occupancy should predict both where the cliff sits and how far elimination moves it.

To state the law, let $D_{jc}$ be the number of distinct addresses stored for class $c$ in node $j$ after elimination. Let $m$ be the Bloom filter size in bits and $k$ the number of hash functions. The standard false-positive rate of such a filter is

$$p_{jc} = \left(1 - e^{-k D_{jc}/m}\right)^{k}.$$

For a test input of true class $c$, the score margin over a rival class $c'$ is a sum over nodes of hit indicators. Each term contributes a true-hit probability $q_{jc}$, which reflects genuine generalization, plus false-positive and genuine-overlap terms for the rival. Treating the node contributions as weakly dependent, which is the signal-to-noise approximation of Mimura and Okada, gives a predicted pairwise error

$$P(\text{error}_{c \to c'}) \approx \Phi\!\left(-\frac{\sum_j \big(q_{jc} - r_{jcc'} - (1-r_{jcc'})\,p_{jc'}\big)}{\sqrt{\sum_j \sigma^2_{jcc'}}}\right).$$

Here $\Phi$ is the standard normal cumulative distribution, $r_{jcc'}$ is the measured probability that a class-$c$ test address is genuinely stored for $c'$, and $\sigma^2_{jcc'}$ is the per-node variance of the margin term. Every quantity is estimated from training occupancy and a held-out split, not from random-pattern assumptions. This is what lets us address the structured-data gap that Chou leaves open. The law also says when false positives are harmless and when they are destructive. They act as mild noise while $p$ is small relative to the gap between true-hit and overlap rates, and they cause collapse once $p$ closes that gap. This turns the Santiago-versus-Marcus disagreement into a measurable threshold on load per bit, $D/m$.

Research Program

The work has three parts.

The first part implements common-mode elimination for binary and counter WiSARD and for Bloom WiSARD. For Bloom WiSARD, elimination has to happen before filter insertion, because once addresses are hashed into a filter the constant entries can no longer be identified. We will verify bit-exact prediction equivalence for the table versions on every benchmark. We will then extend the rule to an approximate tier, removing entries set in all but one class, since those entries carry information about a single class. This tier is no longer exact, and we will report its accuracy cost separately rather than folding it into the exact result.

The second part fits the capacity law. For each dataset we sweep tuple size $n$, training-set size, filter size $m$, and hash count $k$. We record the per-node statistics above, predict accuracy from the formula, and compare against measured accuracy. The test is whether the law locates the cliff, defined as the load at which accuracy falls by more than five points from its plateau, to within one step of the sweep grid.

The third part turns the law into a sizing rule. It assigns each node the smallest $m$ that keeps its predicted margin above a target. This yields non-uniform filter sizes chosen without any retraining.

Baselines

The naive reference is uncompressed WiSARD with the same tuple mapping. It fixes the accuracy ceiling and shows the raw memory footprint at each $n$.

The strongest existing pruning method is response-score pruning with straight-through fine-tuning from Pruning Weightless Neural Networks. On MNIST it reports 98.49% at 373 KiB and 97.91% at 112 KiB after 70% pruning. On Satimage it reports a 79% size reduction for about a 3% accuracy drop. We will rerun their method on our identical tuple mappings and splits, with their fine-tuning budget, and compare accuracy at matched memory. Beating it means matching or exceeding their accuracy at equal or smaller memory without using their fine-tuning step. The stronger version of the result is that common-mode elimination composed with their pruning beats their pruning alone, which would show the two remove different redundancy.

The strongest compression baseline is Bloom WiSARD from Santiago et al.. It reports 91.5% on MNIST against 91.7% for standard WiSARD, and Letter memory near 91 KB. We will run it with the same $m$ and $k$ grid, with and without elimination before insertion. Success means a visible rightward shift of the cliff, specifically equal accuracy at a smaller $m$, at matched hash cost.

Counter thresholding, often called bleaching, is the usual practitioner's fix for saturation. It ignores entries whose count falls below a tuned threshold. We include it with the threshold tuned on validation. It is the most direct competitor for the saturation question.

As an accuracy-per-memory reference from a different regime, we include differentiable weightless networks from Bacellar et al., trained with their estimator. They report an average rank of 2.5 on the AutoGluon tabular suite. We report their accuracy at matched LUT budget, alongside their much higher training cost.

The key ablation removes only the elimination step while keeping everything else, including sizing by the capacity law. This isolates whether the gain comes from removing shared load or simply from better filter sizing. A second ablation sizes filters uniformly, to isolate the value of the law-derived sizing.

Why not just…?

Why not just use response-score pruning, which already removes uninformative parts of the network? Response-score pruning in Susskind et al. removes whole nodes, needs labelled data to score them, and needs fine-tuning to recover the accuracy it loses. A node can be mostly common-mode yet carry a few highly discriminative entries. Node-level pruning must either keep all of that node's waste or lose those entries. Common-mode elimination works per entry and is exactly lossless. The real risk is that the two methods remove largely the same redundancy. The composition experiment settles this: if elimination adds nothing on top of their pruning at matched memory, the pruning half of this proposal is redundant, and the contribution reduces to the capacity law.

Why not just make the Bloom filters bigger or tune the hash count? That is exactly what the capacity law tells you how to do. Without the law, the choice is a grid search per dataset. Bigger filters also spend memory on entries that cannot affect any decision. The uniform-sizing ablation and the elimination ablation measure each effect separately. If tuned uniform filters match law-sized, eliminated filters at equal total memory, we will report that the practical gain is small, and the law stands only as an explanatory result.

Why not just use bleaching thresholds, the standard fix for saturated weightless memories? Bleaching is a serious threat, because it targets saturation directly. However, it is lossy, it requires a tuned threshold, and it acts on counts rather than on cross-class redundancy. A frequently written entry that is shared by all classes survives bleaching even though it is useless for classification. We expect the two to be complementary. The experiment that decides this is bleaching versus elimination versus both, at matched memory, on Adult and MNIST, where shared background addresses should be common. If bleaching alone dominates, we will say so.

Why not just train a differentiable weightless network, which learns which inputs matter? Differentiable networks reach strong accuracy, but they train 3–7× slower than conventional networks according to Bacellar et al., and they give up one-pass training. That one-pass training is the property that makes classical weightless networks attractive for on-device and federated learning. Our question is how to size and prune one-pass memories soundly. The differentiable network is reported as the accuracy-per-LUT reference, not as the thing to beat on training cost.

Proposed Experiments

We use MNIST, FashionMNIST, UCI Letter, Satimage, Adult, and Banana, which are the datasets on which Susskind et al. and Santiago et al. report results. We add CIFAR-10 as a stress case, where structured correlations are strongest and weightless accuracy is known to lag. Metrics are test accuracy, stored bits, the fraction of entries removed by exact elimination, and the error between predicted and measured accuracy along each sweep.

The first decisive check is exactness. Eliminated table WiSARD must reproduce every test prediction of the original. Any mismatch is a bug, not a result.

The second check is cliff location. Across the $D/m$ sweep, the predicted cliff must fall within one grid step of the measured cliff on at least five of the seven datasets. Failure on the correlated datasets would mean the weak-dependence approximation breaks down. That would itself be informative about the structured-data limitation noted by Chou.

The third check is the cliff shift. Elimination before Bloom insertion should reach Bloom WiSARD's accuracy at a strictly smaller $m$.

The fourth check resolves the regularization dispute. We test whether the accuracy-versus-$p$ curve shows a regime where moderate false positives slightly improve held-out accuracy, as Santiago et al. claim, followed by the collapse the associative-memory analyses predict. We also test whether the boundary between these regimes matches the law's predicted threshold.

A negative outcome on the third check, with success on the second, would still deliver a validated capacity law for weightless memories on real data.