38
An Introduction to Poker Opponent Modeling Peter Chapman Brielin Brown University of Virginia 1 March 2011

An Introduction to Poker Opponent Modelingevans/poker/wp-content/uploads/2011/02/... · Di culties of Poker Opponent Modeling Missing Information [2] A fold does not reveal opponent’s

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: An Introduction to Poker Opponent Modelingevans/poker/wp-content/uploads/2011/02/... · Di culties of Poker Opponent Modeling Missing Information [2] A fold does not reveal opponent’s

An Introduction to Poker Opponent Modeling

Peter Chapman Brielin Brown

University of Virginia

1 March 2011

Page 2: An Introduction to Poker Opponent Modelingevans/poker/wp-content/uploads/2011/02/... · Di culties of Poker Opponent Modeling Missing Information [2] A fold does not reveal opponent’s

It is not my aim to surprise or shock you-but the simplest way Ican summarize is to say that there are now in the world machinesthat think, that learn and that create. Moreover, their ability todo these things is going to increase rapidly until - in a visiblefuture - the range of problems they can handle will be coextensivewith the range to which the human mind has been applied.

Herbert Simon - 1957 [1]

Page 3: An Introduction to Poker Opponent Modelingevans/poker/wp-content/uploads/2011/02/... · Di culties of Poker Opponent Modeling Missing Information [2] A fold does not reveal opponent’s

It is not my aim to surprise or shock you-but the simplest way Ican summarize is to say that there are now in the world machinesthat think, that learn and that create. Moreover, their ability todo these things is going to increase rapidly until - in a visiblefuture - the range of problems they can handle will be coextensivewith the range to which the human mind has been applied.

Herbert Simon - 1957 [1]

Page 4: An Introduction to Poker Opponent Modelingevans/poker/wp-content/uploads/2011/02/... · Di culties of Poker Opponent Modeling Missing Information [2] A fold does not reveal opponent’s

Goals

Basic Knowledges of General Approaches to OpponentModeling (OM)

Ability to Implement the Simple OM System Used inLoki

Page 5: An Introduction to Poker Opponent Modelingevans/poker/wp-content/uploads/2011/02/... · Di culties of Poker Opponent Modeling Missing Information [2] A fold does not reveal opponent’s

Goals

Basic Knowledges of General Approaches to OpponentModeling (OM)

Ability to Implement the Simple OM System Used inLoki

Page 6: An Introduction to Poker Opponent Modelingevans/poker/wp-content/uploads/2011/02/... · Di culties of Poker Opponent Modeling Missing Information [2] A fold does not reveal opponent’s

Outline

1 Motivation

2 General Approaches

3 Loki Opponent Modeling

Page 7: An Introduction to Poker Opponent Modelingevans/poker/wp-content/uploads/2011/02/... · Di culties of Poker Opponent Modeling Missing Information [2] A fold does not reveal opponent’s

Opponent Modeling

Goals:Understanding the internal state of the opponent

Predicting the opponent’s future actions

Page 8: An Introduction to Poker Opponent Modelingevans/poker/wp-content/uploads/2011/02/... · Di culties of Poker Opponent Modeling Missing Information [2] A fold does not reveal opponent’s

Opponent Modeling

Goals:Understanding the internal state of the opponent

Predicting the opponent’s future actions

Page 9: An Introduction to Poker Opponent Modelingevans/poker/wp-content/uploads/2011/02/... · Di culties of Poker Opponent Modeling Missing Information [2] A fold does not reveal opponent’s

Deep Blue

”There is no psychology atwork” in Deep Blue, says IBMresearch scientist MurrayCampbell. Nor does Deep Blue”learn” its opponent as it plays.Instead, it operates much like aturbocharged ”expert system,”drawing on vast resources ofstored information (For example,a database of opening gamesplayed by grandmasters over thelast 100 years) and thencalculating the most appropriateresponse to an opponent’s move.

Page 10: An Introduction to Poker Opponent Modelingevans/poker/wp-content/uploads/2011/02/... · Di culties of Poker Opponent Modeling Missing Information [2] A fold does not reveal opponent’s

Scrabble

Page 11: An Introduction to Poker Opponent Modelingevans/poker/wp-content/uploads/2011/02/... · Di culties of Poker Opponent Modeling Missing Information [2] A fold does not reveal opponent’s

Rock-Paper-Scissors

Page 12: An Introduction to Poker Opponent Modelingevans/poker/wp-content/uploads/2011/02/... · Di culties of Poker Opponent Modeling Missing Information [2] A fold does not reveal opponent’s

Rock-Paper-Scissors

Page 13: An Introduction to Poker Opponent Modelingevans/poker/wp-content/uploads/2011/02/... · Di culties of Poker Opponent Modeling Missing Information [2] A fold does not reveal opponent’s

Rock-Paper-Scissors

Page 14: An Introduction to Poker Opponent Modelingevans/poker/wp-content/uploads/2011/02/... · Di culties of Poker Opponent Modeling Missing Information [2] A fold does not reveal opponent’s

