Scientists at Harvard University have developed a swarm of more than 1,000 tiny robots that can follow simple rules to automatically assemble themselves into predetermined shapes. According to the scientists, the robots are considered to be a milestone in the development of collective artificial intelligence.

Commands can be sent to 1,024 little bots simultaneously via an infrared light, after which they begin to blink at one another and gradually arrange themselves into complex patterns, the scientists say. Each of the small robots, named “Kilobots,” measures only a few centimeters across and stands on three pin-like legs.

“Just as trillions of individual cells can assemble into an intelligent organism, or a thousand starlings can form a great flowing murmuration across the sky, the Kilobots demonstrate how complexity can arise from very simple behaviors performed en masse,” the scientists said, in a statement.

Each robot moves using two vibrating motors, allowing it to slide across a surface on its legs. An infrared transmitter and receiver allow the robot to communicate with its neighbors and measure their proximity.

The scientists compared the tiny robots to army ants that can link together to form rafts and bridges to cross difficult terrain. The scientists also took the example of cuttlefish, which change color at the level of individual cells to help the entire organism blend into its surroundings. The study was published in the journal Science.

“Biological collectives involve enormous numbers of cooperating entities—whether you think of cells or insects or animals—that together accomplish a single task that is a magnitude beyond the scale of any individual,” Michael Rubenstein, a research associate at Harvard University and the study’s lead author, said in a statement.

The Kilobots, which do not require micromanagement or intervention once they receive an initial set of instructions, have four robots among them acting as the origin of a coordinate system, while the rest of them receive a 2D image to mimic. In addition, the Kilobots also correct their own mistakes. For example, if a robot moves off-course, nearby robots sense the problem and cooperate to fix it.

“Increasingly, we’re going to see large numbers of robots working together, whether its hundreds of robots cooperating to achieve environmental cleanup or a quick disaster response, or millions of self-driving cars on our highways,” Radhika Nagpal, Fred Kavli professor of computer science at the Harvard School of Engineering and Applied Sciences, said in the statement.