Richer or More Gates? Fan-In Trade-offs in Learnable Logic Circuits

Youngsung KimNeurIPS 2026

TL;DR

Imagine designing a brain out of pure digital logic gates: under a fixed budget, is it better to buy thousands of simple 2-input gates, or a handful of complex 6-input ones? This paper turns that trial-and-error dilemma into a predictable science, revealing a sharp divide between tasks that crave quantity (like vision) and tasks that require complexity (like arithmetic and parity). Even more surprisingly, it proves that just because a circuit can represent a complex function doesn't mean gradient descent will find it—how you mathematically relax the gates during training can make a 50-percentage-point difference.

What Problem Does This Paper Address?

Learnable logic gate networks are a fascinating alternative to standard neural networks: instead of multiplying floating-point numbers, each "neuron" learns to become a discrete Boolean logic gate (like AND, OR, or XOR). At deployment, the trained network snaps into a pure, blazingly fast combinational logic circuit—zero floating-point math required.

Historically, researchers almost exclusively used 2-input gates (fan-in $k=2$). Why? Because there are only $2^{2^2} = 16$ possible two-input gates, making it trivial to learn a probability distribution over them. Modern FPGAs, however, natively use 6-input lookup tables ($k=6$). Increasing $k$ makes each gate doubly exponentially more expressive (at $k=6$, there are $\sim 10^{19}$ possible Boolean functions!), acting much like a larger kernel size in a CNN.

The catch is parameter cost. Storing a truth table for a $k$-input gate takes $2^k$ parameters. At a fixed parameter budget $P$, increasing $k$ exponentially shrinks your layer width ($N = P/2^k$). Prior work showed how to train larger gates up to $k=6$, but left a glaring question unanswered: when is sacrificing network width for richer gates actually worth it?

Figure 1: The quantity–quality tradeoff in logic gate networks. (a) At fixed parameter budget P, each k-input gate stores 2k coefficients (the number inside each green chip-shaped block), so width is N = P/2k. Higher k yields fewer but richer gates: k=2 produces 16× more gates than k=6, but each computes only degree-2 interactions. (b) Top: how per-gate complexity scales with k (parameters, function space, degree, width at P=256). Bottom: the depth–fan-in bound L ≥ ⌈logk d⌉for four tasks of increasing degree. Low-degree tasks need only L=1 at moderate k; high- degree tasks (Ham8 = Hamming par 8-bit, d=16) require L≥2 even at k=6.

Methods

Enumerating all $2^{2^k}$ gates (like standard Differentiable Logic Gate Networks do for $k=2$) is impossible at $k=6$. Instead, the author extends a Multilinear Extension (MLE) parameterization to arbitrary fan-in $k$. Every Boolean function of $k$ inputs can be uniquely written as a multilinear polynomial with $2^k$ coefficients. During training, neurons operate on continuous values in $[0,1]$ using these $2^k$ coefficients (singly exponential!). At deployment, an exact mathematical bridge called the Möbius transform snaps those learned coefficients cleanly into a discrete Boolean truth table.

Because straight-through estimation (hard snapping during training) starves high-degree terms of gradients, the paper introduces three continuous relaxation selection mechanisms to train the truth-table entries, forming a hierarchy of "coupling":

  1. Sigmoid: Relaxes each of the $2^k$ truth-table entries independently. Scales easily to any $k$.
  2. Multinomial (New): Divides truth-table logits by their shared mean absolute value before applying sigmoid, coupling the entries together without blowing up memory. Scales to any $k$.
  3. Softmax: Takes a convex combination over all $2^{2^k}$ valid Boolean gates. Strongly coupled, but computationally feasible only up to $k \le 4$ (where $65,536$ gates are manageable via chunking).

Datasets

The author evaluates the framework across:

  • 28 synthetic Boolean tasks spanning 8 families—such as $k$-XOR, cellular automata (Rule 30), modular arithmetic, binary/BCD addition, GF(2) multiplication, and Hamming parity—each explicitly annotated with its exact multilinear polynomial degree $d$.
  • 5 real-world datasets: MNIST, CIFAR-10, and SVHN (vision), plus UCI HAR (9-channel sensor data) and DNA Splice junctions (4-channel nucleotide sequences).