Rock-Paper-Scissors

i n t getComputer Input ( ) i n t t o t a l = seenPaper+seenRock+s e e n S c i s s o r s ;i n t c h o i c e = rand ( ) % t o t a l ;

i f ( c h o i c e < seenPaper )return SCISSORS ;

e l s e i f ( c h o i c e < seenRock )return PAPER ;

e l s ereturn ROCK ;

Page 15: An Introduction to Poker Opponent Modelingevans/poker/wp-content/uploads/2011/02/... · Di culties of Poker Opponent Modeling Missing Information [2] A fold does not reveal opponent’s

Rock-Paper-Scissors

i n t henny ( )

return ( (∗ o p p h i s t o r y ? o p p h i s t o r y [ random ( )%∗o p p h i s t o r y +1]+1: random ( ) ) %3) ;

Page 16: An Introduction to Poker Opponent Modelingevans/poker/wp-content/uploads/2011/02/... · Di culties of Poker Opponent Modeling Missing Information [2] A fold does not reveal opponent’s

Optimality and Maximality

Optimal PlayNash Equilibrium

Maximal PlayMaking non-optimal moves in order to increaseexpected value

Page 17: An Introduction to Poker Opponent Modelingevans/poker/wp-content/uploads/2011/02/... · Di culties of Poker Opponent Modeling Missing Information [2] A fold does not reveal opponent’s

Poker opponent modeling is hard.

Page 18: An Introduction to Poker Opponent Modelingevans/poker/wp-content/uploads/2011/02/... · Di culties of Poker Opponent Modeling Missing Information [2] A fold does not reveal opponent’s

Difficulties of Poker Opponent Modeling

Fundamental Uncertainties [2]

Each hand is completely different

Difficult to extract a “signal” through the noise.

Time to Learn [3]

Need to get a good model working in less than 100hands

Page 19: An Introduction to Poker Opponent Modelingevans/poker/wp-content/uploads/2011/02/... · Di culties of Poker Opponent Modeling Missing Information [2] A fold does not reveal opponent’s

Difficulties of Poker Opponent Modeling

Fundamental Uncertainties [2]

Each hand is completely different

Difficult to extract a “signal” through the noise.

Time to Learn [3]

Need to get a good model working in less than 100hands

Page 20: An Introduction to Poker Opponent Modelingevans/poker/wp-content/uploads/2011/02/... · Di culties of Poker Opponent Modeling Missing Information [2] A fold does not reveal opponent’s

Difficulties of Poker Opponent Modeling

Missing Information [2]

A fold does not reveal opponent’s hand

Few games make it the showdown

Different Criteria for Different Players [2]

Position at the tableGenerally better to have loose player on the right and tight player onthe left [4]

Stack size, blind size and position, previous actions ofother players

Mood of the game and players

Player skill

Hand strength

Page 21: An Introduction to Poker Opponent Modelingevans/poker/wp-content/uploads/2011/02/... · Di culties of Poker Opponent Modeling Missing Information [2] A fold does not reveal opponent’s

Difficulties of Poker Opponent Modeling

Missing Information [2]

A fold does not reveal opponent’s hand

Few games make it the showdown

Different Criteria for Different Players [2]

Position at the tableGenerally better to have loose player on the right and tight player onthe left [4]

Stack size, blind size and position, previous actions ofother players

Mood of the game and players

Player skill

Hand strength

Page 22: An Introduction to Poker Opponent Modelingevans/poker/wp-content/uploads/2011/02/... · Di culties of Poker Opponent Modeling Missing Information [2] A fold does not reveal opponent’s

Difficulties of Poker Opponent Modeling

The past is not necessarily a good predictor of thefuture [5]

Looking only at the recent history does not work

Humans have emotions

Good opponents change strategies

Your opponent is modeling you

Page 23: An Introduction to Poker Opponent Modelingevans/poker/wp-content/uploads/2011/02/... · Di culties of Poker Opponent Modeling Missing Information [2] A fold does not reveal opponent’s

Rational Opponent

The implicit model in Minimax search

Variations possible

Page 24: An Introduction to Poker Opponent Modelingevans/poker/wp-content/uploads/2011/02/... · Di culties of Poker Opponent Modeling Missing Information [2] A fold does not reveal opponent’s

Prepared Strategies

Simple Prepared Strategy

Come up with some poker strategy that works

against everyone

Categorical Prepared Strategy

Loose, tight, passive, aggressive, etc.

Page 25: An Introduction to Poker Opponent Modelingevans/poker/wp-content/uploads/2011/02/... · Di culties of Poker Opponent Modeling Missing Information [2] A fold does not reveal opponent’s

Statistical Approach

Simple

Percentage of time opponent sees the flop

Percentage of time caught bluffing

Complex

Frequency opponent goes for the straight

Page 26: An Introduction to Poker Opponent Modelingevans/poker/wp-content/uploads/2011/02/... · Di culties of Poker Opponent Modeling Missing Information [2] A fold does not reveal opponent’s

