Skip to content

Benchmarks

Numbers measured with this library, laid out across model × dataset × hard accuracy × scale. Every row records when, on what hardware and under which conditions it was measured.

If you want a one-line-per-model overview — headline accuracy, main open problem, world-first verdict — read the Model Zoo first.

Model / configurationDatasethardsoftGatesDate & environment
DLGN (softmax N=2, 6 layers × 8,000, τ=10, unique connections, 200k iter)MNIST 20×200.97840.978748,0002026-07-02 / Modal A10G
DLGN (Hard-ST selection, 6 layers × 64,000, N=2, 50k iter)MNIST 28×280.9802—384,0002026-04-15 / RunPod GPU
DLGN (Soft-Mix selection, same as above)MNIST 28×280.9746—384,0002026-04-15 / RunPod GPU
DLGN (softmax N=2, 6 layers × 16,000, 50 ep)MNIST 28×280.97740.983096,0002026-04-20 / RTX 5090
DLGN (warp N=2, same as above)MNIST 28×280.96110.960596,0002026-04-20 / RTX 5090
DLGN (warp N=4, same as above)MNIST 28×280.95500.956424,0002026-04-20 / RTX 5090
DLGN (softmax N=4, same as above)MNIST 28×280.94540.956624,0002026-04-20 / RTX 5090
BinaryBrain-style (raw + BatchNorm + Binarize, N=6, 10 ep)MNIST0.9483—14,5162026-04-20 / GPU
BinaryBrain-style (same, smaller, 10 ep)MNIST0.9308—3,1822026-04-20 / GPU
DLGN (softmax N=6, 10 ep, gate count matched to the row above)MNIST0.6352—3,1802026-04-20 / GPU
Conv-DLGN (after the softmax16g fix)CIFAR-100.5808——2026-07-05 / GPU
Conv-DLGN (before the fix, 4-entry simplex)CIFAR-100.4921——2026-07-05 / GPU
LogicMixer (20k steps, needs calibration)MNIST0.671——2026-07-10 / A10G
LogicResNet (3 ep, needs calibration)MNIST0.113——2026-07-10 / A10G

Gate counts are LUT counts computed as “layers × layer width” (GroupSum is not included).

2. Parameterization comparison (matched conditions)

Section titled “2. Parameterization comparison (matched conditions)”

MNIST 28×28, 6 layers, τ=10, 50 epochs, bs=128, lr=0.01, seed=0, RTX 5090 (32GB), 2026-04-20.

softmax N=2warp N=2warp N=4softmax N=4
hard accuracy97.74%96.11%95.50%94.54%
soft accuracy98.30%96.05%95.64%95.66%
Discretization gap0.56pp−0.06pp0.14pp1.12pp
Gates96,00096,00024,00024,000
Parameters1,536,000384,000384,000384,000
Training time5.0 min3.1 min2.1 min1.7 min
Training FLOPs/sample16,896,0001,920,0001,440,0002,976,000
Accuracy / K gates0.01020.01000.03980.0394
Accuracy / M parameters0.6362.5032.4872.462

After discretization every method yields the same LUT circuit, so inference performance is identical and the differences only exist during training. For how to choose, see Parameterization; for the experiment itself, see the parameterization study.

Learning rulesofthardConditions
BP (softmax N=2)0.9830.9776 layers, τ=10, 50 ep / RTX 5090
BP (Hard-ST selection)—0.9806 layers × 64,000, 50k iter / RunPod GPU
BP (Soft-Mix selection)—0.975same as above
AP (Akiho Propagation, error broadcast, no backprop)≈0.90≈0.85flat, 4 layers × 16,000, 30 ep

AP is our own learning rule, which updates LUTs directly as weight += error × basis × learning rate without backprop. On fully connected MLPs it is stable at soft ≈0.90 at any depth from 2 to 8 (0.898–0.909). On CNNs, however, it collapses to ≈0.11 (loss pinned at ln 10, i.e. chance), and on RNNs (seq2seq) it never rises above chance (the breaking point lies between sequence length T=1 and T=2). The hypothesis that the collapse is caused by “broken monotonicity” has been rejected: even when projecting onto the monotone cone to force zero monotonicity violations, all three seeds still collapsed. On the other hand, randomizing the sign of the error broadcast destroys learning completely, so sign consistency is essential.

DFA and EGGROLL (evolution strategies) are implemented as learning rules too, but the measurements we can publish today stop at convergence checks on XOR / parity / full adder (hard eval 100%) rather than MNIST-scale results.

For how the learning rules work, see Learning rules (BP/AP/DFA/ES).

