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 that requires, at least among humans, an added degree of intuition.

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 that drive 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 in 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 in the moment to what he saw from his opponent—something AlphaGo can’t yet do.

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 this best-of-five series 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—certainly the most entertaining contest of series—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. Time and again, he 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 that 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.”

That pressure seemed to lift in Game Four. Lee Sedol played his strongest match. And he won. For the Korean, he won in part 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, at the end of the press conference, he turned to Demis Hassabis and asked if he—not AlphaGo—could play the black stones in Game Five. In other words, he was 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—rather than playing a more cagey game. He had attacked in Game Four, and he had won. But that was with the white stones. When he attacked in Game Three, with the white stones, things didn’t turn out so well.

About nine moves into Game Five, one of the English language commentators, Michael Redmond, himself a very talented Go player, was wondering whether the Korean would take the fight to the Google machine, when the answer came. Lee Sedol attacked. In essence, he was 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,” Redmond said.

One difference from the previous three games is that Lee Sedol was playing with more speed. In Games Two, Three, and Four, he fell into clock trouble rather early, as he spent 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, the machine 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 in the game, Lee Sedol continued to play aggressively. In Redmond’s words, his 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 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. “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—something that is completely separate from its meltdown in Game Four. AlphaGo plays moves designed to maximize its chances of winning—not to maximize the margin of victory—and this sometimes results in weak or “slack” moves that top human players don’t quite understand.

‘A Horrible Loss’

In any event, both AlphaGo and Lee Sedol were playing at speed. “I’m barely keeping up with the game,” Redmond said. The Korean had used up more of his play clock, but only slightly more. 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 right-hand side of the board. It seemed that AlphaGo had made a major error in this area—an error that even a moderately skilled human would never make. “It’s black’s territory,” Redmomd said, referring to the Korean. AlphaGo, he added, could end up taking a “horrible loss” in this area—a 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 of the Korean. “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 so 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 win 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, referring to the Korean. And Redmond agreed.

‘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 at in the very middle of the board. But he still felt that the Korean was ahead. There was one scenario, he said, where Lee Sedol grabbed 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 half hour mark, Lee Sedol ran into time trouble. His clock was down to 5 minutes, while AlphaGo still has close to 30. The problem was that there was still so much unclaimed space in the top right-hand side of the board. Fighting for that space would not 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 repeated 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 what are called 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 real live players, it 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 a bit better than the Korean grandmaster. It’s clock still carried sixteen minutes.

The Google machine continued to make moves that flummoxed the commentators. But that too is expected. After training on real human, 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.

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

Eying the board, Redmond started to count up the points that seemed available to each player, and it seemed 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. And 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.

Read More: 

Google’s AI Wins Fifth And Final Game Against Go Genius Lee Sedol