Until a couple of years ago, Antonio Garcia Martinez was living the dream life: a tech-start up guy in Silicon Valley, surrounded by hip young millionaires and open plan offices.

He'd sold his online ad company to Twitter for a small fortune, and was working as a senior exec at Facebook (an experience he wrote up in his best-selling book, Chaos Monkeys). But at some point in 2015, he looked into the not-too-distant future and saw a very bleak world, one that was nothing like the polished utopia of connectivity and total information promised by his colleagues.

"I’ve seen what’s coming," he told me when I visited him recently for BBC Two’s Secrets of Silicon Valley. "And it’s a big self-driving truck that’s about to run over this economy."

Antonio is worried about where modern technology – especially the twin forces of automation and artificial intelligence – is taking us. He thinks it’s developing much faster than people outside Silicon Valley realize, and we’re on the cusp of another industrial revolution that will rip through the economy and destroy millions of jobs.

"Every time I meet someone from outside Silicon Valley – a normy – I can think of 10 companies that are working madly to put that person out of a job."

Antonio estimates that within 30 years, half of us will be jobless. "Things could get ugly," he told me. “It’s very scary, I think we could have some very dark days ahead of us."

Think of the miners’ strike, but in every industry. People could be be driven to the streets, he fears, and in America at least, those people have guns. Law and order could break down, he says, maybe there will be some kind of violent revolution.

So, just passing 40, Antonio decided he needed some form of getaway, a place to escape if things turn sour. He now lives most of his life on a small Island called Orcas off the coast of Washington State, on five Walt Whitman acres that are only accessible by 4x4 via a bumpy dirt path that just about cuts through densely packed trees.

Instead of gleaming glass buildings and tastefully exposed brick, his new arrangements include: a tepee, a building plot, some guns, 5.56mm rounds, a compost toilet, a generator, wires, and soon-to-be-installed solar panels. It feels a million miles from his old stomping ground.

Former Facebook executive Antonio Garcia Martinez at his remote island hideout, ready in case automation causes social breakdown Image: tristan quinn / bbc

Antonio isn’t the only tech entrepreneur wondering if we’re clicking and swiping our way to dystopia. Reid Hoffman, co-founder of LinkedIn and influential investor, told The New Yorker earlier this year that around half of all Silicon Valley billionaires have some degree of ‘apocalypse insurance.’ Pay-Pal co-founder and influential venture capitalist Peter Thiel recently bought a 477-acre bolthole in New Zealand, and became a kiwi national to boot.

Others are getting together in secret Facebook groups to discuss survivalism tactics: helicopters, bomb-proofing, gold. It’s not all driven by fears about technology – terrorism, natural disasters, and pandemics also feature – but much is.

According to Antonio, many tech entrepreneurs in Silicon Valley are just as pessimistic as he is about the future they’re building. They don’t say it in public of course, because what’s the point. It’s inevitable, they say; technology can’t be stopped. It’s a force of nature.

Even just a couple of years ago, this would have sounded like just another exhibit in the long-tradition of American dystopian paranoia. But the robot jobs apocalypse argument is starting to sound more reasonable by the day.

"I’ve seen what’s coming, and it’s a big self-driving truck that’s about to run over this economy."

The Economist, MIT Review, and Harvard Business Review have all recently published articles about how the economy is on the brink of transformation. President Obama’s team suggested driverless cars would dispense with 3 million jobs pretty soon. According to the Bank of England, as many as 15 million British jobs might disappear within a generation.

I blame Hollywood for our lack of preparedness. Thanks to Blade Runner, Terminator, Ex Machina and the rest, ‘artificial intelligence’ is now synonymous with sentient robots taking our jobs, our women, or our lives. Forget all that.

The A.I. revolution comes in the less sexy form of machine learning algorithms, which essentially means giving a machine lots of examples from which it can learn how to mimic human behaviour. It relies on data to improve, which creates a powerful feedback loop: more data fed in makes it smarter, which allows it to make more sense of any new data, which makes it smarter, and on and on and on.

Antonio thinks we’re entering into this sort of feedback loop. Over the last year or so, various forms of machine learning technology, teamed up with robotics, are making inroads into brick-laying, fruit-picking, burger-flipping, banking, trading, and driving. Even, heaven forbid, journalism and photography. Every year will bring more depressing news of things machines are better than us at.

New technology in the past has tended to increase markets and jobs. In the last industrial revolution, machinery freed up humans from physical tasks, allowing us to focus on mental ones. But this time, A.I. might have both covered.

Machine learning can, for example, already outperform the best doctors at diagnosing illness from CT scans, by running through millions of correct and thousands of incorrect examples real life doctors have produced over the years. Potentially no industry will be untouched.

