Worm Uploaded to Computer Learns to Balance a Pole in Simulation

Summary: Researchers translated the nervous system of the nematode C. elegans into computer code and trained the virtual worm to perform a pole‑balancing task, demonstrating that a biological neural circuit can be recreated and adapted in software.

Source: Vienna University of Technology.

Small organism, big insight: the nematode C. elegans is only about one millimetre long, but its simple nervous system makes it uniquely valuable for neuroscience and computational modeling. C. elegans is the only organism whose entire neural wiring has been mapped, allowing researchers to recreate its neural circuit as computer code and simulate its activity precisely.

At TU Wien (Vienna University of Technology), researchers have now used that complete neural map to create a virtual C. elegans and trained the simulated nervous system to balance a pole fixed at the tip of the worm’s tail. This work demonstrates how a compact biological circuit, when reproduced in software, can solve classic control problems through learning.

Recreating the worm’s reflexes as executable code

The adult C. elegans has about 300 neurons, a remarkably small number that nevertheless supports navigation, feeding, and simple sensory responses. Reflexive behaviors such as withdrawing when touched arise from the pattern of neurons and the strengths of their synaptic connections. When that network is faithfully encoded in a computer model, the simulated worm responds to virtual stimuli in ways that mirror the real animal—not because someone explicitly programmed each reaction, but because those behaviors are intrinsic to the neural circuitry.

Lead researcher Ramin Hasani (Institute of Computer Engineering, TU Wien) notes that the worm’s reflexive response is analogous to a standard control engineering problem: balancing a pole. In this control task, a pole mounted on a moving base must be kept upright by moving the base whenever the pole begins to tilt. Similarly, the worm must change its locomotion when sensory input indicates a perturbation. The similarity suggested a concrete experiment: can the biological neural network, implemented as computer code, learn to solve a pole‑balancing task by adjusting synaptic weights alone?

Mathias Lechner, Radu Grosu and Ramin Hasani sought to answer that question without adding neurons or hand‑crafting a controller. Instead, they preserved the original neuron count and connectivity, and allowed the synaptic strengths to change through learning. This approach mirrors natural learning processes, where behavior changes as connections between neurons are strengthened or weakened.

Learning emerges without explicit programming

The team applied reinforcement learning—an algorithmic approach that improves performance through trial, error and reward—to the simulated worm. Over repeated interactions with the virtual environment, the artificial neural circuit adjusted its synaptic weights and gradually acquired the behavior needed to stabilize the pole.

According to Mathias Lechner, the reinforcement learning process optimized the worm’s reflex network so that it could perform the pole‑balancing task robustly. Radu Grosu emphasizes the conceptual novelty: the controller that emerged was not written by hand. No human programmer designed the rules for pole balancing; the capability arose from training the biologically inspired neural model itself.

This result highlights a deep link between biological neural circuits and engineered learning systems. By demonstrating that a compact, biologically derived network can be uploaded to a computer and trained to solve a standard control problem, the study raises questions about the fundamental similarities between brain activity and machine learning architectures. While the nematode itself does not know whether it exists in soil or as code on a disk, the experiment shows that its neural design can be adapted to tasks outside its natural repertoire.

worm diagram
In real life, the worm reacts to touch — and the same neural circuits can perform tasks in the computer. Image credited to TU Wien.
About this research

Institution: Vienna University of Technology (TU Wien).
Research team: Mathias Lechner, Ramin Hasani, Radu Grosu and collaborators.
Publisher note: Originally reported by neuroscience outlets and organized summaries; the underlying study is listed in the proceedings of NIPS 2017.
Image credit: TU Wien.