# Uczenie przez grę z samym sobą (self-play)

EN: **Self-play and league training** · id `selfplay` · aliases: self-play, gra z samym sobą, league training, trening ligowy, fictitious self-play, population-based training

Path: [AI Atlas](https://aiatlasgraph.com/llms.txt) › [AI w grach](https://aiatlasgraph.com/t/gameai.md) › [Agenci grający w gry](https://aiatlasgraph.com/t/gameplaying.md) › Uczenie przez grę z samym sobą (self-play)

## Description

- PL: Trening agentów przez rozgrywki z bieżącymi lub wcześniejszymi wersjami siebie, często z populacją strategii (liga) chroniącą przed cyklicznym zapominaniem.
- EN: Training agents through games against current or past versions of themselves, often with a population of strategies (a league) to prevent cyclic forgetting.

## In one sentence

- PL: Program uczy się gry, rozgrywając miliony partii przeciw własnym kopiom, bez podglądania ludzi.
- EN: A program learns a game by playing millions of matches against copies of itself, without watching people.

## Problem it solves

- PL: Do nauki potrzeba przeciwnika na właściwym poziomie, a ludzi do grania i nagrań z mistrzowskich partii jest za mało.
- EN: Learning needs an opponent at the right level, and there are too few people to play and too few recorded master games.

## What it does

- PL: Jak szachista, który gra sam ze sobą po obu stronach planszy: każde odkrycie jednej strony zmusza drugą do poprawy.
- EN: Like a chess player playing both sides of the board: every discovery by one side forces the other to improve.

## Everyday example

- PL: Komputerowy przeciwnik w grze strategicznej, który na początku ruszał się losowo, a po tygodniach treningu ze sobą wygrywa z ligą ludzi.
- EN: A strategy-game opponent that first moved at random and, after weeks of training against itself, beats ranked human players.

## This concerns you if you…

- PL: ciekawi cię, jak AI pokonało mistrzów gier
- PL: trenujesz agenta, a brakuje ci przeciwników
- EN: wonder how AI beat game champions
- EN: train an agent and lack opponents for it

## Keywords

AlphaZero · AlphaStar · league training · fictitious self-play · PSRO · population-based training · OpenAI Five

## How it works

- PL: Agent gra przeciw kopiom, a wyniki partii są sygnałem uczenia, np. dla przeszukiwania drzewa z siecią lub dla uczenia ze wzmocnieniem. Sama gra z najnowszą wersją prowadzi do kręcenia się w kółko strategii, dlatego utrzymuje się pulę dawnych wersji i wyspecjalizowanych wyzyskiwaczy, którzy wskazują słabości głównego agenta.
- EN: The agent plays copies of itself, and match outcomes are the learning signal, e.g. for tree search with a network or for reinforcement learning. Playing only the latest version makes strategies chase each other in circles, so a pool of past versions and specialised exploiters is kept to expose the main agent's weaknesses.

## Limits

- PL: Wymaga ogromnej liczby rozgrywek i szybkiego symulatora. Bez puli przeciwników agent może zapomnieć, jak bronić się przed starymi strategiami. W grach wieloosobowych i kooperacyjnych sama gra ze sobą tworzy konwencje niezrozumiałe dla ludzi.
- EN: It needs enormous numbers of games and a fast simulator. Without an opponent pool the agent may forget how to counter old strategies. In multiplayer and cooperative games, pure self-play produces conventions people cannot follow.

## Key terms

- PL: **liga**: Populacja agentów i ich dawnych wersji grających przeciw sobie.
- PL: **wyzyskiwacz**: Agent trenowany tylko do szukania słabości głównego agenta.
- PL: **równowaga Nasha**: Stan, w którym żaden gracz nie zyska, zmieniając sam strategię.
- EN: **league**: A population of agents and their past versions playing each other.
- EN: **exploiter**: An agent trained only to find the main agent's weaknesses.
- EN: **Nash equilibrium**: A state where no player gains by changing strategy alone.

## Know first

- [Planowanie z przeszukiwaniem drzewa (AlphaZero, MuZero) (Tree-search planning with learned models)](https://aiatlasgraph.com/t/mctsplanning.md)
- [Uczenie wieloagentowe (MARL) (Multi-agent reinforcement learning (MARL))](https://aiatlasgraph.com/t/marl.md)

## Related topics

Untyped, symmetric "see also" links.

- [Koewolucja: populacje oceniane przez wzajemne starcia (Coevolutionary algorithms)](https://aiatlasgraph.com/t/coevolution.md)
- [Planowanie z przeszukiwaniem drzewa (AlphaZero, MuZero) (Tree-search planning with learned models)](https://aiatlasgraph.com/t/mctsplanning.md)
- [Uczenie wieloagentowe (MARL) (Multi-agent reinforcement learning (MARL))](https://aiatlasgraph.com/t/marl.md)

## Sources

- [Grandmaster level in StarCraft II using multi-agent reinforcement learning](<https://www.nature.com/articles/s41586-019-1724-z>) `vinyals-alphastar-2019` · by Oriol Vinyals, Igor Babuschkin, Wojciech M. Czarnecki i in. (DeepMind)

---

AI Atlas revision 122 (2026-10-30) · HTML: https://aiatlasgraph.com/t/selfplay · index: https://aiatlasgraph.com/llms.txt · everything: https://aiatlasgraph.com/llms-full.txt · updated 2026-10-30
