Max Musing
A dovecote, and its pigeons feeding in a sown field. Line drawing in black on white.

Project · 2015

Simulating brains in artificial organisms

A grade 12 research project on evolving neural networks.

“Simulating brains in artificial organisms” was the science fair project I did in grade 12, in 2015, with my friend Evan. It was my introduction to machine learning and the first time I trained a model. That was two years before the paper that introduced the transformer, and long before large language models.

I had been making games since I was six. In a game I wrote the rules for how everything on the screen behaved. In this project we wanted the behavior to be learned.

We built a simulated environment with food growing in it, and put a population of creatures in it that had to move around and find the food. Each creature was controlled by a neural network. The network’s inputs were information about the creature’s surroundings, and its outputs were different kinds of movement. We gave the creatures no rules for finding food. They learned through an evolutionary algorithm: they reproduced and passed on their genes, and their networks changed from one generation to the next.

The technique is called neuroevolution. Most neural networks, including the ones behind today’s language models, are trained by gradient descent, which adjusts a network’s weights directly to reduce its error. Neuroevolution works by selection. The networks that do well pass themselves on with small changes, and over many generations the population gets better at the task. It is still an active area of research. In 2017 researchers at OpenAI showed that evolution strategies could train neural networks to play Atari games and control simulated robots about as well as the reinforcement learning methods in common use. Ours was a high school project and far simpler, but it belonged to the same family of methods.

We built the simulation to run an experiment. We wanted to know how environmental pressure affects the rate at which neural networks learn. In our simulation, pressure came from how much food there was, how quickly it grew back, and how many creatures were competing for it. We varied those and measured how quickly the creatures developed the ability to get around efficiently and collect food.

We found that pressure and the rate of learning were correlated, and that there was an ideal level of pressure at which the networks improved fastest. From that we predicted that a similar process could be used with other kinds of neural networks, well beyond creatures looking for food in a simulation.

We entered the project in the Toronto Science Fair, where it won a gold medal. From there we went on to the Canada-Wide Science Fair, the national fair, which was held in Fredericton that year. There it won a bronze medal.

A few months later I started studying software engineering at McGill, and the year after that Evan and I started Scholarly together. Machine learning has since become incredibly important to what we do at Basedash. The product is built around language models, and much of our engineering goes into getting a model to do a task well and measuring whether it did, which is why we built BI Bench. I did that for the first time in this project. We set a task, measured how well a model learned it, and changed the conditions to see what happened.