SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2605.20803 · 2026

Tunable MAGMAX: Preference-Aware Model Merging for Continual Learning

Kento Uchida, Shinichi Shirakawa, Kei Hiroshima

arXiv · PDF · Open in the Atlas

Code that ran

7 of 10 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, 0 violated it and 0 have no contract verdict; 7 failures of our instrument; 3 no recorded run), measured 2026-11-23; 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/2605.20803.json · badge: /api/ran/2605.20803.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
KeiHiroshima/tunable-magmax canonical (classifier label)
classifier basis: census
7 ran · 3 no recorded run
FunctionStatusWhere it lives
build_file_path_list Ran
ran; our contract draft was wrong, not the code
KeiHiroshima/tunable-magmax/postprocessing/utils.py
code served (permissive licence) · get_code("b76500bc7f542ca5")
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.

ARGS = {
    'dir_path': '/results',
    'merge_fn': 'merge_method_a',
    'metric_name_path': 'metrics/',
    'similarity_metric': 'cosine',
    'lambda_': 0.5,
    'target_id': 42,
    'seed_list': [0, 1, 2, 123]
}
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 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
cosine_lr Ran
ran; our contract draft was wrong, not the code
KeiHiroshima/tunable-magmax/src/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from BAIKLAB/SiM, is pointer only (licence: NONE) · get_code("2d5d7a12d8de02b7")
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 BAIKLAB/SiM, 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_class_incremental_classes_and_subset_indices Ran
ran; our contract draft was wrong, not the code
KeiHiroshima/tunable-magmax/src/datasets/common.py
code served (permissive licence) · get_code("0950233b875181d6")
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 math

torch.manual_seed(0)

class SimpleDataset:
    def __init__(self, targets, num_samples=10):
        self.targets = targets
        self.data = torch.randn(num_samples, 4)
    
    def __len__(self):
        return len(self.targets)
    
    def __getitem__(self, idx):
        return self.data[idx], self.targets[idx]

class SimpleDatasetWrapper:
    def __init__(self):
        # Create train and test datasets with 10 samples across 4 classes
        train_targets = [0, 0, 1, 1, 2, 2, 3, 3, 0, 1]
        test_targets = [0, 1, 2, 3, 0, 1, 2, 3, 0, 1]
        
        self.train_dataset = SimpleDataset(train_targets, num_samples=10)
        self.test_dataset = SimpleDataset(test_targets, num_samples=10)
        self.default_class_order = [0, 1, 2, 3]

dataset = SimpleDatasetWrapper()
n_splits = 2
split_idx = 0

ARGS = {
    "dataset": dataset,
    "n_splits": n_splits,
    "split_idx": split_idx
}
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
get_zeroshot_checkpoint Ran
ran; our contract draft was wrong, not the code
KeiHiroshima/tunable-magmax/src/config.py
code served (permissive licence) · get_code("6c5767d872d24a45")
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 str. 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 os
import torch

# Set up a temporary base directory for checkpoints
os.environ['MAGMAX_BASE_DIR'] = '/tmp/magmax_test'

# The function get_zeroshot_checkpoint takes one parameter: model_name
# It constructs a path to a checkpoint file based on the model name
# No actual file I/O is needed since we're just constructing the argument

