SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2312.08888 · 2023

Read Between the Layers: Leveraging Multi-Layer Representations for Rehearsal-Free Continual Learning with Pre-Trained Models

arXiv · PDF · Open in the Atlas

Code that ran

6 of 11 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; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 5 failures of our instrument; 5 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/2312.08888.json · badge: /api/ran/2312.08888.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
ky-ah/layup canonical (classifier label)
classifier basis: census
6 ran · 5 no recorded run
FunctionStatusWhere it lives
convert_module Ran
ran; our contract draft was wrong, not the code
ky-ah/layup/src/backbone/util.py
code served (permissive licence) · get_code("c671a43aac3cfcaf")
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 NestedModule. 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
from torch import nn
from torch.nn.modules.module import _IncompatibleKeys
from typing import Type, Dict, List, Optional, Callable
import inspect

torch.manual_seed(0)

# Define a simple source module to convert from
class SimpleLinear(nn.Module):
    def __init__(self, in_features=4, out_features=3):
        super().__init__()
        self.in_features = in_features
        self.out_features = out_features
        self.linear = nn.Linear(in_features, out_features)
    
    def forward(self, x):
        return self.linear(x)

# Define a target module to convert to
class SimpleLinearV2(nn.Module):
    def __init__(self, in_features=4, out_features=3, bias=True):
        super().__init__()
        self.in_features = in_features
        self.out_features = out_features
        self.bias_enabled = bias
        self.linear = nn.Linear(in_features, out_features, bias=bias)
    
    def forward(self, x):
        return self.linear(x)

# Create a nested module structure for testing recursive conversion
class NestedModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.layer1 = SimpleLinear(in_features=4, out_features=3)
        self.layer2 = SimpleLinear(in_features=3, out_features=2)
    
    def forward(self, x):
        x = self.layer1(x)
        x = self.layer2(x)
        return x

# Create the module instance to convert
module = NestedModule()

# Define the class mapping
cls_mapping = {
    SimpleLinear: SimpleLinearV2
}

# Define optional info_assertion function
def info_assertion_fn(info: _IncompatibleKeys) -> bool:
    # Accept any incompatible keys (permissive)
    return True

# Define optional kwargs_calculation function
def kwargs_calculation_fn(module: nn.Module, kwargs: Dict) -> Dict:
    # Add custom kwargs based on module properties
    if hasattr(module, 'in_features'):
        kwargs['in_features'] = module.in_features
    if hasattr(module, 'out_features'):
        kwargs['out_features'] = module.out_features
    return kwargs

# Construct the ARGS dictionary
ARGS = {
    'module': module,
    'cls_mapping': cls_mapping,
    'ignore': None,
    'info_assertion': info_assertion_fn,
    'kwargs_calculation': kwargs_calculation_fn,
    'recursive': True,
    'kwargs': {}
}
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 NestedModule — a NestedModule output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a NestedModule 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_extended_state_dict Ran
ran; our contract draft was wrong, not the code
ky-ah/layup/src/backbone/util.py
code served (permissive licence) · get_code("6315877fcb9b006a")
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 dict. 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 typing import Dict

torch.manual_seed(0)

class SimpleModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
        self.bias_term = 0.5
        self.name = "test_module"
    
    @property
    def param_count(self):
        return sum(p.numel() for p in self.parameters())

module = SimpleModule()

extra_config = {
    "learning_rate": 0.001,
    "batch_size": 2,
    "epochs": 10
}

