<?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 Andrea Cossu on Medium]]></title>
        <description><![CDATA[Stories by Andrea Cossu on Medium]]></description>
        <link>https://medium.com/@andcos?source=rss-e7eb0ef42b10------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*gCj_OQouzYUmDjW0fFO2Kw.png</url>
            <title>Stories by Andrea Cossu on Medium</title>
            <link>https://medium.com/@andcos?source=rss-e7eb0ef42b10------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 10:07:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@andcos/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[Continual Learning with Recurrent Neural Networks]]></title>
            <link>https://medium.com/continual-ai/continual-learning-with-recurrent-neural-networks-ce631c913b0?source=rss-e7eb0ef42b10------2</link>
            <guid isPermaLink="false">https://medium.com/p/ce631c913b0</guid>
            <category><![CDATA[lifelong-learning]]></category>
            <category><![CDATA[recurrent-neural-network]]></category>
            <category><![CDATA[review]]></category>
            <category><![CDATA[continual-learning]]></category>
            <dc:creator><![CDATA[Andrea Cossu]]></dc:creator>
            <pubDate>Thu, 05 Aug 2021 13:01:20 GMT</pubDate>
            <atom:updated>2021-08-24T07:23:47.584Z</atom:updated>
            <content:encoded><![CDATA[<h3>Continual Learning for Recurrent Neural Networks</h3><h4>Opportunities and pitfalls when learning continuously from a stream of sequential data</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/452/1*rVdtljIOUL83uRew09QiGg.png" /><figcaption><em>Continual Learning on a sequence of experiences. Each experience introduces 2 new classes of objects taken from the Quick, Draw! dataset which have to be classified by the model.</em></figcaption></figure><h3>Walking like a robot</h3><p>Back when you were a baby, you learned how to walk without falling. After many trials and (painful) errors, you finally mastered that ability and now you enjoy wandering around in the streets, running on a beach or climbing a snowy mountain.</p><p>Now, imagine you are a robot trying to learn how to do the same. Despite the intrinsic difficulties a robot may experience in achieving such a hard challenge, let’s suppose you eventually learn how to walk on the smooth paved road in front of your house. Since it is sunny, you then decide to go to the beach. The changes in the new terrain cause you some problems at the beginning, but you quickly discover how to adapt and walk effectively. <br>Quite strangely, when you come back to the street, you find yourself unable to proceed properly. You basically have to learn again how to address the paved road.</p><p>The destruction of previous knowledge when facing new situations is a phenomenon called <em>catastrophic forgetting </em>and currently affects many of the most advanced artificial intelligent systems. However, this is not something we would expect from a truly intelligent agent. Instead, we would like to see one able to quickly learn new information when exposed to different environments <em>and </em>also to retain existing knowledge in order to reuse it when needed.<br>Building such intelligent agent is precisely the focus of <strong><em>continual learning.</em></strong></p><blockquote><em>Forgetting</em> previous knowledge when learning new things is a prominent challenge of <strong>continual learning</strong>, whose objective is to design agents which adapt continuously to the environment.</blockquote><h3>Time matters</h3><p>The field of continual learning is moving fast, with new approaches introduced every day. More and more, artificial neural networks are becoming the most studied models within continual learning. And computer vision the most investigated application. The combination of computer vision and neural networks naturally leads to the use of feedforward and convolutional neural networks. This has been (and continues to be) the focus of most of the continual learning works.</p><p>The robot example discussed above highlights a rather complex environment, in which data comes continuously in various forms and in a temporally-correlated fashion. Robot sensors constantly detect the current position of its legs and joints, the vision system processes the light reflected by surrounding objects to avoid obstacles and so on.</p><blockquote>Of course, time-series and sequential data (where the order between samples matters) are very important for a walking robot. But if you think about finance, activity recognition, natural language processing and similar applications, you can easily find additional examples.</blockquote><p><em>Recurrent neural networks</em> are machine learning models which <strong>naturally deal with time</strong> and whose study in continual learning is starting to gain momentum. While there are different approaches to tackle specific continual learning problems with recurrent models, <em>the research is still missing a clear direction</em>.</p><h3>A review</h3><p>That said, what did <a href="http://pai.di.unipi.it/">we</a> do? Well, we looked at the existing literature on continual learning with recurrent neural networks and we tried to put it together in a way that can be useful for others (you know, like a review).</p><p>We recognized 4 different classes of contributions:</p><ol><li><strong>Seminal: </strong>the authors worked on continual learning with recurrent models when few or nobody did. They studied recurrent models of various kinds on very simple (often synthetic) benchmarks.</li><li><strong>Natural Language Processing (NLP): </strong>natural language processing is one of the most studied application for continual learning and recurrent models nowadays. Even if these works are often specific to this domain, they propose concrete solutions to address the continual NLP challenge.</li><li><strong>Bio-inspired: </strong>recurrent networks goes hand in hand with neuroscience (e.g. spiking neural networks). The way recurrent networks learn in machine learning does not always satisfy neuroscientists (and not only them). This family of approaches tries to tackle continual learning with ad-hoc recurrent networks leveraging alternative learning algorithms or custom architectures.</li><li><strong>Deep Learning: </strong>the study of deep recurrent networks like LSTM is at the center of this group of work. Almost all of them introduce new strategies and approaches to mitigate catastrophic forgetting in recurrent networks.</li></ol><p>The shallow categorization proposed above comes bundled with a description of datasets and benchmarks used in all these works. You may want to take a look at the <a href="https://arxiv.org/abs/2103.07492">paper</a> if you are interested in using them for your own work.</p><h3>An empirical evaluation</h3><p>What can we derive from this review? At least 2 observations.</p><ol><li>No matter the family of works, there are few insights on what happens when recurrent neural networks are combined with traditional continual learning strategies (originally proposed for computer vision applications). <strong>The introduction of new methods and approaches often takes the priority</strong> with respect to a careful analysis of what already exists and could be adapted to different contexts.</li><li><strong>The number of benchmarks used in the literature is quite large considering the actual number of papers</strong>. It seems that no clear winner exists among the current proposals. One of the reason this happens is that each benchmark is either application-specific or too “simple” when compared to real-world applications.</li></ol><p>To address these two problems, we conducted an <strong>experimental evaluation</strong> with <strong>6 continual learning strategies</strong> on <strong>4 sequence classification benchmarks</strong>. The 6 strategies were originally evaluated on computer vision tasks.</p><p>The <em>Synthetic Speech Commands</em> benchmark involves the incremental classification of audio samples into the corresponding words. <br>The<em> Quick, Draw!</em> benchmark requires to classify a sketch (a sequence of pen strokes) into the corresponding object.</p><p>We also used classic benchmarks like Permuted MNIST and Split MNIST. These are continual learning benchmarks built on top of the MNIST dataset of handwritten digits (each of size 28x28). We transformed each pattern of the dataset into a sequence by taking a certain amount of pixels at a time (e.g. taking 28 pixels at a time means reading each image row by row and produces sequences of 28 steps). By varying the number of pixels read at a time we can produce sequences of different lengths.<br>Analyze the effect of the sequence length on forgetting helps to study the peculiarity of recurrent models.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/1*Iy5PxKLRYQBesBhdyaRvkg.png" /><figcaption>Sequence classification task: time steps of the input sequence are represented by the circles. The square represents the target class which has to be predicted by the model when reaching the end of the sequence.</figcaption></figure><p>Since we are interested in studying the behavior of deep recurrent networks, we chose <strong>LSTM </strong>as representatives of the recurrent models. We also experimented with <strong>feedforward neural networks (MLP)</strong> to compare the results.</p><blockquote>We found out that the input sequence length impacts the final performance in terms of catastrophic forgetting (the amount of knowledge forgotten by the model). The longer the sequence length, the larger the forgetting showed by the models. This result holds, with different trends, for all the 6 strategies we tried.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bo3Lea2hunleFZ3_AkSVeQ.png" /><figcaption>Average Accuracy for growing sequence lengths on Permuted MNIST benchmark (10 experiences). The sequence length is increased by taking fewer pixels per time step in the sequence: from 784 to 4, thus obtaining sequences with length from 1 to 196. The decreasing trend shows the negative effect of sequence length on the final performance.</figcaption></figure><p>By comparing the performance across all the 4 benchmarks, we discovered that popular strategies like LwF are unable to scale well to more complex scenarios (like <em>Synthetic Speech Commands</em> and <em>Quick, Draw!</em>). Instead, replay and orthogonal projection methods like GEM works quite well.</p><p>However, an in-depth analysis shows that the training performance of GEM decreases as new data is encountered. Moreover, GEM requires larger training times than the other strategies. Replay still remains the best option when looking for a simple, yet effective solution to catastrophic forgetting.</p><h4>Future directions</h4><p>Where we can go from here? As it turns out, in many different directions. <strong>We are just scratching the surface of recurrent models in continual learning!</strong> You can have fun and try to:</p><ol><li><strong>Adapt existing continual learning strategies</strong> to work better with recurrent models (e.g. replay with few patterns, alternative and more efficient versions of GEM).</li><li><strong>Improve recurrent models with ad-hoc solutions</strong> (long sequence lengths often causes gradient issues which in turn may affect continual learning strategies). Previous attempts summarized in our review already started the journey.</li><li><strong>Design realistic scenario on which evaluate new solutions</strong> (e.g. based on online streaming learning). This will be required for the field to scale up to complex and more interesting problems than the current ones. But be patient, we just started, didn’t we?</li></ol><p>So, try not to forget that the world surrounding us provides lots of data, usually in the form of sequences. Time and temporal information provide critical knowledge that help us to learn. We should take it into account as well when building continual learning agents which are expected to operate autonomously in real environments. <br>Stay tuned for more!</p><p>Feel free to check out <a href="https://www.sciencedirect.com/science/article/pii/S0893608021002847">the complete work </a>:)</p><blockquote>Andrea Cossu, Antonio Carta, Vincenzo Lomonaco, Davide Bacciu. <em>Continual Learning for Recurrent Neural Networks: an Empirical Evaluation. Neural Networks, 2021. Preprint available on </em><a href="https://arxiv.org/abs/2103.07492"><em>arXiv</em></a><em>.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*6zl3mz2Zt9KYfJE2lh79QA.jpeg" /></figure><p>I am a PhD student in Data Science at <a href="https://www.sns.it/">Scuola Normale Superiore</a> and <a href="https://www.unipi.it/">University of Pisa</a>. I am a member of the <a href="http://pai.di.unipi.it/">Pervasive AI Lab</a> and Board Member at <a href="https://www.continualai.org/">ContinualAI</a>. I work on Continual Learning with applications to recurrent models and sequential data processing.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ce631c913b0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/continual-ai/continual-learning-with-recurrent-neural-networks-ce631c913b0">Continual Learning with Recurrent Neural Networks</a> was originally published in <a href="https://medium.com/continual-ai">ContinualAI</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>