SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2603.10237 · 2026

One Adapter for All: Towards Unified Representation in Step-Imbalanced Class-Incremental Learning

Xiaoyan Zhang

arXiv · PDF · Open in the Atlas

Code that ran

7 of 12 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 1 has no contract verdict; 5 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/2603.10237.json · badge: /api/ran/2603.10237.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
xiaoyanzhang1/One-A community
Papers with Code archive
7 ran · 5 no recorded run
FunctionStatusWhere it lives
CosineLinear Ran
ran on a synthesized input
xiaoyanzhang1/One-A/models/onea.py
code served (permissive licence) · get_code("8873ca5e037fdec2")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) 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 math
import torch
from torch.nn import functional as F
from torch import nn

class CosineLinear(nn.Module):

    def __init__(self, in_features, out_features, nb_proxy=1, to_reduce=False, sigma=True):
        super(CosineLinear, self).__init__()
        self.in_features = in_features
        self.out_features = out_features * nb_proxy
        self.nb_proxy = nb_proxy
        self.to_reduce = to_reduce
        self.weight = nn.Parameter(torch.Tensor(self.out_features, in_features))
        if sigma:
            self.sigma = nn.Parameter(torch.Tensor(1))
        else:
            self.register_parameter('sigma', None)
        self.reset_parameters()

    def reset_parameters(self):
        stdv = 1.0 / math.sqrt(self.weight.size(1))
        self.weight.data.uniform_(-stdv, stdv)
        if self.sigma is not None:
            self.sigma.data.fill_(1)

    def forward(self, input):
        out = F.linear(F.normalize(input, p=2, dim=1), F.normalize(self.weight, p=2, dim=1))
        if self.to_reduce:
            out = self.reduce_proxies(out, self.nb_proxy)
        if self.sigma is not None:
            out = self.sigma * out
        return {'logits': out}

    def reset_parameters_to_zero(self):
        self.weight.data.fill_(0)

    def reduce_proxies(self, out, nb_proxy):
        if nb_proxy == 1:
            return out
        return out.view(out.size(0), -1, nb_proxy).mean(dim=2)


INIT_ARGS = {
    'in_features': 4,
    'out_features': 3,
    'nb_proxy': 1,
    'to_reduce': False,
    'sigma': True
}

ARGS = {
    'input': torch.randn(2, 4)
}

if __name__ == '__main__':
    model = CosineLinear(**INIT_ARGS)
    result = model(**ARGS)
    print(result)
    print(result['logits'].shape)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
accuracy Ran
ran; our contract draft was wrong, not the code
xiaoyanzhang1/One-A/models/onea.py
code served (permissive licence) · get_code("ffec6145f7c448f8")
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) 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 numpy as np

# Create sample predictions and ground truth labels
np.random.seed(0)

# Create predictions and true labels
# Let's say we have 20 samples with classes 0-14
n_samples = 20
y_true = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 0, 1, 2, 3, 4])
y_pred = np.array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 0, 1, 2, 3, 4])

# nb_old represents the number of old classes (classes seen in previous tasks)
nb_old = 10

# init_cls is the number of initial classes
init_cls = 10

# increments defines how many new classes are added in each increment
# First element is init_cls, subsequent elements are increments
increments = [10, 5]

ARGS = {
    'y_pred': y_pred,
    'y_true': y_true,
    'nb_old': nb_old,
    'init_cls': init_cls,
    'increments': increments
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy — 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
compute_lambda Ran
ran, honoured the contract we drafted
xiaoyanzhang1/One-A/models/onea.py
code served (permissive licence) · get_code("934110ba181dbd40")
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) and returned float, ndim 0, dtype family float, shape () 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 math

torch_seed = 0

ARGS = {
    "task_size": 5,
    "lamda_max": 0.1,
    "lamda_min": 0.01,
    "k": 2.3979,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 float, ndim 0, dtype family float, shape () — shape () 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
contrastive_loss Ran
ran; our contract draft was wrong, not the code
xiaoyanzhang1/One-A/models/onea.py
code served (permissive licence) · get_code("402c4823b108bebc")
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) and returned Tensor, ndim 0, dtype family float, shape () 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 torch.nn.functional as F

torch.manual_seed(0)

# Create small feature tensor [N, D] where N=2 (batch size), D=4 (feature dimension)
features = torch.randn(2, 4)

# Create labels tensor [N] with class assignments
labels = torch.tensor([0, 1])

# Margin parameter for negative pairs
tau = 0.07

