SEOUL, SOUTH KOREA — In the final game of their historic match, Google's artificially intelligent Go-playing computer system has defeated Korean grandmaster Lee Sedol, finishing the best-of-five series with four wins and one loss.

The win puts an exclamation point on a significant moment for artificial intelligence. Over the last twenty-five years, machines have beaten the best humans at checkers, chess, Othello, even Jeopardy! But this is the first time a machine has topped the very best at Go—a 2,500-year-old game that's exponentially more complex than chess and requires, at least among humans, an added degree of intuition.

Game Five grew into the most exciting of the series, a game balanced on a knife edge.

The victory is notable in its own right. But this week's events are even more significant when you consider that the machine learning technologies underpinning Google's machine, known as AlphaGo, are already pushing their way into real-world applications. Some help drive services inside Google and other Internet giants, helping to identify faces in photos, recognize commands spoken into smartphones, and so much more. Other techniques at the heart of Google's AI are poised to remake everything from scientific research to robotics.

Lee Sedol could not climb back to finish within one win of his artificially intelligent rival. But he did lead Game Five in the early going, after a significant error by AlphaGo—an error that looked amateurish to the human eye. As the Google machine dug out of its hole in the second half of the contest, Game Five grew into the most exciting of the series, a game balanced on a knife edge, exceeding even the drama of Lee Sedol's win in Game Four.

The Korean showed—in swashbuckling fashion—that humans still carry talents that no machine can duplicate. Yes, early in the five-game series, he struggled to deal with the pressure—a very human failing. But as the match continued, he adapted to what he saw from his opponent in previous games—something AlphaGo can't yet do.

Geordie Wood for WIRED

National Hero

The excitement swirling around Game Five was more extreme even than in the run-up to Game One—a remarkable thing when you consider that the match had been decided three days earlier, when AlphaGo swept the first three games and took home the $1 million match prize. But that was only one way of deciding this historic match. Lee Sedol very much changed the equation on Sunday night, when he won a stirring Game Four, and a small mob of Korean press cheered him as he walked into the post-game press conference.

"Because I lost three matches and then was able to get one single win, this win is so valuable that I wouldn’t exchange it for anything in the world," he said, through an interpreter, after his victory in Game Four. "That's because of the cheers and the encouragement that you all have shown me."

It's not just the Korean press that's excited. Here in Seoul, the match has been front-page news all week—literally. If you turn on television in your hotel room or hop into a cab with the radio on, it inevitably pops up. Hours before Game Five, Demis Hassabis, who oversees the Google AI Lab that built AlphaGo, walked down the main boulevard in Sejong Daero, just down the street from the Four Seasons hotel, which has housed the match all week. Time and again, Hassabis was recognized by passers-by. One Korean woman stretched out both her arms out and theatrically dropped her jaw in amazement. It was a bit like she'd just seen Beyoncé walking down the Sejong Daero—arm-in-arm with Lady Gaga.

The Harder Road

But the Korean public isn't pulling for Demis Hassabis and AlphaGo. They're pulling for Lee Sedol. An estimated 8 million Koreans play Go, and even among those who don't, he's a national figure. It's his boyish face that typically appears on those front pages. The result is that during the first three games of the match, he very much felt the weight of a nation. He said as much during the press conference following his decisive loss in Game Three. He also apologized to anyone who had expected more from him. "I don't know what to say today, but I think I will have to express my apologies first," he said. "I should have shown a better result, a better outcome, a better contest in terms of the games played."

Over the course of the match, the machine can't change its strategy based on how its opponent played in the previous games.

That pressure seemed to lift in Game Four. Lee Sedol played his strongest match. And he won, in part, he said, because AlphaGo was playing the black stones and he was playing the white. AlphaGo also played black in Game Two, and in both of these games, Lee Sedol said, he felt that the machine wasn't as strong. "It struggled more when it was holding black," he said during the press conference following his win in Game Four.

And yet he asked to play the black stones in Game Five, choosing the more difficult scenario. He wanted to win in a way he hadn't yet won. "I really do hope I can win with black" he said, "because winning with black is much more valuable."

To Attack or Not to Attack?

As Game Five began, the question was whether Lee Sedol would go on the attack with the black stones or play a more cagey game. He had attacked in Game Four, and he had won. But that was with the white stones. About nine moves into Game Five, the Korean did attack, laying claim to territory on the right-hand side of the board rather than play a more expansive game across the board as a whole. Typically, Lee Sedol prefers an aggressive style. He was playing to his strengths.

But judging from what little we know about AlphaGo—we've only seen this incarnation of the machine play a total of four games—it too was playing to type. It seems to prefer a more expansive style. "Both players are, in a way, playing predictably," said English language commentator Michael Redmond.

Compared to the previous three games, Lee Sedol played with more speed. In Games Two, Three, and Four, he fell into clock trouble early after spending an enormous amount of time contemplating early moves. Forty minutes into this game, he had just as much time on the clock as AlphaGo.

A machine has certain advantages in a match like this. It doesn't feel pressure. It doesn't get tired. But in the case of AlphaGo, there's one notable disadvantage. Over the course of the match, Google's craetion can't change its strategy based on how its opponent played in the previous games. Because Hassabis and team need several weeks to retrain AlphaGo, they can't alter the system until after the match is over. But Lee Sedol can shift strategy. He can adapt his play according to what has come before. And as Game Five progressed, it seemed that he was adapting, drawing not only on his win in Game Four but on his losses in the first three games.

Can Genius Repeat Itself?

An hour into the game, Lee Sedol continued to play aggressively. In Redmond's words, the strategy was "take territory, take territory." This worked in Game Four. But as Redmond pointed out, it worked only after one brilliant game-changing move from the Korean grandmaster.

