SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2311.12048 · ICML · 2024

One Size Fits All for Semantic Shifts: Adaptive Prompt Tuning for Continual Learning

Hwanjun Song, Doyoung Kim, Dongmin Park, Jihwan Bang, Youngjun Lee, Jae-Gil Lee, Susik Yoon

arXiv · PDF · Open in the Atlas

Code that ran

6 of 7 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, 1 violated it and 0 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/2311.12048.json · badge: /api/ran/2311.12048.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
kaist-dmlab/AdaPromptCL canonical (classifier label)
classifier basis: census
6 ran · 0 no recorded run
kaist-dmlab/adapromptcl canonical (classifier label)
classifier basis: classifier_2025
0 ran · 1 no recorded run
FunctionStatusWhere it lives
checkpoint_filter_fn Ran
ran; our contract draft was wrong, not the code
kaist-dmlab/AdaPromptCL/clip_vit.py
code served (permissive licence) · get_code("356e2c00330c8d41")
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
import math

torch.manual_seed(0)

# Build a minimal model that satisfies the function's usage
class PatchEmbed(nn.Module):
    def __init__(self):
        super().__init__()
        self.proj = nn.Conv2d(3, 768, kernel_size=16, stride=16)
        self.grid_size = (14, 14)

class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.patch_embed = PatchEmbed()
        # pos_embed shape: (1, num_patches + num_prefix_tokens, embed_dim)
        # For a 14x14 grid: 196 patches + 1 cls token = 197 tokens
        self.pos_embed = nn.Parameter(torch.randn(1, 197, 768))
        self.num_prefix_tokens = 1
        self.no_embed_class = False

model = MinimalModel()

# Create a sample state_dict
state_dict = {
    'model': {
        'patch_embed.proj.weight': torch.randn(768, 3, 16, 16),
        'pos_embed': torch.randn(1, 197, 768),
        'blocks.0.norm1.weight': torch.randn(768),
        'blocks.0.norm1.bias': torch.randn(768),
        'pre_logits.fc.weight': torch.randn(1000, 768),  # This should be skipped
        'head.weight': torch.randn(1000, 768),
    }
}

