Genotype Circuits: Phenome-Wide Scans of Learned Multi-Locus Logic

Hardware engineers who compile neural networks directly into chip logic have spent years fighting one problem. A neuron whose inputs are a few discrete values can be written out as a complete lookup table, but the table doubles in size with every extra input bit. Their fixes are to keep each unit's inputs few, split wide units into small tables whose outputs are added together, and parametrize units directly over their input combinations. Together these amount to a disciplined way of searching over small, arbitrary nonlinear functions of discrete inputs. Genetics has the same problem under a different name. A phenome-wide association study (PheWAS) fixes one genetic factor and tests it against thousands of clinical diagnoses from electronic health records. It is usually run one variant at a time, because testing combinations of variants (epistasis, where the effect of one variant depends on another) explodes combinatorially. Genotypes are already discrete: each person carries 0, 1 or 2 copies of the minor allele. They are exactly the kind of input these circuit methods were built for.

We propose to train sparse, low-fan-in logic networks on genotypes from a discovery half of a biobank. Each learned unit is a closed-form Boolean function of about three variants. That fixed function is then treated as a new "genetic factor" and run through a standard, calibrated PheWAS on the held-out half, testing whether it associates with diagnoses beyond the additive effects of its own variants. In two sentences: circuit-compilation methods discover a small set of compact multi-locus rules, and an ordinary phenome-wide test on fresh data decides which rules are real and how broadly they act across diseases. The FPGA (a reconfigurable chip built from small lookup tables) is not the point. What we borrow is the model class that the fan-in constraint enforces.

Core Claim

The claim is narrow and testable. Suppose a network is constrained so that every unit reads at most three variants, each encoded as a dominant bit and a recessive bit, so six binary inputs in all, which is exactly one six-input lookup table. Suppose also that wide units are built as sums of such small tables. Then the network produces interaction candidates that are both enumerable and testable, and when those candidates are passed to a held-out PheWAS they replicate at a higher rate than candidates from exhaustive pairwise scans or from tree ensembles under the same testing budget. The fan-in wall that makes monolithic truth tables impossible, the "$2^{N \times B}$" blow-up described for LogicNets, plays the role of a statistical prior. A three-variant table has at most nine populated genotype cells. That is few enough to estimate from biobank-scale data and few enough to hand to a geneticist as a readable rule.

Several parts of the circuit literature are reused directly as method. LogicNets co-designs sparse low-bit networks with their truth-table hardware under an analytical cost model; we reuse its sparse-connectivity, discrete-input training recipe. PolyLUT-Add splits a wide neuron into $A$ small sub-neurons combined by an adder, with 2.0x–13.9x lookup-table reduction and up to 2.7% accuracy gain at $A=2$. Read genetically, that architecture is an additive model over small interaction blocks, so we adopt it as the output layer. Light Differentiable Logic Gate Networks parametrize a gate over its $2^N$ input combinations rather than over all $2^{2^N}$ Boolean functions. For genotypes this is a saturated genotype-cell model: one learnable value per multi-locus genotype. Align Forward, Adapt Backward uses hard selection in the forward pass so the trained network is exactly the discrete one, reporting a 0% selection gap. This matters for us because the rule we test must be the rule the network actually uses. Finally, Two-Stage Unit Tying clamps uncritical gates to constants, cutting post-synthesis lookup tables by up to 48.3%. We use it to prune units a trait does not need, which exposes which interaction units are shared across traits.

All of these papers evaluate only on vision, synthetic data or physics and security benchmarks. None has touched genotypes or diagnosis matrices; the file found no published work joining "phenome-wide" with lookup-table or logic-gate terms.

Research Program

The first component is the encoding and architecture. Each variant becomes two bits: carries at least one minor allele, and carries two. A first-layer unit reads three variants, which is six bits and one lookup table. It is trained with input-wise parametrization and hard-forward estimation, so at the end its behaviour is a lookup over at most nine genotype cells. Units feed a multi-output head in the style of PolyLUT-Add. Each clinical phenotype receives a sum of a small number of unit outputs plus additive per-variant terms, and the model is trained jointly on a panel of phecodes (expert groupings of ICD billing codes into roughly 1,500–1,800 disease definitions) and lab traits.

The additive per-variant path is essential. Without it, units would simply relearn main effects, and every "interaction" would be additive signal in disguise.

The second component is connectivity. The state explosion here moves from table size to wiring. With a few thousand input variants there are billions of possible triplets, and the random fixed wiring LogicNets uses would almost never hit a true interacting set. We therefore learn the wiring, following the connectivity optimization of Enhancing LUT-based Deep Neural Networks Inference through Architecture and Connectivity Optimization. The input space is restricted to a candidate set of 2,000–5,000 variants chosen in the discovery half, from loci with marginal association to any trait in the panel. We state openly that this is the component most likely to fail, and the simulations below are designed to measure it.

The third component is the decisive statistical step. Once training on the discovery half is finished, each surviving unit is frozen as a Boolean genetic factor. On the held-out half we run a PheWAS of that factor across all phecodes using carrier-based saddlepoint approximations from fastSPA. fastSPA controls false positives under case-to-control ratios as extreme as 1:600, and it is fast because its cost scales with the number of carriers. Our Boolean factors are often rare, which suits this well.

