KataGo

{{Short description|Open-source Go (game) engine}}

{{Infobox software

| name = KataGo

| developer = David Wu

| released = {{Start date and age|2019|02|27|df=yes}}

| latest release version = 1.15.3

| latest release date = {{Start date and age|2024|08|05|df=yes}}

| programming language = C++

| genre = Go software

| license = MIT License

| website = {{URL|https://katagotraining.org/}}

}}

KataGo is a free and open-source computer Go program, capable of defeating top-level human players. First released on 27 February 2019, it is developed by David Wu,{{cite arXiv |eprint=1902.10565 |class=cs.LG |author=David Wu |title=Accelerating Self-Play Learning in Go |date=27 February 2019}} who also developed the Arimaa playing program bot_Sharp which defeated three top human players to win the Arimaa AI Challenge in 2015.{{Cite journal |last=Wu |first=David J. |date=2015-01-01 |title=Designing a Winning Arimaa Program |url=https://content.iospress.com/articles/icga-journal/icg38104 |journal=ICGA Journal |language=en |volume=38 |issue=1 |pages=19–40 |doi=10.3233/ICG-2015-38104 |issn=1389-6911}}

KataGo's first release was trained by David Wu using resources provided by his employer Jane Street Capital,{{cite web|url=https://blog.janestreet.com/accelerating-self-play-learning-in-go|title=Accelerating Self-Play Learning in Go|type=blog post|author=David Wu|date=28 February 2019|access-date=2 November 2022}} but it is now trained by a distributed effort.{{cite web|url=https://katagotraining.org|title=KataGo Distributed Training|access-date=2 November 2022}} Members of the computer Go community provide computing resources by running the client, which generates self-play games and rating games, and submits them to a server. The self-play games are used to train newer networks and the rating games to evaluate the networks' relative strengths.

KataGo supports the Go Text Protocol, with various extensions,{{cite web|url=https://github.com/lightvector/KataGo/blob/master/docs/GTP_Extensions.md|title=KataGo GTP Extensions|website=GitHub |access-date=3 January 2023}} thus making it compatible with popular GUIs such as Lizzie. As an alternative, it also implements a custom "analysis engine" protocol, which is used by the KaTrain GUI,{{cite web|url=https://github.com/sanderland/katrain|title=KaTrain|website=GitHub |type=Github repo|access-date=3 January 2023}} among others. KataGo is widely used by strong human go players, including the South Korean national team, for training purposes.{{cite web|url=https://paper.xinmin.cn/html/xmwb/2021-03-01/13/97205.html|title=AI当道 中国围棋优势缩小了吗?|author=金雷|trans-title=With the dominance of AI, is China's Go superiority shrinking?|date=1 March 2021|newspaper=Xinmin Evening News|access-date=5 December 2021}}{{cite web|url=https://www.chosun.com/site/data/html_dir/2020/04/13/2020041304205.html|title='AI 기사' 격전장에 괴물 '블랙홀'이 등장했다|author=Hong-ryeol Lee|trans-title=A monster 'black hole' appeared in the battlefield of 'AI Go players'|newspaper=The Chosun Ilbo|date=14 April 2020|access-date=8 December 2021}} KataGo is also used as the default analysis engine in the online Go website AI Sensei,{{cite web|url=https://ai-sensei.com/faq|title=AI Sensai FAQ|access-date=2 November 2022}} as well as OGS (the Online Go Server).{{cite web|url=https://forums.online-go.com/t/considering-removing-leela-zero-from-our-supported-ai-reviewers/42547|title=Considering removing Leela Zero from our supported AI Reviewers|author=Anoek (OGS developer)|date=31 March 2022|access-date=2 November 2022}}

Technology

Based on techniques used by DeepMind's AlphaGo Zero, KataGo implements Monte Carlo tree search with a convolutional neural network providing position evaluation and policy guidance. Compared to AlphaGo, KataGo introduces many refinements that enable it to learn faster and play more strongly.{{cite web |author=David Wu |date=15 November 2020 |title=Other Methods Implemented in KataGo |url=https://github.com/lightvector/KataGo/blob/master/docs/KataGoMethods.md |access-date=4 November 2022 |website=GitHub}}

Notable features of KataGo that are absent in many other Go-playing programs include score estimation; support for small boards, arbitrary values of komi, and handicaps; and the ability to use various Go rulesets and adjust its play and evaluation for the small differences between them.

= Network =

The network used in KataGo are ResNets with pre-activation.

While AlphaGo Zero has only game board history as input features (as it was designed as a general architecture for board games, subsequently becoming AlphaZero), the input to the network contains additional features designed by hand specifically for playing Go. These features include liberties, komi parity, pass-alive, and ladders.

The trunk is essentially the same as in AlphaGo Zero, but with global pooling layers added to allow the network to be conditioned on global context such as ko fights. This is similar to the Squeeze-and-Excitation Network.

The network has two heads: a policy head and a value head. The policy and value heads are mostly the same as in AlphaGo Zero, but both heads have auxiliary subheads to provide auxiliary loss signal for faster training:

  • Policy head: predicts policy for the current player's move this turn, and the opponent player's move in the next turn. A policy Each is a logit array of size 19 \times 19 + 1, representing the logit of making a move in one of the points, plus the logit of passing.
  • Value head: predicts game outcome, expected score difference, expected board ownership, etc.

The network is described in detail in Appendix A of the report.

The code base switched from using TensorFlow to PyTorch in version 1.12.

= Training =

Let its trunk have b residual blocks and c channels. During its first training run, multiple networks were trained with increasing (b, c). It took 19 days using a maximum of 28 Nvidia V100 GPUs at 4.2 million games.

After the first training run, training became a distributed project run by volunteers, with increasing network sizes. {{As of|2024|08}}, it has reached b28c512 (28 blocks, 512 channels).

Adversarial attacks

In 2022, KataGo was used as the target for adversarial attack research, designed to demonstrate the "surprising failure modes" of AI systems. The researchers were able to trick KataGo into ending the game prematurely.{{cite web |author=Benj Edwards |date=7 November 2022 |title=New Go-playing trick defeats world-class Go AI, but loses to human amateurs |url=https://arstechnica.com/information-technology/2022/11/new-go-playing-trick-defeats-world-class-go-ai-but-loses-to-human-amateurs |access-date=8 November 2022}}{{Cite journal |last1=Wang |first1=Tony Tong |last2=Gleave |first2=Adam |last3=Tseng |first3=Tom |last4=Pelrine |first4=Kellin |last5=Belrose |first5=Nora |last6=Miller |first6=Joseph |last7=Dennis |first7=Michael D. |last8=Duan |first8=Yawen |last9=Pogrebniak |first9=Viktor |last10=Levine |first10=Sergey |last11=Russell |first11=Stuart |date=2023-07-03 |title=Adversarial Policies Beat Superhuman Go AIs |url=https://proceedings.mlr.press/v202/wang23g.html |journal=Proceedings of the 40th International Conference on Machine Learning |language=en |publisher=PMLR |pages=35655–35739|arxiv=2211.00241 }}

Adversarial training improves defense against adversarial attacks, though not perfectly.{{Cite journal |last=Hutson |first=Matthew |date=2024-07-08 |title=Can AI be superhuman? Flaws in top gaming bot cast doubt |url=https://www.nature.com/articles/d41586-024-02218-7 |journal=Nature |language=en |doi=10.1038/d41586-024-02218-7|pmid=38977931 }}{{cite arXiv |last1=Tseng |first1=Tom |title=Can Go AIs be adversarially robust? |date=2024-06-18 |eprint=2406.12843 |last2=McLean |first2=Euan |last3=Pelrine |first3=Kellin |last4=Wang |first4=Tony T. |last5=Gleave |first5=Adam|class=cs.LG }}

References

{{Reflist}}