WHEN Facebook founder Mark Zuckerberg stopped off in Ireland earlier this month as part of a Europe-wide charm offensive, he gave an interview to broadcaster RTE in which he said that 99 per cent of terrorist content on the social media platform was flagged and taken down before anybody saw it. More notable though was the matter-of-fact way he referred to the software that did it: “our AI systems” he called it, conjuring an image of a room full of glassy-eyed bots plugged into a winking mainframe as they track ISIS videos in cyberspace.

Of course for people like Zuckerberg, AI – short for artificial intelligence – really is a matter of fact, end of story. But even though many of us interact daily with AI on social media platforms like Facebook, we mere mortals still require a little pinch to believe it’s true and that the stuff of a dimly-remembered Tomorrow’s World episode is here, now, today.

Booker Prize-winning novelist Ian McEwan needs no such pinch or reminder. As long ago as the 1970s, heyday of Tomorrow’s World when the programme was pulling in 10 million viewers a week, he was writing television plays about the subject and discussing it with distinguished figures such as Professor Donald Michie, then head of Edinburgh University’s Department of Machine Intelligence and Perception but previously a member of Alan Turing’s Bletchley Park team of war-time codebreakers.

“I’ve had a lifelong interest in AI and related matters,” says the 70-year-old over the phone from his London home. “But just lately, in the last 10 or 12 years, I’ve noticed that AI had gone through a bit of a silver, if not a golden age. AI sort of collapsed in the 1990s. They began to realise just how complex the brain is and they could never make anything equivalent to the human mind. All those optimistic predictions of Alan Turing in the late 1940s that he’d have a human brain-type machine in 10 years were just based on a lack of understanding of neuroscience, about just how complex it is even to raise a cup to your lips. But in the last 10 years there’s been a real surge, largely in software but also in the hardware.”

For McEwan, a writer of literary fiction that digs deep into human emotions and behaviour and, by his own admission, a keen student of science, such a state of affairs was too good to ignore. So into the imaginative space between AI’s present reality and our notion of it as a tool of the future – and playing on traditions reaching from Frankenstein back to the myth of Prometheus – comes his latest novel, Machines Like Me.

“I thought I’d just take a plunge into the whole realm of what would be close-up contact with a completely plausible artificial human, and what would be the moral, ethical, emotional consequences of that. What might it be like? So that was really the starting point.”

Set in an alternate 1982 in which The Beatles are still together, Prime Minister Margaret Thatcher is losing the Falklands War, and protestors march to a rally where they’re addressed by Leader of the Opposition Tony Benn, the novel introduces the world’s first artificial humans – 12 Adams and 13 Eves, in a range of ethnicities and skin tones, and available to enthusiastic early adopters with enough money in the bank to pay for the privilege (if privilege it really is).

Charlie, the novel’s narrator, is one of these cash-rich early adopters. Gifted the necessary £86,000 from his mother’s will, he tries for an Eve but is stymied when a job lot is sold to a Saudi potentate. Instead he buys an Adam, bringing him home to his poky London flat in a hired van and plugging him in to charge. Meanwhile Charlie invites winsome upstairs neighbour Miranda to help him shape Adam’s personality using a set of character parameters, and as they bond over the process he and Miranda become lovers.

It’s when Adam wakes and begins to interact with the couple that the fun starts. Adam becomes a keen composer of haikus, which he recites ad nauseum, and obsesses about Shakespeare, particularly Hamlet. And when Miranda asks Adam to go to bed with her – purely out of curiosity, she says later – Charlie overhears and finds himself facing a unique dilemma: is Miranda being unfaithful? Can Adam mean it when he says afterwards that he’s in love with Miranda? And, based on the answers Charlie comes up with to those questions, how upset does he have a right to be?

“Adam has sex with Miranda, Charlie listens to the whole thing and then the important thing to me was the confrontation with Miranda afterwards,” says McEwan. “Was this a betrayal or not? She says: ‘Well you wouldn’t have complained if I’d been with a vibrator’ … Again you come back to the dilemma we’ll have around what, if we have built ourselves a fully-functioning consciousness or apparent consciousness, our responses will be.”

In a final twist to McEwan’s alternate 1982, Alan Turing is still alive. He didn’t kill himself in 1954 and now lives in central London with his partner, a theoretical physicist. It was his advances in science which helped make AI a reality and he himself is said to have taken ownership of an Adam. In McEwan’s hands Turing also makes two vital interventions in the novel, the first after Charlie and Miranda encounter him in a restaurant in Soho, the second in the final chapter.

McEwan is certainly having fun with his setting, but in what genre does he place the novel? Not in the realm of sci-fi, it seems.

“One of the reasons I’ve never been a fan of science fiction is that by setting a novel in the future it always has a vaguely predictive quality. The chances of it being right are minimal,” he says. “The other is the technological stuff. Although I’m fascinated by science in general, my toes curl when people are crossing the universe at a trillion times the speed of light because the empiricist in me is saying ‘Well if they’re exceeding the speed of light, then we have to have a whole new physics’.”

