Showcase: Evolved Logic Circuits
A few dozen logic gates clear Mario 1-1, make a bug walk, and make a snake swim.
Nothing on this page learned neural-network weights. Each controller is a circuit of two-input logic gates (AND, OR, XOR, …), grown generation by generation with neuroevolution (NEAT). The circuits stay small, yet they find their own way to beat a game or move a body.
What is going on
Section titled “What is going on”- Screen and sensor values are converted into bit vectors and fed into a logic-gate circuit
- The circuit’s output bits pick an action such as “run right”, “jump”, or “bend this joint”
- NEAT changes the shape of the circuit itself (which gates exist and how they are wired) every generation and keeps the individuals that do well
What remains after evolution is not a weight table but a logic circuit small enough to read. For several environments you can follow it all the way down to a circuit diagram and Boolean formulas. The mechanics are in How It Works.
Results by environment
Section titled “Results by environment”Press play to watch (muted, looping). The gate count is the size of the circuit evolution found.
An honest scorecard
Section titled “An honest scorecard”Logic circuits do not always win. With the same observations and the same evaluation, we compared them against classic NEAT with real-valued weights (NN). The winner depends on the environment.
| Environment | Logic circuit (DLGN) | NN | Outcome |
|---|---|---|---|
| Flappy Bird | Solved in 2 of 2 runs with 11 gates | Not solved even after 900 generations | Logic circuit wins |
| 2D race car | Solved in 2 of 2 runs with 22-23 gates | Not solved in either run | Logic circuit wins |
| Super Mario 1-1 | 1 of 2 runs cleared (32 gates) | 1 of 2 runs cleared (51 parameters) | Tie |
| Bug walker | Walks with 32 gates (distance 20.6) | Walks with 16 parameters (21.1) | About even |
| CartPole | Solved immediately with 8 gates | Solved immediately with 4 parameters | Tie |
| LunarLander | Failed independent verification | Lands with 12-33 parameters | NN wins |
Gate counts and parameter counts are different units, so they cannot be divided into a ratio. Detailed comparisons, including where the circuits lost, are in Creatures & Robots and Games & Control.
Read next
Section titled “Read next”- Super Mario: the 32-gate clearing circuit, and why it is closer to memorization
- Creatures & Robots: bug, snake, cheetah, biped, quadruped, humanoid
- Games & Control: race car, Flappy Bird, Snake, CartPole, LunarLander, robot arms
- How It Works: how NEAT and logic-gate circuits fit together