<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Alessandro Ficca on Medium]]></title>
        <description><![CDATA[Stories by Alessandro Ficca on Medium]]></description>
        <link>https://medium.com/@alessandroficca?source=rss-18f130e7985e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*f4w220FY1WYynnox</url>
            <title>Stories by Alessandro Ficca on Medium</title>
            <link>https://medium.com/@alessandroficca?source=rss-18f130e7985e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 23:00:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@alessandroficca/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Mastering the game of GO: AlphaGO]]></title>
            <link>https://medium.com/@alessandroficca/mastering-the-game-of-go-alphago-7574c0e8cd7e?source=rss-18f130e7985e------2</link>
            <guid isPermaLink="false">https://medium.com/p/7574c0e8cd7e</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[alphabet]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[games]]></category>
            <dc:creator><![CDATA[Alessandro Ficca]]></dc:creator>
            <pubDate>Sun, 26 May 2024 18:42:49 GMT</pubDate>
            <atom:updated>2024-05-26T18:42:49.426Z</atom:updated>
            <content:encoded><![CDATA[<p>Have you ever heard of the game Go?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/0*yURykm5lmp48KxS0" /></figure><p>Go is an ancient board game that originated in China about 2,500 years ago. Despite its simple rules, it is considered one of the most challenging games.</p><p>Go is played on a grid called a <em>“goban”,</em> where two players place their stones — black and white — to control the largest possible territory without being captured by the opponent.</p><p>The complexity of the game lies in the immense number of possible combinations that can be generated on the board. To give you an idea, the number of configurations exceeds the number of atoms in the universe: we’re talking about approximately 2.08×¹⁰¹⁷⁰ different possible positions. Quite incredible! …</p><p>Maybe you’ve heard of DeepMind.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/0*PGTr4QVLVfC3ALIM" /></figure><p>DeepMind is the Google’s AI research lab. It’s a British company acquired by Google in 2014 to lead research in the field of AI. Today, it is a major player.</p><p>So, what do these two things have in common? In 2016, DeepMind achieved a seemingly impossible milestone: it developed software capable of defeating the world’s best Go players… <strong>AlphaGo</strong>.</p><p>AlphaGo became famous in the AI sector after defeating European champion <strong><em>Fan Hui</em></strong> in a series of official matches. Here it is!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*pdz1xCTR9myB7u2J.jpg" /></figure><p>The victory against champion Fan Hui was a historic moment for the AI world. It marked the first time a computer had defeated a professional Go player.</p><p>In this article, I’d like to briefly describe the research published by DeepMind in the paper <a href="https://www.nature.com/articles/nature16961"><strong><em>“Mastering the game of Go with deep neural networks and tree search.”</em></strong></a></p><blockquote>Although the world of AI, Deep Learning, and Machine Learning has made incredible strides since this paper was published in 2016, AlphaGo remains a significant milestone in the journey that has led to the results we see today.</blockquote><h3>AlphaGo: An Introduction</h3><p>Games like Go and chess are known as <strong>games of perfect information</strong>. This means that all players are aware of all the information present on the board at any time.</p><p>For such games, it’s possible to associate an optimal value function <em>v(s)</em> with each position <em>s</em> on the board. This function returns the game’s final result based on the state <em>s</em>, assuming both players act “perfectly.”</p><p>To explore all possible moves and states during a game, an algorithm called Monte Carlo Tree Search (MCTS) can be used.</p><h4>Monte Carlo Tree Search (MCTS) 🌲</h4><blockquote>MCTS is a decision-making search algorithm that aims to find the optimal sequence of actions to maximize a certain reward function.</blockquote><blockquote>Here are a few key points:<br>The algorithm performs a simulation (<strong>rollout</strong>), starting from a node (our state <em>s</em>), expanding the tree, and exploring further possible moves and states based on a certain policy (let’s call it a “strategy” for now).<br>Upon reaching the termination state, the result of this rollout is used to approximate the expected value of the starting state.<br>With more rollouts, the approximation becomes increasingly accurate.</blockquote><p>The challenge arises from the size of this search tree.</p><p>The goal is to explore only a subset of the search tree, through two methods:</p><ul><li><strong>Reducing depth</strong>: Using a function <strong><em>v*(s)</em></strong> to approximate the original function <em>v(s)</em></li><li><strong>Reducing breadth</strong>: Choosing the next move based on a probability distribution <strong>p(a|s)</strong> (the so-called <strong>“policy”</strong>) instead of exploring all possible moves.</li></ul><p>The best Go engines before AlphaGo were based on MCTS but did not achieve exceptional results.</p><blockquote>DeepMind researchers decided to combine MCTS with the power of neural networks, bringing in Deep Learning.</blockquote><p>They created a hybrid system using two neural networks: one to evaluate the possible outcome given a certain board position (<strong>value network</strong>) and the other to generate a probability distribution p(a|s) from which to choose the best move (<strong>policy network</strong>).</p><p>Here’s an example of a convolutional network. In AlphaGo, this type of neural network was used to analyze a representation of the game grid.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*cMkU9x1-3bREIwaI.png" /></figure><h3>Diving Deeper: Training AlphaGo</h3><h4>Supervised Learning of the Policy Network</h4><p>The first phase of AlphaGo’s training involves using <strong>Supervised Learning</strong> for the Policy Network.</p><p>This convolutional neural network is trained using a dataset containing moves and positions played by expert players (hence the “supervised” context).</p><p>The network receives as input a representation of the board and the move played (the input pair is <em>(s,a) </em>, where <em>s</em> represents the state and <em>a</em> the move played). It outputs a probability distribution considering all legal moves in that position, trying to “predict” the move played.</p><p>In this phase, a <strong>Rollout Policy</strong> is also trained. It is obtained as a <strong>linear function</strong> of the input, different from the convolutional network.</p><h4>Reinforcement Learning of the Policy Network</h4><p>The second phase of AlphaGo’s training involves using <strong>Reinforcement Learning</strong> for the Policy Network.</p><blockquote>Reinforcement Learning (RL) is a learning technique used in ML and DL.</blockquote><blockquote>In RL, an agent learns through simulations. The agent chooses actions to maximize its reward. The more simulations the agent performs, the better it learns to make the right choices to win!</blockquote><p>Starting from the neural network trained in the first phase, a second network with the same structure is trained using RL. Simulated games are played with the network aiming to “win,” i.e., maximize the reward function.</p><h4>Reinforcement Learning of the Value Network</h4><p>So far, we’ve focused on the policy, which involves choosing the best move given a certain position (<em>state</em>). Now we focus on <em>“position evaluation”</em> i.e., estimating a value function that predicts the game’s outcome, knowing that both players play according to the same policy (in our case, the policy obtained from Reinforcement Learning). The value network is trained for this purpose.</p><p>The neural network takes positions as input and, through regression, outputs a single value: the game’s outcome.</p><p>This is an image summarizing the different training phases of AlphaGo.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/759/0*sX_QEZU_evFuB-up.png" /></figure><h4>Putting It All Together 🥣</h4><p>The innovation of AlphaGo is combining the trained policy and value networks with MCTS. Here are the key points:<br>- Each edge <em>(s,a)</em> of the tree stores an <strong>“action value”</strong> <em>Q(s,a)</em>, the count of visits to that edge <em>N(s,a)</em>, and the probability <em>P(s,a)</em>.<br>- The tree is traversed during the simulation, and at each step <em>t</em>, the action <em>a</em> that maximizes the action value plus a certain bonus is chosen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/0*BPOPg5hO4rFRm7u-.png" /></figure><p>The bonus <em>u(s,a)</em> encourages exploring unvisited nodes.</p><p>Upon reaching a leaf node (one without further child nodes), the node is processed:</p><ul><li>First, the policy network provides the probabilities <em>P(s,a)</em>.</li><li>Then the value network gives the value <em>v(s)</em></li><li>Finally, the rollout policy obtains <em>z</em>.</li></ul><p>The last two values are combined to get the final value of the position at the considered node.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/479/0*A1ajm7CiYwZlI6v-.png" /></figure><p>At the end of the simulation, the statistics of each traversed edge are updated based on the values calculated in the previous step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/0*wj9Ctkvx0Kz2BACe.png" /></figure><p>Once the search is complete, a search tree is obtained, and the algorithm chooses, in each position, the most visited edge to continue the game.</p><h3>Conclusions</h3><p>AlphaGo’s strength lies in combining <strong>MCTS with Deep Learning</strong>. This innovative approach allowed AlphaGo to learn and develop new game strategies, never seen before, enabling it to surpass the performance of the best existing game engines of its time.</p><p>Although it might seem like just a program capable of playing a game, AlphaGo represents much more. It is a concrete example of how AI can be used to solve complex problems and achieve seemingly impossible goals.</p><p>For those who have become passionate about this story, we recommend visiting DeepMind’s YouTube channel. In particular, watch this short video on the project’s inception… it’s very inspirational!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FSUbqykXVx0A%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DSUbqykXVx0A&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FSUbqykXVx0A%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/c0cec702f689842c8ff5c3c21a7285f7/href">https://medium.com/media/c0cec702f689842c8ff5c3c21a7285f7/href</a></iframe><p>And for the more tech-savvy, here’s the full documentary 🤓</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FWXuK6gekU1Y%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DWXuK6gekU1Y&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FWXuK6gekU1Y%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/84e9bb1a9fd633eace902b36cd0687b5/href">https://medium.com/media/84e9bb1a9fd633eace902b36cd0687b5/href</a></iframe><p><strong>P.S.</strong> We hope you enjoyed this article! Many aspects have not been formally addressed. The goal was simply to share something more about this research with you.<br>If you have any doubts or curiosities, please comment on the story!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7574c0e8cd7e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>