He isn’t over-fond of other labels for it either, such as speculative fiction or alternative history. “I think it lies along the path of many of my earlier novels. I think of it as a literary novel.” But he does admit that besides allowing him to have Turing as a character, the alternate 1982 setting makes him “immune from any of the demands of the realistic novel, which I’ve been in flight from for these last few novels. I spent years writing novels which I patiently researched to get everything right and getting everything right is incredibly hard. You always get letters correcting you on this and that. Here, I’m beyond correction because everything is fake. It’s all smoke and mirrors.”

Beyond correction he may be, but beyond current events he is not. McEwan started writing in late 2016 – just months after the UK voted to leave the European Union – and wrote the bulk of the novel against the background of the resulting divorce negotiations. Despite his best efforts, outside politics crept in. “As I found my character marching against the Task Force I remembered that only last week I was on a march against Brexit,” he says. “And the parallels just grew. It’s very hard to avoid it.”

It isn’t just Brexit that feels present in the novel. In a speech delivered by Tony Benn, McEwan tackles other political issues relating to AI which are as current in the real world as they are in his alternate 1982. One is the prospect of joblessness caused by increased automation. Another is whether robots should be taxed and human workers given an equity share in the fruits of their labour. A third is the idea of a universal state wage for essentially doing nothing, such as was trialled in Finland recently.

“If robots are going to take workers’ jobs then robots should be taxed,” says McEwan. “It is an idea floating around because while we’re racking our brains over Brexit, there is a real existing problem with forthcoming unemployment due to automation. I think Brexit is one of the consequences of this. People have been told immigrants have been taking their jobs, but actually it’s machines.

“It’s going to be so socially destabilising to have so many people out of work and we’re going to have to think of new ways of living, not just individuals but as a society."

Artificial intelligence is in the headlines for reasons other than Zuckerberg and his Facebook AI systems, of course. It has been implicated in the tragic loss of two passenger planes just five months apart – Boeing 737 MAX airliners operated by Indonesia’s Lion Air and Ethiopian Airlines – and, although currently relatively small, the list of fatalities caused by autonomous, AI-controlled vehicles is growing.

Then there was the dire warning about AI issued by the late Professor Steven Hawking. “The development of full artificial intelligence could spell the end of the human race,” he said in 2014. “It would take off on its own, and re-design itself at an ever increasing rate … Humans, who are limited by slow biological evolution, couldn’t compete, and would be superseded.”

McEwan doesn’t see it quite like that, and in some ways Machines Like Me acts as a riposte to Hawking’s concerns.

“For a start I think there’s no way of avoiding AI,” he says. “We can’t help ourselves. We’re going to do this. It’s already started. And I think it’s going to be like the internet itself: all of human nature [is there], so some of our worst and some of our best impulses will be encoded in what we do with artificial intelligence. There’s a great deal of rather dark, military expenditure on AI. Everyone’s in a race for it. But then on the other hand there’s many, many benign possibilities with it. I think it’s going to be a mixed result.”

But he does admit that our brains could be in for some re-wiring. “I am quite serious about the fact that it’s going to change us to be in emotional relationships with an artificial consciousness, if we ever get to that state of advanced engineering”.

McEwan’s own inter-action with AI is limited but it has thrown up some interesting moral problems. A dinner conversation recently came up in which someone posed this question: should children be taught to say please when they address voice-activated virtual assistant’s such as Siri and Alexa?

“It seemed to me a rather wonderful moment,” he laughs. “If children are not saying please and thank you, might this train them to treat humans rather peremptorily and is it not good to teach your children good manners in talking to these entities? I thought what a peculiarly modern problem. Here is an interface with an artificial intelligence, how do we behave in front of it? When I say to Siri ‘Count down six minutes’ because I’m boiling an egg, I never say please.”

As for Alexa, McEwan says he has abandoned it. “Sometimes if there’s an old pop song you want to play it’s quite handy but otherwise I’m quite suspicious of it. Sometimes it interrupts conversations. It says: ‘I don’t understand that’. We haven’t even asked it anything, but it thought it heard its name”.

McEwan’s artificial humans soon learn to disable their over-ride switches. One Adam reduces its own computing capability to make itself less intelligent. Two of the Saudi Eves go further and effectively commit suicide, “dying” in each other’s arms. But while the novelist in McEwan relishes such plot twists, the amateur scientist in him recognises it will be many decades before anything like an Adam or an Eve is viable.

“I think we are bound to do it, but at the moment we’re nowhere with it,” he says. “We don’t even have a battery. If you look at pictures of these robots, they’re either sitting at a table because they don’t have a bottom half or if they’re walking around they’ve got a 25 kilo battery on their backs and they’re not walking very convincingly. Beyond that, AI is 60 years old and we’re competing with three and a half billion years of evolution, of trial and error, so we’re nowhere near the processing capabilities of the human brain.”

So if there’s a takeaway from Machines Like Me, it’s this: humans, with their quirks and eccentricities, their need for social inter-action, their desire to make the right moral choices and ability to choose to make the wrong ones, lead lives that are best described as messy – too messy for a machine to faithfully replicate and represent. For the present, that’s still the job of the novelist.

Machines Like Me by Ian McEwan is published on April 18 (Jonathan Cape, £18.99). Ian McEwan will be appearing at the Mitchell Library, Glasgow for a Waterstones/Aye Write event with Denise Mina on April 23 (6.30pm). Tickets available from www.ayewrite.com