SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2207.07256 · ICML · 2022

Improving Task-free Continual Learning by Distributionally Robust Memory Evolution

Li Shen, Mingchen Gao, Zhenyi Wang, Le Fang, Qiuling Suo, Tiehang Duan

arXiv · PDF · Open in the Atlas

Code that ran

5 of 5 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 5 failures of our instrument; 0 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2207.07256.json · badge: /api/ran/2207.07256.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
joey-wang123/dro-task-free canonical (classifier label)
classifier basis: classifier_2025
3 ran · 0 no recorded run
joey-wang123/DRO-Task-free marked official in Papers with Code
Papers with Code archive
2 ran · 0 no recorded run
FunctionStatusWhere it lives
SGLD_step Ran
ran; our contract draft was wrong, not the code
joey-wang123/DRO-Task-free/WGF.py
code served (permissive licence) · get_code("bb45173f2c1e0b85")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# z_gen needs to have .data attribute with .new() and .size() methods
# This means it should be a torch.Tensor
z_gen = torch.randn(2, 4, requires_grad=True)

# target_grad should be a tensor of the same shape as z_gen
# since it's added directly to z_gen in the function
target_grad = torch.randn(2, 4)

# stepsize is a scalar (float)
stepsize = 0.01

ARGS = {
    "stepsize": stepsize,
    "z_gen": z_gen,
    "target_grad": target_grad,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
SVGD_kernal Ran
ran; our contract draft was wrong, not the code
joey-wang123/dro-task-free/WGF.py
code served (permissive licence) · get_code("b40fd105a84e61c1")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Create a small tensor with shape (2, 4) - 2 particles in 4-dimensional space
flat_x = torch.randn(2, 4, requires_grad=True)

ARGS = {
    "flat_x": flat_x,
    "h": -1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, scipy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
SVGD_step Ran
ran; our contract draft was wrong, not the code
joey-wang123/dro-task-free/WGF.py
code served (permissive licence) · get_code("9775a658736ec278")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Create small tensors for testing
# z_gen: memory data buffer, shape (batch_size, feature_dim)
z_gen = torch.randn(2, 4, requires_grad=False)

# target_grad: gradient of per datapoint in memory buffer, same shape as z_gen
target_grad = torch.randn(2, 4, requires_grad=False)

# stepsize: learning rate for the step
stepsize = 0.01

ARGS = {
    "stepsize": stepsize,
    "z_gen": z_gen,
    "target_grad": target_grad,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, scipy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
WGF_retrieve_replay_update Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
joey-wang123/dro-task-free/WGF.py
code served (permissive licence) · get_code("4b54dcf0c81ce82d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned SimpleModel. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from copy import deepcopy

torch.manual_seed(0)

# Build a minimal model that satisfies the function's usage
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.conv = nn.Conv2d(3, 8, kernel_size=3, padding=1)
        self.linear = nn.Linear(8 * 4 * 4, 5)  # 5 classes
    
    def return_hidden(self, x):
        # x shape: (batch, 3, 4, 4)
        h = self.conv(x)  # (batch, 8, 4, 4)
        h = h.view(h.size(0), -1)  # (batch, 128)
        return h
    
    def forward(self, x):
        h = self.return_hidden(x)
        logits = self.linear(h)
        return logits

# Build a minimal buffer class
class SimpleBuffer:
    def __init__(self):
        self.logits = []
        self.data_x = torch.randn(4, 3, 4, 4)
        self.data_y = torch.tensor([0, 1, 2, 3])
    
    def sample(self, batch_size, exclude_task=None):
        indices = torch.randperm(len(self.data_x))[:batch_size]
        return (
            self.data_x[indices],
            self.data_y[indices],
            torch.tensor([0, 0])  # bt (batch task)
        )

# Build args config
class ArgsConfig:
    def __init__(self):
        self.buffer_batch_size = 2
        self.T_adv = 2
        self.gamma = 0.1
        self.method = 'SVGD'
        self.stepsize = 0.01
        self.beta = 0.5

# Create instances
model = SimpleModel()
opt = torch.optim.SGD(model.parameters(), lr=0.01)
buffer = SimpleBuffer()

# Input data
input_x = torch.randn(2, 3, 4, 4)  # batch_size=2, channels=3, spatial=4x4
input_y = torch.tensor([0, 1])  # 2 labels from 5 classes

ARGS = {
    'args': ArgsConfig(),
    'model': model,
    'opt': opt,
    'input_x': input_x,
    'input_y': input_y,
    'buffer': buffer,
    'task': 0,
    'loader': None,
    'rehearse': True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, scipy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SimpleModel — a SimpleModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleModel output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
WGF_retrieve_replay_update Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
joey-wang123/DRO-Task-free/WGF.py
code served (permissive licence) · get_code("4ba4ef2010aed900")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned MinimalModel. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import torch.optim as optim
import numpy as np

torch.manual_seed(0)
np.random.seed(0)

# Build a minimal model that has the required methods and attributes
class MinimalModel(nn.Module):
    def __init__(self, input_dim=4, hidden_dim=8, num_classes=3):
        super().__init__()
        self.features = nn.Linear(input_dim, hidden_dim)
        self.linear = nn.Linear(hidden_dim, num_classes)
    
    def forward(self, x):
        hidden = self.return_hidden(x)
        return self.linear(hidden)
    
    def return_hidden(self, x):
        return torch.relu(self.features(x))

# Build a minimal buffer class
class MinimalBuffer:
    def __init__(self):
        self.logits = []
    
    def sample(self, batch_size, exclude_task=None):
        # Return (mem_x, mem_y, bt)
        mem_x = torch.randn(batch_size, 4)
        mem_y = torch.randint(0, 3, (batch_size,))
        bt = torch.tensor([0] * batch_size)
        return mem_x, mem_y, bt

# Build a minimal args class
class Args:
    def __init__(self):
        self.buffer_batch_size = 2
        self.T_adv = 2
        self.gamma = 0.1
        self.beta = 0.5
        self.stepsize = 0.01
        self.method = 'SGLD'

# Create instances
args = Args()
model = MinimalModel(input_dim=4, hidden_dim=8, num_classes=3)
opt = optim.SGD(model.parameters(), lr=0.01)
input_x = torch.randn(2, 4)
input_y = torch.randint(0, 3, (2,))
buffer = MinimalBuffer()
task = 0
loader = None

ARGS = {
    'args': args,
    'model': model,
    'opt': opt,
    'input_x': input_x,
    'input_y': input_y,
    'buffer': buffer,
    'task': task,
    'loader': loader,
    'rehearse': True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MinimalModel — a MinimalModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MinimalModel output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 4 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 4 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Task-free continual learning (CL) aims to learn a non-stationary data stream without explicit task definitions and not forget previous knowledge. The widely adopted memory replay approach could gradually become less effective for long data streams, as the model may memorize the stored examples and overfit the memory buffer. Second, existing methods overlook the high uncertainty in the memory data distribution since there is a big gap between the memory data distribution and the distribution of all the previous data examples. To address these problems, for the first time, we propose a principled memory evolution framework to dynamically evolve the memory data distribution by making the memory buffer gradually harder to be memorized with distributionally robust optimization (DRO). We then derive a family of methods to evolve the memory buffer data in the continuous probability measure space with Wasserstein gradient flow (WGF). The proposed DRO is w.r.t the worst-case evolved memory data distribution, thus guarantees the model performance and learns significantly more robust features than existing memory-replaybased methods. Extensive experiments on existing benchmarks demonstrate the effectiveness of the proposed methods for alleviating forgetting. As a by-product of the proposed framework, our method is more robust to adversarial examples than existing task-free CL methods. Code is available on GitHub https://github.com/ joey-wang123/DRO-Task-free

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2207.07256")
get_code_for_paper("2207.07256")
have("2207.07256")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2207.07256.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2207.07256.svg)](https://syntology.ai/paper/2207.07256)

Connect an agent — have() is free.