ARGS = {
    'model_name': 'bert-base-uncased'
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
maybe_dictionarize Ran
ran; our contract draft was wrong, not the code
KeiHiroshima/tunable-magmax/src/datasets/common.py
code served (permissive licence) · get_code("b1e9e0d3d7d7e615")
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 numpy as np

torch.manual_seed(0)

# Test case 1: batch as a dict (should return as-is)
batch_dict = {
    'images': torch.randn(2, 4),
    'labels': torch.randint(0, 10, (2,))
}

# Test case 2: batch as tuple with 2 elements
batch_tuple_2 = (
    torch.randn(2, 4),
    torch.randint(0, 10, (2,))
)

# Test case 3: batch as tuple with 3 elements
batch_tuple_3 = (
    torch.randn(2, 4),
    torch.randint(0, 10, (2,)),
    {'sample_id': [0, 1]}
)

# Use the dict case for ARGS
ARGS = {
    'batch': batch_dict
}
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 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
parse_competitor_key Ran
ran; our contract draft was wrong, not the code
KeiHiroshima/tunable-magmax/postprocessing/utils.py
code served (permissive licence) · get_code("05494a683cf8e3db")
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, 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

ARGS = {
    "key": "merge_max_abs_masked_with_targetdata-ot_embedded"
}
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, ndim 1, dtype family float — a tuple 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
resolve_dir_path Ran
ran; our contract draft was wrong, not the code
KeiHiroshima/tunable-magmax/postprocessing/utils.py
code served (permissive licence) · get_code("b5b2a970d71a6c73")
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 str. 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

ARGS = {
    'dir_path_shared': '/base/path/DIR_NAME/subdir',
    'key': 'masked_model_v1',
    'dir_name': {
        'proposed': 'experiment_001',
        'other': 'baseline_run'
    }
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
accuracy Not yet run
unverified (harvested, no recorded run)
KeiHiroshima/tunable-magmax/src/utils.py
code served (permissive licence) · get_code("aafcff3ad1ccef6e")
How it ran

no invocation recorded.

get_balanced_data_incremental_subset_indices Not yet run
unverified (harvested, no recorded run)
KeiHiroshima/tunable-magmax/src/datasets/common.py
code served (permissive licence) · get_code("b1839b50380566e8")
How it ran

no invocation recorded.

torch_load Not yet run
unverified (harvested, no recorded run)
KeiHiroshima/tunable-magmax/src/utils.py
code served (permissive licence) · get_code("79ae2d63ada03edb")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 3 the same month, 2 later) and 7 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
accuracy 22 other papers
20 dated earlier, 1 the same month, 1 later
2207.05333 (2022-07)
IDEA: Increasing Text Diversity via Online Multi-Label Recognition for Vision-Language Pre-training
2208.05592 (2022-08)
Patching open-vocabulary models by interpolating weights
2211.12914 (2022-11)
Open-vocabulary Attribute Detection
and 19 more not named here
maybe_dictionarize 13 other papers
12 dated earlier, 1 the same month · 1 only as an assembly brick
2308.01313 (2023-08)
PerceptionCLIP: Visual Classification by Inferring and Conditioning on Contexts
2308.12213 (2023-08)
CLIPN for Zero-Shot OOD Detection: Teaching CLIP to Say No
2311.01723 (2023-11)
Towards Calibrated Robust Fine-Tuning of Vision-Language Models
and 10 more not named here
cosine_lr 11 other papers
9 dated earlier, 1 the same month, 1 later
2208.05592 (2022-08)
Patching open-vocabulary models by interpolating weights
2305.12827 (2023-05)
Task Arithmetic in the Tangent Space: Improved Editing of Pre-Trained Models
2308.12213 (2023-08)
CLIPN for Zero-Shot OOD Detection: Teaching CLIP to Say No
and 8 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

Continual learning (CL) aims to train models sequentially on multiple tasks while mitigating catastrophic forgetting of previously learned knowledge. Recent advances in large pre-trained models (LPMs) and model merging techniques, such as MAGMAX, have demonstrated effective CL performance by combining task-specific parameters. However, existing methods primarily focus on average performance across all tasks and do not adequately address how to construct models accommodating different deployment environments or varying user preferences. This paper proposes a model merging framework, termed Tunable MAGMAX, which enables preference-aware control of task-specific performance in CL. Our method introduces a preference vector that controls the number of elements selected from each task vector during model merging, allowing us to adjust the merged model performance according to their deployment needs. We further propose a method for automatically constructing appropriate preference vectors by leveraging small amounts of target environment data and datasets from model training tasks, thereby eliminating the need for manual specification. The experimental result on CL benchmark tasks demonstrates that Tunable MAGMAX effectively controls task-wise performance and successfully adapts merged models to various target environments. The proposed Tunable MAGMAX achieves superior or comparable performance to baseline methods, making it a practical solution for deploying CL models to various environments where the preferences of each task performance differ.

For agents

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

get_harvested_code_for_paper("2605.20803")
get_code_for_paper("2605.20803")
have("2605.20803")

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

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

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

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

Connect an agent — have() is free.