Hi @lanctot, I have a feature proposal to be integrated to OpenSpiel.
For the past few months, I have been working on a benchmarking framework for LLMs, which uses OpenSpiel under the hood. The goal was to build a unified interface that would transform OpenSpiel's states and actions to something the LLMs would understand in prompts and could play by. Using this I measure how well the LLMs play simple games (tic_tac_toe, nim, connect_four) against fixed opponents (random, mcts, stochastic minimax). The results were not very good, e.g. gpt-5.4 (high) lost to a random opponent on tic_tac_toe (full results published here). To find out whether the models are truly reasoning about the states or just recalling observed strategies from training, I also introduced "obfuscations", which are alternative rule, state and action formulations that preserve the game tree but try to prevent the LLM from immediately recognizing the game.
Now, regarding the feature proposal. I published this as an installable package (GitHub repo), however then I noticed that OpenSpiel 2.0 came out alongside with the structured representations directly aimed at evaluating LLMs, thus overlapping with my package in some areas. As it's much more mature codebase than mine, I am wondering whether you'd be interested in integrating some of the features into OpenSpiel. If yes, I would be more than happy to implement them and draft a PR. Specifically, I currently have two features in mind:
-
Add stochasticity to the minimax player.
To make the LLMs see more diverse states, I modified the minimax player to always collect all moves with the highest value and then sample from them uniformly at random. That way even when two minimax players play against each other, the games are different. I found that it sometimes exposes the LLMs performing worse on less conventional states.
-
General mechanism for the obfuscations.
I think it could work like an additional layer between the base engine and the input for the LLMs (that's how it's in my project). I defined each obfuscation as a head prompt, where the modified rules are explained, and two transformation functions mapping states and actions to new states and actions. In my case they are mappings from a board states and numbers to strings, in OpenSpiel it could be a mapping from JSON to JSON. I think it could be useful addition for studying LLMs in games, if that is the direction OpenSpiel wants to aim to. The only downside I can think about is that by publishing the changes in a well-known project, that is probably indexed and trained on, the unknown element of the obfuscations will be lost. However, I believe it could be introduced as a general transform mechanism with the specific instances kept outside of OpenSpiel repository and left up to the user. This would ensure that it's consistent for all users and potential papers using OpenSpiel.
What do you think? Let me please know, if you'd be interested in the features I mentioned. We could also discuss other features, if relevant to OpenSpiel. I would of course maintain this part of the codebase as I don't want to add additional work for you and your team.
Hi @lanctot, I have a feature proposal to be integrated to OpenSpiel.
For the past few months, I have been working on a benchmarking framework for LLMs, which uses OpenSpiel under the hood. The goal was to build a unified interface that would transform OpenSpiel's states and actions to something the LLMs would understand in prompts and could play by. Using this I measure how well the LLMs play simple games (tic_tac_toe, nim, connect_four) against fixed opponents (random, mcts, stochastic minimax). The results were not very good, e.g.
gpt-5.4 (high)lost to a random opponent on tic_tac_toe (full results published here). To find out whether the models are truly reasoning about the states or just recalling observed strategies from training, I also introduced "obfuscations", which are alternative rule, state and action formulations that preserve the game tree but try to prevent the LLM from immediately recognizing the game.Now, regarding the feature proposal. I published this as an installable package (GitHub repo), however then I noticed that OpenSpiel 2.0 came out alongside with the structured representations directly aimed at evaluating LLMs, thus overlapping with my package in some areas. As it's much more mature codebase than mine, I am wondering whether you'd be interested in integrating some of the features into OpenSpiel. If yes, I would be more than happy to implement them and draft a PR. Specifically, I currently have two features in mind:
Add stochasticity to the minimax player.
To make the LLMs see more diverse states, I modified the minimax player to always collect all moves with the highest value and then sample from them uniformly at random. That way even when two minimax players play against each other, the games are different. I found that it sometimes exposes the LLMs performing worse on less conventional states.
General mechanism for the obfuscations.
I think it could work like an additional layer between the base engine and the input for the LLMs (that's how it's in my project). I defined each obfuscation as a head prompt, where the modified rules are explained, and two transformation functions mapping states and actions to new states and actions. In my case they are mappings from a board states and numbers to strings, in OpenSpiel it could be a mapping from JSON to JSON. I think it could be useful addition for studying LLMs in games, if that is the direction OpenSpiel wants to aim to. The only downside I can think about is that by publishing the changes in a well-known project, that is probably indexed and trained on, the unknown element of the obfuscations will be lost. However, I believe it could be introduced as a general transform mechanism with the specific instances kept outside of OpenSpiel repository and left up to the user. This would ensure that it's consistent for all users and potential papers using OpenSpiel.
What do you think? Let me please know, if you'd be interested in the features I mentioned. We could also discuss other features, if relevant to OpenSpiel. I would of course maintain this part of the codebase as I don't want to add additional work for you and your team.