Continual learning requires balancing plasticity and stability while mitigating catastrophic forgetting. Inspired by human dreaming as a mechanism for internal simulation and knowledge restructuring, we introduce Dream2Learn (D2L), a framework in which a model autonomously generates structured synthetic experiences from its own internal representations and uses them for self-improvement. Rather than reconstructing past data as in generative replay, D2L enables a classifier to create novel, semantically distinct dreamed classes that are coherent with its learned knowledge yet do not correspond to previously observed data. These dreamed samples are produced by conditioning a frozen diffusion model through soft prompt optimization driven by the classifier itself. The generated data are not used to replace memory, but to expand and reorganize the representation space, effectively allowing the network to self-train on internally synthesized concepts. By integrating dreamed classes into continual training, D2L proactively structures latent features to support forward knowledge transfer and adaptation to future tasks. This prospective self-training mechanism mirrors the role of sleep in consolidating and reorganizing memory, turning internal simulations into a tool for improved generalization. Experiments on Mini-ImageNet, FG-ImageNet, and ImageNet-R demonstrate that D2L consistently outperforms strong rehearsal-based baselines and achieves positive forward transfer, confirming its ability to enhance adaptability through internally generated training signals.
Figures & tables
Figure 1: Dreamed classes generated by D2L . Examples of dreamed classes synthesized from their corresponding real classes (left). These samples emerge as semantically distinct yet structurally coherent representations in the generator’s latent space, forming intermediate concepts that enhance the continual classifier’s generalization to future tasks.
Figure 2: Overview of Dream2Learn. (1) During CL training, a deep neural network (DNN) learns from real sensory images (the current task distribution plus the buffer) and dreamed samples produced by a latent diffusion model (LDM). (2) The dreaming optimization process refines the LDM prompts, with an Oracle Network providing a stopping criterion that prevents collapse. (3) Prompts generate auxiliary classes: dreamed samples are not buffered, but rather enrich the representation space with coherent latent clusters that foster knowledge reuse and adaptation.
Figure 3: Visualization of the dreaming optimization process in the latent space of a LDM. Given a real sample x , the optimization refines the soft prompt psoft,c to steer the diffusion model towards generating a dreamed counterpart that aligns with the target class c (e.g., a green mamba in this example). The dreaming process explores latent regions where images are visually similar yet distinct from target classes, forming novel intermediate classes (violet zones).
Figure 4: Examples of dreaming optimization trajectories showing collapse . From left to right, the images depict different stages of the optimization process. Each row illustrates the evolution of three example images throughout the same prompt optimization. Initially, the generated samples maintain meaningful variations. However, as optimization progresses, they become increasingly similar, reducing diversity and leading to less effective representations.
Mini-ImageNet
FG-ImageNet
ImageNet-R
2000
5000
2000
5000
2000
5000
ER
27.91 ± 3.49
34.21 ± 3.04
21.08 ± 2.38
22.21 ± 3.44
7.68 ± 0.97
10.69 ± 1.29
↪ D2L
31.18 ± 2.74
39.75 ± 2.61
23.53 ± 1.98
32.73 ± 3.39
8.67 ± 0.66
11.84 ± 0.95
DER++
14.74 ± 2.14
26.92 ± 4.72
14.43 ± 3.68
23.86 ± 2.54
6.08 ± 0.81
8.29 ± 1.15
↪ D2L
21.06 ± 5.45
31.91 ± 5.19
18.86 ± 3.22
25.38 ± 2.17
8.60 ± 1.00
10.89 ± 1.56
ER-ACE
33.26 ± 3.51
40.59 ± 1.20
24.79 ± 5.02
30.16 ± 4.97
7.09 ± 0.59
9.44 ± 0.70
Table 1: Class-incremental final average accuracy (FAA) of rehearsal-based methods , with and without dreaming, for buffer sizes 2000 and 5000.
Mini-ImageNet
FG-ImageNet
ImageNet-R
2000
5000
2000
5000
2000
5000
ER
-2.58
-1.62
-1.88
-1.52
-1.32
-0.64
↪ D2L
+0.33
+0.47
+1.79
+1.19
+0.24
+0.14
DER++
-1.55
-2.00
-1.36
-2.48
-1.03
-1.83
↪ D2L
+0.97
+0.71
-0.13
+1.86
+0.30
+0.24
ER-ACE
-1.99
-2.45
-2.00
-2.16
-2.46
-1.27
Table 2: Forward Transfer (FWT) of rehearsal-based methods , with and without dreaming, for buffer sizes 2000 and 5000.
Method
Mini-ImageNet
FG-ImageNet
ImageNet-R
Fine-tune
6.72 ± 1.20
6.98 ± 0.10
4.46 ± 0.15
Buffer-based methods
2000
5000
2000
5000
2000
5000
GSS
6.40 ± 0.38
5.71 ± 0.08
8.07 ± 0.26
9.23 ± 0.85
5.08 ± 0.13
4.29 ± 0.32
A-GEM
6.78 ± 1.13
7.45 ± 0.76
6.20 ± 1.11
6.11 ± 1.13
4.69 ± 0.03
6.29 ± 0.84
RPC
9.22 ± 0.30
9.02 ± 0.24
8.13 ± 0.11
7.41 ± 0.74
5.71 ± 0.03
6.32 ± 0.80
Table 3: Comparison with state-of-the-art methods, in terms of class-incremental final average accuracy (FAA) , for buffer sizes 2000 and 5000.
Buffer size
Method
2000
5000
ER-ACE
33.26 ± 3.51
40.59 ± 1.20
+ Fixed optim.
38.94 ± 0.97
46.41 ± 0.55
+ Oracle (D2L)
40.90 ± 0.95
47.32 ± 0.89
Table 4: Ablation on the oracle. Results on Mini-ImageNet comparing our method with Fixed optimization.
Buffer size
Dreaming
2000
5000
No dreams
33.36 ± 3.51
40.59 ± 1.20
At beginning
36.93 ± 2.09
41.59 ± 2.54
Incremental
36.85 ± 1.16
43.87 ± 2.90
D2L
40.90 ± 0.95
47.32 ± 0.89
Table 5: Impact of dream class updates. Comparison on Mini-ImageNet of different dreaming strategies.
Buffer size
Method
2000
5000
ER-ACE
33.26 ± 3.51
40.59 ± 1.20
+ Mixup
36.84 ± 0.94
44.82 ± 1.27
+ Continual Mixup
36.05 ± 1.22
43.45 ± 0.83
+ Textual Mixup
31.89 ± 0.50
–
+ Synth Mixup
36.99 ± 0.26
–
Table 6: Comparison of alterative dream generation strategies. Evaluation on Mini-ImageNet comparing interpolation-based baselines and WSCL (auxiliary-data surrogate against our proposed D2L.
Method
Diffusion Usage
Training cost
Inference cost
Avg. Acc. ( ↑ )
ER-ACE
None
1×
1×
33.26 ± 3.51
+ Mixup
None
1×
1×
36.84 ± 0.94
+ Diffusion (Augmentation + Rehearsal)
Frozen (samples only)
∼7×
1×
36.69 ± 0.42
DDGR (ResNet)
Generator trained (Replay)
∼489×
1×
43.46 ± 0.25
D2L (Ours)
Frozen + Dream classes
∼17×
1×
40.90 ± 0.95
Table 7: Relative training cost per task normalized to ER-ACE ( 1× ) on SeqMiniImageNet. ER-ACE serves as the reference cost model. We report training cost under different diffusion usage regimes (none, augmentation/rehearsal with frozen generator, generator-trained replay, and dreaming). Inference cost remains identical across methods ( 1× ). A detailed cost decomposition is provided in Appendix Appendix B. Computational Cost Estimation .
Table 8: Computational Analysis and Paradigm Comparison. We report the Relative Training Cost normalized to the standard ER-ACE baseline ( 1× ). We also report a per-task TFLOPs Breakdown and the corresponding Total TFLOPs .
Huazhong University of Science and Technology, Wuhan, China · State Key Laboratory of Multispectral Information Intelligent Processing Technology, Wuhan, China · University of Science and Technology of China, Anhui, China +1