{{Short description|Reinforcement learning technique}} {{Machine learning|Reinforcement learning}}

'''Self-play''' is a technique for improving the performance of reinforcement learning agents. Intuitively, agents learn to improve their performance by playing "against themselves".

== Definition and motivation ==

In multi-agent reinforcement learning experiments, researchers try to optimize the performance of a learning agent on a given task, in cooperation or competition with one or more agents. These agents learn by trial-and-error, and researchers may choose to have the learning algorithm play the role of two or more of the different agents. When successfully executed, this technique has a double advantage:

# It provides a straightforward way to determine the actions of the other agents, resulting in a meaningful challenge. # It increases the amount of experience that can be used to improve the policy, by a factor of two or more, since the viewpoints of each of the different agents can be used for learning. Czarnecki et al<ref>{{Cite journal |last1=Czarnecki |first1=Wojciech M. |last2=Gidel |first2=Gauthier |last3=Tracey |first3=Brendan |last4=Tuyls |first4=Karl |last5=Omidshafiei |first5=Shayegan |last6=Balduzzi |first6=David |last7=Jaderberg |first7=Max |date=2020 |title=Real World Games Look Like Spinning Tops |url=https://proceedings.neurips.cc/paper/2020/hash/ca172e964907a97d5ebd876bfdd4adbd-Abstract.html |journal=Advances in Neural Information Processing Systems |publisher=Curran Associates, Inc. |volume=33 |pages=17443–17454|arxiv=2004.09468 }}</ref> argue that most of the games that people play for fun are "Games of Skill", meaning games whose space of all possible strategies looks like a spinning top. In more detail, we can partition the space of strategies into sets <math>L_1, L_2, ..., L_n</math>, such that any <math>i < j, \pi_i\in L_i, \pi_j \in L_j</math>, the strategy <math>\pi_j</math> beats the strategy <math>\pi_i</math>. Then, in population-based self-play, if the population is larger than <math>\max_i |L_i|</math>, then the algorithm would converge to the best possible strategy.

== Usage ==

Self-play is used by the AlphaZero program to improve its performance in the games of chess, shogi and go.<ref>{{Cite arXiv|author-link1=David Silver (programmer)|first1=David|last1= Silver|first2=Thomas|last2= Hubert|first3= Julian|last3=Schrittwieser|first4= Ioannis|last4=Antonoglou |first5= Matthew|last5= Lai|first6= Arthur|last6= Guez|first7= Marc|last7= Lanctot|first8= Laurent|last8= Sifre|first9= Dharshan|last9= Kumaran|author-link9=Dharshan Kumaran|first10= Thore|last10= Graepel|first11= Timothy|last11= Lillicrap|first12= Karen|last12= Simonyan|first13=Demis |last13=Hassabis|author-link13=Demis Hassabis |eprint=1712.01815|title=Mastering Chess and Shogi by Self-Play with a General Reinforcement Learning Algorithm|class=cs.AI|date=5 December 2017}}</ref>

Self-play is also used to train the Cicero AI system to outperform humans at the game of Diplomacy. The technique is also used in training the DeepNash system to play the game Stratego.<ref>{{Cite web |last=Snyder |first=Alison |date=2022-12-01 |title=Two new AI systems beat humans at complex games |url=https://www.axios.com/2022/12/01/ai-beats-humans-complex-games |access-date=2022-12-29 |website=Axios |language=en}}</ref><ref>{{Citation |last=Erich_Grunewald |title=Notes on Meta's Diplomacy-Playing AI |url=https://www.lesswrong.com/posts/oT8fmwWddGwnZbbym/notes-on-meta-s-diplomacy-playing-ai |work=LessWrong |date=22 December 2022 |language=en}}</ref>

== Connections to other disciplines ==

Self-play has been compared to the epistemological concept of tabula rasa that describes the way that humans acquire knowledge from a "blank slate".<ref>{{cite arXiv|first=Alexandre|last=Laterre|eprint=1712.01815|title=Ranked Reward: Enabling Self-Play Reinforcement Learning for Combinatorial Optimization|year=2018|class=cs.AI }}</ref>

== Further reading ==

* {{cite arXiv | first1 = Anthony | last1 = DiGiovanni | first2 = Ethan | last2 = Zell | display-authors=etal | title = Survey of Self-Play in Reinforcement Learning | eprint = 2107.02850 | year = 2021 | class = cs.GT }}

==References== {{Reflist}}

Category:Reinforcement learning Category:Machine learning algorithms