Avalanche: A PyTorch Library for Deep Continual Learning

Antonio CartaLorenzo PellegriniAndrea CossuHamed HematiVincenzo Lomonaco

article2023JMLR46 citations

Introduces Avalanche, an open-source PyTorch library that simplifies continual learning research by providing dynamic neural network architectures, streaming data loaders, modular training plugins, and standardized evaluation benchmarks.

Listen

Modern artificial intelligence applications increasingly require systems that can learn continuously from changing, non-stationary streams of data. However, standard deep learning frameworks are designed around offline training, where model architectures, optimizers, and datasets are assumed to remain static throughout execution. This structural mismatch creates substantial friction for researchers and developers attempting to implement incremental training, dynamic neural network growth, and standardized evaluation.

The article demonstrates the architecture and capabilities of Avalanche, an open-source library built on top of PyTorch designed to provide comprehensive, native support for continual deep learning. The primary objective is to evaluate how modular software abstractions can standardize dynamic learning scenarios, streamline rapid prototyping, and improve experimental reproducibility across research environments.

To achieve this, the developers structured Avalanche around five cohesive modules: benchmarks, training algorithms, models, evaluation metrics, and logging utilities. The framework relies on a callback-driven template and plugin architecture that converts conventional static deep learning elements into dynamic components capable of altering architectures, regularizing loss functions, and managing replay buffers during training. The platform’s reliability was validated through continuous integration suites featuring comprehensive unit tests and automated baseline benchmarking against established literature.

The analysis highlights key findings regarding system functionality and adoption. First, Avalanche represents the most comprehensive software toolkit available for continual learning, supporting an extensive array of scenarios including class-, task-, and domain-incremental learning as well as online continuous streams. Second, its callback-based plugin architecture allows distinct continual learning strategies to be combined into hybrid methods with minimal code modifications, a capability unsupported by alternative libraries. Third, the system extends data handling through specialized stream-aware data structures that track metadata and support experience-based updates. Finally, the framework includes robust utilities for pause-and-resume checkpointing, serialization, and standardized multi-level metric evaluation across central processing unit and memory usage.

These findings indicate that adopting a standardized framework can significantly reduce development time and engineering overhead in complex learning workflows. By eliminating ad-hoc implementations, organizations can lower technical risk, achieve verifiable reproducibility, and improve system maintainability across changing production data. The open-source model under the MIT license, backed by a collaborative network across more than fourteen research organizations, ensures sustainable long-term governance.

Stakeholders and research teams should consider adopting Avalanche for continuous learning workflows and baseline replication. Future development plans outlined in the article focus on advancing toward the official version 1.0 release, incorporating enhanced support for continual reinforcement learning, as well as distributed and federated training environments. Organizations with specialized distributed deployment requirements should monitor these roadmap updates, as current features reflect version 0.3.1 prior to full stable release.

No sufficiently relevant recommendations were found.

Cover for Avalanche: A PyTorch Library for Deep Continual Learning

Abstract

Continual learning is the problem of learning from a nonstationary stream of data, a fundamental issue for sustainable and efficient training of deep neural networks over time. Unfortunately, deep learning libraries only provide primitives for offline training, assuming that model’s architecture and data are fixed. Avalanche is an open source library maintained by the ContinualAI non-profit organization that extends PyTorch by providing first-class support for dynamic architectures, streams of datasets, and incremental training and evaluation methods. Avalanche provides a large set of predefined benchmarks and training algorithms and it is easy to extend and modular while supporting a wide range of continual learning scenarios. Documentation is available at https://avalanche.continualai.org.

Table of Contents

  • 1 Introduction
  • 2 What can you do with Avalanche?
  • 3 API and Design
  • 4 Conclusion
  • References