Neural Networks

Page 27: An Introduction to Poker Opponent Modelingevans/poker/wp-content/uploads/2011/02/... · Di culties of Poker Opponent Modeling Missing Information [2] A fold does not reveal opponent’s

Neural Networks

Page 28: An Introduction to Poker Opponent Modelingevans/poker/wp-content/uploads/2011/02/... · Di culties of Poker Opponent Modeling Missing Information [2] A fold does not reveal opponent’s

Loki

Predecessor to Poki and Norse God or Jotunn or Both. [6]

Page 29: An Introduction to Poker Opponent Modelingevans/poker/wp-content/uploads/2011/02/... · Di culties of Poker Opponent Modeling Missing Information [2] A fold does not reveal opponent’s

Loki

Keep in mind Loki’s OM only tries to figure out opponents cards.

Page 30: An Introduction to Poker Opponent Modelingevans/poker/wp-content/uploads/2011/02/... · Di culties of Poker Opponent Modeling Missing Information [2] A fold does not reveal opponent’s

Loki

Keep in mind Loki’s OM only tries to figure out opponents cards.

Page 31: An Introduction to Poker Opponent Modelingevans/poker/wp-content/uploads/2011/02/... · Di culties of Poker Opponent Modeling Missing Information [2] A fold does not reveal opponent’s

Hand Assessment

Hand Strength (HS)Pre-flop strength is calculated through offline randomsimulationAfter the flop, the strength is the percentile ranking ofthe current hand in relation to all the other (1081)possible dealt pairs

A♦− Q♣ with the flop 3♥− 4♣− J♥444 better hands, 9 equal hands, and 628 worse hands628+ 9

2

1081 = 58.5%

Page 32: An Introduction to Poker Opponent Modelingevans/poker/wp-content/uploads/2011/02/... · Di culties of Poker Opponent Modeling Missing Information [2] A fold does not reveal opponent’s

Hand Assessment

Hand PotentialPositive Potential (PpotN): The probability ofimproving to the best hand after N more cards

Negative Potential (NpotN): The probability of fallingbehind after N more cards

For each 1,081 hands, look at 990 combinations of thetwo cards after the flop

Effective Hand Strength (EHS)Hands where player is ahead or have a positivepotential

Page 33: An Introduction to Poker Opponent Modelingevans/poker/wp-content/uploads/2011/02/... · Di culties of Poker Opponent Modeling Missing Information [2] A fold does not reveal opponent’s

Opponent Modeling

Calculate a weight for each of the 1,081 possibleopponent hands

Assumes ”reasonable” behavior, seems vulnerable tobluffing

Can include specific opponent history to increaseaccuracy

Page 34: An Introduction to Poker Opponent Modelingevans/poker/wp-content/uploads/2011/02/... · Di culties of Poker Opponent Modeling Missing Information [2] A fold does not reveal opponent’s

Opponent Modeling

Initial Weights

Page 35: An Introduction to Poker Opponent Modelingevans/poker/wp-content/uploads/2011/02/... · Di culties of Poker Opponent Modeling Missing Information [2] A fold does not reveal opponent’s

Opponent Modeling

Re-weighting

Page 36: An Introduction to Poker Opponent Modelingevans/poker/wp-content/uploads/2011/02/... · Di culties of Poker Opponent Modeling Missing Information [2] A fold does not reveal opponent’s

Knowledge is power, if you know it about the right person.

Erastus Flavel Beadle (1821-1894)

Page 37: An Introduction to Poker Opponent Modelingevans/poker/wp-content/uploads/2011/02/... · Di culties of Poker Opponent Modeling Missing Information [2] A fold does not reveal opponent’s

References

S. Russell and P. Norvig, Artificial Intelligence: A Modern Approach, 3rd ed.Upper Saddle River, NJ, USA: Prentice Hall Press, 2009.

A. Davidson, A. Davidson, D. Szafron, R. Holte, and W. Pedrycz,“Opponent modeling in poker: Learning and acting in a hostile and uncertainenvironment,” Tech. Rep., 2002.

D. Billings and D. Billings, “Algorithms and assessment in computer poker,”Tech. Rep., 2006.

K. Glocer and M. Deckert, “Opponent modeling in poker,” Tech. Rep., 2007.

M. Salim and P. Rohwer, “Poker opponent modeling.”

D. Billings, D. Papp, J. Schaeffer, and D. Szafron, “Opponent modeling inpoker,” Proceedings of the Fifteenth National Conference of the AmericanAssociation for Artificial Intelligence (AAAI), 1998. [Online]. Available:http://www.cs.ualberta.ca/∼games/poker/publications/AAAI98.pdf

Page 38: An Introduction to Poker Opponent Modelingevans/poker/wp-content/uploads/2011/02/... · Di culties of Poker Opponent Modeling Missing Information [2] A fold does not reveal opponent’s

Initial Explanation Detailed