Scientists Make ‘Cyborg Worms’ with a Brain Guided by AI

AI and tiny worms team up to get to treats

Illustration of a finger that looks like a worm, looking at a red apple

Thomas Fuchs

Join Our Community of Science Lovers!

Scientists have given artificial intelligence a direct line into the nervous systems of millimeter-long worms, letting it guide the creatures to a tasty target—and demonstrating intriguing brain-AI collaboration. They trained the AI with a methodology called deep-reinforcement learning; the same is used to help AI players learn to master games such as Go. An artificial neural network, software roughly modeled on biological brains, analyzes strings of actions and outcomes, extracting strategies for an AI “agent” to interact with its environment and achieve a goal.

In the study, published in Nature Machine Intelligence, researchers trained an AI agent to direct one-millimeter-long Caenorhabditis elegans worms toward tasty patches of Escherichia coli in a four-centimeter dish. A nearby camera recorded the location and orientation of every worm’s head and body; three times per second the agent received this information for the previous 15 frames, giving it a sense of the past and present at each moment. The agent could also turn on or off a light aimed at the dish. The worms were optogenetically engineered so certain neurons would become active or inactive in response to the light, sometimes prompting movement.

The research team tested six genetic lines in which the number of light-sensitive neurons ranged from one to all 302 the worms possessed. Stimulation had a different effect in each line, making the worm turn, for instance, or preventing it from turning. The scientists first collected training data by flashing lights randomly at the worms for five hours, then fed the data to the AI agent to find patterns before setting the agent loose.


On supporting science journalism

If you're enjoying this article, consider supporting our award-winning journalism by subscribing. By purchasing a subscription you are helping to ensure the future of impactful stories about the discoveries and ideas shaping our world today.


With five of the six lines, including the line where all neurons responded to light, the agent learned to direct the worm to the target faster than if the worm had been left alone or the light had flashed randomly. What’s more, the agent and the worm cooperated: if the agent steered the worm straight toward a target but there were small obstacles in the path, the worm would crawl around them.

T. Thang Vo-Doan, an engineer at the University of Queensland in Australia, who has independently worked on cyborg insects, praised the work for its simple setup—reinforcement learning is flexible, and AI based on it can figure out how to perform complex tasks. According to Harvard University biophysicist Chenguang Li, the paper’s lead author, “one can easily see how it might be extended to harder problems.” Her team is now exploring whether their method can improve electrical deep-brain stimulation to treat Parkinson’s disease in humans by adjusting the voltage used and its timing. One day reinforcement learning plus implants might even give us new skills, Li says—artificial and real neural nets united.

It’s Time to Stand Up for Science

If you enjoyed this article, I’d like to ask for your support. Scientific American has served as an advocate for science and industry for 180 years, and right now may be the most critical moment in that two-century history.

I’ve been a Scientific American subscriber since I was 12 years old, and it helped shape the way I look at the world. SciAm always educates and delights me, and inspires a sense of awe for our vast, beautiful universe. I hope it does that for you, too.

If you subscribe to Scientific American, you help ensure that our coverage is centered on meaningful research and discovery; that we have the resources to report on the decisions that threaten labs across the U.S.; and that we support both budding and working scientists at a time when the value of science itself too often goes unrecognized.

In return, you get essential news, captivating podcasts, brilliant infographics, can't-miss newsletters, must-watch videos, challenging games, and the science world's best writing and reporting. You can even gift someone a subscription.

There has never been a more important time for us to stand up and show why science matters. I hope you’ll support us in that mission.

Thank you,

David M. Ewalt, Editor in Chief, Scientific American

Subscribe