Birds don’t always flap their wings to fly; sometimes they soar by taking advantage of rising columns of warm air known as thermals. With large wingspans, they can stay aloft for hours while expending minimal energy. Exactly how they do it — navigating tiny changes in unpredictable air currents — isn’t well-known. But scientists are now using artificial intelligence to learn their tricks, and hopefully, they can teach our aircraft to do the same.

As described in a paper published this week in the journal Nature, researchers from universities in the US and Italy used machine learning to train an algorithm to control a glider to navigate thermals. It’s not the first time artificial intelligence has been used for this task (Microsoft published similar work with gliders last year), but it’s the first time that data from real flights has been used to update and improve an AI’s performance in the field.

The research could help us understand how real birds navigate thermals

The work suggests that future autonomous aircraft could take advantage of thermals, rather than relying on noisy and energy-intensive powered flight. It also suggests that AI might be able to help us figure out exactly how soaring birds do what they do so well. When training their algorithm, the scientists found that some factors — particularly vertical wind acceleration and side-to-side torque — were important when teaching the system glider to navigate smoothly. The same, they suggest, might be true for birds.

To create their AI system, the researchers used reinforcement learning. This is a training tool that works like trial and error. The system is given a number of inputs, and it’s asked to act in a way that maximizes a certain reward. It starts without any knowledge of the task, and it learns how to behave correctly over time. In this case, the input consisted of flight information, like the glider’s pitch, yaw, groundspeed, and airspeed. The reward it was seeking was to maximize its climb rate (the speed with which it gained height).

The researchers trained their algorithm first in a simulator and then in real life. They performed some 240 flights in the skies over Poway, California, which lasted, on average, about three minutes. They steered their glider to a fixed location using a manual controller, and then the AI took over, using the air currents from thermals (which can travel as fast several meters a second) to climb into the sky.

“In good situations the glider could stay aloft for about 45 minutes,” Gautam Reddy, one of the paper’s authors, tells The Verge by email. “We had some flights where the wind was too strong for the glider to handle and we had to get it back prematurely [and] we had a few with eagles attacking the glider and a few with eagles and the glider soaring together.”

There’s a lot more work to be done in this area before we can use AI to control soaring gliders for real work. Thermals are just one type of updraft that soaring birds take advantage of. Others are created by air currents spilling over mountain ridges or by the collision of air masses in “convergence zones” — places like shores and desert boundaries. In other words: just because AI can ride a thermal, doesn’t mean it’s ready to take on the varieties of wind that the world has to offer.

However, Gautam and his colleagues are confident about the future. They say it wouldn’t be too hard to create autonomous gliders that use AI to navigate thermals over long distances. “We are looking forward to doing this in the future,” says Gautam. Such craft could be used for long-term scientific surveys and for ambitious projects, like tracking bird migrations wingtip to wingtip. By learning how to fly like birds, we can learn more about their lives as well.