ARGS = {
    "module": module,
    "extra_config": extra_config
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
init_ssf_scale_shift Ran
ran; our contract draft was wrong, not the code
ky-ah/layup/src/backbone/ssf.py
code served (permissive licence) · get_code("e8318b2d967c44c7")
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 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
from torch import nn

torch.manual_seed(0)

ARGS = {
    "dim": 8
}
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 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
load_from_extended_state_dict Ran
ran; our contract draft was wrong, not the code
ky-ah/layup/src/backbone/util.py
code served (permissive licence) · get_code("9e82f563cdb33d99")
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 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 torch.nn as nn
from typing import Type, Dict

torch.manual_seed(0)

# Define a simple test module class
class SimpleModule(nn.Module):
    def __init__(self, input_dim=4, hidden_dim=8, **kwargs):
        super().__init__()
        self.linear = nn.Linear(input_dim, hidden_dim)
    
    def forward(self, x):
        return self.linear(x)

# Create a state dict with config
state_dict_with_config = {
    'config': {
        'input_dim': 4,
        'hidden_dim': 8
    },
    'state_dict': {
        'linear.weight': torch.randn(8, 4),
        'linear.bias': torch.randn(8)
    }
}

# Create a state dict without config (just the model weights)
state_dict_without_config = {
    'linear.weight': torch.randn(8, 4),
    'linear.bias': torch.randn(8)
}

ARGS = {
    'module_cls': SimpleModule,
    'state_dict': state_dict_with_config,
    'strict': False,
    'config_overrides': {}
}
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 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
ssf_ada Ran
ran, honoured the contract we drafted
ky-ah/layup/src/backbone/ssf.py
pointer only (licence: MIT); the stored copy get_code serves, from yewen1486/emtal, is pointer only (licence: NONE) · get_code("61e8364b7e9bcb70")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from yewen1486/emtal, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

target2onehot Ran
ran; our contract draft was wrong, not the code
ky-ah/layup/src/modules/ridge.py
code served (permissive licence) · get_code("5924c99e9a1d5d6f")
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

torch.manual_seed(0)

# Create a batch of target labels
# Shape: (batch_size,) where batch_size=2
targets = torch.tensor([0, 1])

# Number of classes
n_classes = 4

ARGS = {
    "targets": targets,
    "n_classes": n_classes,
}
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 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
add_adapters Not yet run
unverified (harvested, no recorded run)
ky-ah/layup/src/backbone/adapter.py
code served (permissive licence) · get_code("7269b079418e3027")
How it ran

no invocation recorded.

add_ssf Not yet run
unverified (harvested, no recorded run)
ky-ah/layup/src/backbone/ssf.py
code served (permissive licence) · get_code("ac1158c40bae34cb")
How it ran

no invocation recorded.

add_vpt Not yet run
unverified (harvested, no recorded run)
ky-ah/layup/src/backbone/vpt.py
code served (permissive licence) · get_code("f7b4fed516f29530")
How it ran

no invocation recorded.

calculate_ridge_weights Not yet run
unverified (harvested, no recorded run)
ky-ah/layup/src/modules/ridge.py
code served (permissive licence) · get_code("97da5d529666cfe5")
How it ran

no invocation recorded.

get_backbone Not yet run
unverified (harvested, no recorded run)
ky-ah/layup/src/backbone/general.py
code served (permissive licence) · get_code("892e324f237b4d5d")
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, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 2 the same month, 3 later) and 8 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.

FunctionAlso present inEarliest-datedOthers named
ssf_ada 8 other papers
3 dated earlier, 1 the same month, 4 later · 1 only as an assembly brick
2210.08823 (2022-10)
Scaling & Shifting Your Features: A New Baseline for Efficient Model Tuning
2307.02251 (2023-07)
RanPAC: Random Projections and Pre-trained Models for Continual Learning
2307.11342 (2023-07)
Tuning Pre-trained Model via Moment Probing
and 5 more not named here
target2onehot 8 other papers
2 dated earlier, 5 later, 1 same year, order not determinable · 1 only as an assembly brick
aaai_26216 (2023 (year only))
Isolation and Impartial Aggregation: A Paradigm of Incremental Learning without Interference
2307.02251 (2023-07)
RanPAC: Random Projections and Pre-trained Models for Continual Learning
2307.12045 (2023-07)
Revisiting Distillation for Continual Learning on Visual Question Localized-Answering in Robotic Surgery
and 5 more not named here
init_ssf_scale_shift 7 other papers
3 dated earlier, 1 the same month, 3 later
2210.08823 (2022-10)
Scaling & Shifting Your Features: A New Baseline for Efficient Model Tuning
2307.02251 (2023-07)
RanPAC: Random Projections and Pre-trained Models for Continual Learning
2307.11342 (2023-07)
Tuning Pre-trained Model via Moment Probing
and 4 more not named here

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

We address the Continual Learning (CL) problem, wherein a model must learn a sequence of tasks from non-stationary distributions while preserving prior knowledge upon encountering new experiences. With the advancement of foundation models, CL research has pivoted from the initial learning-from-scratch paradigm towards utilizing generic features from large-scale pre-training. However, existing approaches to CL with pre-trained models primarily focus on separating class-specific features from the final representation layer and neglect the potential of intermediate representations to capture low- and mid-level features, which are more invariant to domain shifts. In this work, we propose LayUP, a new prototype-based approach to CL that leverages second-order feature statistics from multiple intermediate layers of a pre-trained network. Our method is conceptually simple, does not require access to prior data, and works out of the box with any foundation model. LayUP surpasses the state of the art in four of the seven class-incremental learning benchmarks, all three domain-incremental learning benchmarks and in six of the seven online continual learning benchmarks, while significantly reducing memory and computational requirements compared to existing baselines. Our results demonstrate that fully exhausting the representational capacities of pre-trained models in CL goes well beyond their final embeddings.

For agents

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

get_harvested_code_for_paper("2312.08888")
get_code_for_paper("2312.08888")
have("2312.08888")

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

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

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

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

Connect an agent — have() is free.