SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2305.18806 · ICLR · 2024

Prediction Error-based Classification for Class-Incremental Learning

Tinne Tuytelaars, Michał Zaj, Gido Van De Ven

arXiv · PDF · Open in the Atlas

Code that ran

8 of 11 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (5 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 5 have no contract verdict; 3 failures of our instrument; 3 no recorded run), measured 2026-11-23; 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/2305.18806.json · badge: /api/ran/2305.18806.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
michalzajac-ml/pec canonical (classifier label)
classifier basis: classifier_2025
8 ran · 3 no recorded run
FunctionStatusWhere it lives
PecCNN Ran
ran on a synthesized input · constructed an object; no result was computed
michalzajac-ml/pec/models/pec.py
code served (permissive licence) · get_code("f78b7afe23662a85")
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 an instance of its own class, PecCNN: the run constructed the object and did not call it, so no result was computed. 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 torch.nn as nn

torch.manual_seed(0)

# Minimal args class
class Args:
    def __init__(self):
        self.pec_conv_layers = [(8, 3, 1), (16, 3, 2)]
        self.pec_teacher_width_multiplier = 1.5
        self.pec_normalize_layers = True
        self.pec_activation = 'relu'
        self.pec_conv_reduce_spatial_to = 2
        self.pec_output_dim = 32

# Minimal dataset config
dataset_config = {
    'channels': 3,
    'size': 16
}

args = Args()

