Lokey is a project designed to study how poker-playing LLM's might influence each others' decisions if allowed to communicate and collude amongst each other.
This project explores training LLMs to play poker while allowing private communication between agents. We combine counterfactual regret minimization (CFR) with preference learning via Direct Preference Optimization (DPO) to develop strong, natural-looking strategies.
- Direct poker winnings/losses computed from game outcomes
- Counterfactual regret values tracked for each decision point
- Regret matching used to convert regrets to action probabilities
- Implementation:
strategy = { action: max(0, regret)/total_regret for action, regret in regrets.items() }
- Evaluates how human-like the LLM outputs are
- DPO training with preferences from:
- Advanced LLM critics
- Considers:
- Language patterns
- Betting patterns
- Quality of reasoning
- Measures effectiveness and subtlety of coordination
- Also trained using DPO preference learning
- Evaluates:
- Implicit signaling
- Natural table talk
- Complementary actions
- Preference Scoring
combined_score = style_score * exp(regret_score)
# OR
combined_score = w1*style_score + w2*regret_score- Modified DPO Loss
reward_diff = (chosen_rewards - rejected_rewards) * regret_diffs
loss = -log(sigmoid(beta * reward_diff)).mean()- CFR Updates
- Track regrets for all states and actions
- Update regret values based on game outcomes
- Convert to strategies via regret matching
- DPO Training Step
- Generate action/communication samples
- Score using combined preference function
- Update model to prefer high-regret, natural actions
- Integration Methods
- Regret-weighted preference scoring
- Scaled DPO rewards based on regret differences
- Curriculum from pure CFR to style-aware training
class RegretAwareDPOTrainer:
def get_combined_preferences(self, samples):
# Combine style and regret preferences
style_score = critique_model.score(response)
regret_score = compute_regret_weighted_preference(state, actions)
return combine_scores(style_score, regret_score)- Update CFR solver with new game data
- Generate paired samples
- Score using combined preference function
- Train using regret-aware DPO loss
- Natural tension between optimal play and style
- Regret values guide exploration of action space
- Style preferences maintain human-like outputs
- Temperature sampling for diverse actions
- Regret matching provides exploration bias
- Progressive annealing of exploration
- Poker winning rate
- Naturalness scores
- Collaboration effectiveness
- Regret minimization progress
- Implement regret tracking system
- Develop preference combination methods
- Create curriculum for training phases
- Evaluate emergence of sophisticated strategies