ARGS = {
    'state_dict': state_dict,
    'model': model,
    'adapt_layer_scale': 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 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
dataset_idx2text Ran
ran; our contract draft was wrong, not the code
kaist-dmlab/AdaPromptCL/vision_transformer.py
code served (permissive licence) · get_code("538940a0cabf2a8f")
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 json
import tempfile
import os

# Create a temporary directory and mock dataset info file
temp_dir = tempfile.mkdtemp()
dataset_infos_dir = os.path.join(temp_dir, 'continual_datasets')
os.makedirs(dataset_infos_dir, exist_ok=True)

# Create mock dataset_infos.json with CIFAR100 classes
mock_data = {
    'cifar100': {
        'features': {
            'fine_label': {
                'names': [
                    'apple', 'aquarium_fish', 'baby', 'bear', 'beaver',
                    'bed', 'bee', 'beetle', 'bicycle', 'bottle',
                    'bowl', 'box', 'boy', 'bridge', 'bus',
                    'butterfly', 'camel', 'can', 'canal', 'cancel',
                    'car', 'card', 'carpet', 'carriage', 'cart',
                    'case', 'castle', 'caterpillar', 'cattle', 'caught',
                    'cause', 'cave', 'ceiling', 'celery', 'cement',
                    'census', 'century', 'cereal', 'certain', 'chain',
                    'chair', 'chalk', 'champ', 'champion', 'change',
                    'channel', 'chant', 'chaos', 'chap', 'char',
                    'character', 'charge', 'chariot', 'charm', 'chart',
                    'chase', 'chat', 'cheap', 'cheat', 'check',
                    'cheese', 'cheetah', 'chef', 'chemical', 'cherish',
                    'cherry', 'chess', 'chest', 'chicken', 'chief',
                    'child', 'chimney', 'chimpanzee', 'chin', 'china',
                    'choice', 'choose', 'chop', 'chopsticks', 'chord',
                    'chore', 'chose', 'chow', 'chowder', 'chrome',
                    'chrysanthemum', 'chuck', 'chuckle', 'chug', 'chum',
                    'chunk', 'church', 'churn', 'chute', 'cider',
                    'cigar', 'cinnamon', 'cipher', 'circle', 'circuit',
                    'circular', 'circulate', 'circum', 'circumstance', 'circus',
                    'cistern', 'citadel', 'citation', 'cite', 'citizen',
                    'citric', 'citrine', 'citron', 'citronella', 'citrus',
                    'city', 'civet', 'civic', 'civil', 'civilian',
                    'civility', 'civilly', 'clack', 'clad', 'claim',
                    'clam', 'clamber', 'clammy', 'clamor', 'clamp',
                    'clan', 'clang', 'clank', 'clap', 'clapper'
                ]
            }
        }
    }
}

json_path = os.path.join(dataset_infos_dir, 'dataset_infos.json')
with open(json_path, 'w') as f:
    json.dump(mock_data, f)

# Change to the temporary directory so the relative path works
original_cwd = os.getcwd()
os.chdir(temp_dir)

ARGS = {
    'dataset': 'Split-CIFAR100'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — 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
get_init_weights_vit Ran
ran; our contract draft was wrong, not the code
kaist-dmlab/AdaPromptCL/clip_vit.py
pointer only (licence: Apache-2.0); 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 (Apache-2.0), 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.

resize_pos_embed Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
kaist-dmlab/AdaPromptCL/clip_vit.py
code served (permissive licence) · get_code("321424d80e3f6eed")
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 3, dtype family float, shape (1, 17, 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 math

torch.manual_seed(0)

# Small position embedding tensor with batch=1, seq_len=10, embedding_dim=4
# Structure: [batch, seq_len, embed_dim]
# With num_prefix_tokens=1, we have 1 prefix token + 9 grid tokens
# 9 = 3x3 grid, so sqrt(9) = 3
posemb = torch.randn(1, 10, 4)

# New position embedding tensor with different sequence length
# Let's say we want a 4x4 grid + 1 prefix token = 17 tokens
posemb_new = torch.randn(1, 17, 4)

# Number of prefix tokens (e.g., class token in ViT)
num_prefix_tokens = 1

# New grid size (height, width) for interpolation
# For 16 grid tokens: 4x4
gs_new = (4, 4)

ARGS = {
    'posemb': posemb,
    'posemb_new': posemb_new,
    'num_prefix_tokens': num_prefix_tokens,
    'gs_new': gs_new,
}
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 3, dtype family float, shape (1, 17, 4) — shape (1, 17, 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
target_transform Ran
ran, violated the contract we drafted
kaist-dmlab/AdaPromptCL/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
text_preprocess Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
kaist-dmlab/AdaPromptCL/vision_transformer.py
code served (permissive licence) · get_code("925fcd07bfa13582")
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 list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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 json
import tempfile
import os

# Create a temporary directory with the required dataset info file
temp_dir = tempfile.mkdtemp()
dataset_infos_dir = os.path.join(temp_dir, 'continual_datasets')
os.makedirs(dataset_infos_dir, exist_ok=True)

# Create the dataset_infos.json file with CIFAR100 class names
dataset_infos = {
    'cifar100': {
        'features': {
            'fine_label': {
                'names': [
                    'apple', 'aquarium_fish', 'baby', 'bear', 'beaver',
                    'bed', 'bee', 'beetle', 'bicycle', 'bottle',
                    'bowl', 'boy', 'bridge', 'bus', 'butterfly',
                    'camel', 'can', 'canal', 'cancel', 'candle',
                    'cannon', 'canoe', 'canvas', 'canyon', 'cap',
                    'car', 'card', 'cardigan', 'cargo', 'carpet',
                    'carriage', 'carrot', 'cart', 'case', 'cash',
                    'casino', 'castle', 'casual', 'cat', 'catalog',
                    'catch', 'category', 'cattle', 'caught', 'cause',
                    'caution', 'cave', 'cavern', 'cease', 'ceiling',
                    'celery', 'cellar', 'cement', 'cemetery', 'census',
                    'century', 'cereal', 'certain', 'certainly', 'certainty',
                    'certificate', 'cesspool', 'chafe', 'chaff', 'chain',
                    'chair', 'chalk', 'challenge', 'chamber', 'chamois',
                    'champ', 'champion', 'chance', 'chandelier', 'change',
                    'channel', 'chant', 'chaos', 'chap', 'chapel',
                    'chaplain', 'chapped', 'chapter', 'char', 'character',
                    'charcoal', 'charge', 'charger', 'chariot', 'charm',
                    'charmed', 'charmer', 'charming', 'chars', 'chart',
                    'charter', 'chase', 'chased', 'chaser', 'chasm',
                    'chassis', 'chaste', 'chasten', 'chastise', 'chastity',
                    'chat', 'chafe', 'chateau', 'chattel', 'chatter',
                    'chatterbox', 'chatty', 'chauffeur', 'cheap', 'cheapen',
                    'cheaper', 'cheapest', 'cheaply', 'cheapness', 'cheat',
                    'cheated', 'cheater', 'cheating', 'check', 'checked',
                    'checker', 'checkerboard', 'checkers', 'checking', 'checkmate',
                    'checkout', 'checkpoint', 'checkup', 'cheddar', 'cheek',
                    'cheeked', 'cheekbone', 'cheeky', 'cheep', 'cheer'
                ]
            }
        }
    }
}

json_path = os.path.join(dataset_infos_dir, 'dataset_infos.json')
with open(json_path, 'w') as f:
    json.dump(dataset_infos, f)

# Change to temp directory so the relative path works
original_cwd = os.getcwd()
os.chdir(temp_dir)

torch.manual_seed(0)

# Create a small batch of target indices
target = torch.tensor([0, 1, 5, 10], dtype=torch.long)

ARGS = {
    'target': target,
    'dataset': 'Split-CIFAR100'
}
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 list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
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
EPrompt Not yet run
unverified (harvested, no recorded run)
kaist-dmlab/adapromptcl/prompt.py
code served (permissive licence) · get_code("701cbaee174d4e62")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 1 the same month, 2 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.

FunctionAlso present inEarliest-datedOthers named
get_init_weights_vit 25 other papers
9 dated earlier, 1 the same month, 14 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
3 dated earlier, 3 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
2310.13888 (2023-10)
Towards a General Framework for Continual Learning with Pre-training
and 3 more not named here
resize_pos_embed 3 other papers
3 dated earlier
2303.11403 (2023-03)
eP-ALM: Efficient Perceptual Augmentation of Language Models
2308.03374 (2023-08)
Heterogeneous Forgetting Compensation for Class-Incremental Learning
2308.09610 (2023-08)
On the Effectiveness of LayerNorm Tuning for Continual Learning in Vision Transformers

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 real-world continual learning (CL) scenarios, tasks often exhibit intricate and unpredictable semantic shifts, posing challenges for fixed prompt management strategies which are tailored to only handle semantic shifts of uniform degree (i.e., uniformly mild or uniformly abrupt). To address this limitation, we propose an adaptive prompting approach that effectively accommodates semantic shifts of varying degree where mild and abrupt shifts are mixed. AdaPromptCL employs the assign-and-refine semantic grouping mechanism that dynamically manages prompt groups in accordance with the semantic similarity between tasks, enhancing the quality of grouping through continuous refinement. Our experiment results demonstrate that AdaPromptCL outperforms existing prompting methods by up to 21.3%, especially in the benchmark datasets with diverse semantic shifts between tasks.

For agents

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

get_harvested_code_for_paper("2311.12048")
get_code_for_paper("2311.12048")
have("2311.12048")

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

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

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

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

Connect an agent — have() is free.