Patterns across various versions of LeelaZero training
Posted: Sun Mar 11, 2018 12:54 pm
I was curious to see how an AlphaZero-like system discovers various Go patterns while training from self-play, from scratch.
So I did a little data-mining starting from the large SGF collection of self-play games from https://sjeng.org/zero/ (the all_sgf.xz file).
The version I did this analysis is about 3 weeks old now - the latest LZ version included in my analysis is af9ce63c from Feb 21st.
I skipped the first 1.5M games from that SGF collection to eliminate the initial random play, so the first version analyzed is 39fe0ce3 from Dec 28th, 2017.
I parsed the SGFs and extracted all the corner, 9x9 sized patterns containing exactly 10 stones (5 for each of white and black), and which appeared in at least 3 different LZ versions. Symmetries and color-swaps are taken into account, too.
I generated a report with top patterns from each version (versions are listed in chronological order). One can find the version IDs on the LZ project page here: http://zero.sjeng.org/
For each pattern, the plot next to it shows its frequency across the training versions. The x-axis numbers correspond to version index (from 0 to 45, since there are 46 versions between 39fe0ce3 and af9ce63c), while the y-axis numbers are the frequency of the pattern relative to other patterns in the same version, for instance 0.003 means this pattern appeared 3 times in each 1000 patterns in the games of a LZ version). Taller ticks mean that the pattern's relative frequency within a particular version is higher.
Each pattern is only shown in the earliest LZ version it occurred in - looking at the plot next to it should give an idea about popularity trend: if ticks for later versions are higher, the pattern became more popular in later versions, while if it is lower its popularity faded away.
I generated a report for the top one pattern in each version: http://361points.com/media/top1patterns/patterns.html
The page is very slow to load the patterns, it will show first some "....xxxooo..." text before showing image patterns.
Interestingly, we can see first the old-style 3x3 invasion against the opponent's 4x4 stone, with hane-tsugi in the end; LZ did this in older versions, but we see from the frequency plot how it abandoned it eventually.

Second pattern is the AlphaGo style of crawling one more time on 2nd line instead, to get sente; LZ discovered this later, but it seem to have abandoned it too; I bet it will show again in the most recent versions (after the switch to the 10-blocks, on March 5th), I will redo the analysis to incorporate more recent versions.

Third pattern is the double-hand and capture, which we see from the plot that it became super-popular in the 2nd half of the timeline. I expect that as LZ gets even stronger, it will abandon this in favor of the 2nd pattern, above.

For people interested in more data: I also generated a report for the top-10 patterns in each version: http://361points.com/media/top10patterns/patterns.html
This larger analysis may take several minutes to load - sorry about that, I hope I can figure out a better way.
So I did a little data-mining starting from the large SGF collection of self-play games from https://sjeng.org/zero/ (the all_sgf.xz file).
The version I did this analysis is about 3 weeks old now - the latest LZ version included in my analysis is af9ce63c from Feb 21st.
I skipped the first 1.5M games from that SGF collection to eliminate the initial random play, so the first version analyzed is 39fe0ce3 from Dec 28th, 2017.
I parsed the SGFs and extracted all the corner, 9x9 sized patterns containing exactly 10 stones (5 for each of white and black), and which appeared in at least 3 different LZ versions. Symmetries and color-swaps are taken into account, too.
I generated a report with top patterns from each version (versions are listed in chronological order). One can find the version IDs on the LZ project page here: http://zero.sjeng.org/
For each pattern, the plot next to it shows its frequency across the training versions. The x-axis numbers correspond to version index (from 0 to 45, since there are 46 versions between 39fe0ce3 and af9ce63c), while the y-axis numbers are the frequency of the pattern relative to other patterns in the same version, for instance 0.003 means this pattern appeared 3 times in each 1000 patterns in the games of a LZ version). Taller ticks mean that the pattern's relative frequency within a particular version is higher.
Each pattern is only shown in the earliest LZ version it occurred in - looking at the plot next to it should give an idea about popularity trend: if ticks for later versions are higher, the pattern became more popular in later versions, while if it is lower its popularity faded away.
I generated a report for the top one pattern in each version: http://361points.com/media/top1patterns/patterns.html
The page is very slow to load the patterns, it will show first some "....xxxooo..." text before showing image patterns.
Interestingly, we can see first the old-style 3x3 invasion against the opponent's 4x4 stone, with hane-tsugi in the end; LZ did this in older versions, but we see from the frequency plot how it abandoned it eventually.
Second pattern is the AlphaGo style of crawling one more time on 2nd line instead, to get sente; LZ discovered this later, but it seem to have abandoned it too; I bet it will show again in the most recent versions (after the switch to the 10-blocks, on March 5th), I will redo the analysis to incorporate more recent versions.
Third pattern is the double-hand and capture, which we see from the plot that it became super-popular in the 2nd half of the timeline. I expect that as LZ gets even stronger, it will abandon this in favor of the 2nd pattern, above.
For people interested in more data: I also generated a report for the top-10 patterns in each version: http://361points.com/media/top10patterns/patterns.html
This larger analysis may take several minutes to load - sorry about that, I hope I can figure out a better way.