SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2410.17146 · ICLR · 2025

LiNeS: Post-training Layer Scaling Prevents Forgetting and Enhances Model Merging

Pascal Frossard, Ke Wang, Guillermo Ortiz-Jimenez, Alessandro Favero, Nikolaos Dimitriadis, Francois Fleuret

arXiv · PDF · Open in the Atlas

Code that ran

3 of 6 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; 3 failures of our instrument; 3 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/2410.17146.json · badge: /api/ran/2410.17146.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
wang-kee/LiNeS canonical (classifier label)
classifier basis not recorded on the link
3 ran · 2 no recorded run
wang-kee/lines canonical (classifier label)
classifier basis: classifier_2025
0 ran · 1 no recorded run
FunctionStatusWhere it lives
convert Ran
ran; our contract draft was wrong, not the code
wang-kee/LiNeS/src/datasets/cifar10.py
pointer only (licence: MIT); the stored copy get_code serves, from BAIKLAB/SiM, is pointer only (licence: NONE) · get_code("6d77ee840479c381")
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.

maybe_dictionarize Ran
ran; our contract draft was wrong, not the code
wang-kee/LiNeS/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
pretify_classname Ran
ran; our contract draft was wrong, not the code
wang-kee/LiNeS/src/datasets/eurosat.py
pointer only (licence: MIT); the stored copy get_code serves, from mlfoundations/task_vectors, is pointer only (licence: NONE) · get_code("241a2a00ba0c307b")
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 mlfoundations/task_vectors, 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.

_TaskVector Not yet run
unverified (harvested, no recorded run)
wang-kee/lines/src/models/task_vectors.py
code served (permissive licence) · get_code("10c1e5b6d05ea3f2")
How it ran

no invocation recorded.

get_features Not yet run
unverified (harvested, no recorded run)
wang-kee/LiNeS/src/datasets/common.py
pointer only (licence: MIT); the stored copy get_code serves, from mlfoundations/task_vectors, is pointer only (licence: NONE) · get_code("3b97c12751c0cf5b")
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 mlfoundations/task_vectors, 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. No invocation recorded.

get_features_helper Not yet run
unverified (harvested, no recorded run)
wang-kee/LiNeS/src/datasets/common.py
pointer only (licence: MIT); the stored copy get_code serves, from mlfoundations/task_vectors, is pointer only (licence: NONE) · get_code("238ff32fcbf410d6")
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 mlfoundations/task_vectors, 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. No invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 5 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 1 the same month, 5 later) and 1 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
maybe_dictionarize 13 other papers
7 dated earlier, 1 the same month, 5 later · 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
convert 8 other papers
4 dated earlier, 4 later
2208.05592 (2022-08)
Patching open-vocabulary models by interpolating weights
2312.15901 (2023-12)
Black-Box Tuning of Vision-Language Models with Effective Gradient Approximation
2405.07813 (2024-05)
Localizing Task Information for Improved Model Merging and Compression
and 5 more not named here
get_features_helper 6 other papers
2 dated earlier, 4 later
2405.07813 (2024-05)
Localizing Task Information for Improved Model Merging and Compression
2406.05184 (2024-06)
The Unmet Promise of Synthetic Training Images: Using Retrieved Real Images Performs Better
2411.06966 (2024-11)
Robust Fine-tuning of Zero-shot Models via Variance Reduction
and 3 more not named here
get_features 5 other papers
1 dated earlier, 4 later
2405.07813 (2024-05)
Localizing Task Information for Improved Model Merging and Compression
2411.06966 (2024-11)
Robust Fine-tuning of Zero-shot Models via Variance Reduction
2412.12153 (2024-12)
Revisiting Weight Averaging for Model Merging
and 2 more not named here
pretify_classname 5 other papers
2 dated earlier, 3 later
2304.04512 (2023-04)
Defense-Prefix for Preventing Typographic Attacks on CLIP
2405.07813 (2024-05)
Localizing Task Information for Improved Model Merging and Compression
2412.12153 (2024-12)
Revisiting Weight Averaging for Model Merging
and 2 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

Fine-tuning pre-trained models has become the standard approach to endow them with specialized knowledge, but it poses fundamental challenges. In particular, (i) fine-tuning often leads to catastrophic forgetting, where improvements on a target domain degrade generalization on other tasks, and (ii) merging fine-tuned checkpoints from disparate tasks can lead to significant performance loss. To address these challenges, we introduce LiNeS, Layer-increasing Network Scaling, a post-training editing technique designed to preserve pre-trained generalization while enhancing fine-tuned task performance. LiNeS scales parameter updates linearly based on their layer depth within the network, maintaining shallow layers close to their pre-trained values to preserve general features while allowing deeper layers to retain task-specific representations. In multi-task model merging scenarios, layer-wise scaling of merged parameters reduces negative task interference. LiNeS demonstrates significant improvements in both single-task and multi-task settings across various benchmarks in vision and natural language processing. It mitigates forgetting, enhances out-of-distribution generalization, integrates seamlessly with existing multi-task model merging baselines improving their performance across benchmarks and model sizes, and can boost generalization when merging LLM policies aligned with different rewards via RLHF. Our method is simple to implement, computationally efficient and complementary to many existing techniques. Our source code is available at github.com/wang-kee/LiNeS.

For agents

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

get_harvested_code_for_paper("2410.17146")
get_code_for_paper("2410.17146")
have("2410.17146")

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

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

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

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

Connect an agent — have() is free.