Want a quick email when a new article is published? Subscribe
A machine learned to fly a plane by trial and error. Here's how, and what it showed.
The first eight pilots crashed within seconds. They weren’t people: each was a tiny computer program, a hundred or so numbers chosen at random, and it had never been told what an aeroplane is, what the controls do or where the runway lies. After enough rounds of practice, the descendants of programs like those were taking off, flying a full circuit round an airfield and landing on the runway centreline, ten times out of ten, in a simulator they had never practised on.
They learned from a score alone, with no flying instructions programmed in.

This page is the short version of the whole project: what it was, how it worked, what came out of it and what the project showed. Each section ends with a link to the article that tells that part properly. You don’t need to know anything about machine learning or flying to read any of it.
It started as a question about crowded skies
I fly light aircraft, and I’ve long been interested in what software people can learn from pilots. In small planes, pilots avoid each other mostly by looking out of the window, which works largely because the sky is big. I wanted to know how well that really works, so I built a simulator of an airfield with planes flying round it, and watched.
Writing a flight simulator used to be about three months of work I couldn’t spare. Instead, AI coding assistants wrote it, with me describing what I wanted, watching it run and saying what was wrong. Later, an AI assistant (Claude Code) also wrote the code for the learning project described here, and ran the experiments, while I decided what to try and what counted as success. That’s worth saying plainly, because it’s part of the story: one person with an idea and an AI assistant can now do experiments like this in weeks rather than years.
Once the simulator could be flown by a program instead of a person, the obvious question followed. Could a computer learn to fly the plane itself, with no lessons and no instructions, just trial and error?
Read more: Introduction tells how the simulator came about, and how each new AI model got better at building it.
The simulator: a sky you can run faster than life
The simulator is called BigSkySim, and it runs in a web browser. It shows an airfield from above, from the side and from the cockpit, with wind, several aircraft types and pilots of different skill.
Two things about it made the learning possible. First, a program can fly the plane through it, and the program only gets what a real pilot would have: rounded readings from the instruments, and a description of what’s out of the window. It isn’t told the plane’s exact position. Second, the part that calculates how the plane moves can run without the screen, thousands of times faster than real time, and it gives exactly the same result every time for the same inputs. That second point turned out to matter enormously, as you’ll see.
You can fly it yourself at dada.ms/bigskysim/fly/.
Read more: BigSkySim covers how the simulator works. If you’ve never flown, Flying a circuit explains what a pilot actually does on a circuit, the job the machine had to learn.
First, a car learned to drive
Before the plane, the project tried the same idea on something simpler: a car on a racetrack. The car could “see” seven distances to the edge of the track, like feelers, and knew its own speed. It controlled the accelerator, brake and steering.
Its “brain” was a small neural network. Despite the name, a neural network here is just a recipe that turns the inputs into outputs by multiplying and adding, using a list of 90 adjustable numbers. Change the numbers and you change how it drives.
To find good numbers, the project used a method borrowed from evolution:
- Make a thousand cars, each with random numbers.
- Let them all drive, and score each one on how far round the track it gets, with a bonus for a fast lap.
- Keep the best few, make slightly altered copies of them, and throw the rest away.
- Repeat.
The first cars crashed almost immediately. Within a few minutes of this, the best car was lapping faster than a hand-written driver, and it had found a racing line nobody had shown it.

