All projects

Machine Learning for Poker Opponent Modeling

Combining solver policies, player history, and empirical opponent models.

Visible table + prior hand historyReconstruct the decisionPosition · Board · Pot · Stack · Legal actions
Strategy reference

Stored solver policy

CFR+ / DCFR lookup

Legal action & sizing

Bounded conditioning and guards

Advice for the player
Behavior diagnostics

Historical features

Completed hands and prior actions

Nine predictive layers

Probabilities and support checks

Context alongside advice

Later runtime: predictive diagnostics have zero strategy weight. The human makes the decision.

Overview

Overview

I built a poker decision-support system and research pipeline to study how stored solver policies and models of opponent behavior can inform human decisions. The system reconstructed visible table state, constrained advice to legal actions, and displayed predictions with their supporting context.

Across a 313,672-decision replay, the selected postflop model reached 67.37% observed-action accuracy on supported confirmation rows. That establishes predictive performance, not improved winnings. The public release contains the paper, methodology, notebooks, and aggregate results; trained weights and the live Assistant remain private.

Context

Decision support under hidden information

Context

Poker provided a concrete setting for studying decisions with incomplete information. The same visible action can come from different holdings, strategies, or levels of experience. Position, stack depth, previous bets, and the number of remaining players all change its meaning.

I developed the project around three questions: which learned components improve on simple predictive priors, whether player and session history add useful information, and what recorded play can actually establish about outcomes. Those questions shaped both the interface and the evaluation.

The Problem

Legal actions and reliable decision inputs

The Problem

Predicting an opponent’s next action does not identify the best action for the player. A recommendation also needs a valid game state, a legal action, an appropriate amount, and evidence that its inputs apply to the current situation.

The system therefore needed explicit boundaries between strategy references, empirical predictions, and uncertain historical evidence. Missing histories had to remain missing; revealed cards could supply training labels without becoming information available at an earlier decision. I treated abstention and source labels as part of the product.

Example: translating table controls into legal actions

Visible state

Pot: 60 BB · Call: 20 BB · Stack: 100 BB

Observed betting controls

Fold · Call · Raise

Legal-action mask
Constrained policy output

Unavailable actions are excluded. Aggressive sizing must fit the observed bounds; inconsistent bounds cause abstention.

Illustrative state, not a recorded hand or a model recommendation.

An example legal-action mask built from observed controls. The mask constrains advice before it reaches the user.
System

System architecture

System

The read-only runtime reconstructed cards, stacks, betting controls, and the preceding action sequence. A legal-action mask removed unavailable choices. Stored policies and reviewed preflop references supplied the strategy foundation, followed by bounded conditioning and conditional sizing within the visible legal interval.

A separate path combined player histories with learned models and support checks. Earlier Testing versions blended supported predictions into experimental advice. The later runtime retained those predictions as diagnostics with zero strategy weight. The human player remained responsible for every betting decision.

Visible table + prior hand historyReconstruct the decisionPosition · Board · Pot · Stack · Legal actions
Strategy reference

Stored solver policy

CFR+ / DCFR lookup

Legal action & sizing

Bounded conditioning and guards

Advice for the player
Behavior diagnostics

Historical features

Completed hands and prior actions

Nine predictive layers

Probabilities and support checks

Context alongside advice

Later runtime: predictive diagnostics have zero strategy weight. The human makes the decision.

Later architecture: policy selection and behavior diagnostics have separate roles in the displayed advice.
Data & evaluation

Decision-time features and evaluation splits

Data & evaluation

The training source contained 2,334,700 decisions. Rule checks quarantined 1,239 inconsistent records, leaving 2,333,461 decisions from 202,788 hands across 447 games. Historical features used previously completed hands; within-hand features used only preceding actions. Identity resolution was retrospective.

Chronological selection separated fitting, development, and calibration. Frozen-model replay then covered 313,672 decisions in 60 games, with 106,318 confirmation rows before component-specific support filters. Comparisons used 23 whole-game clusters and paired bootstrap intervals, preserving dependence between decisions from the same game.

Decision-time features, chronological evaluation

  1. 01Train

    1,821,293 earlier decision rows.

  2. 02Develop

    398,940 subsequent decision rows.

  3. 03Calibrate

    113,228 later decision rows.

  4. 04Replay

    313,672 replay decisions.

Replay includes 106,318 confirmation rows, 198,448 development rows, and 8,906 training-overlap rows. Component support is evaluated separately.

Training-source, calibration, and replay counts describe different cohorts; confirmation support varies by component.
Opponent models

Opponent-model architecture

Opponent models

I evaluated supervised tree ensembles from LightGBM, XGBoost, CatBoost, and Extra Trees. The selected layers model postflop behavior, within-hand sequences, joint action and sizing patterns, player archetypes, multiway responses, strategy drift, fold responses, bluff proxies, and showdown calibration.

