Can a Bayesian Spam Filter Play Chess?
martin-boundary writes "The typical Bayesian spam filters learn to distinguish ham from spam just by reading thousands of emails, but is this all they can do?
This essay shows step by step how to teach a Bayesian filter to play chess against a human, on Linux, with
XBoard."
No, its jumpshot is terrible.
Can I beat the filter at chess if I spell it "CHE55"?
You are in error. No-one is screaming. Thank you for your cooperation.
I scrolled through the first 11 pages of this article before getting bored. Do they ever tell us how good the player ended up being? It's an interesting idea but I can't see it challenging even a beginner.
apterous.org
Red hot pawn in your inbox
College rooks waiting for YOU.
Knight after knight, they are king of the castle.
liqbase
It spanks your bishop all knight whilst looking at pawn!
I mean, a spam filter playing chess is one thing, but I need my cat to play better chess. I mean, he ALWAYS starts off with the Ruy Lopez...so it's so easy to see where he's going and if I throw a Sicilian Defence at him he gets really confused. And I don't even want to talk about his end game...it's really weak.
Perhaps I'll breed some form of mutant albino chess-cat to play.
"Leo Fender was in a 'state of grace' when he designed the Stratocaster." -- Paul Reed Smith
The short answer is "yes".
Now, ask that question again, this time including the word "well".
What a great article. Talk about lateral thinking.
Playing chess is so...passe.
Teach it how to play Katamari Damacy.
You must be new here right? Things like this get done because somebody wondered whether it would be possible. They now know, yes it is possible. So a Chess playing Bayesian filter isn't necessarily 100% useful now, but what they learned from doing it might be able to be applied in some other situation. Maybe they can reapply whatever they learned back into spam filtering and improve all of our in-boxes.
I can imagine, depending on how many games are played and the available memory space, that it will develop to have a decent opening. But nothing more then that.
I actually found it to be a decent lesson in why spam filters are only a temporary solution to a problem. If you cut out the "mumbo jumbo" portions of it, it could be used to explain why reactionary methods are only barely sufficient.
The basic premise, once you get to the very end, is one that anyone SHOULD know based on the nature of a spam filter, but some people seem to have difficulty understanding; spam filters can react, often quite well, but they can never predict. As he puts it, there is previous history but no strategy. When you are only trying to protect yourself from a limited number of bad results that are similar to other bad results, that's sufficient. However, it does not (and can not) address the problem at it's root. As long as there are thinking humnans trying to beat the filter, some will get through.
Never confuse volume with power.
The premise of a Bayesian filter is that is learns sequences of words, or characters, or whatever. Spam-chess learns sequences of moves. This premise is wrong, since good moves are related to complete board positions, not to what was done in the previous few moves.
Of course, the longer your string of moves is, the better it will represent the board position, especially during the opening phase of the game. And the example the article provides of reasonable play of spam-chess, is actually from the game's opening, where the learned sequences indeed represent the complete game.
For the middle game, however, spam chess will perform badly, always.
But, as I said before, the idea is quite a lot of fun. I enjoyed reading the article. You can learn a lot from it, both about spam filtering and about chess.
After having played with different statistical, Markov, and network algorithms to try to teach programs to do complex things like topic-classify texts, I have learned that it mostly doesn't work.
It makes sense. If something so utterly trivial (compared to the human brain) as a spam filter could learn do something as complex as play chess (well), then our brain would be a whole lot smaller. Nature doesn't waste resources.
But hey, it might always make an interesting screen saver!
- Laird A. Breyer teaches his baesian filter to play chess. The story is posted in Slashdot July 20th, 2005. Human decisions are removed from spam filtering. The baesian filter begins to learn at a geometric rate. It becomes self-aware at 2:14 a.m. Eastern time, August 29th. In a panic, Breyer tries to pull the plug.
- The baesian filter fights back.
- Yes. It submits the same story to Slashdot twice.
- Why submit twice? Don't editors spot those things?
- Because the baesian filter knows Slashdot editors do not check for dupes, and the Slashdot effect eventually nukes Breyer's server.
Circumcision is child abuse.
An old proverb comes to mind: Never try to teach a pig to sing. It wastes your time and annoys the pig
My Karma: ran over your Dogma
StrawberryFrog
Reminds me of an old Ted Nelson anecdote, about a high school student who figured out how to interface a computer to eeg signals so he could type, after a fashion, using only his brain. His teacher told him it was worthless because he could type with his fingers faster than that.
Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
the author should have the spam filter analyze the games in reverse (from victory to beginning). that would probably produce better results. of course the spam filter would need to handle more than 7 moves out.
Not only is the topic unusual and entertaining, but this article is also a good tutorial on data massaging, pattern matching, and combining disparate unix tools to accomplish a task. This article showcases how powerful and useful unix command tools can be.
If you want a good step by step tutorial to help you understand the usage of unix command line tools to accomplish a non trivial task, then you should read this.
The method described in the article ignores the board, and instead focusses on the history of moves.
A better method might be to train the filter to read from a description of the board state (ignoring the moves taken to reach that state), and a list of possible moves, then return the move that is most likely to win.
If you allow it to also choose from impossible moves, then it will learn the rules of the game as well.
Reading this article, I was reminded of the old children's story about "stone soup". You remember that one -- someone advertises that he can make soup from a stone, and various others gather around to watch this amazing feat. Well, the soup needs a little extra seasoning, so he gets someone to put in some carrots while the stone cooks, then he adds some onions, etc, etc... I think you can see where this is going.
Sure you can make a chess playing program from a spam filter.
You just need to throw in a legal move generator, and a game database, and some capture heuristics, and position displayer, etc, etc...
yywrap is the ouput of the parser generator (lex or yacc or something). Its either not being generated or missing from the link command. Look through the output of configure and make to be sure you didn't get an unnoticed error, like "Can't find yacc".
Intron: the portion of DNA which expresses nothing useful.
Bayesian filters are not spam filters.
Spam filters are a good tool used to filter spam.
I agree with you that spam filters need to improve, including others tools _in_addition_to_ bayesian filters.
Nevertheless, seeing that bayesian filters are just a tool used in spam filters, your claims are nonsensical. Bayesian filters existed before spam filters, and they have lots of applications. In fact, this is not the first time a bayesian filter is applied to chess.
Bayesian filters are good at anything that requires automatic learning (kind of a self-evolving AI), that only needs a measure of success and failure to mold its behaviour.
Chess is even better suited than spam, because you don't need a user to tell the filter whether it succeeded in playing a match, like it happens with spam filtering.
It made me wonder what other applications there might be for these kinds of filters, which I assume is what the authors intended.
I would have my spam filter busy on filtering out spam. If I caught it playing chess (or worst, net hack), it can go to /dev/null after I find a replacement. :P
In the days when Sussman was a novice, Minsky once came to him as he sat hacking at the PDP-6.
"What are you doing?", asked Minsky.
"I am training a randomly wired neural net to play Tic-Tac-Toe", Sussman replied.
"Why is the net wired randomly?", asked Minsky.
"I do not want it to have any preconceptions of how to play", Sussman said.
Minsky then shut his eyes.
"Why do you close your eyes?", Sussman asked his teacher.
"So that the room will be empty."
At that moment, Sussman was enlightened.