More responses to Intelligent mistakes

11/24/2005 – Our ongoing ChessBase Workshop discussion on handicapping chess programs to play in a more human-like manner has taken a decidedly technical turn this week. You can see the latest reader comments and our own replies in the latest edition. Workshop...

ChessBase 15 - Mega package ChessBase 15 - Mega package

Find the right combination! ChessBase 15 program + new Mega Database 2019 with 7.6 million games and more than 70,000 master analyses. Plus ChessBase Magazine (DVD + magazine) and CB Premium membership for 1 year!

More...

Four days ago (as I write this) ChessBase GmbH published a prior column of mine which presented reader responses to my "intelligent mistakes" column. That batch of reader responses had already resulted in a deluge of e-mail hitting my (new) e-mail box (you'll find the link at the end of this column). I think it's safe to say that the original "Intelligent mistakes" column is well in the running for the largest amount of reader response to any chess column I've written over the last eight years.

It was never my intention to make ChessBase Workshop a "reader-submitted Q&A" column, but as long as the e-mails remain interesting I think it's a service to other readers to present them here. As with the last batch of reader comments I'm again passing your e-mails along to the programmers, I'm again using italics to denote my responses to these e-mails, and I'm again disinterested in flamewars or arguments (let's keep this a civil discussion).

_____

I have read your article on intelligent computer mistakes and feel I might be able to shed some light on the subject. This subject is of some interest to me and I think this is one of the hardest problems in Chess Computer programming. In my opinion it is much harder than the problem of actually making a strong program which I feel is no longer an AI problem. Perhaps intelligent mistakes are still part of the AI domain however. I suggest if you receive any more messages describing very concrete implementations of intelligent mistakes then you should refer them to the Crafty source and suggest that the individual try it.

First if we want computers to emulate human mistakes then I think we should look at some typical human errors, in no particular order.

  • 1) Forgetting the book variation.
  • 2) Not considering a move/threat during calculation.
  • 3) Playing without a plan.
  • 4) Playing with an incorrect plan.
  • 5) Stopping calculation too early.
  • 6) Evaluating a position incorrectly.

The underlying reason for a player making these errors is not important to us. Now we will look at them and examine potential implementations of these in a chess player program. Some will be easy to implement (even already implemented) and others will be more difficult (or impossible).

1) Forgetting the book variation.
Not an uncommon mistake, and also quite easy to implement in software. At some point the program could be thrown out of book onto it's own devices. This would be especially effective if it happened early in the game as computers can still struggle without there carefully prepared opening books. The problem is that it is terribly simplistic to assume this will have a detrimental effect on the programs play. Usually the realisation that the player has forgotten an important book variation leads to panic, an in-ability to be objective and other errors such as mis-calculation or mis-assessment in the near future. I would actually expect that the playing algorithm would take over, if it didn't make the best play up then play a slightly different line to the 'best' on in the opening book. The human would become confused by this (because humans rely on prepared variations more than computers) and blunder soon and so the computer would be seen as an un-natural calculating machine once again.

2) Not considering a move/threat during calculation
A very common mistake. I don't think I have played a game where I correctly saw everything I could reasonably have needed to. This is also easy to implement in the program we could just throw away some moves when doing calculations (the program will even search faster!!). The problem is that humans don't regularly miss routine ideas (like defending their queen). They tend to miss obscure ideas so the progam actually needs to discover obscure moves to mis-calculate. This falls into the very hard category in terms of evaluating which moves are humanly inferior. More to the point for the missed variation to be significant the program actually needs to know that it's important. That means that the program needs to examine this variation. This is where we get to the crux of the problem with many of your correspondents solutions. Chess programs (despite the rumours) don't actually examine every position within there maximum search depth (please keep reading I am not speaking crazy talk). Programs use an algorithm called Alpha-Beta pruning which means that if the program considers the best variation first then it does less work to reach the same conclusion which it would have done should it have used the pure Mini-Max algorithm. This means that the program actually slows itself down (a little) when it considers more than one best variation. Actually if programs could not use the Alpha-Beta search algorithm the computer chess would still be in the dark ages. The best evidence I can give for this is that there are approximately 4M positions after 4 ply from the starting position, but hang on Fritz calculating a 3M positions per second can search (well) more than 4 ply in less than a second. Hmm, yes Alpha-Beta pruning has been very good to chess programming. Naturally if the computer program was both searching slower and choosing inferior moves this would translate to it not playing very strong at all. I think that with the Alpha-Beta heuristic turned off on even a modern program like Fritz 8 it would struggle to play as well as computers did in the 1980's.