ModelTaskMetricValueConditions & environment
LogicGPT L0 (all FP, ceiling)Tiny Shakespeare char LMhard ppl4.94vocab 65, T=64, 20k steps / A10G
LogicGPT L0b (logic in the FFN only)same as abovehard ppl≈7.9same as above
LogicGPT L1 (+ projections as circuits)same as abovehard ppl19.24same as above
LogicGPT L2 (+ XNOR scores)same as abovehard ppl19.39same as above
LogicGPT L3-C (attention fully as circuits)same as abovehard ppl15.54soft ≈12.2, gap 0.29
LogicGPT L3-C + Gumbelsame as abovehard ppl13.31soft ≈12.2, gap 0.107
LogicLSTMdelayed copy (T=8)hard acc1.00≤200 steps on every seed
Elman-style (equivalent to RDDLGN)same as abovehard acc≈0.86still short of it at 800 steps
LogicReservoir (frozen circuit + trained readout)delayed bit recallhard acc1.00every seed, readout only trained
DLGNAttentionTranslatorcopy (seq_len=16)hard acc25.77%soft 71.66%, 9,352 gates / 156,032 params, 50k steps
RDDLGN (re-implemented in this library)copy (seq_len=16)hard acc15.54%soft 22.54%, 10,888 gates / 180,608 params, same conditions

LogicGPT is configured as d=128, 4 heads, 2 layers, T=64, character vocabulary 65, with 33,349 parameters in the logic part and a 545KB checkpoint. Embeddings, LayerNorm, residual additions and the LM head are left in FP.

5. Detection, dense prediction and generative models

Section titled “5. Detection, dense prediction and generative models”
ModelTaskMetricValueConditions & environment
CenterNetLUTMulti-MNIST detection (96×96, 1 object)mAP (hard)0.5425 (epoch 78, pre-fix figure, awaiting re-measurement)soft 0.1791, 13,944 params, 1,000 ep / 11h45m / RTX 5090. The mAP predates the image-scope fix in compute_map
LogicUNet8×8 toy segmentationIoU0.875needs calibration
LogicUNetfull MNIST masksIoU0.373needs calibration
LogicBinaryDiffusionbinary MNISTacc@t10.886denoising margin +0.377 (passthrough baseline 0.499), 4 ep, 3,937 params
LogicVAE (binary latent)binary MNISTreconstruction193.6 nat/imageKL 0.448, active_bits 0.99, 30 ep
LutAutoencoderMNIST reconstructionTest MSE (hard)0.0863 (epoch 63)soft 0.0438, 30,784 gates / 492,544 params / Apple M4 Pro (MPS)
LogicYOLOMulti-MNIST detection—full run not doneverified structurally up to round-trip IoU > 0.8
LogicGAN8×8 binary patterns—open problemdiverges untuned; with stabilization the two players stay balanced

WRIME (sentiment analysis of Japanese social media posts), LUT-based TextCNN. All values are hard.

TaskAccuracyF1ParametersReference (published external values)
Binary classification82%———
8-emotion binary classification83.4%0.367approx. 2.08MDeBERTa-v3-base 87.0% / F1 0.630

The 8-emotion version is 3.6pt behind DeBERTa in accuracy with 1/88 of the parameters, but F1 is 0.263 lower, which is a large deficit (minority classes get missed). Training takes about 15 minutes on a GPU. The reference column lists each model’s published values; it is not a re-measurement under conditions matched to this library.

PathDatasethardNotes
Pruned transfer + STE fine-tuning + int4 QAT + adder-tree loweringMNIST0.9558within 2% of the teacher, exact lowering, 418k LUTs emitted
Same recipe transferred (fan-in 48 / bits 6)Fashion-MNIST0.8196quantization and lowering are data-independent; the fan-in budget needs to be about 1.5× for a harder task
Pruned transfer (fan-in 32, before lowering)MNIST0.9268naive sparse transfer collapses to 0.097 → recovered with pruning + STE
KD from a public ResNet18 (CIFAR-10, 0.9498)CIFAR-10+2.3pt vs. scratchdense DLGN. The gain comes from the capability gap between teacher and student
native DLGN conversion from a weak teacher (MNIST)MNISTbelow scratch (all three paths)a negative result. native DLGN itself reaches scratch 0.9739 with 6–8k gates
KD from a public DistilBERTSST-280.7% (+7.3pt)73.4% → 80.7%, 88.4% recovery, α=0.25 / T=2
Data-free distillation from a public nanoGPTchar LMBPC 2.710.51 bit behind the teacher, with no training data (only teacher-generated text)

8. Results you can reproduce on CPU alone (tutorials)

Section titled “8. Results you can reproduce on CPU alone (tutorials)”

Every tutorial on this site was executed and generated as a scaled-down version that runs start to finish on CPU, no GPU required. Below are the measured values printed on those pages (times are rough; the CPU model is not pinned).

