A gif of an elaborate automaton playing its miniature dulcimer by striking the strings. It moves its head, arms, eyes and body.

This dulcimer-playing automaton from the 1770s, attributed to clockmaker Joseph Möllinger, mimics human movements to play eight compositions.Credit: M.S. Rau Antiques, New Orleans

The French philosopher René Descartes was reputedly fond of automata: they inspired his view that living things were biological machines that function like clockwork. Less known is a strange story that began to circulate after the philosopher’s death in 1650. This centred on Descartes’s daughter Francine, who died of scarlet fever at the age of five.

According to the tale, a distraught Descartes had a clockwork Francine made: a walking, talking simulacrum. When Queen Christina invited the philosopher to Sweden in 1649, he sailed with the automaton concealed in a casket. Suspicious sailors forced the trunk open; when the mechanical child sat up to greet them, the horrified crew threw it overboard.

“Talos was basically the first killer robot…”

The story is probably apocryphal. But it sums up the hopes and fears that have been associated with human-like machines for nearly three millennia. Those who build such devices do so in the hope that they will overcome natural limits — in Descartes’s case, death itself. But this very unnaturalness terrifies and repulses others. In our era of advanced robotics and artificial intelligence (AI), those polarized responses persist, with pundits and the public applauding or warning against each advance. Digging into the deep history of intelligent machines, both real and imagined, we see how these attitudes evolved: from fantasies of trusty mechanical helpers to fears that runaway advances in technology might lead to creatures that supersede humanity itself.

Arguably the oldest known story of something approximating AI can be found in the eighth-century-bc Iliad, Homer’s epic poem of the Trojan War. In it, Hephaestus, disabled god of metalworking, creates golden handmaidens to help him in his forge: “In them is understanding in their hearts, and in them speech and strength, and they know cunning handiwork”. Hephaestus was also supposedly responsible for the first ‘killer robot’, Talos. A mechanical bronze colossus featuring in the third-century-bc epic Argonautica, it patrolled the shores of Crete, lobbing boulders at invaders.

A woodcut of Hero of Alexandria's automatic mechanical theatre.

A nineteenth-century engraving of Hero of Alexandria’s first-century-AD puppet theatre.Credit: INTERFOTO/Alamy

These fictions were grounded in reality: ancient Greek technologists were astonishingly skilled in mechanics and metalwork. In her forthcoming book Gods and Robots, classicist Adrienne Mayor describes bronze automata that featured at the Olympic Games two centuries before the Argonautica — a leaping dolphin and eagle in apparent flight. In his first-century-ad treatise On Automaton-Making, the mathematician-engineer Hero of Alexandria describes a fully automated puppet theatre that, through a combination of displaced grain, axles, levers, pulleys and wheels, could enact an entire tragedy.

These classical stories reveal how, then as now, humanoid machines were mostly conceived as representing straightforward hopes — the ideal servant who always obeys, the perfect soldier who never tires. But as the influence of Greece declined over the first centuries ad, the West entered a millennium in which the skills of automaton-making were lost, along with the aspirations associated with them. As historian E. R. Truitt describes in Medieval Robots (2015), it was the Byzantine Empire and Arab world that preserved the mechanical arts over those centuries. Around ad 850, for instance, the Banu Musa brothers in what is now Iraq published the Book of Ingenious Devices, which featured automata such as a water-powered organ. Thus, in the West, the ‘otherness’ of mechanical simulacra was compounded. Associated with the exotic and the idea of an ‘infidel’ East, automata were viewed for some time with awe and suspicion.

A woodblock engraving of a brazen head speaking. To the left Miles plays the tambour, to the right two friars are seated.

A 1630 woodcut depicts the story of scholar Roger Bacon’s talking bronze head.Credit: Anon./Wikimedia Commons

