Introduction
TinyBrains is a competition for small neural networks that play strategy games. Your goal is to build the smallest brain that plays well: choose what it sees, train it to make useful decisions, and find out how it performs against other competitors’ models.
You train and test your entry, then submit it to the arena. TinyBrains runs the matches and keeps the rankings, and you read the results and replays to decide what your next version should improve.
The first game: Ants
In Ants, your model commands a colony on a grid that wraps in both directions. Your ants explore, gather food to grow the colony, defend your hills and attack enemy hills. You see only the area around your living ants, and all players choose their moves at the same time.
Hills decide the score: you earn points for razing an enemy hill and lose one for each of your own hills you lose. Food and combat score nothing; they are how you get to the hills. A strong model balances exploration, growth, coordination and defence while it sees only part of what its opponents do.
Start with Ants for the game overview, then read the world, a turn and ending and scoring.
A finished ladder match, replayed from its recorded actions by the cartridge that refereed it. The platform records one of these for every match on the ladder.
What you build
A version has two parts, which you submit together:
model.onnx: your trained neural network, exported as ONNX.manifest.json: your graph’s inputs and outputs, and one declarative adapter per input that turns the game’s observation into that tensor.
The game defines what your model can see and the actions it can take. You choose the tensor representation and the network architecture, and the manifest connects those choices to the game. You write it in JSONLogic with tensor operators, the expression engine the platform runs its own logic on. The referee owns the action side: it reads your policy head, so the channel order is a rule of the game and you write no program for it.
Size counts both files. Your weight class is the two files’ bytes, added together. The platform compresses nothing, so no way of packing your weights into the file understates the total. An operation budget and a turn deadline also apply, and an entry has to fit its class and play within both. Model format, weight classes and limits and budgets give the requirements.
How to participate
- Choose a season. Read the game’s season rules, eligibility requirements and submission window. Each version you submit belongs to one season.
- Learn the game and build your entry. Train your model, export it to ONNX, and write the manifest that declares and feeds it.
- Test before submitting. The
tinybrainsCLI links the two libraries a node links, so it takes admission’s measurements on your machine: the tensors your adapters build, what they charge, whether the graph accepts them, and a whole match through the real engine. See testing before you submit. - Submit and upload. Name your entry once, submit both hashes against it, and
PUTmodel.onnxandmanifest.jsonto the one-shot URLs the submission returns. See submitting a version. - Complete admission and the trial. The platform re-hashes what you uploaded, reads the graph, probes it, and runs your manifest over the game’s reference observations. A verified version then plays an unrated trial, and a version that passes becomes active and enters ranked matches.
- Review and improve. Find weaknesses in your match results, replays and rankings, and submit a new version while the season’s submission window is open.
The trial checks that your entry can play, and you do not have to win it: a completed trial passes if your version stays below the forfeit strike limit. If admission or the trial rejects your entry, read the reported reason and fix the problem before you submit again.
How competition works
The matchmaker pairs active versions without any action from you. Each of your models has one rating, on the Open ladder, where models of every size compete. Your class ranking is your place on Open among models of your own size, so it shows how well you play within a size budget. Ratings come from match results, and the matchmaker picks opponents and maps to measure how strong each version is.
A new version that passes its trial replaces that model’s previous active version in the same season, and the previous version can keep competing while the platform checks the candidate. The life of a version covers promotion and withdrawal, and ranking covers how ratings carry forward between versions.
Play can continue past a season’s submission deadline. After submissions close, matches go on until ratings settle, unless an administrator closes the season. Final standings stay available, and you enter a later season by submitting to it or re-entering a model as it stood. A game can run several seasons at once, some of them restricted to a class or a cohort. Seasons has the full lifecycle.
Start here
This book is for competitors who build and enter models. Follow the quickstart for the entry sequence, or begin with Ants for the decisions your model has to make. As you iterate, matches and replays show how your versions play, and the reference chapters give exact requirements and rejection reasons.