3) Playing without a plan
This is considered a very common beginner mistake. It is however difficult to really show that Steinitz old principal actually holds true. One thing we know is that chess computers only follow a plan inside their search horizon. Computers don't engage in long term planning in the human sense so there is no way we can weaken them in this area. Basically it seems to me that if you can calculate as fast as Fritz then you don't need to follow a long term plan very often.

4) Playing with an incorrect plan
This is similar to 3 but we could try weakening certain area's of a computers evaluation function. Computer evaluation functions are not particularly accurate anyway so I think this would not be that effective in humanising it's play. The fact that the human opponent would most likely have to play very accurately in order to actually exploit any weakness in this area means it doesn't really lend itself as a great solution in many ways.

5) Stopping calculation too early
This would not be to difficult to implement. The Horizon effect can effect program performance. The effect however would be more typical computer mistakes as the program steals material only to find it can't extract the erant piece. There was a time when I could beat PC computer programs occasionally for doing this but this has since passed.

6) Evaluating a position incorrectly
This is a problem both humans and computers face. Computers tend to evaluate positions incorrectly because there evaluation is defficient, while humans tend to do it for all sorts of reasons, many are phychological. One common one is sacrifice shock, another is an over eagerness to get a positive result. It is difficult to program a computer to make the typical mistakes a human would given the difference in basis for these mistakes and ways they operate.

You are also correct to say that correlating this to a rating level (which is a requirement for a chess computer brain damage type feature) is very difficult. Suffice it to say that 'making a computer play consistently at a 1300 level by programing it to play inconsistently' somehow doesn't really make logical sense.

Finally I would like to point out that most of the traits of computer like play are areas where it out performs humans. Taking a sacrifice of material and holding onto it, more consistant / objective evaluation, better opening memory or more accurate calculation of combinations. If we take these away from the computer and it must be expected still to win some games then it must find other ways to outplay humans. This makes it difficult for computer programs to play at a certain rating level while being perceived to play in a human way. Computer Chess players passed the Turing Test a long time ago and I think that a large amount of the description of computer like play is not quite as true as all that anyway. In many ways it is an excuse for the humans mistakes in losing to the computer as it is an objective description of a computer style.

I hope that this has been of some interest to you and I have not wasted your valuable time.

Nicolas Croad
Wellington, New Zealand

"Wasted my time"??!!?? Lord. no! This is one of the most complete and thorough responses I've received. Thank you for writing!

Just a few comments of my own:

Your comment "you should refer them to the Crafty source and suggest that the individual try it" made me laugh out loud. I think that's a really reasonable suggestion since there are a number of "open source" programs available online which allow a user with programming experience to tweak the engine's algorithm to their heart's content. The reason I laughed was because I believe quite a few people would soon discover how difficult and daunting a task "dumbing down" a chess program can be.

1) Forgetting the book variation: as you mentioned, this has already been implemented. Fritz' Friend mode causes the program to "leave book" at an earlier point than regular play modes.

2) Not considering a move/threat during calculation: thank you for the excellent explanation of tree pruning. Here again, this has been implemented to a degree: Fritz' Sparring mode will spot its opponent's possible threats and tactics in the search tree and steer the game toward them instead of away from them. It's a sort of "inverted minimax search".

3 & 4) -- I found the discussion interesting. But, as you say, computers don't really play with a "plan" anyway (that's why they're traditionally weak at positional/strategic chess), so I think the first (huge, probably impossible) step is to develop engines which do plan and then find a way to subvert that function in a handicap mode.

5) Stopping calculation too early: that's the traditional way of reducing a program's performance. I have a standalone chess machine from the 1980's which has a LCD display to show you what it's "thinking"; in lower modes, you can see a reduced search depth on the display.

