Hacker News new | past | comments | ask | show | jobs | submit login

Another fun one is when the programmers accidentally give the AI the wrong goal.

I have no idea if this actually happened, but I've heard of a chess program that was playing in a tournament that started making really weird moves in the endgame. Before that point, it was playing excellently.

It took the developers a while to figure out what was going on. They had made a mistake when doing some last minute tweaks before the tournament, and in effect the program was playing to lose.

Think about that for a minute. At first you might think losing would be easy. Just don't defend against your opponent's attacks, and make moves that weaken your position to make it even easier for the opponent.

But wait...the mistake in the code applied to the program's evaluation of both its own moves and the opponent's possible moves. In other words the program assumed that the opponent was also playing to lose.

How do you play to lose a game of chess if your opponent also wants to lose? You need to get to a position where the only legal move of the opponent is to checkmate you.

You'll want a position where you have a big material advantage, and all the opponent has is their king and enough material to mate you. Probably just king and queen. Then you'd need to keep putting them in check, in such a way that they have to block with the queen. You'd need to arrange a series of such checks and blocks so that the final block also delivers checkmate on you.

And so it turns out that during the opening and middle game, playing to lose against someone who is also playing to lose looks pretty much the same as playing to win against someone who is also playing to win.

(Personally, I doubt this actually happened. The story is old, and I don't think chess programs would have been able to see far enough ahead for them to discover that getting an overwhelming position is the way to force the opponent to checkmate them).




> (Personally, I doubt this actually happened. The story is old, and I don't think chess programs would have been able to see far enough ahead for them to discover that getting an overwhelming position is the way to force the opponent to checkmate them).

True, but (in the traditional minimax-alpha-beta-classic-gameplay model) you're using heuristics anyway up until you're in spitting distance of the end, and it seems plausible that if this "tweak" involved something like negating something and flipping a less-than sign (or whatever) that the heuristics were evaluating correctly but the end game evaluations were backwards. (Which contradicts the explanation but not the overall story.)

It's also possible that the explanation does work even with a backwards heuristic: in the try-to-win version, I'll eliminate or downgrade one branch because my only success route would be if the opponent directly manouvres themselves to be captured, which they obviously wouldn't do; but in the try-to-lose version, I might eliminate the same branch because I expect the opponent would do that but I don't want that to happen. I can't quite fully work out the logic in my head but it seems plausible.


I'd believe it. I had a similar bug in a minimax AI I made to play Hive. I had messed up the game-end valuation in such a way that the AI basically valued winning less than anything but outright losing. It would play a perfectly normal and competent game right up until the end, at which point it would try its hardest to draw out the game indefinitely, usually by forcing me into terrible positions that nonetheless didn't particularly benefit it at all.

(Like blahedo points out, this is possible because, unlike say basic MCTS, minimax uses a heuristic to judge board positions prior to game end, so it is possible for the two metrics to be out-of-sync.)


For anyone curious, this variant of chess where both players are trying to lose is simply called "anti-chess" and many chess programs have an anti-chess mode. Playing it is really weird.


I looked it up, but that’s the known variant where the opponent has to take your pieces. Playing to lose a normal chess is uncomparably harder.


Yes, good point. I'd forgotten that capturing was compulsory in anti-chess.


This reminds me of the first time I took LSD. I ended up at a hippy coffee shop with a Canadian soccer player (also tripping) playing a game of chess with the goal of losing.

It’s hard to play to lose! We ended up having a long conversation with a bearded man who kept telling us he’d been where we were.

Of that I have no doubt.


The chess computer story you’re half remembering sounds a lot like Kasparov playing against deep blue. I can’t find a link right now but somewhere on the internet there is an article where Kasparov describes the match in his own words and its really quite beautiful.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: