Reproduce the paper's forgetting experiments to verify that self-generated replay reduces catastrophic forgetting in language models
Use the configuration files as a starting point for your own continual learning experiments before scaling up
Study how training data recency and learning rate interact with forgetting to inform your own fine-tuning strategy
Requires JAX and familiarity with ML research workflows, GPU recommended for larger experiments.
This repository holds the code for a research paper studying a problem that occurs when you train an AI language model on new information: the model tends to forget what it learned before. The paper is titled "Forgetting in Language Models: Capacity, Optimization, and Self-Generated Replay" and the repository accompanies the published work so others can reproduce the experiments. The core finding is that a technique called data replay, where you mix in examples from the original training data while teaching the model something new, greatly reduces how much the model forgets. The more interesting discovery is that when you do not have access to the original training data, you can instead ask the model to generate its own synthetic examples from memory, and those work nearly as well as the real data. The research also finds that forgetting gets worse when a model has little remaining learning capacity, meaning models that were trained very thoroughly on the original data have a harder time absorbing new knowledge without losing old knowledge. Learning rate settings also matter: lower learning rates cause less forgetting but require much more training time, while the replay technique removes that tradeoff. The code is written in Python and uses JAX, a library for numerical computing often used in machine learning research. The experiment workflow has four steps: train a text tokenizer, convert datasets into a binary format the trainer expects, run an initial pretraining phase on one dataset, then fine-tune on a different dataset while applying the forgetting-prevention technique. The repository includes configuration files and plotting scripts for reproducing the specific experiments shown in the paper's figures. This is a research codebase aimed at machine learning researchers studying how language models retain and lose knowledge during training. It is not a general-purpose tool or product, but the README includes a walkthrough with small example runs that are easy to try on a modest setup before scaling up to larger experiments.
← martin-marek on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.