Knowls

  1. Knowl 1 — Avalanche extends PyTorch for deep continual-learning research

    model/method

    Avalanche is an open-source library built on PyTorch to support deep continual learning, where models learn from changing data over time. It provides components for working with data streams, incremental training and evaluation, and architectures that can change during learning. The library is intended to support a range of continual-learning scenarios, including class-, task-, and domain-incremental learning and online continual learning.

  2. Knowl 2 — Benchmarks organize continual-learning data into streams and experiences

    definition

    In Avalanche, a benchmark is a collection of data streams, such as training and test streams. A stream is an ordered sequence of experiences, each representing the information available at a particular point in time. An experience supplies what a method needs at that point—for example, a dataset in supervised learning or an environment in reinforcement learning. Streams and experiences have unique identifiers used for logging.

  3. Knowl 3 — Avalanche provides benchmark definitions, generators, and stream construction tools

    model/method

    Avalanche supports defining continual-learning benchmarks at multiple levels: it includes standard benchmark definitions, high-level generators, and lower-level utilities for constructing benchmarks by manipulating datasets and experience streams. Its supported scenarios include class-, task-, and domain-incremental learning and online continual learning. The library includes benchmarks such as Split and Permuted, CORe50, Stream51, EndlessCL, and OpenLORIS, as well as tools for out-of-distribution and validation streams.

  4. Knowl 4 — Training strategies use templates and callbacks to support extensible loops

    model/method

    An Avalanche training strategy combines one or more templates that define the structure of a training or evaluation loop with a list of plugins. Templates expose callbacks at points in the loop, including around training, experiences, epochs, iterations, forward passes, backward passes, and parameter updates. Plugins use callbacks to access strategy state—such as the model, optimizer, data loader, and loss—and execute their behavior at selected points. A plugin can be used with any template that provides the callbacks and state it requires, enabling reuse across experimental settings.

  5. Knowl 5 — Avalanche datasets attach metadata and support stream and replay manipulation

    model/method

    AvalancheDataset extends PyTorch datasets with example-level attributes, including task labels and other metadata. It supports multiple groups of transformations and custom collation functions, and datasets can be subsampled or concatenated. These operations provide a common interface for defining and manipulating continual-learning streams and replay buffers. Avalanche also provides flexible data loaders for balancing data and jointly sampling from multiple datasets.

  6. Knowl 6 — Dynamic components let continual-learning strategies change during training

    model/method

    Avalanche provides dynamic counterparts to components that are typically static in PyTorch, so a continual-learning strategy can update its architecture, optimizer, losses, or datasets as learning proceeds. DynamicModules support growing architectures, including multi-head classifiers and progressive networks. ExemplarsBuffer manages replay buffers, regularization plugins can modify the loss after each experience, and optimizers can be updated before each experience. Strategies manage these components automatically, while each can also be used independently in a custom training loop.

  7. Knowl 7 — Training methods and replay policies can be extended and combined

    model/method

    Avalanche supplies standard training algorithms and a collection of ready-to-use continual-learning techniques. Training strategies can be extended or combined to create hybrid methods. For replay-based methods, users can define custom storage policies; available options include balancing methods and reservoir sampling. The library’s strategy and plugin design permits methods such as replay and regularization to be added to a training loop without rewriting the underlying strategy.

  8. Knowl 8 — Evaluation metrics are collected and routed to multiple loggers

    model/method

    Avalanche defines continual-learning metrics through a declarative API and computes them automatically at different granularities, such as minibatch, experience, or stream. Its metrics cover model performance and system measurements, including memory use and CPU usage; users can define custom metrics or calculate them from existing metric results. The EvaluationPlugin connects strategies, metrics, and loggers by collecting metric outputs and dispatching them to registered loggers. Built-in logging options include TensorBoard, Weights and Biases, CSV, text files, and standard output, and the logging interface can be extended.

  9. Knowl 9 — Avalanche supports pausing experiments and testing software changes

    model/method

    Avalanche provides checkpointing so experiments can be paused and resumed, and its components are serializable. The library is tested with unit tests; each pull request runs a subset through continuous integration. A subset of continual-learning baselines is also executed regularly to check whether Avalanche’s baseline results remain consistent with results expected from the literature.

Coverage note — No substantial described contribution was omitted; the paper provides no quantitative comparative evaluation, so its contribution is captured through the library’s design, functionality, and stated testing practices.

