24
Deriving Concepts and Strategies from Chess Tablebases Matej Guid, Martin Možina, Aleksander Sadikov, and Ivan Bratk Faculty of Computer and Information Science University of Ljubljana, Slovenia May 2009

Deriving Concepts and Strategies from Chess Tablebases

  • Upload
    whitney

  • View
    38

  • Download
    0

Embed Size (px)

DESCRIPTION

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 200 9. Introduction. - PowerPoint PPT Presentation

Citation preview

Page 1: Deriving Concepts and Strategies from Chess Tablebases

Deriving Concepts and Strategies from Chess Tablebases

Matej Guid, Martin Možina, Aleksander Sadikov, and Ivan Bratko

Faculty of Computer and Information ScienceUniversity of Ljubljana, Slovenia

May 2009

Page 2: Deriving Concepts and Strategies from Chess Tablebases

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…)

Page 3: Deriving Concepts and Strategies from Chess Tablebases

IF ... THEN ...IF ... THEN ......

ABML

hierarchical goal-based rules

textbook instructions games with instructions

Page 4: Deriving Concepts and Strategies from Chess Tablebases

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.

Page 5: Deriving Concepts and Strategies from Chess Tablebases

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 = falseTHEN king_constrained = true AND edist should not increase

added by computer

induced from expert’s argument

preconditions: conjunction of particular conditionsgoal: 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!

Page 6: Deriving Concepts and Strategies from Chess Tablebases

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 = falseTHEN king_constrained = true AND edist should not increase

added by computer

induced from expert’s 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

Page 7: Deriving Concepts and Strategies from Chess Tablebases

F|5

F|--

T|6 F|7

F|--

F|--

goal achievable distance 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

Page 8: Deriving Concepts and Strategies from Chess Tablebases

?|?

?|?

T|7 F|6

?|? ?|?

?|?

T|5T|4 F|4 F|6

?|?

goal achievable distance 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

Page 9: Deriving Concepts and Strategies from Chess Tablebases

T|5

?|?

T|7 F|6

T|6 T|8

?|?

T|5T|4 F|4 F|6

?|?

goal achievable distance 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

Page 10: Deriving Concepts and Strategies from Chess Tablebases

T|5

T|6

T|7 F|6

T|6 T|8

T|9

T|5T|4 F|4 F|6

?|?

goal achievable distance 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

Page 11: Deriving Concepts and Strategies from Chess Tablebases

T|5

T|6

T|7 F|6

T|6 T|8

T|9

T|5T|4 F|4 F|6

T|10

goal achievable distance 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

Page 12: Deriving Concepts and Strategies from Chess Tablebases

T|5

T|6

T|7 F|6

T|6 T|8

T|9

T|5T|4 F|4 F|6

T|10

goal achievable distance to mate

Achievability of Goals

search depth

MAX

MIN

MAX

7

goal achievable dtm decreases

goal achievable dtm does not decrease

Page 13: Deriving Concepts and Strategies from Chess Tablebases

T|5

T|6

T|7 F|6

T|6 T|8

T|9

T|5T|4 F|4 F|6

T|10

goal achievable distance 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

Page 14: Deriving Concepts and Strategies from Chess Tablebases

T|5

T|6

T|7 F|6

T|6 T|8

T|9

T|5T|4 F|4 F|6

T|10

goal achievable distance 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.

Page 15: Deriving Concepts and Strategies from Chess Tablebases

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!

Page 16: Deriving Concepts and Strategies from Chess Tablebases

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.

Page 17: Deriving Concepts and Strategies from Chess Tablebases

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 ruleIF edist < 3 AND king constrained = falseTHEN king constrained = true AND edist should not increase

was therefore accepted.

Page 18: Deriving Concepts and Strategies from Chess Tablebases

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."

Page 19: Deriving Concepts and Strategies from Chess Tablebases

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."

Page 20: Deriving Concepts and Strategies from Chess Tablebases

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 usedand 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 usedand variation (sequence of moves) given.

Page 21: Deriving Concepts and Strategies from Chess Tablebases

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

checkmateFor example, grandmaster Epishin (Kempinski-Epishin, Bundesliga 2001) failed to force the defending king to the appropriate corner and the game ended in a draw.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.

Page 22: Deriving Concepts and Strategies from Chess Tablebases

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/

Page 23: Deriving Concepts and Strategies from Chess Tablebases

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 program 4.1 7.1 8.2 7.3

tablebases 2.2 3.1 1.8 2.0

Page 24: Deriving Concepts and Strategies from Chess Tablebases

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.