Each layer has its own features and support requirements. The postflop predictor uses 61 public-state features; within-hand modeling extends that representation with the visible action sequence. Reveal-based layers carry selection limitations: observed holdings and bluff proxies do not expose every opponent’s cards or intentions.

Parallel opponent-model architecture

Structured decision and historical records

Board · position · stacks · pot · prior actions · completed hands

Construct only features available at the decision
Current decision

Public state, action sequence, and legal choices

LightGBMPostflop behavior
CatBoostWithin-hand line
LightGBMAction & size
Prior behavior

Player histories, session histories, and observed opportunities

XGBoostPlayer archetype
CatBoostMultiway response
CatBoostStrategy drift
Conditional evidence

Supported fold responses and reveal-based training targets

Extra TreesFold response
XGBoostBluff likelihood
CatBoostShowdown calibration
Per-model predictions and support checks

Action probabilities, sizing information, historical support, and coverage

Diagnostic output
Behavior diagnostics

Display supported predictions and historical context; zero strategy weight

Independent strategy input

Separate policy reference

Stored CFR+ / DCFR policies, legal-action checks, and bounded sizing supply the advice

Displayed together in the interface
Human decision

The interface presents advice and diagnostic context; the player chooses the action.

These are separate tree-ensemble predictors, not sequential neural layers. Revealed cards supply selected training targets; future cards are not decision-time inputs.

Nine separate predictive components, selected from tree-ensemble families and evaluated on their supported rows.
Strategy reference

Offline policy training and runtime lookup

Strategy reference

The solver work used CFR+ and discounted CFR to train policies for declared poker subgames. Roots specified public histories, board textures, positions, stack depths, and range assumptions. The runtime consulted compiled policies instead of solving the full game during each hand.

The installed river-policy subset contains 67 roots, each with two CFR+ and two DCFR lanes. Evaluation covered both seats, behavioral opponents, and paired cross-play. These checks support the retained artifacts within their restricted contracts; they do not establish equilibrium play for every live state.

Offline solving → runtime lookup

  1. 01Restricted roots

    Specify public state, stack anchors, and range families.

  2. 02CFR+ / DCFR

    Update regret and accumulate strategies offline.

  3. 03Stored policy

    Retain evaluated policies for supported situations.

  4. 04Runtime

    Select, condition, and constrain to legal actions.

Restricted policy references, not a new full-game equilibrium solve at every decision.

Offline restricted-game training feeds a compiled reference; live conditioning does not create a newly solved equilibrium.
Predictive results

Predictive performance against baseline models

Predictive results

All nine selected layers improved log loss over their frozen priors on supported confirmation rows. The postflop model achieved 67.37% accuracy on 42,451 rows, reducing log loss from 0.7955 to 0.6507. Its paired improvement was 0.1448, with a stored interval of 0.1352–0.1555.

The comparison changes when the selected postflop model becomes the baseline. No alternative reliably improves on it. The within-hand model’s interval crosses zero; the other alternatives trail it. This finding argues for evaluating each contribution before combining models into a recommendation.

Paper figure comparing predictive layers against frozen priors and the selected postflop predictor, with uncertainty intervalsView full size
Paired log-loss improvement with whole-game bootstrap intervals. Positive is better; supported rows differ between comparisons.

Predictive support

How much of the confirmation cohort each model covers

106,318 candidate rows
Joint action and size
105,92499.6%
Player archetype
106,17599.9%
Multiway response
36,35834.2%
Bluff likelihood
53,79450.6%
Strategy drift
105,22799.0%
Postflop behavior
42,45139.9%
Showdown calibration
53,79450.6%
Fold response
61,24157.6%
Within-hand sequence
97,80892.0%
Observed-action accuracy67.37%on 42,451 supported rows
Model log loss0.6507lower is better
Prior log loss0.7955on this component’s cohort

Every component is evaluated across 23 games, with its own support filters. The bars show coverage of the 106,318-row confirmation cohort. These overlapping subsets are not additive, and their accuracy values do not form a like-for-like model ranking.

View component metrics
Supported confirmation rows and component-specific predictive measurements
ComponentRowsCoverageAccuracyLog lossPrior log loss
Joint action and size105,92499.6%62.81%0.86950.8979
Player archetype106,17599.9%62.83%0.86980.8980
Multiway response36,35834.2%65.73%0.85840.8861
Bluff likelihood53,79450.6%59.40%0.89860.9200
Strategy drift105,22799.0%62.81%0.86920.8977
Postflop behavior42,45139.9%67.37%0.65070.7955
Showdown calibration53,79450.6%59.40%0.90010.9200
Fold response61,24157.6%59.41%0.87060.9158
Within-hand sequence97,80892.0%66.75%0.75080.8950
Source data
Supported confirmation rows for each predictive component. The cohorts overlap and vary by task, so their accuracies should not be treated as a common leaderboard.
History experiment

Effects of player and session history

History experiment