Stefan Seltz-Axmacher, 27 year old founder of Starsky Robotics who are using $5 million of investment to develop self driving trucks. Image: tristan quinn / bbc

The latest wave of machine learning is even smarter. It involves teaching machines to solve problems for themselves rather than just feeding them examples, by setting out rules and letting them get on with it. This has had particularly promising results when training ‘neural networks’ (networks of artificial neurons that behave a little like real ones), using an approach called ‘deep learning.’

Recently, some neural network chatbots from Facebook were revealed to have gone rogue and invented their own language, before researchers shut them off. These simple chatbots were given a load of examples to spot basic patterns in human communication, and then conversed with themselves millions of times in order to figure out how negotiate with humans. What followed appeared as a stream of nonsense:

Bob: i can i i everything else…….

Alice: balls have zero to me to me to me to me to me to me to me to

Bob: you i everything else . . . . . . . . . . . . . .

Alice: balls have a ball to me to me to me to me to me to me to me

No human, with the possible exception of one Chuckle Brother, talks like this. But the failed experiment proved an important point. It seems these chatbots had calculated, within the parameters of their task, and without human intervention, a more efficient way of negotiating. This is the essence of deep learning: coming up with new ways to tackle problems that are beyond us.

In the same week, Elon Musk (who believes A.I. is a great threat to humanity) and Mark Zuckerberg (who does not) got into a public row about the risks of letting A.I. like this loose. Zuck said Musk was irresponsible. Musk said Zuck's understanding of the subject was 'limited.' But this misses the point.

A.I. is not about to go Skynet on us. These chatbots hadn’t developed some sinister secret language. But mega-efficiency or neural network problem solving might be just as disruptive. True, some of the recent fear about the coming age of the robots is probably overdone. We’re not all about to be turfed out by bots. And we’ve always had disruption: people were warning about a jobless economy 50 years ago too. We’ve always found new jobs, and new ways to entertain ourselves.

Around half of all Silicon Valley billionaires have some degree of ‘apocalypse insurance.’

Let's not forget the wonders of A.I., such as dramatically improving how doctors diagnose, which will certainly save lives. It will stimulate all sorts of exciting new research areas. Replacing people with machines will have other benefits, too: driverless lorries would almost certainly be safer than exhausted driver-full ones.

The most likely scenario, reckons Antonio, is a gradual dislocation of the economy and an accompanying escalation of unrest. David Autor, an MIT economist, reckons we could be heading toward a ‘bar-belled shaped economy.’

There will be a few lucrative tech jobs at the top of the market, but many of the middling jobs – trucking, manufacturing – will wither away. They will be replaced by jobs that can’t be automated, in the low paid service sector. Maybe there will be new jobs – who imagined app developer would be a profession – but will they be the same sort of jobs? Will they be in the same places, or clustered together in already well-off cities?

Drivers alone – taxi or truckers – make up around 17 percent of the U.S. adult work force. Taxis are often the first jobs for newly arrived, low-skilled migrants; trucking is one of the reasonably well-paid jobs for Americans that are not highly educated. What are they going to do instead? Are the cashier operators, and burger flippers going to retrain overnight, and become software developers and poets?

At the very least it seems economic and social disruption and turbulence as we muddle through are likely. The whole shape of the economy could change too. Some worry about the possibility of growing inequality between the tech-innovators who own all the tech assets and the rest of us. A world where you either work for the machines or the machines work for you.

What does that mean for people’s sense of fairness or agency or well-being? Or the ability of governments to raise taxes? The Silicon Valley survivalists fear that, if this happens, people will look for scapegoats. And they might decide that techies are it.

Jamie Bartlett outside Apple’s new $5 billion HQ Image: Tristan quinn / bbc

One of the questions I asked as part of this programme is whether we are prepared. We don’t even know how little we know; and our politicians seem to know even less. I found one mention of artificial intelligence in the 2017 party manifestos.

When asked recently about the future of artificial intelligence and automation, U.S. Treasury Secretary Steven Mnuchin replied that ‘it’s not even on our radar screen’ and that he’s ‘not worried at all’. A couple of months back his boss climbed into a huge rig wearing an “I love trucks” badge, just as nearly everyone in Silicon Valley agreed that the industry was about to be decimated.

Antonio told me in the race between technology and politics the technologists are winning. ‘They will destroy jobs and economies before we even react to them.’

Still, guns and solar panels? Survivalism seems like overkill to me. "What do you have?" Antonio asks, fiddling around with a tape measure outside his giant tepee. "You’re just betting that it doesn’t happen."

Before I can answer, he tells precisely me what I have: "You have hope, that’s what you have. Hope. And hope is a shitty hedge."