ARGS = {
    'dataset_config': dataset_config,
    'args': args,
    'is_teacher': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type PecCNN — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a PecCNN 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
PecMLP Ran
ran on a synthesized input · constructed an object; no result was computed
michalzajac-ml/pec/models/pec.py
code served (permissive licence) · get_code("8823f18fc15e1f29")
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 an instance of its own class, PecMLP: the run constructed the object and did not call it, so no result was computed. 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 torch.nn as nn
import torchvision

torch.manual_seed(0)

class DatasetConfig(dict):
    def __init__(self):
        super().__init__()
        self['size'] = 4
        self['channels'] = 3

class Args:
    def __init__(self):
        self.pec_num_layers = 3
        self.pec_width = 16
        self.pec_teacher_width_multiplier = 2.0
        self.pec_output_dim = 8
        self.pec_normalize_layers = True
        self.pec_activation = 'relu'

dataset_config = DatasetConfig()
args = Args()

ARGS = {
    'dataset_config': dataset_config,
    'args': args,
    'is_teacher': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type PecMLP — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a PecMLP 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
PecStudentTeacherPair Ran
ran on a synthesized input · constructed an object; no result was computed
michalzajac-ml/pec/models/pec.py
code served (permissive licence) · get_code("9a76caeddc04c602")
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 an instance of its own class, PecStudentTeacherPair: the run constructed the object and did not call it, so no result was computed. 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 torch.nn as nn
import torchvision

torch.manual_seed(0)

class SimpleArgs:
    def __init__(self):
        self.pec_architecture = 'mlp'
        self.pec_num_layers = 2
        self.pec_width = 8
        self.pec_output_dim = 4
        self.pec_normalize_layers = False
        self.pec_activation = 'relu'
        self.pec_teacher_width_multiplier = 1.5
        self.pec_conv_layers = [(8, 3, 1), (16, 3, 2)]
        self.pec_conv_reduce_spatial_to = 1

def get_activation_from_name(name):
    if name == 'relu':
        return nn.ReLU
    if name == 'lrelu':
        return nn.LeakyReLU
    if name == 'leakyrelu':
        return nn.LeakyReLU
    if name == 'gelu':
        return nn.GELU
    if name == 'tanh':
        return nn.Tanh
    if name == 'selu':
        return nn.SELU
    if name == 'silu':
        return nn.SiLU
    if name == 'celu':
        return nn.CELU
    if name == 'mish':
        return nn.Mish
    if name == 'no':
        return nn.Identity
    assert False, 'bad activation name!'

def get_single_pec_network(dataset_config, args, is_teacher=False):
    model_class = {'mlp': PecMLP, 'cnn': PecCNN}[args.pec_architecture]
    model = model_class(dataset_config, args, is_teacher=is_teacher)
    if is_teacher:
        for param in model.parameters():
            param.requires_grad = False
    return model

class PecMLP(nn.Module):
    def __init__(self, dataset_config, args, is_teacher=False) -> None:
        super().__init__()
        num_layers = args.pec_num_layers
        width = args.pec_width
        if is_teacher:
            width = int(width * args.pec_teacher_width_multiplier)
        in_channels = dataset_config['size'] ** 2 * dataset_config['channels']
        hidden_channels = num_layers * [width]
        hidden_channels[-1] = args.pec_output_dim
        norm_layer = nn.LayerNorm if args.pec_normalize_layers else None
        self.features = nn.Sequential(nn.Flatten(), torchvision.ops.MLP(in_channels=in_channels, hidden_channels=hidden_channels, norm_layer=norm_layer, activation_layer=get_activation_from_name(args.pec_activation), inplace=None, dropout=0.0))

    def forward(self, x: torch.Tensor) -> torch.Tensor:
        return self.features(x)

class PecCNN(nn.Module):
    def __init__(self, dataset_config, args, is_teacher=False) -> None:
        super().__init__()
        layers = []
        cur_channels = dataset_config['channels']
        cur_size = dataset_config['size']
        for channels, kernel, stride in args.pec_conv_layers:
            if is_teacher:
                channels = int(args.pec_teacher_width_multiplier * channels)
            layers.append(nn.Conv2d(in_channels=cur_channels, out_channels=channels, kernel_size=kernel, stride=stride, padding=kernel // 2))
            cur_channels = channels
            cur_size //= stride
            if args.pec_normalize_layers:
                layers.append(nn.InstanceNorm2d(cur_channels, affine=True))
            layers.append(get_activation_from_name(args.pec_activation)())
        layers.append(nn.AdaptiveAvgPool2d(args.pec_conv_reduce_spatial_to))
        layers.append(nn.Flatten(1))
        layers.append(nn.Linear(cur_channels * args.pec_conv_reduce_spatial_to ** 2, args.pec_output_dim))
        self.features = nn.Sequential(*layers)

    def forward(self, x: torch.Tensor) -> torch.Tensor:
        return self.features(x)

class PecStudentTeacherPair(nn.Module):
    def __init__(self, dataset_config, args, teacher):
        super().__init__()
        self.student = get_single_pec_network(dataset_config, args)
        self.teacher = teacher

    def forward(self, x):
        return torch.mean((self.student(x) - self.teacher(x).detach()) ** 2, dim=1)

dataset_config = {
    'channels': 3,
    'size': 4
}

args = SimpleArgs()

teacher = get_single_pec_network(dataset_config, args, is_teacher=True)

ARGS = {
    'dataset_config': dataset_config,
    'args': args,
    'teacher': teacher
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type PecStudentTeacherPair — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a PecStudentTeacherPair 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
PolynomialLR Ran
ran on a synthesized input · constructed an object; no result was computed
michalzajac-ml/pec/models/pec.py
code served (permissive licence) · get_code("cadb2743e9a418c1")
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 an instance of its own class, PolynomialLR: the run constructed the object and did not call it, so no result was computed. 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 torch.nn as nn
import torch.optim as optim

torch.manual_seed(0)

# Create a simple model
model = nn.Sequential(
    nn.Linear(4, 3),
    nn.ReLU(),
    nn.Linear(3, 2)
)

# Create an optimizer
optimizer = optim.SGD(model.parameters(), lr=0.001)

# Define ARGS dictionary with all parameters for PolynomialLR
ARGS = {
    'optimizer': optimizer,
    'total_iters': 4,
    'power': 1.0,
    'last_epoch': -1,
    'verbose': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type PolynomialLR — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a PolynomialLR 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
get_activation_from_name Ran
ran; our contract draft was wrong, not the code
michalzajac-ml/pec/models/pec.py
code served (permissive licence) · get_code("7d8ef9a6878e7c6d")
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 type. 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 torch.nn as nn

torch.manual_seed(0)

# The function takes a single parameter 'name' which is a string
# It returns an activation function class based on the name provided
# We'll test with a valid activation name

ARGS = {
    'name': 'relu'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type type — a type output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a type 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
get_lr_scheduler Ran
ran; our contract draft was wrong, not the code
michalzajac-ml/pec/models/pec.py
code served (permissive licence) · get_code("e7b24e736dee1ac3")
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 PolynomialLR. 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 torch.nn as nn
from torch.optim import SGD

torch.manual_seed(0)

# Create a minimal model
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

model = MinimalModel()

# Create an optimizer
optimizer = SGD(model.parameters(), lr=0.001)

# Create a minimal args object
class Args:
    def __init__(self, optim_scheduler):
        self.optim_scheduler = optim_scheduler

args = Args(optim_scheduler='linear')

# Number of steps
num_steps = 10

ARGS = {
    'optimizer': optimizer,
    'args': args,
    'num_steps': num_steps
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type PolynomialLR — a PolynomialLR output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a PolynomialLR 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
get_single_pec_network Ran
ran; our contract draft was wrong, not the code
michalzajac-ml/pec/models/pec.py
code served (permissive licence) · get_code("5f242e8af6904119")
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 PecCNN. 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 torch.nn as nn
import torchvision

torch.manual_seed(0)

class SimpleArgs:
    def __init__(self):
        self.pec_architecture = 'cnn'
        self.pec_conv_layers = [(8, 3, 1), (16, 3, 2)]
        self.pec_teacher_width_multiplier = 2.0
        self.pec_normalize_layers = True
        self.pec_activation = 'relu'
        self.pec_conv_reduce_spatial_to = 1
        self.pec_output_dim = 10
        self.pec_num_layers = 3
        self.pec_width = 32

dataset_config = {
    'channels': 3,
    'size': 8
}

ARGS = {
    'dataset_config': dataset_config,
    'args': SimpleArgs(),
    'is_teacher': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type PecCNN — a PecCNN output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a PecCNN 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
persistent_locals Ran
ran on a synthesized input · constructed an object; no result was computed
michalzajac-ml/pec/models/pec.py
code served (permissive licence) · get_code("d11b19ee641dd2e6")
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 an instance of its own class, persistent_locals: the run constructed the object and did not call it, so no result was computed. 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 sys
from typing import Callable

torch.manual_seed(0)

def sample_function(x, y):
    """A simple function to be decorated with persistent_locals"""
    local_var_1 = x + y
    local_var_2 = x * y
    result = local_var_1 + local_var_2
    return result

ARGS = {
    "func": sample_function
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type persistent_locals — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a persistent_locals 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
ContinualModel Not yet run
unverified (harvested, no recorded run)
michalzajac-ml/pec/models/pec.py
code served (permissive licence) · get_code("ffb4ae870279d896")
How it ran

no invocation recorded.

Pec Not yet run
unverified (harvested, no recorded run)
michalzajac-ml/pec/models/pec.py
code served (permissive licence) · get_code("816bf4763e66b179")
How it ran

no invocation recorded.

wandb_safe_log Not yet run
unverified (harvested, no recorded run)
michalzajac-ml/pec/models/pec.py
code served (permissive licence) · get_code("9bb47c58ee482974")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 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 11 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-23.

Repositories linked to this paper

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

Abstract

Class-incremental learning (CIL) is a particularly challenging variant of continual learning, where the goal is to learn to discriminate between all classes presented in an incremental fashion. Existing approaches often suffer from excessive forgetting and imbalance of the scores assigned to classes that have not been seen together during training. In this study, we introduce a novel approach, Prediction Error-based Classification (PEC), which differs from traditional discriminative and generative classification paradigms. PEC computes a class score by measuring the prediction error of a model trained to replicate the outputs of a frozen random neural network on data from that class. The method can be interpreted as approximating a classification rule based on Gaussian Process posterior variance. PEC offers several practical advantages, including sample efficiency, ease of tuning, and effectiveness even when data are presented one class at a time. Our empirical results show that PEC performs strongly in single-pass-through-data CIL, outperforming other rehearsal-free baselines in all cases and rehearsal-based methods with moderate replay buffer size in most cases across multiple benchmarks. 1

For agents

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

get_harvested_code_for_paper("2305.18806")
get_code_for_paper("2305.18806")
have("2305.18806")

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

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

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

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

Connect an agent — have() is free.