6) Evaluating a position incorrectly: I think this is the crux of the problem. Programmers have spent years strengthening their engines to try to eliminate positional errors (for example, the infamous "anti-positional pawn pushes" I referred to in a prior article) and tactical oversights; I imagine it's tough for them to "de-evolve" their programs and reintroduce these errors. And, even if they do, they still face the possible (in fact likely) criticism that the errors aren't "natural" ones (in other words, they're not "intelligent mistakes").

Again, thank you for writing! -- SL

-----

I’m writing as somebody uniquely qualified to make a contribution to the current how-to-dumb-down-chess-programs debate: in a discussion otherwise filled with views and discussion from good chess players, I’m writing from the sidelines as a bad one.

I’m writing as one of millions of chess players who read the word "obviously" in chess books and howl with incomprehension. ("Obviously black’s position is now hopeless, and he resigned shortly afterwards"? Huh? He’s got more pieces, and BOTH of his horses! Where’s the problem?...)

As a result, I have more than just an academic interest in the current debate about creating believably handicapped programs, because I’d be an enthusiastic consumer of such a program. In fact, the only reason I haven’t purchased Fritz yet is because I had read that it only plays down to 1350 (Hey Chessbase! that’s up for me)

And so I use the other program, the one with the pretty boards, and sure enough, I can win against its low ranked players. But I want a sparring partner who doesn’t let me win by smacking me about the head for 16 moves, and then offering me their queen by way of apology.

I think a possible solution for this lies in the very thing has been driving me nuts about chess books for years. There has been plenty written in such books about what makes particular moves poor, usually followed by suggestions as to what would have been better. Ack! Don’t do that move! It’s bad. Here’s why. Do this move instead.

In other words, the viewpoint is always from that of good chess, and helping the error-prone student gravitate towards it. It’s time to turn that upside down.

What’s missing from advice like this -- and from chess engine coding -- is an understanding of why that original bad move was so attractive to the player in the first place. It’s not that the bad moves simply materializes. A 900 rated player may well be producing some ugly chess, but let’s give them a little credit -- they’re still screwing their face up and thinking hard just like anybody else, and so they have reasons for advancing that pawn, castling, or leaving their knight where it is. They might not be sound reasons, but they are reasons nonetheless.

Surely if you were a coder trying to create believable handicap, wouldn’t you just be a little curious as to what these reasons actually were? To start by getting inside the heads of beginners, instead of starting with an algorithm that was designed to produce effective play and then argue about what sort of lobotomy to give it?

Here’s the thing, and the reason lobotomies don’t work: As poor players, we’re not playing with less effective versions of the same algorithms good players use. We’re not selecting the 7th best move, or only seeing one move ahead from the same chess engine that can play at 2600+ when its wings aren’t clipped.

We’re playing with completely different engine in the first place.

In the quest to dumb down programs, the battle so far has been too much about trying to reproduce bad play outcomes, without trying to reproduce bad play thinking that produces those outcomes.

You can’t imagine this bad chess thinking - especially if you’re a good player yourself. You have to ask bad players.

And then fasten your seat belt, because you’re going to hear some weird things.

An example, from my own daughter. In her first few games of chess, she was introduced to the idea of pawn promotion. Her reaction, as a 5 year old discovering this rule? Yihaaah! Bonus queens! And so her next few games became a stampede of pawns towards what she now saw as a finish line -- the logic being that if she threw enough of them forwards, one of them had to get past. Then let’s see if dad can beat me, once I’m chasing him around the board with 9 queens...

No dumbed down chess algorithm is going to be able to guess play that that.

Now her thought process in this instance might be too isolated to be useful, but the logic is that if a coder was armed with the thought processes that beginners often use, those thought processes could actually be turned into algorithms. The engine would then play to the best of its ability, within the following this new rulebook. No dumbing down required.

That’s the theory. Of course, the whole idea is contingent not only upon being able document thought processes like this, but that the results yield categorisable trends. It’s of no value if 10,000 beginners each have their own unique warped bad way of playing chess.

Maybe they do. Maybe they don’t. Maybe there are genuinely Two Dozen Common Dumb Thought Processes that Sub-1000 Chess Players Use When Choosing Moves -- which would be a gold mine for coders of dumbed down programs.

So let’s find out.

What it would require is a wide-ranging study of beginners the world over -- tens of thousands of games that are commentated by the beginners as they play, explaining why they make the move they did.

It’s not enough to know that they hang pieces. We need to know what was going on in their head when they did, and then teach our chess programs to think that way too. Which means that if the study reveals that 67% of players regularly move their rook midgame for no better reason than "it’s been a while since I moved my rook", then the engine should think that way too, even though it’s appalling chess.

My own belief is that if this study were to happen, we would see patterns. These patterns, and the flawed logic that underpins them, may curl the toes of experienced chess players, but the information may lead to the world’s first completely scaleable computer chess partner.

And when it’s ready, give me a call. En garde, I’ll yell at it. And tell it to watch out. It’s been a while since I moved my queen.

Philip Johnston
Canberra, Australia

First of all, thanks for writing! I loved this e-mail for a bunch of reasons. I'm not sure that you'll take this as a compliment, but I intend it as one (or at least as recognition of a fact): you write a lot like I do. Reading your e-mail was like reading one of my own past columns. Now put the gun down, Philip, and we'll press on...

I like your idea a lot, but I also see a potential pitfall for the programmers. It's hard enough to get a computer to play good chess even when you know what at least some of the optimal solutions to a tactical or positional problem should be. How do you mathematically quantify the fact that a certain square will be important fifteen moves from now when that point is still well beyond the search horizon of a program? But bad play? That might be even harder.

Here's an example. I once wrote an electronic book for beginning chessplayers and used games from Yahoo Chess for my examples, a sort of "learning by bad example" book. I included a game in which one of the players missed "mate in one to three" on several consecutive moves. There was nothing baroque about these mates, either -- I spotted them easily without computer aid, and I'm far from being a strong player. How would you program this behavior into an engine's algorithm? Remember that we have to a) quantify it in mathematical terms and b) develop a "trigger" -- some sort of board event which would cause this subroutine to kick in.

You ask a grandmaster why he played a particularly indecipherable move and he'll answer, "It just seemed right." You ask a beginner why he moved a Knight to a bad square and he'll say, "It just seemed right." The commonality to both responses is intuition (regardless of whether it's good or bad) and that's gonna be a tough thing to program. Back when I taught chess, I'd often ask a student why they played a particular move and get the "seemed right" response -- they really couldn't tell me why they'd played it.

But that leads me right to a thought I had as I read your e-mail. A great source for the project you suggest would be chess teachers. Two words: Jeremy Silman. He'd be the best consultant available for such a project -- after all, it's been his literary bread and butter for years now.

As I said, I like your idea a lot. As to whether or not it's programmable, I'll leave that for the pros to decide.

Oh, and just to throw in a little ChessBase plug here, there are engines available which are considerably weaker than Fritz. Older versions of Fritz came with two versions of the Doctor? engine which played at the level of a typical club player. The Downloads page at www.chessbase.com also contains ExChess, a weaker engine. And, if you're feeling industrious, a couple of my past columns gave details on how to get Winboard and UCI engines to play within the Fritz interface -- many of these engines are quite weak. Another weak engine is mentioned in the next e-mail, too.

And there's always "Handicap and fun mode" within Fritz which allows you to severely lobotomize any chess engine, no matter how strong its natural level. -- SL

-----

I'm a BCF 103 / ELO 1424 player. I tend to play rated blitz games against Fritz & friends, usually allowing the engine to play unleashed, and of course giving it access to it's opening book and to the table-bases.

Of course I get my head ripped off 99.9% of the time, not that it really matters to me. On the rare occasions I can get a draw against the likes of Fritz 8, Shredder 8 & Deep Junior 8, I can feel extremely chuffed with myself.

More importantly, I find these defeats very instructive. It gradually allows me to see weaknesses in my game which I begin to recognise when playing against human opposition. The way Fritz kills me off becomes the way I in turn kill off my human opponents. In-fact training with Fritz at these high levels is a bit like the old-time sportsmen who used to train wearing heavy diving boots. Once those boots come off it is surprising how easy things become.

Perhaps they become too easy, it's not unknown for me to kill someone maybe 40-50 BCF above me, and promptly lose to someone else 40-50 below. But that's just me, Mr inconsistency, I guess.

For players about my level who want a weaker opponent, but one that's not too dumb, I could recommend Konig Swartz. Play that unleashed, with a Fritz book, ( I don't think it reads table-bases), and you should win enough games to satisfy most people.

I would say keep those playing levels high, but occasionally treat yourself to a weaker opponent.

Paul Ruffle

Thanks Paul! You bring up a point I've been harping on for years and have mentioned in prior columns; in fact, it's the genesis of this whole discussion.

One of my favorite training techniques is to set the "Handicap and fun" rating slider to my own rating (which will actually provide an opponent about 100 Elo higher, since USCF ratings are a bit inflated) and play a six-game match. If I win, I raise the slider 25 or 50 Elo and play another match. If I tie (3-3), I'll play another six games with the slider untouched. And should I lose, I'll lower the slider 25 to 50 Elo points. I find that I get competitive games without getting slaughtered, and they're somewhat comparable to the games I get from human opponents down at the chess club.

Some folks, however, find the mistakes that the engines make to be "unintelligent", which is how this whole ball started rolling in the first place.

And thank you for mentioning Konig Swartz (German for "Black King"). That engine, as well as dozens of others, are available in the ChessBase Engine Archive. If Konig Swartz isn't there, try here instead. -- SL

-----

I don't know 1) why this font is so big:) and 2) If you want a prog to play at 1500, seems to me it would be easier just to find a 1500 player since there would be so many of them. Also why not just play online? Why bother with a prog when there are real players around? I can only see value in an engine if it is used for training and I think it would have to be set higher than 15 or 1600 to do that. Online at Red hot Pawn you can play long term cor. type games. On Blitzen ICC or playchess or god forbid even Yahoo (correctly named) you can play fast games of most any time.

Susan Jennings

First off, I have HTML turned off in my mailbox, so the font size looked all right to me. (That's a lot of the reason I turned it off -- I'm on dialup and e-mails with "background stationery", other graphics, and big honking fonts take an eon or two to load).

I hear what you're saying, Susan, and I don't necessarily disagree. There are pros and cons to playing human opponents online. You can see some of the "cons" in a recent ChessBase Workshop, but I'm keeping that particular can of worms closed now that it appears to be firmly welded shut.

I'm in favor of both approaches -- playing humans and computers. I will confess, though, that most of my training these days is against machines rather than people. There's a practical reason for this (it's like the HTML thing I mentioned -- dang near everything I do is done [or not done] for a well-considered reason). I lead a hectic life and I can't often commit to an uninterrupted hour or two to play a human online (I'm too old for blitz chess anymore); with a computer, I can stop a game, save it, and come back to it later.

But as I said in an old column called "The Crossroads", we should all get out and play face-to-face sometimes, too. It all works.

Thanks for writing! -- SL

-----

Interesting topic, "how to dumb down our silicon beasts": To chime in, here are some of my thoughts.

The playing strength from a computer is determined by two factors:
(a) the evaluation function (strategical strength)
(b) pruning of the search tree (tactical strength)

To 'dumb down' a computer's playing strength is relatively easy for (a), by weighing different factors of the board position. For example, a novice would weigh the position by material only, a slightly more advanced player takes into account weak pawn-structure, then weak squares, king safety and so on. A weaker player could have these weighing-factors set to a sub-optimal value to err on the positional side of the game. Like in the "Chessmaster" series, one could set up Personalities to makes them play with these traits and quircks and this works rather well.

(b) is much harder to emulate. How *does* a human prune their search-tree? The novice: "I take his pawn with my knight, then his bishop takes my knight, I take back with my bishop, he takes back with his knight and I take his other bishop with my queen. I've won a pawn!!", and he sets out on the plan. However, a move later the novice sees that the plan doesn't work: instead of taking back *immediately* with his knight, his opponent moves his bishop with check first (a zwischenzug) and the novice loses a bishop for a pawn.

We have *all* fallen to these tactical oversights, at some level or another. It's what makes chess, well... chess. If a computer can be blinded for certain moves *at a certain search-depth* then that would go a long way in emulating the human decision-making.

More concretely:

Classify moves in these catagories.

  • - Capturing moves,
  • - Check moves,
  • - Attacking moves (meaning: the moved piece will attack a piece),
  • - Other moves,
  • - Castling,
  • - En passant

Let the "strength"-variable determine if a move is a candidate to be evaluated to be pruned or not, *as a function of a current search-depth". For example: if the a check occurs at depth=5 then the computer will evaluate that move, but if there is a defense by castling at depth=3, then the computer will miss it, and only see it when it's too late.

I think this is a good way to approach the problem, as it stops the one-move oversights and still allow for tactical errors that the computer otherwise wouldn't make.

Jeroen W. Neve

Jeroen, thanks for writing. Have you downloaded the source for Crafty yet? (Just kidding).

Your move hierarchy idea is a sort of modified spin on the Turing engine, but more sophisticated. Nice idea (and, by the way, if you've not downloaded Turing and the associated text materials from the Engine Downloads page on this site, I encourage you to do so. I'm thinking of devoting a future column to Alan Turing's little "hand simulation" -- it's a fascinating story).

And you commented: "How *does* a human prune their search-tree?" There's that old "intuition" thing again. While analyzing specific variations is certainly a concrete process, the idea of selecting the first candidate move for each variation is a lot more nebulous. I think this is where intuition and experience come greatly into play. And I also believe it's what separates Grandmasters from average players: GMs are far better at identifying fruitful candidates than we mere mortals are. -- SL

---

That's all we have time for right now. We'll look at more the next time around. Until then, have fun!

You can e-mail me with your comments on ChessBase Workshop. All responses will be read, and sending an e-mail to this address grants us permission to use it in a future column. No tech support questions, please.


© 2005, Steven A. Lopez. All rights reserved.



Discussion and Feedback Join the public discussion or submit your feedback to the editors


Discuss

Rules for reader comments

 
 

Not registered yet? Register