Each test conditions on the additive dosages of the unit's own variants, ancestry principal components and standard covariates. A significant result therefore means the combination explains that phenotype beyond its parts. Because each factor is fixed before the test data are seen, the p-values are valid in the ordinary sense. This resolves the objection raised in the file that logic networks have no significance framework: we do not ask the network for p-values at all. Replication then moves to an independent cohort: BioVU to Mass General Brigham, following the design of Dennis et al., or UK Biobank to an external cohort.

Two clinical lessons from the file shape the phenotype side. Dennis et al. found that LDL genetic signal is stronger in pre-statin draws, so lab traits are taken from pre-treatment measurements where possible. Johnson et al. showed effect sizes differing across ancestry groups at PNPLA3, so held-out tests are stratified by genetically inferred ancestry to check whether learned rules transfer.

Baselines

The naive reference is a standard single-variant PheWAS over the same candidate variants, run with fastSPA on the held-out half with identical covariates. It sets the count of associations any additive analysis finds and the null calibration we must match. Dey et al. report the cost scale for such scans: 1.09 CPU-years for 10 million SNPs across 1,500 phenotypes with fastSPA-2 versus 117 with Firth's test. No reported result was found on Lacuna for detection of epistatic or multi-locus PheWAS associations on any of these cohorts, so our comparisons are internal and matched.

The strongest classical competitor is exhaustive scanning of all pairs of candidate variants, plus triplets within loci, using fastSPA with interaction terms. It is the obvious non-learned route to the same question. To make the comparison fair, it uses the same held-out data and covariates and the same multiple-testing correction, with the family-wise error rate controlled at 0.05 over however many hypotheses each method submits. This is exactly where the learned method should win or lose: it submits hundreds of hypotheses, where the exhaustive scan submits millions.

The strongest learned competitor is gradient-boosted trees on the same two-bit encoding, trained on the discovery half with depth capped at three and a matched tuning budget. Their depth-three paths are extracted as candidate Boolean factors and pushed through the identical held-out PheWAS. Trees are themselves small logic functions, so this is the honest foil. The comparison uses the same number of submitted candidates.

For predictive value we also report the multi-disease network score of netCRS where its inputs are available. It propagates genotypes over a variant-disease graph and reports a 28.29% AUC improvement over polygenic score alone and 6.26% over polygenic score plus covariates for myocardial infarction. We ask only whether adding replicated logic factors improves on polygenic score plus covariates.

Three ablations isolate the proposal's ingredients. Removing the additive per-variant path tests whether interaction units just absorb main effects. Replacing learned wiring with LogicNets-style random wiring tests whether connectivity learning is essential. Raising fan-in to four variants tests whether the three-variant limit is a useful prior or merely a hardware artifact. "Beating" a baseline means more held-out associations that also replicate in the external cohort, at equal or better null calibration.

Why not just…?

Why not just scan all pairs with fastSPA and stop there? For pairs within a few thousand variants this is feasible and fully calibrated, and it is a real threat for two-way interactions. Its weakness is multiple-testing cost: millions of pairs push the significance threshold so low that modest interactions become undetectable, and triplets are out of reach. The simulation study below measures power as a function of interaction order and effect size. If exhaustive pairwise scanning matches our method on planted two-way effects and the advantage appears only for three-way effects, we will report that narrower claim.

Why not just use gradient-boosted trees, which are already logic? This is the most serious alternative. It could plausibly match us, since depth-limited trees produce conjunctions over discrete inputs. The differences we test are three. Our units are arbitrary functions over genotype cells rather than axis-aligned splits, so they can express patterns such as "exactly one of these variants" that trees need several paths to encode. Our additive path explicitly separates main effects from interactions. And our units are shared across the phenotype panel, so pleiotropy is built into the model. The matched-budget comparison of replicated associations settles the question; if trees tie, the contribution shrinks to the encoding and testing pipeline, and we will say so.

Why not a dense neural network, or a topic model, and interpret it afterwards? Attributions from a dense network are not fixed closed-form factors, so they cannot be handed to a held-out test without redefining them. MixEHR-SAGE improves discovery by making phenotypes continuous across 350,469 UK Biobank participants, but it acts on the phenotype side, not the genotype side. We view it as complementary: its topic scores can serve as additional outcomes in our held-out scan.

Proposed Experiments

We begin by checking our training code against the circuit literature. We retrain a LogicNets-style model on jet substructure classification and confirm accuracy near the reported 71.8% for the JSC-L configuration.

The simulation study uses real UK Biobank genotypes with synthetic phenotypes. We plant two-way and three-way interactions of varying effect size, allele frequency and pleiotropic breadth, then measure how often the planted variant set is recovered, held-out power at a fixed family-wise error rate, and null calibration on permuted phenotypes (genomic inflation near 1). A decisive negative outcome is learned wiring that fails to recover planted three-way sets that the exhaustive triplet scan finds within loci.

The real-data study trains on half of UK Biobank and BioVU across a panel of about 50 phecodes and lab traits chosen for known heritability; Dennis et al. found 335 of 939 lab traits heritable. We then run held-out PheWAS of each frozen unit across the full phenome and replicate hits in Mass General Brigham or the other biobank.

The main outcomes are the number of conditionally significant, replicated interaction associations; how many diagnoses each replicated factor touches, as a measure of pleiotropy; transfer across ancestry strata; and incremental AUC over polygenic score plus covariates. A secondary report compiles the surviving circuit to an FPGA and records lookup-table counts after unit tying, as a check that the rules are compact, with no claim of clinical latency value.

The proposal succeeds if learned three-variant circuits yield replicated associations that neither exhaustive scanning nor depth-matched trees produce under the same testing budget. It fails, informatively, if they do not.