ARGS = {
    "features": features,
    "labels": labels,
    "tau": tau,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 0, dtype family float, shape () — shape () 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_backbone Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
xiaoyanzhang1/One-A/models/onea.py
code served (permissive licence) · get_code("7f0e5ee3d0b40ec1")
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 MockViTModel. 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 unittest.mock import Mock, MagicMock, patch

torch.manual_seed(0)

# Mock the backbone module and vit_onea since we can't import real ones
class MockViTModel(nn.Module):
    def __init__(self, num_classes, global_pool, drop_path_rate, tuning_config):
        super().__init__()
        self.num_classes = num_classes
        self.global_pool = global_pool
        self.drop_path_rate = drop_path_rate
        self.tuning_config = tuning_config
        self.out_dim = 768
        self.linear = nn.Linear(768, 768)
    
    def forward(self, x):
        return self.linear(x)
    
    def eval(self):
        return super().eval()

# Create mock vit_onea module
class MockVitOnea:
    @staticmethod
    def vit_base_patch16_224_onea(num_classes, global_pool, drop_path_rate, tuning_config):
        return MockViTModel(num_classes, global_pool, drop_path_rate, tuning_config)
    
    @staticmethod
    def vit_base_patch16_224_in21k_onea(num_classes, global_pool, drop_path_rate, tuning_config):
        return MockViTModel(num_classes, global_pool, drop_path_rate, tuning_config)

# Mock EasyDict
class MockEasyDict(dict):
    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.__dict__ = self

# Patch the imports before defining ARGS
import sys
mock_backbone = Mock()
mock_backbone.vit_onea = MockVitOnea()
sys.modules['backbone'] = mock_backbone
sys.modules['backbone.vit_onea'] = MockVitOnea()
sys.modules['easydict'] = Mock(EasyDict=MockEasyDict)

ARGS = {
    'args': {
        'backbone_type': 'vit_base_patch16_224_onea',
        'ffn_num': 2,
        'model_name': 'onea',
        'device': ['cpu']
    },
    'pretrained': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
backbone, easydict, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type MockViTModel — a MockViTModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MockViTModel 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
make_worker_init_fn Ran
ran; our contract draft was wrong, not the code
xiaoyanzhang1/One-A/models/onea.py
code served (permissive licence) · get_code("e6c61130b205b52c")
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) and returned function. 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 random
import numpy as np
import torch

torch.manual_seed(0)

ARGS = {
    "base_seed": 42
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
tensor2numpy Ran
ran; our contract draft was wrong, not the code
xiaoyanzhang1/One-A/models/onea.py
code served (permissive licence) · get_code("ba7e5268c5f9c56b")
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) and returned ndarray, 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
import numpy as np

torch.manual_seed(0)

# Create a small CPU tensor
x_cpu = torch.randn(2, 4)

# Create a small CPU tensor (tensor2numpy doesn't use CUDA, but we test the CPU path)
x = x_cpu

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, 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
Adapter_merge Not yet run
unverified (harvested, no recorded run)
xiaoyanzhang1/One-A/models/onea.py
code served (permissive licence) · get_code("09bb51e47461ceb7")
How it ran

no invocation recorded.

BaseLearner Not yet run
unverified (harvested, no recorded run)
xiaoyanzhang1/One-A/models/onea.py
code served (permissive licence) · get_code("3b604a0669da1fed")
How it ran

no invocation recorded.

BaseNet Not yet run
unverified (harvested, no recorded run)
xiaoyanzhang1/One-A/models/onea.py
code served (permissive licence) · get_code("0170f8faf03e95d2")
How it ran

no invocation recorded.

Learner Not yet run
unverified (harvested, no recorded run)
xiaoyanzhang1/One-A/models/onea.py
code served (permissive licence) · get_code("68a29c9cb0466184")
How it ran

no invocation recorded.

seed_all Not yet run
unverified (harvested, no recorded run)
xiaoyanzhang1/One-A/models/onea.py
code served (permissive licence) · get_code("79f5943208920ea6")
How it ran

no invocation recorded.

Also present in other papers' code

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

Class-incremental learning (CIL) aims to acquire new classes over time while retaining prior knowledge, yet most setups and methods assume balanced task streams. In practice, the number of classes per task often varies significantly. We refer to this as step imbalance, where large tasks that contain more classes dominate learning and small tasks inject unstable updates. Existing CIL methods assume balanced tasks and therefore treat all tasks uniformly, producing imbalanced updates that degrade overall learning performance. To address this challenge, we propose One-A, a unified and imbalance-aware framework that incrementally merges task updates into a single adapter, maintaining constant inference cost. One-A performs asymmetric subspace alignment to preserve dominant subspaces learned from large tasks while constraining low-information updates within them. An information-adaptive weighting balances the contribution between base and new adapters, and a directional gating mechanism selectively fuses updates along each singular direction, maintaining stability in head directions and plasticity in tail ones. Across multiple benchmarks and step-imbalanced streams, One-A achieves competitive accuracy with significantly low inference overhead, showing that a single, asymmetrically fused adapter can remain both adaptive to dynamic task sizes and efficient at deployment. Code is available at https://github.com/xiaoyanzhang1/One-A.

For agents

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

get_harvested_code_for_paper("2603.10237")
get_code_for_paper("2603.10237")
have("2603.10237")

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

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

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

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

Connect an agent — have() is free.