whatisgithub

What is dreaming?

6elphegor/dreaming — explained in plain English

Analysis updated 2026-05-18

0PythonAudience · researcherComplexity · 3/5Setup · moderate

In one sentence

A small research experiment testing a method that helps a model keep old memorized knowledge while learning new information.

Mindmap

mindmap
  root((Dreaming))
    What it does
      Trains model on old key value pairs
      Fine tunes on new pairs
      Applies penalty vs frozen self
      Measures retention and acquisition
    Tech stack
      Python
      PyTorch
      matplotlib
    Use cases
      Study catastrophic forgetting
      Test KL regularization methods
      Reproduce a small ML experiment
    Audience
      Researchers
      ML students

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Reproduce a small experiment on catastrophic forgetting during continued training.

USE CASE 2

Study how a KL penalty against a frozen copy of a model affects knowledge retention.

USE CASE 3

Sweep the penalty strength and see the tradeoff between old and new knowledge.

USE CASE 4

Use the small transformer setup as a base for testing your own forgetting mitigation idea.

What is it built with?

PythonPyTorchmatplotlib

How does it compare?

6elphegor/dreaming0xallam/my-recipe0xhassaan/nn-from-scratch
Stars00
LanguagePythonPythonPython
Last pushed2022-11-22
MaintenanceDormant
Setup difficultymoderatemoderatemoderate
Complexity3/52/54/5
Audienceresearchergeneraldeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Needs PyTorch and a GPU for reasonable speed, though it can run slowly on CPU.

Unknown from the shown README, check the repository license file for exact terms.

So what is it?

Dreaming is a small research project studying a problem called catastrophic forgetting, which happens when a model learns new information but loses accuracy on things it learned earlier. The experiment trains a small transformer model to memorize 10,000 key and value pairs, treated as old knowledge, then continues training it on 1,000 fresh pairs, treated as new knowledge. Simply fine-tuning on the new pairs without any protection turns out to wipe out most of the old knowledge: only about 29 percent of the old pairs are still remembered afterward, even though none of the new data actually contradicts the old. The fix tested here adds a penalty during the new training that compares the model's answers to those of a frozen copy of itself from before the new training began, using sequences the frozen copy generates on its own, which is why the project calls this dreaming. Adding even a small amount of this penalty recovers most of the lost old knowledge while still learning almost all of the new pairs, and a moderate setting keeps over 98 percent of the old knowledge with almost no cost to the new. Pushing the penalty too high starts to block learning the new pairs without adding much more protection for the old ones. The code trains a roughly 1.1 million parameter transformer from scratch and runs the full sweep of settings in under four minutes on a GPU, though it also works slower on a CPU. Running it requires PyTorch, and making the result charts requires matplotlib. The main script is a single Python file that both defines the model and runs the training, alongside a separate script for plotting results and one for inspecting the pretrained model afterward. This is a small scale experiment rather than a ready made tool, aimed at people curious about how catastrophic forgetting behaves and one way researchers try to reduce it.

Copy-paste prompts

Prompt 1
Explain what catastrophic forgetting means using the results from this dreaming experiment.
Prompt 2
Show me how to run python dreaming.py with a smaller kl_coeff sweep for a quick test.
Prompt 3
Walk me through what the KL penalty in this project is comparing and why it is called dreaming.
Prompt 4
Help me plot my own results.json using this project's plot_results.py script.

Frequently asked questions

What is dreaming?

A small research experiment testing a method that helps a model keep old memorized knowledge while learning new information.

What language is dreaming written in?

Mainly Python. The stack also includes Python, PyTorch, matplotlib.

What license does dreaming use?

Unknown from the shown README, check the repository license file for exact terms.

How hard is dreaming to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is dreaming for?

Mainly researcher.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.