TutorialTaskMeasuredScaleTime
Train on MNISTMNIST 20×20soft 0.8765 / hard 0.86704,000 gates, 4,000 steps~10 min
Build a Hybrid NNsynthetic (2 Transformer blocks)loss 2.0758 → 1.64058,706 real-valued + 16,384 logic params~5 min
Export to HDLXORIR simulate predictions match the labels, Verilog comparison ALLPASS—~10 min
Export a CNN to HDLsmall image classificationhard 0.760, 100% IR agreement, Verilog ALLPASS864 gates after unrolling~10 min
Learning rules (DFA/AP)XORDFA / AP / BP all reach acc 1.00AP stops early at 7 steps, BP takes 600~5 min
End-to-end walkthroughXORhard 1.00 (from step 100 on), Verilog ALLPASSLutLayer 2→16→16~15 min
Appendix: XORXOR1.00 both soft and hard16 gates~5 min
DWN (thermometer)MNIST 20×20 (1,200 bit)test acc 0.9540, max soft-hard logit difference 0.064-entry LUTs, widths (2000,1000)~7 min
BinaryBrain-compatible APIMNIST (7-frame modulation)eval 0.8030 / 0.2110 after 0-1 rounding / 0.6320 after BN recalibration430 LUT6, 27,520 entries~10 min
TextCNNsynthetic bigram-XOR sentiment1.0000 both soft and hard (reached at step 800)a task where unigrams cap out at 0.535~5 min
Attention tourassociative recall and 3 other tasksBoolean / MultiQuery / Positional all 1.0000; Pointer soft 0.9843 / hard 0.83516,144 params each (9,280 for Pointer)~2 min
The logic laddercopy taskhard: L0 1.000 / L1 0.746 / L2 1.000 / L3-C 0.990800 steps~8 min
Logic GPTTiny Shakespeare (vocab 32)val bpc 3.134 (uniform baseline 5.00)48,640 params total, 1,500 steps~10 min
seq2seq (RDDLGN)copy / reverse (vocab 8)copy soft 1.0000 / hard 0.9688, reverse soft 0.9980 / hard 0.941430,080 gate parameters~8 min
LSTM / GRUdelayed copy (8 steps)LSTM / GRU hard 1.0000, Elman 0.5781LSTM 1,024 / GRU 768 / Elman 256 params~5 min
WaveNet (causal conv)periodic bit-pattern prediction1 layer (RF=2) hard 0.8167, 3 layers (RF=8) hard 1.00001,536 gates at 3 layers~5 min
Reservoirparity / delay-d recallparity hard: 1.0000 for k=1,2; 0.8223 for k=3; 0.5723 for k=4. delay-d is perfect for d=0–516,384 frozen + 1,026 readout params (5.9% trained)~5 min
MixerMNIST 28×28 (16 tokens)soft 0.6740 / hard 0.65803,000 steps, depth 2~8 min
ResNet (exact identity)downscaled image classificationhard: XOR residual 0.361 / OR residual 0.299, max identity error 0.0200 gates total~8 min
U-Net (dense prediction)restoring MNIST masks from noisetest IoU 0.5678 (identity baseline 0.4556)1,000 steps, depth 2~6 min
VAE (binary latent)MNIST 14×14reconstruction BCE 43.27 / KL 13.22 / pixel agreement 0.9073 / active bits 1.0070,436 params, 96-bit latent~7 min
GANfour 8×8 binary patternsstabilized: late_g 1.459 / D acc 0.874 / hamming 3.7 (naive: 7.221 / 1.000 / 21.9)mode collapse to 1 of 4 under both settings~8 min
Diffusion8×8 binary MNIST (T=8)acc@t1 0.8508 (blank 0.7606 / copy 0.9380), acc@tT 0.75441,633 params~6 min
Object detectionsynthetic Multi-MNISTmAP@0.5 = 0.3003679 gates, 500 steps~7 min

A benchmark command ships with the library so you can re-measure on the same footing. Give it a recipe YAML or a saved checkpoint and it measures hard eval accuracy, gate count and forward latency, then writes them to JSON.

ターミナルウィンドウ
# From a recipe (short training run → measure the best checkpoint)
uv run python benchmarks/bench.py configs/recipes/logic_xor.yaml
# Measure only latency and gate count without training (hard_acc becomes null)
uv run python benchmarks/bench.py configs/recipes/logic_xor.yaml --skip-train
# Measure a saved checkpoint
uv run python benchmarks/bench.py outputs/<run>/checkpoints/best.pt

Output goes to benchmarks/results/<date>_<name>.json with this fixed schema.

{
"name": "...",
"timestamp": "...",
"config": { "...": "..." },
"metrics": {
"hard_acc": 0.0,
"total_gates": 0,
"latency_ms_b1": 0.0,
"latency_ms_b128": 0.0
},
"env": { "python": "...", "torch": "...", "platform": "..." }
}

The measurement conditions are fixed as follows.

  • Gate count — the sum of neuron counts for LutLayer and internal tree nodes for LutConv2d.
  • Latency — always on CPU, for reproducibility. After 5 warm-up runs, the median of 20 measurements is taken for both batch=1 and batch=128 (only training follows the device setting in the recipe).
  • Environment — Python, PyTorch and the platform are recorded in the JSON.