SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2310.13888 · NeurIPS · 2023

Towards a General Framework for Continual Learning with Pre-training

Hang Su, Jun Zhu, Liyuan Wang, Jingyi Xie, Xingxing Zhang

arXiv · PDF · Open in the Atlas

Code that ran

8 of 9 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 1 violated it and 2 have no contract verdict; 5 failures of our instrument; 1 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/2310.13888.json · badge: /api/ran/2310.13888.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
thu-ml/HiDe-Prompt canonical (classifier label)
classifier basis: census
7 ran · 1 no recorded run
thu-ml/hide-prompt community
Papers with Code archive
1 ran · 0 no recorded run
FunctionStatusWhere it lives
EPrompt Ran
ran on a synthesized input · constructed an object; no result was computed
thu-ml/hide-prompt/peft/prompt/hide_prompt.py
code served (permissive licence) · get_code("a2575f11d9ebef0c")
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, EPrompt: 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)

# Define ARGS dict with all parameters for EPrompt.__init__
ARGS = {
    'length': 5,
    'embed_dim': 8,
    'embedding_key': 'mean',
    'prompt_init': 'uniform',
    'prompt_pool': True,
    'prompt_key': True,
    'pool_size': 4,
    'top_k': 2,
    'batchwise_prompt': False,
    'prompt_key_init': 'uniform',
    'num_layers': 2,
    'use_prefix_tune_for_e_prompt': True,
    'num_heads': 4,
    'same_key_value': 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 EPrompt — 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 EPrompt 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
checkpoint_filter_fn Ran
ran; our contract draft was wrong, not the code
thu-ml/HiDe-Prompt/vits/hide_prompt_vision_transformer.py
pointer only (licence: MIT); the stored copy get_code serves, from skyofbeginning/fedmgp, is pointer only (licence: NONE) · get_code("ee95af3ec5c38df5")
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 skyofbeginning/fedmgp, 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.

get_episode_dataset Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
thu-ml/HiDe-Prompt/few_shot_datasets.py
code served (permissive licence) · get_code("14b5572abcfb8ffd")
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 EpisodeImagenet_R. 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 mock data source that behaves like a dataset
# It needs to support indexing and return (image, target) tuples
class MockDataSource:
    def __init__(self, num_samples=10):
        self.num_samples = num_samples
        # Create dummy image and target pairs
        self.samples = [
            (torch.randn(3, 32, 32), i % 5)  # image of shape (3, 32, 32), target class
            for i in range(num_samples)
        ]
    
    def __getitem__(self, index):
        return self.samples[index]
    
    def __len__(self):
        return self.num_samples

# Create mock data source with some samples
data_source = MockDataSource(num_samples=20)

# Create episode_samples: indices that define which samples from data_source
# should be included in this episode
episode_samples = [0, 2, 5, 7, 10, 15]

ARGS = {
    'dataset': 'Imagenet-R',
    'episode_samples': episode_samples,
    'data_source': data_source
}
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 EpisodeImagenet_R — a EpisodeImagenet_R 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
get_init_weights_vit Ran
ran; our contract draft was wrong, not the code
thu-ml/HiDe-Prompt/vits/hide_prompt_vision_transformer.py
pointer only (licence: MIT); the stored copy get_code serves, from skyofbeginning/fedmgp, is pointer only (licence: NONE) · get_code("6c600a2f0f2361f1")
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 skyofbeginning/fedmgp, 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.

get_init_weights_vit Ran
ran; our contract draft was wrong, not the code
thu-ml/HiDe-Prompt/vits/hide_lora_vision_transformer.py
code served (permissive licence) · get_code("d2462a444e3fa1df")
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 partial. 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 functools import partial

torch.manual_seed(0)

# Create test arguments for get_init_weights_vit
ARGS = {
    'mode': 'jax',
    'head_bias': 0.5,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
timm, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type partial — a partial output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a partial 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_query_dataset Ran
ran on a synthesized input
thu-ml/HiDe-Prompt/few_shot_datasets.py
code served (permissive licence) · get_code("d43a8b4e6947732e")
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 QueryImagenet_R. 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 mock data source that behaves like a dataset
# It should support indexing and return (image, target) tuples
class MockDataSource:
    def __init__(self, num_samples=10):
        self.num_samples = num_samples
    
    def __getitem__(self, index):
        # Return a small tensor image and a target class index
        img = torch.randn(3, 4, 4)  # 3-channel image, 4x4 spatial
        target = torch.tensor(index % 5)  # 5 classes
        return (img, target)
    
    def __len__(self):
        return self.num_samples

# Create mock data source with sufficient samples
data_source = MockDataSource(num_samples=20)

# Create query_samples - indices into the data_source
query_samples = [0, 2, 5, 7, 9, 11]

# Create ARGS dictionary with all parameters
ARGS = {
    'dataset': 'Imagenet-R',
    'query_samples': query_samples,
    'data_source': data_source
}
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 QueryImagenet_R — a QueryImagenet_R 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
resize_pos_embed Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
thu-ml/HiDe-Prompt/vits/hide_prompt_vision_transformer.py
pointer only (licence: MIT); the stored copy get_code serves, from skyofbeginning/fedmgp, is pointer only (licence: NONE) · get_code("a6e17b60ed761713")
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 skyofbeginning/fedmgp, 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.

target_transform Ran
ran, violated the contract we drafted
thu-ml/HiDe-Prompt/datasets.py
code served (permissive licence) · get_code("265ea374aab10001")
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 1, dtype family float, shape (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)

# Analyze the function: target_transform(x, nb_classes)
# The function returns x + nb_classes
# x should be numeric (supports addition)
# nb_classes should be numeric (supports addition with x)

# Create a small numeric value for x
x = torch.tensor([1, 2, 3, 4], dtype=torch.float32)

# Create a small numeric value for nb_classes
nb_classes = 10

ARGS = {
    'x': x,
    'nb_classes': nb_classes
}
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 1, dtype family float, shape (4,) — shape (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
get_dataset Not yet run
unverified (harvested, no recorded run)
thu-ml/HiDe-Prompt/datasets.py
code served (permissive licence) · get_code("f8e1687c33938e06")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 5 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 5 later) and 3 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
get_init_weights_vit 25 other papers
8 dated earlier, 16 later, 1 same year, order not determinable · 1 only as an assembly brick
2112.08654 (2021-12)
Learning to Prompt for Continual Learning
2207.12819 (2022-07)
S-Prompts Learning with Pre-trained Transformers: An Occam's Razor for Domain Incremental Learning
2210.08823 (2022-10)
Scaling & Shifting Your Features: A New Baseline for Efficient Model Tuning
and 22 more not named here
target_transform 6 other papers
2 dated earlier, 4 later
2112.08654 (2021-12)
Learning to Prompt for Continual Learning
2308.09610 (2023-08)
On the Effectiveness of LayerNorm Tuning for Continual Learning in Vision Transformers
2311.12048 (2023-11)
One Size Fits All for Semantic Shifts: Adaptive Prompt Tuning for Continual Learning
and 3 more not named here
checkpoint_filter_fn 4 other papers
2 dated earlier, 2 later
2112.08654 (2021-12)
Learning to Prompt for Continual Learning
2308.09610 (2023-08)
On the Effectiveness of LayerNorm Tuning for Continual Learning in Vision Transformers
2404.14721 (2024-04)
Dynamically Anchored Prompting for Task-Imbalanced Continual Learning
and 1 more not named here
resize_pos_embed 4 other papers
1 dated earlier, 3 later
2112.08654 (2021-12)
Learning to Prompt for Continual Learning
2404.14721 (2024-04)
Dynamically Anchored Prompting for Task-Imbalanced Continual Learning
2407.00113 (2024-07)
Personalized Federated Continual Learning via Multi-granularity Prompt
and 1 more not named here
get_dataset 1 other paper
1 later
2405.14124 (2024-05)
Mixture of Experts Meets Prompt-Based Continual Learning

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

In this work, we present a general framework for continual learning of sequentially arrived tasks with the use of pre-training, which has emerged as a promising direction for artificial intelligence systems to accommodate real-world dynamics. From a theoretical perspective, we decompose its objective into three hierarchical components, including within-task prediction, task-identity inference, and task-adaptive prediction. Then we propose an innovative approach to explicitly optimize these components with parameter-efficient fine-tuning (PEFT) techniques and representation statistics. We empirically demonstrate the superiority and generality of our approach in downstream continual learning, and further explore the applicability of PEFT techniques in upstream continual learning. We also discuss the biological basis of the proposed framework with recent advances in neuroscience. Our code is available at https://github.com/thu-ml/HiDe-Prompt.

For agents

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

get_harvested_code_for_paper("2310.13888")
get_code_for_paper("2310.13888")
have("2310.13888")

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

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

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

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

Connect an agent — have() is free.