If you want an origin story of modern AI you could do worse than pick a chess tournament 30 years ago in Liechtenstein. Here, a 12-year-old schoolboy from Britain played a German chess master. The game was equally matched. The German had experience. The schoolboy, Demis Hassabis, was one of the top players in his age group in the world. He had youth and a future mapped out. He was to be a professional chess player.

They probed, they parried. Around them, the room emptied. Still they played. Then, the dance came to an end. The German trapped his king. Hassabis resigned. Experience had won. But Hassabis had made a mistake. There had been a way to force a draw.

“Immediately, his opponent leapt to his feet,” Sebastian Mallaby writes in The Infinity Machine. “‘Why have you resigned?’ Hassabis remembers him asking.”

Book cover for "The Infinity Machine" featuring a blurry, motion-streaked image of Demis Hassabis wearing glasses, with the title, author, and publisher prominently displayed.

“For the rest of the day Hassabis felt sick to his stomach. But the next morning he experienced an epiphany.” That epiphany? He looked at all these people at the tournament, all these brains focused on black and white pieces of plastic, that could be thinking about ways to help the world. “I thought we were wasting our minds.” So he stopped.

From that day Hassabis and his mind — the Nobel prizewinning mind that now runs AI for Google — went on to do, well, lots of things. He was accepted by the University of Cambridge at 16, but told to wait two years. So on his gap year he helped to program Theme Park, one of the bestselling console and PC games of the 1990s. When he reached 18 the boss of the games company offered him £500,000 to stay. He declined. He had plans.

At Cambridge he learnt the board game Go. He was so good at it that the professor who taught him published his moves in a guide to the game. He also learnt table football. He became, he reckoned, the best player at the university.

Books newsletter

News, reviews, author interviews and suggested reads from our literary editors.

Sign up with one click

There are a lot of anecdotes like that in Mallaby’s book. Early in his life Hassabis’s father passed on the sort of bromide lots of parents tell their children. He said that it didn’t matter if you won or lost, so long as you did your best. Hassabis took it to heart.

Mallaby interviews Hassabis’s friend and colleague Shane Legg. “I don’t think his father meant his comment in quite that literal sense,” Legg reflected. “Like, ‘Try your best’ wasn’t supposed to mean, ‘Try literally to the point of destroying yourself, go absolutely, completely 100 per cent.’ But that’s how Demis understood it.”

In The Infinity Game, Mallaby is not just telling the story of Hassabis. He is also telling the story of AI. Hassabis is a good choice of character on which to hang that tale. It’s not only that he is the most interesting of all the AI bosses. It’s also that — and this feels increasingly pertinent given how much of our future depends on those bosses — he’s not creepy, psychotic or weird.

I first interviewed him when his company DeepMind had just done two things: designed an AI that could win at Atari games and been bought for a nine-figure sum by Google. I was impressed by the achievement and confused as to why Google thought it worth hundreds of millions.

I interviewed him three years later after DeepMind had triumphed at a rather trickier game — Go. He had gone from having his Go games appearing in a handbook to building the finest Go-playing entity the world had seen — so good that, after playing it, the previous best Go-playing entity the world had seen, a human called Lee Sedol, apologised to humanity and quit. Again, it was impressive. Again, I couldn’t understand the attraction for Google.

When, I asked, would he do something useful? His response? They were working on solving something called protein folding. Predicting the shapes proteins made was a 50-year grand challenge of biology. Doing so successfully would revolutionise the world. I remember thinking when he said it that, even couched in English diffidence, it was a bit hubristic.

Then ten years later we chatted again after he got his Nobel prize for solving protein folding. He celebrated the Nobel, by the way, with a poker evening with the lads. “The lads” being some world poker champions and Magnus Carlsen, the greatest chess player in history. Carlsen later told me that Hassabis was “a very stubborn player”. Maybe he is a bit weird after all.

Over the course of hours of interviews in the back room of a north London pub, Mallaby has tried to understand that weirdness and stubbornness. The story that has emerged is one of a soaring vision, and the will to make it happen. But also, it seems to me, the story of a fall — in the Biblical sense.

When Hassabis was working on Theme Park, he read the Culture series of novels by Iain M Banks. They describe a world without want or scarcity in which humanity used its abundance of resources to become an interstellar civilisation. How did it achieve that? By solving intelligence, by making AI.

This is, still, Hassabis’s vision. To achieve it, though, to get DeepMind to where it is, he has had to look down from the stars, to things a little more gutter-like.

Much of the drama in Mallaby’s book hinges on money — with walk-on parts from some of the biggest names in Silicon Valley. Peter Thiel, the Antichrist-bothering venture capitalist, invested early, believing Hassabis was “A+ on the science, and maybe F on the business model”. Elon Musk invested after deciding that AI “would be more consequential than spaceflight”.

Then, at last, came Larry Page from Google. He shared Hassabis’s vision of AI as something more than another technology — with all the responsibility that implies. He bought DeepMind.

At first, in its Space Invader days, DeepMind was a sort of executive toy for Google. Eventually the spin-out became a spin-in. Today, Hassabis runs Google AI. And here, perhaps, comes the fall.

Hassabis had dreamt of a Banks-style utopia. He imagined the development of true artificial intelligence as a grand project, an international collaboration, conducted carefully and with oversight. Today? As he races against OpenAI and the Chinese?

“It doesn’t feel how I imagined,” Hassabis tells Mallaby. It was supposed to be careful. At the release of each new product he thought they would consider the societal effects, weigh up the risk of it going wrong. The risk — he doesn’t shy away from it — of it killing us all. He and his colleagues have a mathematical term for it: P(doom). One way to increase P(doom) is to compete to get things out fast rather than get them right. “The way it’s going, right, this mad rush… I’ll just have to do the best I can. And maybe, being the world, we’ll muddle through somehow.”

There are some lovely anecdotes in this book. Sometimes, though, the detail can overwhelm. Even with the promise that this could be the defining technology of humanity, I’m not sure I need so much on corporate structures and funding rounds. Yet when it comes to recounting the scientific challenges, Mallaby captures wonderfully the tension, the excitement and the joy.

Still, if AI doesn’t end up destroying the world, I’m probably going to regret the time I spent reading about the intricacies of Google’s safety oversight committees. Mind you, if AI does destroy the world, I’m definitely going to regret the time I spent reading about it.

The Infinity Machine: Demis Hassabis, DeepMind and the Quest for Superintelligence by Sebastian Mallaby (Allen Lane £30 pp480). To order a copy go to timesbookshop.co.uk. Free UK standard P&P on orders over £25. Special discount available for Times+ members