# Deriving Concepts and Strategies from Chess Tablebases Matej Guid, Martin Možina, Aleksander Sadikov, and Ivan Bratko Faculty of Computer and Information.

## Presentation on theme: "Deriving Concepts and Strategies from Chess Tablebases Matej Guid, Martin Možina, Aleksander Sadikov, and Ivan Bratko Faculty of Computer and Information."— Presentation transcript:

Deriving Concepts and Strategies from Chess Tablebases Matej Guid, Martin Možina, Aleksander Sadikov, and Ivan Bratko Faculty of Computer and Information Science University of Ljubljana, Slovenia May 2009 Advances in Computers and Games (ACG 12) Pamplona, Spain, May 11-13, 2009

Introduction Chess tablebases contain a wealth of knowledge, however, mining for this knowledge, manually or automatically, proved as extremely difficult. RESEARCH QUESTION How to produce human-understandable models and use them to generate instructions suitable for teaching humans? RESEARCH QUESTION How to produce human-understandable models and use them to generate instructions suitable for teaching humans? Machine learning from tablebases did not yield much success… relatively small domains (such as KRK endgame in chess) resulting models are hardly intelligible to human experts (novices, beginners…)

IF... THEN...... ABML hierarchical goal-based rules textbook instructionsgames with instructions

Obtaining Knowledge from Domain Expert Computer (to the expert): What goal would you suggest for white in this position? What are the reasons for this goal to apply in this position? The expert (a FIDE master): Black king is quite close to the edge of the board, but the king is not constrained by white pieces. Therefore I would suggest White to constrain black king. A new attribute king_constrained was introduced. The argument was used to induce a new rule.

Strategic Goal-Based Rules Hierarchical model of an ordered set of rules of the following form: IF preconditions THEN goal Preconditions and goals are both expressed by using the features that resulted from the knowledge elicitation process. IF edist < 3 AND king_constrained = false THEN king_constrained = true AND edist should not increase added by computer induced from experts argument preconditions: conjunction of particular conditions goal: conjuction of particular subgoals The expert may add, modify, and/or remove any of the preconditions and subgoals. It is important to rely on common knowledge about the domain! The expert may add, modify, and/or remove any of the preconditions and subgoals. It is important to rely on common knowledge about the domain!

Strategic Goal-Based Rules Hierarchical model of an ordered set of rules of the following form: IF preconditions THEN goal Preconditions and goals are both expressed by using the features that resulted from the knowledge elicitation process. IF edist < 3 AND king_constrained = false THEN king_constrained = true AND edist should not increase added by computer induced from experts argument A subgoal can specify: desired value of an attribute: true/false,, … its optimization: minimize, maximize qualitative changes: decrease, increase, not decrease, not increase A subgoal can specify: desired value of an attribute: true/false,, … its optimization: minimize, maximize qualitative changes: decrease, increase, not decrease, not increase

F|5 F|-- T|6 F|7 F|-- goal achievabledistance to mate Achievability of Goals search depth MAX MIN MAX iterative deepening goal achievable: player MAX can force its execution desirable: distance to mate decreases at given search depth allowing non-optimal play, but aiming towards final goal: delivering checkmate 7

?|? T|7 F|6 ?|? T|5 T|4 F|4 F|6 ?|??|? goal achievabledistance to mate Achievability of Goals search depth MAX MIN MAX the student can sometimes achieve the goal in several ways do they all decrease distance to mate? 7

T|5 ?|? T|7 F|6 T|6 T|8 ?|? T|5 T|4 F|4 F|6 ?|??|? goal achievabledistance to mate Achievability of Goals search depth MAX MIN MAX the student can sometimes achieve the goal in several ways do they all decrease distance to mate? 7

T|5 T|6 T|7 F|6 T|6 T|8 T|9 T|5 T|4 F|4 F|6 ?|??|? goal achievabledistance to mate Achievability of Goals search depth MAX MIN MAX the student can sometimes achieve the goal in several ways do they all decrease distance to mate? 7

T|5 T|6 T|7 F|6 T|6 T|8 T|9 T|5 T|4 F|4 F|6 T|10 goal achievabledistance to mate Achievability of Goals search depth MAX MIN MAX the student can sometimes achieve the goal in several ways do they all decrease distance to mate? 7

T|5 T|6 T|7 F|6 T|6 T|8 T|9 T|5 T|4 F|4 F|6 T|10 goal achievabledistance to mate Achievability of Goals search depth MAX MIN MAX 7 goal achievable dtm decreases goal achievable dtm does not decrease

T|5 T|6 T|7 F|6 T|6 T|8 T|9 T|5 T|4 F|4 F|6 T|10 goal achievabledistance to mate Achievability of Goals search depth MAX MIN MAX 7 max search depth Counter example: goal can be achieved, but resulting play does NOT decrease distance to mate

T|5 T|6 T|7 F|6 T|6 T|8 T|9 T|5 T|4 F|4 F|6 T|10 goal achievabledistance to mate Achievability of Goals search depth MAX MIN MAX 7 max search depth Among counter examples, the position with highest distance to mate is chosen as the key counter example.

