NAnts are to Langton's ant what NCAs are to cellular automata: the rule is learned rather than written by hand.
Presented at the ERA Journal Club🛝 Slides🎥 RecordingNAnts Lab interactive sandbox
step 0 ants 0
Erase part of the drawing and the colony repairs it. Pick a creature and stamp another one anywhere; they all share the one field, and each colony is drawn in its own colour.
3 channels are the picture · 13 are the hidden grid state
The ant applies the same fixed filters an NCA does to its 3×3 patch: identity, and a pair of sobel gradients. The gradients are rotated into the direction it faces, so its senses turn with it.
It also knows how far it has walked from the cell it started on. It has no other sense of where it is.
Those 93 numbers go through one small network of 14,483 weights, which returns 19 numbers.
16 of them are added to the cell underneath. The other 3 pick a turn — left, straight, or right — and the ant steps forward.
Repeat six thousand times and a gecko is on the grid.
Pick any emoji and grow that instead. A run takes a couple of hours on a gpu, and you can watch the picture improve while it goes.
It writes a folder under out/ holding the drawing as it
stands, the error curve, and the best network so far. Stop it whenever
you like — the best one is already saved.
Code and full write-up on GitHub →
Starter code for the EmergANT hackathon at ALIFE 2026.
# install
git clone https://github.com/ichko/nants
cd nants && uv sync
# change the emoji at the top, then run it
uv run python starter/my_nants.py
# render what it learned
uv run nants-crowd out/<datetime>
@misc{zhechev2026nants,
author = {Zhechev, Iliya},
title = {Neural Ants: a learned Langton's ant},
year = {2026},
howpublished = {https://github.com/ichko/nants},
}