A separate experiment compared public-state, population, player, and current-session histories. Sparse histories were shrunk toward broader distributions. I evaluated observed actions and conditional aggressive sizing separately across three training windows.

Session history improved conditional sizing over player history in all three windows. Action-prediction gains varied, including a decline in the smallest window. These results come from reused development games, so they support further investigation rather than an untouched confirmation claim.

Paper figure comparing session history and player history for action prediction and conditional sizingView full size
Session-versus-player history comparisons on reused development games; points and stored lower bounds are descriptive.
Outcome & reflection

Results and limitations

Outcome & reflection

The project produced an implemented advisory system, a documented training and evaluation pipeline, and a public research report. Its clearest result is that behavior models can outperform simple priors while still requiring separate evidence before influencing strategy.

The recorded gameplay sample finished at +486.37 big blinds across 4,880 hands in 32 games: +9.97 BB per 100 hands. The curve below shows how that total developed across complete games, including the losses along the way.

This is an observed gameplay result associated with the project. Without a control group or verified recommendation use, it does not establish how much the Assistant contributed to the winnings.

Recorded gameplay

Complete-game ledger results

+9.97 BB/100486.37 BB · 4,880 hands · 32 games
Cumulative recorded poker return. Cumulative net big blinds by Eligible game number. Exact values follow in the data table.Cumulative net big blinds03507001,0501,40008162432Eligible game numberRecorded return: Eligible game number 0, 0 Cumulative net big blindsRecorded return: Eligible game number 1, 190 Cumulative net big blindsRecorded return: Eligible game number 2, 292 Cumulative net big blindsRecorded return: Eligible game number 3, 415 Cumulative net big blindsRecorded return: Eligible game number 4, 115 Cumulative net big blindsRecorded return: Eligible game number 5, 324 Cumulative net big blindsRecorded return: Eligible game number 6, 74 Cumulative net big blindsRecorded return: Eligible game number 7, 79 Cumulative net big blindsRecorded return: Eligible game number 8, 401 Cumulative net big blindsRecorded return: Eligible game number 9, 462 Cumulative net big blindsRecorded return: Eligible game number 10, 1,016 Cumulative net big blindsRecorded return: Eligible game number 11, 1,029 Cumulative net big blindsRecorded return: Eligible game number 12, 1,130 Cumulative net big blindsRecorded return: Eligible game number 13, 837 Cumulative net big blindsRecorded return: Eligible game number 14, 941 Cumulative net big blindsRecorded return: Eligible game number 15, 691 Cumulative net big blindsRecorded return: Eligible game number 16, 762 Cumulative net big blindsRecorded return: Eligible game number 17, 905 Cumulative net big blindsRecorded return: Eligible game number 18, 1,058 Cumulative net big blindsRecorded return: Eligible game number 19, 1,089 Cumulative net big blindsRecorded return: Eligible game number 20, 1,281 Cumulative net big blindsRecorded return: Eligible game number 21, 1,266 Cumulative net big blindsRecorded return: Eligible game number 22, 866 Cumulative net big blindsRecorded return: Eligible game number 23, 566 Cumulative net big blindsRecorded return: Eligible game number 24, 366 Cumulative net big blindsRecorded return: Eligible game number 25, 546 Cumulative net big blindsRecorded return: Eligible game number 26, 584 Cumulative net big blindsRecorded return: Eligible game number 27, 434 Cumulative net big blindsRecorded return: Eligible game number 28, 234 Cumulative net big blindsRecorded return: Eligible game number 29, 423 Cumulative net big blindsRecorded return: Eligible game number 30, 323 Cumulative net big blindsRecorded return: Eligible game number 31, 449 Cumulative net big blindsRecorded return: Eligible game number 32, 486 Cumulative net big blinds
+37.16 BB in this game · 486.37 BB across 4,880 hands

Observed complete-game outcomes associated with the project. The rate is 486.37 ÷ 4,880 × 100; this sample does not establish long-run profitability or the Assistant’s effect on winnings.

View all 32 game results
Complete-game ledger returns; BB means big blinds
GameHandsNet BBCumulative BB
1230190190
2206102.12292.12
3119123.26415.38
4444-300115.38
5166208.92324.3
6195-25074.3
7383579.3
876321.74401.04
926061.3462.34
10135553.81,016.14
1156131,029.14
12115101.341,130.48
13120-293.5836.98
1482104.5941.48
1553-250691.48
1622070.26761.74
1785143.69905.43
18101152.361,057.79
1916831.371,089.16
20146191.541,280.7
21289-14.291,266.41
22212-400866.41
23104-300566.41
2467-200366.41
2556180546.41
266937.24583.65
27109-150433.65
28193-200233.65
2970189.42423.07
3093-100323.07
31115126.14449.21
3214337.16486.37
Source data
Recorded net big blinds, accumulated in game order. The overall rate is 486.37 ÷ 4,880 × 100 = +9.97 BB/100.
Next projectQQQ Options Research