1 / 12

Knowledge-Based play: Patterns and Chunks

Knowledge-Based play: Patterns and Chunks. Recall that Shannon Type A programs rely on extensive search; for decades the most successful chess programs have been of this type this approach does not hold much promise for some other games, esp. Go

mason
Download Presentation

Knowledge-Based play: Patterns and Chunks

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Knowledge-Based play: Patterns and Chunks • Recall that Shannon Type A programs rely on extensive search; • for decades the most successful chess programs have been of this type • this approach does not hold much promise for some other games, esp. Go • Type B programs rely on knowledge (exclusively; or partially): • some knowledge may be coded in ordinary algorithmic fashion • some knowledge may be expressed in terms of patterns • there is evidence that human experts play games such as Chess, Go, Checkers, Backgammon, and so forth, largely by pattern recognition • it appears that human experts are skilled at perceiving (and recalling) positions in terms of interacting chunks; breaking up a complex position into a small number of internally-coherent, meaningful, fragments. http://csiweb.ucd.ie/Staff/acater/comp4031.html Atificial Intelligence for Games and Puzzles

  2. Example from Chess I think anyone who plays chess will see this picture and think … “back rank mate” Hand-coding of patterns may be possible, but there are likely to be tens of thousands of them required. http://csiweb.ucd.ie/Staff/acater/comp4031.html Atificial Intelligence for Games and Puzzles

  3. Expert annotations in Reitman experiment Example from Go I think anyone who plays Go will see this picture and think … “hatchet five” / “bulky five” http://csiweb.ucd.ie/Staff/acater/comp4031.html Atificial Intelligence for Games and Puzzles

  4. Recall of positions • There have been experiments with humans to see how accurately they can reproduce a chess position they have been shown: • show subject a chess position for 15 seconds (say), then cover it up • ask them to reproduce the position on a different board, in 2 minutes (say) • measure • how many pieces are missing, how many are extra, • how many are in correct places, how many are in wrong places • These studies have shown repeatedly that: • experts do better with realistic positions from games than with random ones • experts are much better than novices with realistic positions • experts are better, but not by much, with random positions • complete novices are unaffected by realism vs randomness http://csiweb.ucd.ie/Staff/acater/comp4031.html Atificial Intelligence for Games and Puzzles

  5. The magic number 7 ± 2 • Cognitive psychologists have long believed that human short-term memory has a limited capacity. • people are generally able to remember about seven unrelated things • they can remember just as many complex things that are meaningful to them • - like familiar song titles, short sentences, and names of friends - • as simple things with no particular pattern, • - like letters, digits, and colour names. • This is interpreted to mean that human STM has around seven slots, each slot is capable of holding any concept. • Extrapolating, human chess experts are able to accurately position 20+ pieces because they aren’t remembering pieces, they are remembering groups of pieces. • Superior play derives from better memory for positions, not from faster search. http://csiweb.ucd.ie/Staff/acater/comp4031.html Atificial Intelligence for Games and Puzzles

  6. What use is chunking, in humans and in programs? • Experiments suggest (surprisingly) that skilled chess players search roughly the same number of imaginary positions as unskilled players. • Masters, mere experts, and club-strength players all seem to consider the same positions over and over again • Human memory limitations make it impossible for us to simultaneously imagine two variations of a position: we reconstruct one at a time • The difference between strong players and weaker players is in the quality of the moves they consider, not the quantity. • A chess program does not have an obvious need to severely limit the number of items to be stored in memory. Computers have abundant, perfect, memory. • But programs could do with a way of preferentially picking quality moves! http://csiweb.ucd.ie/Staff/acater/comp4031.html Atificial Intelligence for Games and Puzzles

  7. How chunking could help programs • If a computer could remember all the grandmaster games from a collection, it would be trivial to reproduce grandmaster moves whenever a previously seen position arose. • But the number of possible positions - est. 1040 - is so huge that positions arising in middle-games are highly unlikely to be previously seen. • Imagine a position is broken into say 6-10 chunks, overlapping to some degree. • Each chunk covers some smallish subset of the pieces in the position • Each chunk is more likely to be found in one, perhaps several, stored positions. • No. of possible chunks (up to say 8 pieces) << No. of possible positions • New positions may be made of known chunks combined in novel ways • Expert moves using a piece from a stored chunk may be good in other positions in which the chunk occurs: they are candidates worth considering. http://csiweb.ucd.ie/Staff/acater/comp4031.html Atificial Intelligence for Games and Puzzles

  8. Using chunks in a chess program: One approach • Develop an algorithm for breaking a position into chunks (however defined). • For each move in each game of a collection of high-level games, • Break the before-position into chunks • Store the before-position, the move, the chunks. • Cross-reference everything, especially the move with the chunk(s) containing the piece that moved. • (Optionally, tidy up and condense: discard little-used & much-used chunks) • When playing, seeking a move from a (probably novel) position • Break the before-position into chunks • Find chunks in store, retrieve the associated moves • Adapt those moves, if possible, to the current position • Supply only those adapted moves to a conventional search algorithm. • Pick the candidate move that this limited search deems best. http://csiweb.ucd.ie/Staff/acater/comp4031.html Atificial Intelligence for Games and Puzzles

  9. Chunking algorithms • Two broad kinds of algorithm for breaking a position into chunks: • Define, programmatically, conditions under which pieces and/or empty squares should be considered to be in the same chunk • Example 1: Flinter’s “TAL” chunking heuristic: • a chunk contains one salient piece, andthose other pieces … • … that the salient piece could move to; or that could move to it • Example 2: Gobet’s “CHREST” 5x5 squares (less near edges) • Take statistical view of a connectionist network trained from game positions • Example: Hyötyniemi & Saariluoma’s (Helsinki) configuration space: • 12x64=768 binary input neurons (in an ANN architecture) • clusters form in the configuration space • thresholding the continuous values of connections give a view that can be related to particular pieces repeatedly found in particular places http://csiweb.ucd.ie/Staff/acater/comp4031.html Atificial Intelligence for Games and Puzzles

  10. Flinter’s chunking heuristic • Every piece can be the salient piece for a cluster. Nearby pieces that interact with the salient piece are recorded as follows: • Note that in general, where sliding pieces (rooks, bishops, queens) are involved (either as salient or satellite piece), they may be one or more spaces away from other pieces in the chunk: the chunk description is deliberately a little vague. http://csiweb.ucd.ie/Staff/acater/comp4031.html Atificial Intelligence for Games and Puzzles

  11. Adaptation • Flinter’s was a case-based reasoning approach. • Playing a moves involved • finding known chunks shared (fuzzily) with the current situation, • finding recorded moves involving pieces implicated in these chunks • adapting the moves to the current situation • using this candidate-move generator within an alpha-beta search regime • Moves need adaptation to the current situation because, for example, a bishop move to capture on a particular square in a recorded game • might not capture anything in the current game • or the bishop might have to travel further to capture something; • or it might capture something closer. http://csiweb.ucd.ie/Staff/acater/comp4031.html Atificial Intelligence for Games and Puzzles

  12. References • Flinter, S. 1997. A case-based reasoning approach to chess. • Unpublished PhD thesis, Trinity College Dublin • Gobet, F. A computer model of chess memory. • http://people.brunel.ac.uk/~hsstffg/papers/ModelChessMem/Chess%20Memory.html • Hyötyniemi and Saariluoma. Chess - Beyond the rules. • http://www.control.hut.fi/hyotyniemi/publications/99_pelit.htm • Reitman, J. 1976. Skilled perception in Go: Deducing memory structures from inter-response times. Cognitive Psychology v.8 pp.336-356 http://csiweb.ucd.ie/Staff/acater/comp4031.html Atificial Intelligence for Games and Puzzles

More Related