References

  1. 1.Arthur Douillard and Timothée Lesort. Continuum: Simple Management of Complex Continual Learning Scenarios. arXiv:2102.06253 [cs], February 2021.
  2. 2.Timothée Lesort, Vincenzo Lomonaco, Andrei Stoian, Davide Maltoni, David Filliat, and Natalia Díaz-Rodríguez. Continual learning for robotics: Definition, framework, learning strategies, opportunities and challenges. Information Fusion, 58:52–68, June 2020. ISSN 1566-2535. doi: 10.1016/j.inffus.2019.12.004.
  3. 3.Vincenzo Lomonaco, Lorenzo Pellegrini, Andrea Cossu, Antonio Carta, Gabriele Graffieti, Tyler L. Hayes, Matthias De Lange, Marc Masana, Jary Pomponi, Gido M. van de Ven, Martin Mundt, Qi She, Keiland Cooper, Jeremy Forest, Eden Belouadah, Simone Calderara, German I. Parisi, Fabio Cuzzolin, Andreas S. Tolias, Simone Scardapane, Luca Antiga, Subutai Ahmad, Adrian Popescu, Christopher Kanan, Joost van de Weijer, Tinne Tuytelaars, Davide Bacciu, and Davide Maltoni. Avalanche: An End-to-End Library for Continual Learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3600–3610, 2021.
  4. 4.Marc Masana, Xialei Liu, Bartłomiej Twardowski, Mikel Menta, Andrew D. Bagdanov, and Joost van de Weijer. Class-Incremental Learning: Survey and Performance Evaluation on Image Classification. IEEE Transactions on Pattern Analysis and Machine Intelligence, pages 1–20, 2022. ISSN 1939-3539. doi: 10.1109/TPAMI.2022.3213473.
  5. 5.Seyed Iman Mirzadeh and Hassan Ghasemzadeh. CL-Gym: Full-Featured PyTorch Library for Continual Learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3621–3627, 2021.
  6. 6.Fabrice Normandin, Florian Golemo, Oleksiy Ostapenko, Pau Rodriguez, Matthew D. Riemer, Julio Hurtado, Khimya Khetarpal, Ryan Lindeborg, Lucas Cecchi, Timothée Lesort, Laurent Charlin, Irina Rish, and Massimo Caccia. Sequoia: A Software Framework to Unify Continual Learning Research, January 2022.
  7. 7.Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Kopf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. PyTorch: An Imperative Style, High-Performance Deep Learning Library. In H Wallach, H Larochelle, A Beygelzimer, F d'Alché-Buc, E Fox, and R Garnett, editors, Advances in Neural Information Processing Systems 32, pages 8024–8035. Curran Associates, Inc., 2019.
  8. 8.Andrei A. Rusu, Neil C. Rabinowitz, Guillaume Desjardins, Hubert Soyer, James Kirkpatrick, Koray Kavukcuoglu, Razvan Pascanu, and Raia Hadsell. Progressive Neural Networks. June 2016.
  9. 9.Maciej Wolczyk, Michał Zajkac, Razvan Pascanu, Lukasz Kuciński, and Piotr Miłos. Continual World: A Robotic Benchmark For Continual Reinforcement Learning. In Thirty-Fifth Conference on Neural Information Processing Systems, May 2021.

Citation

MLA
Carta, A., et al. “Avalanche: A PyTorch Library for Deep Continual Learning”. Journal of Machine Learning Research, vol. 24, no. 363, 2023, pp. 1–6, https://www.jmlr.org/papers/v24/23-0130.html.
APA
Carta, A., Pellegrini, L., Cossu, A., Hemati, H., & Lomonaco, V. (2023). Avalanche: A PyTorch Library for Deep Continual Learning. Journal of Machine Learning Research, 24(363), 1–6. https://www.jmlr.org/papers/v24/23-0130.html
Chicago
Carta, A., L. Pellegrini, A. Cossu, H. Hemati, and V. Lomonaco. 2023. “Avalanche: A PyTorch Library for Deep Continual Learning”. Journal of Machine Learning Research 24 (363): 1–6. https://www.jmlr.org/papers/v24/23-0130.html.
Harvard
Carta, A. et al. (2023) “Avalanche: A PyTorch Library for Deep Continual Learning”, Journal of Machine Learning Research, 24(363), pp. 1–6. Available at: https://www.jmlr.org/papers/v24/23-0130.html.
Vancouver
1. Carta A, Pellegrini L, Cossu A, Hemati H, Lomonaco V (2023) Avalanche: A PyTorch Library for Deep Continual Learning. Journal of Machine Learning Research 24:1–6

BibTeX

@article{JMLR:v24:23-0130,
  author  = {Antonio Carta and Lorenzo Pellegrini and Andrea Cossu and Hamed Hemati and Vincenzo Lomonaco},
  title   = {Avalanche: A PyTorch Library for Deep Continual Learning},
  journal = {Journal of Machine Learning Research},
  year    = {2023},
  volume  = {24},
  number  = {363},
  pages   = {1--6},
  url     = {http://jmlr.org/papers/v24/23-0130.html}
}
Metadata:DOI registry

Source Code

This paper has an official code repository available. Click below to access the source code.

View Repository

Access the Paper

This paper is available from its original source. Click below to access the PDF.

Open PDF
License: https://creativecommons.org/licenses/by/4.0/