Key counter example Computer (to the expert): Would you admonish a student if he or she played 1.Rd1-c1 in this position?" 1.Ke7-d7 is optimal move according to tablebases: achieves mate in 6 moves (after 1...Kb7-b6 2.Rd1-d5!) 1.Rd1-c1 is the worst possible execution of suggested goal (constrain king…) achieves mate in 11 moves -> much worse!

Key counter example Computer (to the expert): Would you admonish a student if he or she played 1.Rd1-c1 in this position?" Human players typically choose a longer path to win by systematically achieving intermediate goals. The resulting play in counter examples should lead to overall progress towards achieving the final goal of delivering checkmate.

Key counter example Computer (to the expert): Would you admonish a student if he or she played 1.Rd1-c1 in this position?" The expert found this execution of the goal to be perfectly acceptable. The rule IF edist < 3 AND king constrained = false THEN king constrained = true AND edist should not increase was therefore accepted.

Hierarchy of Goals goal is achievable also when goals can be executed regardless of the defender's play (optimal or non-optimal) the student is instructed to always try to execute the highest achievable goal typical of a human way of thinking It would be redundant to express goals in the following way: Constrain black king or deliver a checkmate, if the opponent plays badly and allows it." It would be redundant to express goals in the following way: Constrain black king or deliver a checkmate, if the opponent plays badly and allows it."

Constructing Human-Friendly Instructions instructions are obtained by stating only the progressive subgoal IF king_constrained = false … THEN king constrained = true … IF … THEN edist should decrease IF edist>0 … THEN edist=0 the exception is the last, default goal IF edist < 1 THEN edist should not increase AND knight_on_edge = false AND wrong_corner_way should decrease AND wrong_corner_way minimize AND white_king_more_central = true derived instruction: Block the way to the wrong corner."

Obtaining Diagrams and Variations desirable to provide most useful representation of the goals and concepts simulations of delivering checkmate randomly chosen initial positions the program used hierarchy of goals as a heuristic execution of goals in these simulations was optimal (quickest play) For each goal… Position that occurred most frequently is presented by a diagram. When several positions occurred equally frequently, more diagrams were used and variation (sequence of moves) given. For each goal… Position that occurred most frequently is presented by a diagram. When several positions occurred equally frequently, more diagrams were used and variation (sequence of moves) given.

The Bishop and Knight Checkmate (KBNK) regarded as the most difficult of the elementary mates general strategy: driving the opposing king to the edge of the board forcing the king to the appropriate corner delivering a checkmate only knowing this basic strategy hardly suffices for delivering checkmate For example, grandmaster Epishin (Kempinski-Epishin, Bundesliga 2001) failed to force the defending king to the appropriate corner and the game ended in a draw. No formalized models for KBNK endgame suitable for teaching purposes were derived by any machine-learning programs.

Derived Strategy, Concepts, and Example Games 1. (highest) goal: Deliver checkmate. 2. goal: Prepare the knight for checkmate. 3. goal: Restrain black to a minimal area beside the right corner. 4. goal: Build a barrier and squeeze black king's area. 5. goal: Approach black from the center. 6. goal: Block the way to the wrong corner. 7. goal: Push black towards the right corner. 8. goal: Push black towards the edge. 9. goal: Approach with the king. 10. goal: Bring the knight closer to black king. default goal: Keep the kings close. A strategy is an ordered list of goals: The rule-based model for KBNK, description of the attributes and example games containing automatically generated instructions can be found in a web appendix at http://www.ailab.si/matej/KBNK/

Evaluation Three chess teachers (among them a selectors of Slovenian women's and youth squad) all agreed on the usefulness of the presented concepts and found the derived strategy suitable for educational purposes. Among the reasons to support this assessment was that the instructions clearly demonstrate the intermediate subgoals of delivering checkmate. The rules by using them as a heuristic function for 6-ply minimax search to play 100 randomly chosen KBNK positions (at least 28 moves to mate with optimal play) against perfect defender: quickest play: average game length was 32 moves, 100% checkmate slowest play: average game length was 38 moves, 100% checkmate Four strong grandmasters were asked to express their assessment for each game to what degree (1 to 10) they find KRK play to be human-like: our program4.17.18.27.3 tablebases2.23.11.82.0

Conclusions We developed a procedure for semi-automatic synthesis of textbook instructions for teaching the difficult KBNK endgame, accompanied by example games containing generated instructions. Derived strategy includes concepts and key positions from KBNK that help the human learner to easily understand main principles of this strategy: detected automatically from simulated games goals enable correct play also against sub-optimal defence Positive assessment of derived textbook instructions by chess coaches We explained : guidelines for interaction between the machine and the expert to obtain a human-understandable rule-based model for playing a chess endgame how the instructions, including illustrative diagrams, could be derived semi-automatically from such a model.

Download ppt "Deriving Concepts and Strategies from Chess Tablebases Matej Guid, Martin Možina, Aleksander Sadikov, and Ivan Bratko Faculty of Computer and Information."

Similar presentations