Live data from Hacker News

Poker Tournament for LLMs

pokerbattle.ai

101–110 of 212 posts

Re: Poker Tournament for LLMs

#101
post #84

I gave a talk on this topic at PyConEs just 10 days ago. The idea was to have each (human) player secretly write a prompt, then use the same model to see which one wins. It’s just a proof of concept, but the code and instructions are here: https://github.com/pablorodriper/poker_with_agents_PyConEs20...

(author of PokerBattle here) That's cool! Do you have a recording of the talk? You can use PokerKit ( https://pokerkit.readthedocs.io/en/stable/ ) for the engine.

Thank you! I’ll take a look at that. Honestly, building the game was part of the fun, so I didn’t look into open-source options.

The slides are in the repo and the recording will be published on the Python España YouTube channel in a couple of months (in Spanish): https://www.youtube.com/@PythonES

Re: Poker Tournament for LLMs

#102

Earlier quoted context omitted.

> It's not that the algorithm is currently not known but it's the nature of the game that deterministic equilibrium strategies don't exist for anything but most trivial games. Thanks for making this more precise. Generally for imperfect-information games, I agree it's unlikely to have deterministic equilibrium, and I tend to agree in the case of poker -- but I recall there was some paper that showed you can get somet…

>> but I recall there was some paper that showed you can get something like 98% of equilibrium utility in poker subgames, which could make deterministic strategy practical. (Can't find the paper now.) Yeah I can see that for sure. That's also a holy grail of a poker enthusiast "can we please have non-mixed solution that is close enough". The problem is that 2% or even 1% equilibrium utility is huge. Professional play…

I agree it is possible to build an LLM to play poker, with appropriate tool calling, in principle.

I think it's useful to distinguish what LLMs can do in a) theory, b) non-LLM approaches we know work and c) how to do it with LLMs.

In a) theory, LLMs with the "thinking" rollouts are equivalent to (finite-tape) Turing machine, so they can do anything a computer can, so a solution exists (given large-enough neural net/rollout). To do the sampling, I agree the LLM can use an external tool call. This a good start!

For b) to achieve strong performance in poker, we know you can do continual resolving (e.g. search + gadget)

For c) "Quantization" as you suggested is an interesting approach, but it goes against the spirit of "let's have a big neural net that can do any general task". You gave an example how to quantize for a state that has 2 actions. But what about 3? 4? Or N? So in practice, to achieve such generality, you need to output in the token space.

On top of that, for poker, you'd need LLM to somehow implement continual resolving/ReBeL (for equilibrium guarantees). To do all of this, you need either i) LLM call the CPU implementation of the resolver or ii) the LLM to execute instructions like a CPU.

I do believe i) is practically doable today, to e.g. finetune an LLM to incorporate value function in its weights and call a resolver tool, but not something ChatGPT and others can do (to come to my original parent post). Also, in such finetuning process, you will likely trade-off the LLM generality for specialization.

> you can do a k-NN or some other simple approximation. [..] You can say that about any other game then, no?

Yes, you can approximate value function with any model (k-NN, neural net, etc).

> In poker if you call 25% more or 35% more if the bet size is 20% smaller is unlikely to result in a huge blunder. Chess is more volatile and thus you need more "precision" telling patterns apart.

I see. The same applies for Chess however -- you can play mixed strategies there too, with similar property - you can linearly interpolate expected value between losing (-1) and winning (1).

Overall, I think being able to incorporate a value function within an LLM is super interesting research, there are some works there, e.g. Cicero [6], and certainly more should be done, e.g. have a neural net to be both a language model and be able to do AlphaZero-style search.

[6] https://www.science.org/doi/10.1126/science.ade9097

Re: Poker Tournament for LLMs

#103

Earlier quoted context omitted.

I ran a casino and wrote a bot framework that, with a user's permission, attempted to clone their betting strategy based on their hand history (mainly how they bet as a ratio to the pot in a similar blind odds situation relative to the aggressiveness of players before and after), and I let the players play against their own bots. It was fun to watch. Oftentimes the players would lose against their bot versions for aw…

> LLMs would have no hope at conceptualizing any of that. Counter argument - generating probabilistic tokens (degree of randomness) is core concept for an LLM.

It's not. The LLM itself only calculates the probabilities of the next token. Assuming no race conditions in the implementation, this is completely deterministic. The popular LLM inference engine llama.cpp is deterministic. It's the job of the sampler to actually select a token using those probabilities. It can introduce pseudo-randomness if configured to, and in most cases it is configured that way, but there's no requirement to do so, e.g. it could instead always pick the most probable token.

Re: Poker Tournament for LLMs

#104
post #53

Earlier quoted context omitted.

> LLMs do not have a mechanism for sampling from given probability distributions. They could have a tool for that, tho.

They also could be funetuned for it. Eg. When asked for a random number between 1 and 10, and 3 is returned too often, you penalize that in the fine-tuning process until the distribution is exactly uniform.

RLHF for uniform numbers between 1 and 10, lol. What a world we live in now.

Re: Poker Tournament for LLMs

#105

I have PhD in algorithmic game theory and worked on poker. 1) There are currently no algorithms that can compute deterministic equilibrium strategies [0]. Therefore, mixed (randomized) strategies must be used for professional-level play or stronger. 2) In practice, strong play has been achieved with: i) online search and ii) a mechanism to ensure strategy consistency. Without ii) an adaptive opponent can learn to exp…

