1744x Speedup: Compiling a Neural Net to C

2025-05-28

The author trained a neural network with logic gates as activation functions to learn Conway's Game of Life's 3x3 kernel. To speed up inference, the learned logic circuit was extracted and compiled into bit-parallel C code (with optimizations to remove redundant gates). Benchmarking revealed a stunning 1744x speedup compared to the original neural network.

AI