Key Insights and Ideas

  • The Two-Regime Taxonomy: Every task has a multilinear degree $d$ (the largest number of inputs that must interact simultaneously). A circuit of depth $L$ and fan-in $k$ can only compute up to degree $k^L$. This creates two distinct worlds:
  • Width-dominated tasks (like image classification) rely on low-degree approximations where seeing more pixels matters most. Here, $k=2$ wins at a fixed budget because it buys $16\times$ more gates (and thus better input coverage) than $k=6$.
  • Degree-dominated tasks (like parity or arithmetic) have high, irreducible degree $d$. If $k^L < d$, no amount of width can ever solve the task—richer gates ($k>2$) are strictly required.
  • Representability $\neq$ Learnability (The Mechanism Gap): Even when $k^L \ge d$ (the circuit can express the answer), training might completely fail at the capacity boundary ($k^L \approx d$). Why? Through a neat Jacobian analysis, the paper proves that softmax has a positive-semidefinite (PSD) covariance structure that actively pulls gradients toward valid gate vertices. Sigmoid has an indefinite Jacobian—updating truth-table entries independently leaves gradients wandering aimlessly when signal is sparse.
  • The Layer-1 Bottleneck & Heterogeneous Circuits: Shrinking layer width $N = P/2^k$ only hurts input coverage at the very first layer (which reads raw data). Deeper layers read from previous layers of size $N$, where fractional coverage ($k/N$) actually improves with higher $k$. Thus, mixing fan-ins across depth gives you the best of both worlds.

Key Results

  • Zero False Positives on the Capacity Bound: Across all discriminative synthetic tasks, networks reach $\ge 95\%$ accuracy if and only if $k^L \ge d$. On 4-XOR ($d=4$) at $L=1$, $k=2$ stays stuck at $50\%$ chance even with 16,000 neurons, while $k=4$ hits $100\%$.
Solvability sharply transitions at the capacity ratio k^L/d = 1, while the mechanism gap separates softmax and sigmoid right at the boundary.
  • A 50pp Mechanism Gap: On 4-bit Hamming parity ($d=8$) with $k=4, L=2$ ($N=1000$), sigmoid stalls at $56.8\%$ accuracy while softmax hits $100\%$ on the exact same architecture. (Given $10\times$–$20\times$ more width and training budget, sigmoid eventually catches up to $99.5\%$, showing the gap is an optimization hurdle).
  • Scalable Mechanisms Shine on Vision: On width-dominated image tasks where neurons are interchangeable, softmax's rigid gate-competition actually dilutes gradients. At $k=4$, scalable sigmoid and multinomial match softmax on MNIST ($\sim 98.2\%$) and CIFAR-10 ($\sim 55.0\%$), and beat softmax by $\sim 3.4\text{pp}$ on SVHN ($66.76\%$ vs. $63.32\%$).
  • Compact Features & Heterogeneous Wins: Placing $k=6$ at Layer 1 and $k=2$ in deeper layers matches uniform $k=2$ accuracy on MNIST using $2.8\times$ fewer neurons. Furthermore, MLE beats prior Differentiable Weightless Neural Networks (DWN) at matched architectures by $+0.25$–$0.60\text{pp}$ on MNIST and $+12.4$–$50.1\text{pp}$ on synthetic tasks.

Limitations and Future Work

  • Mathematical Open Questions: While softmax's PSD Jacobian is proven for all $k$, the indefiniteness of sigmoid's Jacobian is proven analytically only for $k=1$ and verified empirically up to $k=6$. Formalizing the exact trade-off between softmax's helpful coupling and harmful gradient dilution as a function of width also remains open.
  • Hard-Gate Ceiling on Vision: Accuracy on mid-scale vision like CIFAR-10 ($\sim 55\%$) still lags standard real-valued neural networks—a fundamental consequence of pure, unshared Boolean gates and fixed input wiring rather than the MLE parameterization itself.
  • Next Steps: Combining high-fan-in MLE gates with convolutional weight sharing and learnable input wiring (rather than fixed strided or patch patterns) are prime directions to close the gap on larger-scale tasks.

Summary updated

Abstract

In learnable logic gate networks, each neuron implements a $k$-input Boolean function. The dominant setting $k{=}2$ was chosen for tractability. We ask: when does wider fan-in help? At fixed parameter budget, each gate costs $2^k$ parameters, so increasing $k$ exponentially reduces width. Combined with the depth--fan-in bound $L \geq \lceil \log_k d \rceil$, this partitions tasks into two regimes: width-dominated (image classification), where more gates beat richer gates, and degree-dominated (parity, arithmetic), where $k{>}2$ is necessary. Our main finding is that representability does not imply learnability: at the regime boundary, the selection mechanism determines training success at identical architecture, and on width-dominated tasks the scalable mechanisms match or exceed softmax. A Jacobian analysis explains why: the softmax mechanism's positive-semidefinite (PSD) structure gives basin attraction that sigmoid lacks. A multilinear-coefficient parameterization scales these gates beyond $k{=}2$, and snapping returns each to a Boolean truth table (LUT) at deployment; we validate on 28 tasks and 5 real-world datasets.
BibTeX
@inproceedings{kim2026richer,
  author = {Youngsung Kim},
  title = {{Richer or More Gates? Fan-In Trade-offs in Learnable Logic Circuits}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=KzXBuboGel},
}
Figure