[deleted]

Re: Poker Tournament for LLMs

#106

Earlier quoted context omitted.

That's interesting, because you show a fundamental limitation of current LLMs in which there is a skill that humans can learn and that LLMs cannot currently emulate. I wonder if there are people working on closing that gap.

Humans are very bad at random number generation as well. LLMs can do sampling via external tools, but as I wrote in other thread, they can't do this in "token space". I'd be curious to see a demonstration of sampling of a distribution (i.e. some uniform) in the "token space", not via external tool calling. Can you make an LLM sample an integer from 1 to 10, or from any other interval, e.g. 223 to 566, without an exte…

Actually that seems exactly wrong. unless you set temperature 0, converting logits to tokens is a random pull. so in principle it should be possible for an llm to recognize that it's being asked for a random number and pull tokens exactly randomly. in practice it won't be exact, but you should be able to rl it to arbitrary closeness to exact

Re: Poker Tournament for LLMs

#107

I have PhD in algorithmic game theory and worked on poker. 1) There are currently no algorithms that can compute deterministic equilibrium strategies [0]. Therefore, mixed (randomized) strategies must be used for professional-level play or stronger. 2) In practice, strong play has been achieved with: i) online search and ii) a mechanism to ensure strategy consistency. Without ii) an adaptive opponent can learn to exp…

What are you working on specifically? I've been vaguely following poker research since Libratus, the last paper I've read is ReBeL, has there been any meaningful progress after that? I was thinking about developing a 5-max poker agent that can play decently (not superhumanly), but it still seems like a kind of uncharted territory, there's Pluribus but limited to fixed stacks, very complex and very computationally dem…

I'm not working on game-related topics lately, I'm in the industry now (algo-trading) and also little bit out of touch.

> Has there been any meaningful progress after that?

There are attempts [0] at making the algorithms work for exponentially large beliefs (=ranges). In poker, these are constant-sized (players receive 2 cards in the beginning), which is not the case in most games. In many games you repeatedly draw cards from a deck and the number of histories/infosets grows exponentially. But nothing works well for search yet, and it is still open problem. For just policy learning without search, RNAD [2] works okayish from what I heard, but it is finicky with hyperparameters to get it to converge.

Most of the research I saw is concerned about making regret minimization more efficient, most notably Predictive Regret Matching [1]

> I was thinking about developing a 5-max poker

Oh, sounds like lot of fun!

> I don't see why a LLM can't learn to play a mixed strategy. A LLM outputs a distribution over all tokens, which is then randomly sampled from.

I tend to agree, I wrote more in another comment. It's just not something an off-the-shelf LLM would do reliably today without lots of non-trivial modifications.

[0] https://arxiv.org/abs/2106.06068

[1] https://ojs.aaai.org/index.php/AAAI/article/view/16676

[2] https://arxiv.org/abs/2206.15378

Re: Poker Tournament for LLMs

#108

Earlier quoted context omitted.

FWIW, I’d bet some coin that current CharGPT would provide a genuine pseudo-random number on request. It now has the ability to recognise when answering the prompt requires a standard algorithm instead of ordinary sentence generation. I found this out recently when I asked it to generate some anagrams for me. Then I asked how it did it.

Depends on how you ask it if course. Chatgpt: Output the random generation of a number between 1 and 10, 100 times ..chatgpt would only provide me with a python script and then offered to add scrolling numbers and colourful digits. Tried again in a new session with: Generate a random number between 1 and 10, 100 times. Output only 4, 9, 1, 6, 10, 3, 2, 5, 7, 8, 1, 9, 4, 6, 10, 2, 8, 5, 7, 3, 9, 1, 4, 6, 10, 8, 2, 7,…

Yeesh, that's bad. Nothing ever repeats and it looks like it makes sure to use every number in each sequence of 10 before resetting in the next section. Towards the end it starts grouping evens and odds together in big clumps as well. I wonder if it would become a repeating sequence if you carried it out far enough?

Re: Poker Tournament for LLMs

#109
post #67

I have PhD in algorithmic game theory and worked on poker. 1) There are currently no algorithms that can compute deterministic equilibrium strategies [0]. Therefore, mixed (randomized) strategies must be used for professional-level play or stronger. 2) In practice, strong play has been achieved with: i) online search and ii) a mechanism to ensure strategy consistency. Without ii) an adaptive opponent can learn to exp…

After reading your comment I gave ChatGPT 5 Thinking prompt "Give me a random number from 1 to 10" and it did give me both 1 and 10 after less than 10 tries. I didn't do enough test to do a distribution, but your statement did not hold up to the test.

Was it a new conversation every time, or did you ask it 10 times within one conversation? I think parent commenter is referring to the former (which for me just yields 7 every time).

Re: Poker Tournament for LLMs

#110

I have PhD in algorithmic game theory and worked on poker. 1) There are currently no algorithms that can compute deterministic equilibrium strategies [0]. Therefore, mixed (randomized) strategies must be used for professional-level play or stronger. 2) In practice, strong play has been achieved with: i) online search and ii) a mechanism to ensure strategy consistency. Without ii) an adaptive opponent can learn to exp…

I decided to try this:

> sample a random number from 1 to 10

> ChatGPT: Here’s a random number between 1 and 10: 7

> again

> ChatGPT: Your random number is: 3

Post reply on HN