I have been looking for ways to train a Q-learning agent for a multiplayer zero-sum game (a variation of Tic-Tac-Toe in my case). I came up with a learning strategy I haven't found anywhere else, and I want to know if it would work. Here it is:
The agent learns through self-play. It receives a +1
reward for winning (no matter what player won, you'll see later why) and 0
for every other state. The agent learns through a modified Bellman equation, where the expected future reward is SUBTRACTED and not added.
Q(st, a) = r - γ * max Q(st+1, a)
If you expand this equation, you should get this:
Q(st, a) = rt - γ * rt+1 + γ2 * rt+2 - γ3 * rt+3 + ...
Notice how the plus and minus signs alternate. Thus, your expected reward is a sum of the rewards from your turns minus the sum of your opponent's rewards. That is also why the reward for winning is always +1
.
This strategy is similar to the minimax tree search, where we want the best rewards for us and the worst for our opponent.
I hope I got my point across. Please note that I'm not very good at maths and AI theory, so forgive me if I mixed some things up or have a wrong notation. Also, if this is not a good approach, which would you recommend?