That was Move 78, a "wedge" play in the middle of the board that suddenly and unexpectedly shifted the path of the contest. Before the move, according to commentators and Go aficionados—and according to AlphaGo itself, we later found out—the Google machine held a notable advantage in the game. Then Lee Sedol spent a good half hour considering what to do next before unloading Move 78. As Demis Hassabis soon tweeted, it was not a move that AlphaGo expected any human to make, and with the very next move, the machine made a fateful mistake. Within minutes, after analyzing the state of the game, AlphaGo decided that its chances of winning had plummeted. As the game progressed, the machine began to make a particularly odd and an ineffective string of moves. And eventually, it resigned.

It seemed that a second moment of genius was an awful lot to expect from Lee Sedol.

It seemed that AlphaGo is ill-equipped to deal with such a sudden moment of human genius—a move that no other human is likely to make. But as Game Five rolled on, it also seemed that a second moment of genius was an awful lot to expect from Lee Sedol.

At the hour-and-twenty-minute mark, AlphaGo made what the commentators saw as a rather weak move, and this sparked talk of another sudden collapse. "Are we seeing another short circuit?" asked the other English language commentator, Chris Garlock. But AlphaGo has a general tendency to do this kind of thing. The machine plays moves designed to maximize its chances of winning, not to maximize the margin of victory. This sometimes results in seemingly weak or "slack" moves that top human players look down on.

Geordie Wood for WIRED

'A Horrible Loss'

Now, both AlphaGo and Lee Sedol were playing at speed. "I'm barely keeping up with the game," Redmond said. The Korean had used more of his play clock, but only slightly. AlphaGo's clock stood at one hour and twenty-four minutes. Lee Sedol was at an hour and twelve. Once their clocks run out, the player must make each move in less then 60 seconds.

With his aggressive play, Lee Sedol had come to dominate the area in the lower part of the board. And it seemed that AlphaGo had made a major mistake in this area—an error that even a moderately skilled human would never make. "It's black's territory," Redmond said, referring to the human. AlphaGo, he added, could end up taking a "horrible loss" in this area—the kind of loss that could very much tilt the game in favor of Lee Sedol. "When you give him extra points like this, he's very happy," Redmond said. "He feels that even with just two or three extra points, he should be able to take that home with him and win the game."

But there was still much of the game left to play. As time went on, Garlock and Redmond felt the game was playing out in a way that was somewhere between what went down in Lee Sedol's Game Three loss and what happened during AlphaGo's loss in Game Four. There was more open space, but options still seemed limited. "I don't see any place for black to run here except right into the arms of white," Garlock said.

'A Dangerous Period'

Two and a half hours into the match, Redmond felt the game has entered a "dangerous period." Lee Sedol, he said, faced a fight in the very center of the board. But he still felt the Korean was ahead. There was one scenario, he said, where Lee Sedol would grab hold of the all-important area at the heart of play. But there was another where AlphaGo grabbed this area instead. "The difference between those two futures of the game is really huge," Redmond said.

Forty five minutes later, this fight was still playing out. "It's a very complicated game," Redmond said. "So much hinges on the center territory." And as the game passed the three-and-a-half-hour mark, Lee Sedol ran into time trouble. His clock was down to 5 minutes, while AlphaGo still had close to 30. The problem was: there was still so much unclaimed space in the top right-hand side of the board. Fighting for that space wouldn't be easy.

Indeed, his clock soon ran out. And then he failed to make a move in the allotted sixty seconds. Two more failures and he would forfeit the match. During his win in Game Four, the Korean kept the drama high by repeatedly waiting until the last millisecond to play a move that would have meant defeat if he hadn't played it soon enough.

Deep Learning

AlphaGo relies on deep neural networks—networks of hardware and software that mimic the web of neurons in the human brain. With these neural nets, it can learn tasks by analyzing massive amounts of digital data. If you feed enough photos of cow in the neural net, it can learn to recognize a cow. And if you feed it enough Go moves from human players, it can learn the game of Go. But Hassabis and team have also used these techniques to teach AlphaGo how to manage time. And the machine certainly seemed to manage it better than the Korean grandmaster. Its clock still carried sixteen minutes.

The Google machine repeatedly made rather unorthodox moves that the commentators could quite understand. But that too is expected. After training on real human moves, AlphaGo continues its education by playing game after game after game against itself. It learns from a vast trove of moves that it generates on it own—not just from human moves. That means it is sometimes makes moves no human would. This is what allows it to beat a top human like Lee Sedol. But over the course of an individual game, it can also leave humans scratching their heads.

The game showed that AlphaGo is far from infallible.

Then AlphaGo's clock ran out. Both players were down to 60 seconds for each move, and Lee Sedol had exceeded his 60 seconds twice. One more, and he would forfeit the game. Soon, the game crossed the four-and-a-half-hour mark, and it looked, for the first time in the match, like the two players would play the game out to the very end without either player resigning. It was that close.

Eyeing the board, Redmond started to count up the points that seemed available to each player, and it appeared that one had an edge. "Unfortunately for Lee Sedol," he said, "I think white might have a slight advantage here." And as the game stretched to five hours, Redmond began to concede victory to AlphaGo. But it was hard to tell, he said, where Lee Sedol had gone wrong. Seconds later, the Korean resigned.

The game showed that AlphaGo is far from infallible. Early in the contest, it made a mistake that even a decent human player would not make. There are holes in its education. But, able to draw on months of play with itself—on a corpus of moves that no human has even seen—it also has the ability to climb out of such a deep hole, even against one of the world's best players. AI is flawed. But it is here.