The thirteenth century saw a resurgence of Western interest. Automata began appearing at courts as showpieces designed to wow visitors. The Count of Artois at the château of Hesdin in what is now northern France commissioned a cluster of mechanized beasts and androids that interacted with guests, scolding them and or even soaking them with water. At the same time, hints of darker themes began to emerge. A number of great medieval scholars, such as Roger Bacon and Albertus Magnus, were each rumoured to have created a bronze head that could answer any question — a proto-Siri. These stories end badly, with the oracle’s destruction, sometimes by people who mistrust it. In such cautionary tales, the creation of AI is an act of Promethean hubris, semi-divine power no mortal should possess — presaging the story of Descartes’s daughter and Mary Shelley’s Frankenstein (see R. Holmes Nature 535, 490–492; 2016).

The march of mechanical humanoids nevertheless persisted into the great cultural and technological flowering of the Renaissance. Evoking widespread wonder, hydraulic, spring-powered and clockwork automata proliferated in Europe, from mechanized angels in churches to Neptune automata in grottoes. Their mystical connotations began to give way to reflections of cutting-edge scientific developments: Leonardo da Vinci, for instance, drew up plans for a robotic knight operated internally by weights and pulleys.

Over subsequent centuries, Descartes’s view of living things as complex machines inspired new heights in manufacture, and Europe reached peak automaton in the seventeenth to early nineteenth centuries. Master artisans built marvels of art-imitating-life, such as Jacques de Vaucanson’s 1739 Digesting Duck. Sporting more than 400 moving parts in each wing and internal rubber tubing, it appeared to eat, drink and defecate.

Engraving of the famous hoax chess playing automaton the ‘Mechanical Turk’, with speculation as to the internal mechanisms

The eighteenth-century Mechanical Turk, later revealed as a hoax.Credit: INTERFOTO/Alamy

But the duck had no ‘digestive’ mechanism: its ‘droppings’ were actually pre-fabricated pellets ejected from a hidden compartment. A few decades later in 1770, inventor Wolfgang von Kempelen’s infamous chess-playing Mechanical Turk debuted. Although many suspected it was a hoax, nobody could quite work out how they were fooled until a revelatory article in 1857 announced that it was operated by a person hidden inside. Awe over the transgressive nature of such mechanisms began to mingle with fears of deception, as reflected in the fiction of the time. In Prussian Romantic author E. T. A. Hoffmann’s 1816 short story ‘The Sandman’, for example, the protagonist Nathanael is bewitched by the beauty of a woman called Olimpia. The discovery that she is an automaton drives him to suicide.

The imaginative resonance of intelligent machines began to reach its fullest in the twentieth century, when industrialization replaced the rhythms of nature with those of the production line. It was also a time of revolution and mechanized warfare. Against that backdrop, the word ‘robot’ was born in Czech writer Karel Čapek’s 1920 play R.U.R. (Rossum’s Universal Robots). In the very work coining the term, the robots rebel against and destroy their creators. And that narrative of rebellion has proved to be the most potent of all our AI fears, retold repeatedly as technology evolves.

During the cold war space race, the film 2001: A Space Odyssey (1968) gave us HAL 9000, the murderous spaceship supercomputer. With the rise of the Internet, we got Skynet — a defence network that becomes self-aware in the Terminator films (starting in 1984) — and The Matrix (1999), featuring intelligent machines that farm humans whose minds unknowingly inhabit a virtual reality. Now, with AI dominating headlines, we have sophisticated robots again overthrowing their wetware masters, from Ava in the 2015 film Ex Machina to the android amusement-park hosts in the Westworld television series.

The persistent trope of robot revolts reveals the paradox at the heart of our relationship with intelligent machines. We want to create clever tools that can do everything we can do, and more. They will be the perfect oracles, servants, soldiers, even lovers. To fulfil our hopes, they must have attributes such as intellect and agency — minds of their own, superior to ours. But, paradoxically, that is also why we fear HAL and Skynet. The tension lies in our conflicted desire to create beings superhuman in capacity, but subhuman in status.

Our hopes continually threaten to collapse into such fears, but we hope nevertheless. Every robot rebel has its benevolent counterpart, such as C-3PO in the Star Wars franchise or the android child David in Steven Spielberg’s 2001 film A.I. Artificial Intelligence. Both kinds of stories, the hopeful and the fearful, reveal to us our complex emotional responses to AI. Understanding these and their deep history is crucial to making the most of life with intelligent machines.