SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2604.04420 · 2026

Is Prompt Selection Necessary for Task-Free Online Continual Learning?

Hankook Lee, Seoyoung Park, Haemin Lee

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 (4 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 2 failures of our instrument; 5 no recorded run), measured 2026-11-22; 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/2604.04420.json · badge: /api/ran/2604.04420.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
efficient-learning-lab/SinglePrompt community
Papers with Code archive
6 ran · 5 no recorded run
FunctionStatusWhere it lives
Attention Ran
ran on a synthesized input · constructed an object; no result was computed
efficient-learning-lab/SinglePrompt/models/singlePrompt.py
code served (permissive licence) · get_code("5fef41eb93946fd9")
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, Attention: 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)

# Create a small input tensor: (batch_size=2, num_tokens=3, embedding_dim=8)
x = torch.randn(2, 3, 8)

# Define the Attention module arguments
ARGS = {
    'dim': 8,
    'num_heads': 2,
    'qkv_bias': False,
    'attn_drop': 0.0,
    'proj_drop': 0.0,
}

# Create the module and verify it works with the input
attention_module = nn.Module.__new__(nn.Module)
# Actually instantiate it properly
class Attention(nn.Module):
    def __init__(self, dim, num_heads=8, qkv_bias=False, attn_drop=0.0, proj_drop=0.0):
        super().__init__()
        assert dim % num_heads == 0, 'dim should be divisible by num_heads'
        self.num_heads = num_heads
        head_dim = dim // num_heads
        self.scale = head_dim ** (-0.5)
        self.qkv = nn.Linear(dim, dim * 3, bias=qkv_bias)
        self.attn_drop = nn.Dropout(attn_drop)
        self.proj = nn.Linear(dim, dim)
        self.proj_drop = nn.Dropout(proj_drop)

    def forward(self, x):
        B, N, C = x.shape
        qkv = self.qkv(x).reshape(B, N, 3, self.num_heads, C // self.num_heads).permute(2, 0, 3, 1, 4)
        q, k, v = qkv.unbind(0)
        attn = q @ k.transpose(-2, -1) * self.scale
        attn = attn.softmax(dim=-1)
        attn = self.attn_drop(attn)
        x = (attn @ v).transpose(1, 2).reshape(B, N, C)
        x = self.proj(x)
        x = self.proj_drop(x)
        return x

attention = Attention(**ARGS)
output = attention(x)

ARGS = {
    'dim': 8,
    'num_heads': 2,
    'qkv_bias': False,
    'attn_drop': 0.0,
    'proj_drop': 0.0,
}
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 Attention — 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 Attention 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
Block Ran
ran on a synthesized input · constructed an object; no result was computed
efficient-learning-lab/SinglePrompt/models/singlePrompt.py
code served (permissive licence) · get_code("9b15f0ec8365d3fe")
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, Block: 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
from timm.models.layers import Mlp, DropPath

torch.manual_seed(0)

# Define a minimal Attention layer that accepts prompt parameter
class MinimalAttention(nn.Module):
    def __init__(self, dim, num_heads=8, qkv_bias=False, attn_drop=0.0, proj_drop=0.0):
        super().__init__()
        assert dim % num_heads == 0, 'dim should be divisible by num_heads'
        self.num_heads = num_heads
        head_dim = dim // num_heads
        self.scale = head_dim ** (-0.5)
        self.qkv = nn.Linear(dim, dim * 3, bias=qkv_bias)
        self.attn_drop = nn.Dropout(attn_drop)
        self.proj = nn.Linear(dim, dim)
        self.proj_drop = nn.Dropout(proj_drop)

    def forward(self, x, prompt=None):
        B, N, C = x.shape
        qkv = self.qkv(x).reshape(B, N, 3, self.num_heads, C // self.num_heads).permute(2, 0, 3, 1, 4)
        q, k, v = qkv.unbind(0)
        attn = q @ k.transpose(-2, -1) * self.scale
        attn = attn.softmax(dim=-1)
        attn = self.attn_drop(attn)
        x = (attn @ v).transpose(1, 2).reshape(B, N, C)
        x = self.proj(x)
        x = self.proj_drop(x)
        return x

ARGS = {
    'dim': 4,
    'num_heads': 2,
    'mlp_ratio': 4.0,
    'qkv_bias': False,
    'drop': 0.0,
    'attn_drop': 0.0,
    'init_values': None,
    'drop_path': 0.0,
    'act_layer': nn.GELU,
    'norm_layer': nn.LayerNorm,
    'attn_layer': MinimalAttention,
}
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 Block — 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 Block 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
LayerScale Ran
ran on a synthesized input · constructed an object; no result was computed
efficient-learning-lab/SinglePrompt/models/singlePrompt.py
code served (permissive licence) · get_code("53f7f1cd1032ac80")
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, LayerScale: 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)

# LayerScale uses:
# - dim: integer dimension parameter
# - init_values: scalar for initialization
# - inplace: boolean flag
# The forward method expects input x to support mul_() and * operations with gamma

ARGS = {
    "dim": 4,
    "init_values": 1e-05,
    "inplace": 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 LayerScale — 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 LayerScale 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
PreAttention Ran
ran on a synthesized input · constructed an object; no result was computed
efficient-learning-lab/SinglePrompt/models/singlePrompt.py
code served (permissive licence) · get_code("a6018b1284d2e3e4")
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, PreAttention: 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)

class PreAttention(nn.Module):

    def __init__(self, dim, num_heads=8, qkv_bias=False, attn_drop=0.0, proj_drop=0.0):
        super().__init__()
        assert dim % num_heads == 0, 'dim should be divisible by num_heads'
        self.num_heads = num_heads
        head_dim = dim // num_heads
        self.scale = head_dim ** (-0.5)
        self.qkv = nn.Linear(dim, dim * 3, bias=qkv_bias)
        self.attn_drop = nn.Dropout(attn_drop)
        self.proj = nn.Linear(dim, dim)
        self.proj_drop = nn.Dropout(proj_drop)

    def forward(self, x, prompt=None):
        B, N, C = x.shape
        qkv = self.qkv(x).reshape(B, N, 3, self.num_heads, C // self.num_heads).permute(2, 0, 3, 1, 4)
        q, k, v = qkv.unbind(0)
        if prompt is not None:
            prompt_length = prompt.size(2)
            prompt = prompt.view(B, 2, prompt_length, self.num_heads, C // self.num_heads)
            prompt = prompt.permute(1, 0, 3, 2, 4).contiguous()
            key_prefix = prompt[0]
            value_prefix = prompt[1]
            expected_shape = (B, self.num_heads, C // self.num_heads)
            assert (key_prefix.shape[0], key_prefix.shape[1], key_prefix.shape[3]) == expected_shape, f'key_prefix.shape: {key_prefix.shape} not match k.shape: {k.shape}'
            assert (value_prefix.shape[0], value_prefix.shape[1], value_prefix.shape[3]) == expected_shape, f'value_prefix.shape: {value_prefix.shape} not match v.shape: {v.shape}'
            k = torch.cat([key_prefix, k], dim=2)
            v = torch.cat([value_prefix, v], dim=2)
        attn = q @ k.transpose(-2, -1) * self.scale
        attn = attn.softmax(dim=-1)
        attn = self.attn_drop(attn)
        x = (attn @ v).transpose(1, 2).reshape(B, N, C)
        x = self.proj(x)
        x = self.proj_drop(x)
        return x

# Setup
dim = 8
num_heads = 2
qkv_bias = False
attn_drop = 0.1
proj_drop = 0.1

# Create model instance
model = PreAttention(dim=dim, num_heads=num_heads, qkv_bias=qkv_bias, attn_drop=attn_drop, proj_drop=proj_drop)

# Create input tensor: (batch=2, sequence_length=3, dim=8)
x = torch.randn(2, 3, 8)

# Create optional prompt tensor: (batch=2, 2, prompt_length=4, dim=8)
# Shape needs to be (B, 2, prompt_length, C) where C=8
prompt = torch.randn(2, 2, 4, 8)

ARGS = {
    'dim': dim,
    'num_heads': num_heads,
    'qkv_bias': qkv_bias,
    'attn_drop': attn_drop,
    'proj_drop': proj_drop
}
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 PreAttention — 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 PreAttention 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
efficient-learning-lab/SinglePrompt/models/singlePrompt.py
code served (permissive licence) · get_code("f27dd436fd97776e")
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
import math

torch.manual_seed(0)

# Define ARGS dict 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
resize_pos_embed Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
efficient-learning-lab/SinglePrompt/models/singlePrompt.py
code served (permissive licence) · get_code("7b29cc3bb5b821c7")
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, 12, 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)

# Create position embedding tensor
# Shape: (batch=1, num_tokens, embedding_dim=4)
# num_tokens = num_prefix_tokens + grid_tokens
# With num_prefix_tokens=1 and a 3x3 grid: 1 + 9 = 10 tokens
posemb = torch.randn(1, 10, 4)

# Create new position embedding target
# Shape: (batch=1, new_num_tokens, embedding_dim=4)
# New grid will be 4x4 = 16, plus 1 prefix token = 17 tokens
posemb_new = torch.randn(1, 17, 4)

# num_prefix_tokens indicates how many tokens at the start are prefix tokens
# (e.g., class token) that shouldn't be resized
num_prefix_tokens = 1

# gs_new specifies the new grid size for spatial dimensions
# Empty tuple means it will be computed from ntok_new
gs_new = ()

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, 12, 4) — shape (1, 12, 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
SinglePromptViT Not yet run
unverified (harvested, no recorded run)
efficient-learning-lab/SinglePrompt/models/singlePrompt.py
code served (permissive licence) · get_code("f932b2c858d5f3dc")
How it ran

no invocation recorded.

_load_weights Not yet run
unverified (harvested, no recorded run)
efficient-learning-lab/SinglePrompt/models/singlePrompt.py
code served (permissive licence) · get_code("323ef35022abc876")
How it ran

no invocation recorded.

init_weights_vit_jax Not yet run
unverified (harvested, no recorded run)
efficient-learning-lab/SinglePrompt/models/singlePrompt.py
code served (permissive licence) · get_code("b60a21c3efaab10f")
How it ran

no invocation recorded.

init_weights_vit_moco Not yet run
unverified (harvested, no recorded run)
efficient-learning-lab/SinglePrompt/models/singlePrompt.py
code served (permissive licence) · get_code("9955e1faba88ccc1")
How it ran

no invocation recorded.

init_weights_vit_timm Not yet run
unverified (harvested, no recorded run)
efficient-learning-lab/SinglePrompt/models/singlePrompt.py
code served (permissive licence) · get_code("a6c021ba2c2d56e3")
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, 5 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 0 the same month, 0 later) and 6 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
brick of this paper's assembly: helper
25 other papers
25 dated earlier · 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
LayerScale
brick of this paper's assembly: helper
14 other papers
14 dated earlier · 12 only as an assembly brick
2301.08247 (2023-01)
Multiview Compressive Coding for 3D Reconstruction
2301.10222 (2023-01)
RangeViT: Towards Vision Transformers for 3D Semantic Segmentation in Autonomous Driving
2303.04249 (2023-03)
Where We Are and What We're Looking At: Query Based Worldwide Image Geo-localization Using Hierarchies and Scenes
and 11 more not named here
resize_pos_embed
brick of this paper's assembly: helper
4 other papers
4 dated earlier
2112.08654 (2021-12)
Learning to Prompt for Continual Learning
2310.13888 (2023-10)
Towards a General Framework for Continual Learning with Pre-training
2404.14721 (2024-04)
Dynamically Anchored Prompting for Task-Imbalanced Continual Learning
and 1 more not named here
Attention
brick of this paper's assembly: helper
2 other papers
2 dated earlier · 1 only as an assembly brick
2403.08568 (2024-03)
Consistent Prompting for Rehearsal-Free Continual Learning
2403.15139 (2024-03)
Deep Generative Model based Rate-Distortion for Image Downscaling Assessment
init_weights_vit_timm
brick of this paper's assembly: helper
1 other paper
1 dated earlier
2412.04786 (2024-12)
Slicing Vision Transformer for Flexible Inference

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 online continual learning has recently emerged as a realistic paradigm for addressing continual learning in dynamic, real-world environments, where data arrive in a non-stationary stream without clear task boundaries and can only be observed once. To consider such challenging scenarios, many recent approaches have employed prompt selection, an adaptive strategy that selects prompts from a pool based on input signals. However, we observe that such selection strategies often fail to select appropriate prompts, yielding suboptimal results despite additional training of key parameters. Motivated by this observation, we propose a simple yet effective Sin-glePrompt that eliminates the need for prompt selection and focuses on classifier optimization. Specifically, we simply (i) inject a single prompt into each self-attention block, (ii) employ a cosine similarity-based logit design to alleviate the forgetting effect inherent in the classifier weights, and (iii) mask logits for unexposed classes in the current minibatch. With this simple task-free design, our framework achieves state-of-the-art performance across various online continual learning benchmarks. Source code is available at https://github.com/efficient-learning-lab/SinglePrompt.

For agents

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

get_harvested_code_for_paper("2604.04420")
get_code_for_paper("2604.04420")
have("2604.04420")

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

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

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

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

Connect an agent — have() is free.