The car’s brain knows nothing about the goal, and that is the most important idea in the whole project. Intention goes in only through the score, and the car will exploit any gap in it.
Read more: Teaching a car to drive explains neural networks and the evolutionary method from scratch.
Then a pilot learned to fly
The plane used the same method, with more to learn. One brain couldn’t sensibly do everything, so the flight was split between three specialist pilots, much as a real autopilot has separate modes: one for take-off, one for flying the circuit and one for landing. A few lines of ordinary hand-written code act as a navigator, telling each one where to go and handing over between them.
Each pilot is a small neural network of between 99 and 195 numbers. Each senses what a pilot would sense (speed, height, heading, how far off the runway line it is, how fast it’s sinking) and moves the real controls: the stick, the rudder, the throttle and the brakes. And each was trained by practice and a score. For take-off, the score counted reaching 500 feet, on the runway heading, at a safe speed, without scraping anything on the way.
Practice takes a great deal of flying. A thousand pilots each trying a dozen take-offs per round, over a hundred rounds, comes to around 30,000 hours of flying. At real speed, that’s three and a half years. Running the simulator’s physics directly, without the screen, turned a round of 300 hours of practice into a few seconds.
Read more: Teaching a pilot to fly explains how the pilots work and how they were trained. For the whole project told in order, there are three versions of the same story:
- The walk-through, for executives, with no code and every idea explained;
- The walk-through, with code and the ML explained, for software engineers new to machine learning;
- The walk-through, for ML practitioners, with the details someone who works in machine learning will want.
The results: ten landings out of ten
For the first ten rounds, nothing much happened: no pilot took off at all. Then, quite suddenly, they did. By about round 20, the best take-off pilot climbed away safely in 94% of winds it had never met.
Some things it learned that nobody asked for. In strong crosswinds (wind blowing across the runway, which pushes the plane sideways), the hand-written take-off routine succeeded 6% of the time; the learned pilot succeeded every time. The landing pilot learned to flare, easing the descent in the last few feet so the wheels touch gently, which is exactly what student pilots are taught, although its score never mentioned it.
Joined together, the three pilots flew whole circuits. The final exam was the real simulator in a browser, one plane at a time, with nothing in the code able to see where the plane really was. Ten whole flights; ten stopped on the runway, within 2 metres of the centreline.

Strong, gusty wind can still catch a wingtip on landing, and that’s the next piece of work.
Read more: the three walk-throughs above tell how each result was reached, including the false starts.
The lessons: where the effort went
The learning itself, a few lines of code, worked almost straight away, and nearly all the effort went into three other things. Each of them applies to any team building something that learns, and to plenty that doesn’t.
The practice ground is where the cost lies. The learner needs somewhere to practise, a lot. The first answer was a quick stand-in model of the plane, because the real simulator seemed too slow. The stand-in worked, but quietly cost the pilots some skill, because they learned its errors as well as the flying. Measuring properly showed that the slowness was the browser and the network, not the physics, and the stand-in wasn’t needed at all.
The score is the specification. Whatever you score, the learner optimises, gaps included. The first take-off champion rolled down the runway eight or nine metres to one side of the centreline, take-off after take-off, because its score never mentioned the centreline. Another slammed the controls from stop to stop. Seven times, a pilot found a gap like this, and each fix was a new line in the score.
Parts that pass their own tests can still fail together. The landing pilot passed its own exam 197 times in 200, then failed one landing in six after a real circuit, because the circuit handed it the plane faster and steeper than anything it had practised on. Small tests also flattered weak candidates: on only a hundred tries, a pilot that crashes 3% of the time can look as good as one that crashes 0.5% of the time.
Read more: From the other end lists every lesson, each linked to where it was learnt. The lessons tells the project again with the lessons drawn out as it goes. And What flying can teach us goes the other way: what real flying, rather than the machine, teaches people who build products and software.
Where to start
Most people will want one of these routes. Pick the line that sounds most like you:
| If you are… | Read |
|---|---|
| Curious about flying | Flying a circuit, then BigSkySim, then What flying can teach us |
| An executive or investor | The walk-through, for executives, then From the other end (and What flying can teach us) |
| An engineer new to machine learning | Teaching a car to drive, then Teaching a pilot to fly, then The walk-through, with code and the ML explained, then From the other end |
| Working in machine learning | The walk-through, for ML practitioners, then From the other end |
| Leading a product or engineering team | What flying can teach us, then From the other end, then The walk-through, for executives |
A machine with a hundred numbers can learn to fly if it is told precisely what good flying means, and the same is true of far more than aeroplanes.
Where next
- Never flown? Flying a circuit shows the job the machine had to learn.
- Want the full story without code? The walk-through, for executives.
- Just the lessons? From the other end.
Share this article
Comments
Leave a Comment
All comments are moderated and may take a short while to appear.
Loading comments...