ҹ1000

A skilful primer makes sense of the mathematics beneath AI’s hood

Anil Ananthaswamy's Why Machines Learn: The elegant maths behind modern AI explores the mechanics of the AI revolution, but doesn't examine its ethics
Members of the medical staff at the Elithair clinic conduct an artificial Intelligence analysis of Felix Hofmann's scalp and his hair roots.
Machine learning is key to developments in medical diagnostics
Mario Heller/Panos Pictures


Anil Ananthaswamy (Allen Lane (UK); Penguin Random House (US))

As someone who writes for a living, I routinely feel assaulted by the onslaught of generative artificial intelligence. How long before I become a mere massager of prompted paragraphs, the joy of creation abandoned in favour of more, faster, cheaper?

Anil Ananthaswamy’s Why Machines Learn: The elegant maths behind modern AI won’t tell me or you about the future of AI in our society, nor what we should do about it. But whether you regard the algorithms used in facial recognition, healthcare decision-making tools or ChatGPT as an enemy or a way to improve your life (or profits), you will come away from this book knowing more about how they work.

Ananthaswamy is a science journalist, and a former New Scientist editor. This book came about after he got so excited while learning how ChatGPT’s mathy engine creates outputs that he felt – as many science journalists do – an immense need to share that with us. The mathematics behind AI is simple, he says, the kind “one learns in high school or early in college”, which makes it even more amazing that it can do so much. He illustrates the book with equation after equation as he explains exactly how we got here.

We begin in 1958 with the Perceptron, a simple classifying machine that eventually gave rise to neural networks. It was also an early instance of AI hype, as the US Navy (which partly funded it) bombastically pledged that the Perceptron “will be able to walk, talk, see, write, reproduce itself and be conscious of its existence”.

It didn’t, of course, but the Perceptron, modelled after a single neuron in the human brain, could learn to do some things, such as identify letters of the alphabet and sort unhealthy blood pressure readings from healthy ones in a patient dataset.

From there, we learn the mathematics of sorting, filtering, encrypting and identifying that algorithms now perform in countless real-world settings, even before the rise of word and image-generating tools. Think working out efficient delivery routes for packages, sorting penguins into species based on physical traits or how machine learning is used to check X-ray images for cancer.

It is a hard needle to thread: the book has to catch a non-scientist up on mathematics they may not have seen in decades, then tell a story. We relearn vectors, those quantities that have both size and direction. And we review matrices, derivatives and probabilities. But you soon get to much stranger conceptual spaces, where the equations turn into mostly letters and symbols implying multiple, even infinite, dimensions.

Ananthaswamy is a gentle teacher, repeating concepts in new contexts as needed. Even so, I struggled, letting my eyes breeze past equations until I was safely back among words. But this book works even if you do that. Ignore the equations and you will still learn the logic: AIs iterate, ingesting training data until they produce the most acceptable answer, guided by engineers and their own error calculations.

Ananthaswamy also chronicles the breakthroughs of early and later pioneers: Geoffrey Hinton had this insight, OpenAI’s Ilya Sutskever that one, and so on. We learn about the roadblocks that led to the first “AI winter” in the 1970s, when research funding and corporate interest dried up, and the solutions that fostered the productive decades that followed.

Yet we land in the year 2023 with Ananthaswamy pondering whether the newly released ChatGPT might have the “theory of mind” that allows humans and some animals to infer what’s going on in the thoughts of their fellows. This coda feels unearned, contradicting the logic of pattern-matching and probabilities from the preceding 400 pages and dipping a toe too briefly into a much, much bigger conversation.

Ananthaswamy is also perhaps too cautious in his assessment of how machine learning and other AI may fit into our lives. He thinks it inevitable that algorithms will be everywhere, “for good and for bad”, but leaves it at that. Yet there are many other books to read if you are more concerned about the stakes of our current algorithmic obsession. At its heart, this is a manual more than a philosopher’s text, a solid foundation to bear you into the weird, increasingly synthetic-feeling future.

New Scientist book club

Love reading? Come and join our friendly group of fellow book lovers. Every six weeks, we delve into an exciting new title, with members given free access to extracts from our books, articles from our authors and video interviews.

Topics: AI / Book review / Mathematics