Is it possible that someday we will elect an AI president?

Given some of the recent occupants of the White House, many might consider it an upgrade. After all, humans are prone to making decisions based on ego, anger, and the need for self-aggrandizement, not the common good. An artificially intelligent president could be trained to maximize happiness for the most people without infringing on civil liberties. It might even learn that it’s a good idea to tweet less—or not at all.

Sure, on first glance the idea is far-fetched and a little bit ridiculous. It’s not clear, for example, how an algorithm, no matter how lucid, could host a state dinner. Still, AI politicians are the likely culmination of trends already underway. Think about cars. Tesla owners are thrilled to let their Model S’s drive themselves, and auto manufacturers are rushing to produce vehicles that won’t even have steering wheels. Within a decade, tens of thousands of people will entrust their daily commute—and their safety—to an algorithm, and they’ll do it happily.

Why? Because it will make their lives better. Instead of sitting in traffic, drivers—now passengers—can watch a movie or get some work done. The increase in human productivity and happiness will be enormous. At the same time, it’ll make us safer. More than 30,000 people die in traffic accidents every year in the US alone, and almost all of those deaths are attributable to human error. Self-driving cars are poised to reduce that number significantly.

Similarly, we’re not very good at governing ourselves. The US government is mired in gridlock, name-calling, and partisan entrenchment. We vote for people because we like the way they look or talk, not because of policy positions. We elect politicians who we hope will embody our ideals and values, only to be sorely disappointed when they seduce the interns and demand briefcases of unmarked bills. We want our politicians to embody our highest ideals. They usually don’t.

An AI president offers the possibility of delivering a purer form of government, one focused on the ideals we elect our presidents to represent. Voters could choose between a Democrat or a Republican AI, one that promised to enact the party’s platform. Or, voters could simply vote on a laundry list of issues, and an AI that reflected the popular will on each point would be built.

Certainly, even given a clear governing platform, the answers to big questions are fraught with complexities: Should the Constitution be interpreted literally or adapted to modern times? And how do we tackle poverty, inequality, and entitlements? Any action on these issues is likely to result in unintended consequences. Presidents need to react to novel situations and think many steps ahead, and they need to make difficult choices. “By the time something reaches my desk, that means it’s really hard,” President Obama memorably said in 2009. It might seem unrealistic to think that an algorithm could wade into uncharted territory and do better than a human.

But recent events undercut this assumption. Over the past 12 months, an AI built by Google has won 60 games in a row against the world’s best Go players. To do this, it had to master a game that is far more complex than chess. (There are more possible Go games than there are atoms in the known universe.) The AI faced a huge array of choices and had to think dozens of steps ahead. It needed to make difficult decisions, fashion a strategy that involved risk and operate with incomplete information. It did all this, and it also innovated. “It won by doing things we hadn’t seen before,” says Myungwan Kim, a professional Go player. “We thought it would take 50 years for software to beat the top players in the world but, over five months, this program became the best player in the world.”

In fact, the chess program on the phone in your pocket has more strategic know-how than most residents of 1600 Pennsylvania Avenue, past or current. Imagine an AI presidency in 2003. The software would have analyzed decades’ worth of reports on Saddam Hussein, absorbed the intelligence about WMDs, and concluded that an invasion of Iraq was obviously a dumb idea and unlikely to spread democracy. Ditto Vietnam.

Of course, the real world is different from a chess game. But AIs are already grappling with complexity, and they are only getting better at it. In a recent paper published in Nature, researchers detailed how an AI was able to diagnose melanomas better than board-certified dermatologists with decades of experience. (Other AIs are being trained to detect diabetic blindness and lung cancer.) Powered by neural networks modeled on the human brain, these programs can ingest massive amounts of information and learn from their mistakes, two qualities sorely lacking in today’s politicians.

One of the leading thinkers in deep learning, Facebook’s Yann LeCun, foresees a time not far in the future when machines will begin to understand language, motivation, and thinking. “Our relationship with the digital world will completely change due to intelligent agents you can interact with,” LeCun told MIT Technology Review in 2015. And we are only at the beginning of the deep-learning revolution. It won’t be long before an AI is sophisticated enough to implement a core set of beliefs in ways that reflect changes in the world. In other words, the time is coming when AIs will have better judgment than most politicians.

All of which suggests that the case for an AI president is only going to become more convincing. Human presidents in the modern era are already overwhelmed by a rising flow of information. We just weren’t designed for the digital era. Most of us can’t handle our email inboxes, let alone the data streaming in from government agencies, the economy, and the military. An AI driver can take in 360 degrees of information simultaneously, see farther down the road, and react faster than any human. Could an AI President do the same?

It’s true that an AI is embedded with the biases, blind spots, and cultural and philosophical assumptions of its creators. But the promise of AI is that we provide the end goal, and it figures out how best to get us there. So, like all presidents, the AI leader would seek to maximize the satisfaction of a majority of voters within the confines of the law. Unlike many humans, the AI could overcome biases and assumptions that didn’t help it achieve its goal.

In some ways, the advent of an AI presidency would seem like a natural evolution. Millions of people already entrust their lives to machine intelligence. Commercial airliners have long flown themselves and tend to crash most frequently when pilots switch to manual control. There are more than a million robots working in manufacturing, building everything from trains to computers. Almost every aspect of our lives is digital in some way, from our bank accounts to our entertainment. Whether we know it or not, any given experience is likely being optimized by an AI, making life easier than it was a decade ago.

We are also becoming increasingly accustomed to the idea that our digital services know more about us than we sometimes even know about ourselves. We like it when Amazon shows us books or films we might enjoy. We appreciate it when email filters read our messages and unclog our inboxes. An AI president might be able to suggest policies with the same uncanny prescience of Netflix suggesting shows and movies we’re going to love.

On the other hand, of course, an AI president could be hacked or might turn demonic as it learns independently and pursues its mission of optimizing happiness for the greatest number of citizens. To illustrate the dystopian possibilities, Tesla CEO Elon Musk uses the example of an AI built to grow and harvest strawberries. To fulfill its primary mission of picking as many strawberries as possible, an AI might conclude it would be reasonable to wipe out humanity and turn the planet into a huge strawberry farm. Imagine what could happen if we gave an AI the nuclear launch codes. How could we trust our lives to a machine? Even if the AI were programmed to maximize happiness, it might decide that the threat of global warming is enough to justify killing off millions to decrease carbon emissions. And the fact is that whatever lessons an AI learns based on its consumption of huge amounts of data remain opaque to us. An AI president, just like a human one, would be a black box.

Joshua Davis About Joshua Davis (@joshuadavisnow) is a longtime WIRED contributing editor and the co-founder of Epic Magazine.

We have spent a lot of time imagining dystopic futures that involve machine intelligence. In The Terminator, Skynet goes rogue and tries to annihilate humankind. In The Matrix, machines turn us into batteries, and in 2001: A Space Odyssey Hal is a complicated menace. But it doesn’t have to be that way. There are clearly risks, but it’s important not to lose sight of the benefits an AI presidency could confer. The purpose of AI is to free us from doing the things we aren’t good at, like driving, making medical diagnoses, and governing. It’s entirely possible that AI will lead to a new era of human prosperity and peace.

None of this is going to happen soon or all at once. Leaders will start by turning to AIs to help them analyze complex situations and to game out optimal scenarios. Step by step, it will become clearer that AIs can handle more and more of the tough decision-making. And then there may well come a time when we realize that we are better off with an AI as president. Maybe we can elect someone else to host the state dinners.