SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2502.10436 · ICML · 2025

MERGE 3 : Efficient Evolutionary Merging on Consumer-grade GPUs

Emanuele Rodolà, Donato Crisostomi, Tommaso Mencattini, Adrian Minut, Andrea Santilli

arXiv · PDF · Open in the Atlas

Code that ran

10 of 14 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, 1 violated it and 8 have no contract verdict; 0 failures of our instrument; 4 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/2502.10436.json · badge: /api/ran/2502.10436.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
tommasomncttn/merge3 canonical (classifier label)
classifier basis not recorded on the link
10 ran · 4 no recorded run
FunctionStatusWhere it lives
check_file_exists Ran
ran on a synthesized input
tommasomncttn/merge3/experiments/end2end_utils.py
code served (permissive licence) · get_code("aecf0f6af92bdbea")
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 bool, 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 tempfile
from pathlib import Path

# Create a temporary file for testing
with tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt') as tmp:
    tmp.write("test content")
    temp_file_path = tmp.name

ARGS = {
    "file_path": temp_file_path
}
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 bool, 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
euclidean_distance Ran
ran on a synthesized input
tommasomncttn/merge3/src/mergenetic/analysis/utils.py
code served (permissive licence) · get_code("322193f8e999747b")
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 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 torch

torch.manual_seed(0)

# Create two small distinct vectors for euclidean distance calculation
vector1 = torch.randn(4)
vector2 = torch.randn(4)

ARGS = {
    "vector1": vector1,
    "vector2": vector2,
}
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 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
get_batched_model_predictions Ran
ran on a synthesized input
tommasomncttn/merge3/src/mergenetic/utils.py
code served (permissive licence) · get_code("dc5e6f0b0d3e0338")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 torch.nn as nn
import pandas as pd
from unittest.mock import Mock

torch.manual_seed(0)

class TinyModel(nn.Module):
    def __init__(self, vocab_size=100, hidden_size=4):
        super().__init__()
        self.embed = nn.Embedding(vocab_size, hidden_size)
        self.lm_head = nn.Linear(hidden_size, vocab_size)
        
    def forward(self, input_ids, attention_mask=None):
        x = self.embed(input_ids)
        logits = self.lm_head(x)
        return Mock(logits=logits)
    
    def generate(self, input_ids, attention_mask=None, max_new_tokens=10, 
                 do_sample=False, temperature=1.0, top_p=1.0, repetition_penalty=1.0, 
                 eos_token_id=None, **kwargs):
        batch_size = input_ids.shape[0]
        seq_len = input_ids.shape[1]
        new_tokens = torch.randint(10, 90, (batch_size, min(5, max_new_tokens)))
        return torch.cat([input_ids, new_tokens], dim=1)

class TinyTokenizer:
    def __init__(self):
        self.pad_token = '[PAD]'
        self.eos_token = '[EOS]'
        self.vocab_size = 100
        
    def __call__(self, texts, return_tensors=None, padding=False, truncation=False, max_length=None):
        batch_size = len(texts) if isinstance(texts, list) else 1
        seq_len = 8
        
        input_ids = torch.randint(10, 90, (batch_size, seq_len))
        attention_mask = torch.ones(batch_size, seq_len)
        
        return Mock(
            input_ids=input_ids,
            attention_mask=attention_mask,
            to=lambda device: Mock(
                input_ids=input_ids.to(device),
                attention_mask=attention_mask.to(device)
            )
        )
    
    def batch_decode(self, token_ids, skip_special_tokens=False):
        return [f'generated text {i}' for i in range(token_ids.shape[0])]
    
    def apply_chat_template(self, messages, tokenize=False, system_message=''):
        return messages[0]['content'] if messages else ''
    
    def add_special_tokens(self, tokens_dict):
        pass
    
    def resize_token_embeddings(self, size):
        pass

model = TinyModel(vocab_size=100, hidden_size=4)
tokenizer = TinyTokenizer()

df = pd.DataFrame({
    'prompt': [
        'What is 2+2?',
        'What is the capital of France?',
    ]
})

ARGS = {
    'model': model,
    'tokenizer': tokenizer,
    'df': df,
    'batch_size': 2,
    'randomness': False,
    'device': 'cpu',
    'max_token': 1024,
    'print_output': False,
    'apply_chat': False,
    'dataset_nm': 'test_dataset',
    'custom_prompt_template': False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas, torch, tqdm — 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
get_closest_embeddings_indices Ran
ran on a synthesized input
tommasomncttn/merge3/src/mergenetic/extraction/extract.py
code served (permissive licence) · get_code("ae535f3632a7a319")
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 2, 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 numpy as np
from sklearn.cluster import KMeans
from scipy.spatial.distance import cdist

# Create a small embedding matrix
# Shape: (n_samples, n_features) = (10, 5)
# We need enough points to meaningfully cluster
np.random.seed(0)
embeds = np.random.randn(10, 5).astype(np.float32)

ARGS = {
    "embeds": embeds,
    "n_clusters": 3,
    "random_state": 0,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 2, 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
get_clusters Ran
ran on a synthesized input
tommasomncttn/merge3/src/mergenetic/extraction/extract.py
code served (permissive licence) · get_code("98becc383cf5defb")
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 numpy as np
from sklearn.cluster import KMeans
from scipy.spatial.distance import cdist

# Create small embeddings array
# Shape: (n_samples, n_features)
# Using 10 samples with 4 features each
np.random.seed(0)
embeds = np.random.randn(10, 4).astype(np.float32)

ARGS = {
    "embeds": embeds,
    "n_clusters": 3,
    "random_state": 0,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, sklearn — 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_embeddings Ran
ran on a synthesized input
tommasomncttn/merge3/src/mergenetic/analysis/representation.py
code served (permissive licence) · get_code("1286c013573044fc")
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, 4, 4) as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 as nn

torch.manual_seed(0)

# Create a minimal model that matches how get_embeddings uses it
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        # The function accesses model.model.embed_tokens
        self.model = nn.Module()
        self.model.embed_tokens = nn.Embedding(num_embeddings=100, embedding_dim=4)
    
    def forward(self, x):
        return self.model.embed_tokens(x)

# Create a minimal tokenizer that matches how get_embeddings uses it
class MinimalTokenizer:
    def __call__(self, sentence: str, return_tensors: str = None):
        # The function calls tokenizer(sentence, return_tensors='pt').input_ids
        # This should return an object with .input_ids attribute
        class TokenizerOutput:
            def __init__(self):
                self.input_ids = torch.tensor([[5, 10, 15, 20]], dtype=torch.long)
        return TokenizerOutput()

# Build the arguments
model = MinimalModel()
tokenizer = MinimalTokenizer()
sentence = "This is a test sentence."
preferred_device = "cpu"

ARGS = {
    "model": model,
    "tokenizer": tokenizer,
    "sentence": sentence,
    "preferred_device": preferred_device
}
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, 4, 4) — shape (1, 4, 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
item_curve Ran
ran, honoured the contract we drafted
tommasomncttn/merge3/src/mergenetic/evaluation/perf_estimation.py
code served (permissive licence) · get_code("921caf5fc3c2b540")
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 ndarray, ndim 1, dtype family float, shape (2,) 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 numpy as np

# theta is used in: a * theta
# a is used in: a * theta - b  (element-wise operations, then .sum(axis=1))
# b is used in: a * theta - b

# From the operation "a * theta - b" and ".sum(axis=1)", we can infer:
# - theta should be 2D (batch_size, feature_dim)
# - a should be 1D or broadcastable to theta's shape
# - b should be scalar or broadcastable

# Let's use:
# theta: shape (2, 4) - batch of 2, 4 features
# a: shape (4,) - coefficients for each feature
# b: scalar

theta = np.random.randn(2, 4)
a = np.random.randn(4)
b = 0.5

ARGS = {
    "theta": theta,
    "a": a,
    "b": b,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (2,) — shape (2,) 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
locate_base_folder Ran
ran on a synthesized input
tommasomncttn/merge3/src/mergenetic/utils.py
code served (permissive licence) · get_code("7f86d24773127cc9")
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 tempfile
from pathlib import Path

# Create a temporary directory structure that mimics the expected layout
temp_dir = tempfile.mkdtemp()
main_folder = Path(temp_dir) / 'mergenetic'
main_folder.mkdir(exist_ok=True)

cache_dir = main_folder / 'cache_dir'
cache_dir.mkdir(exist_ok=True)

# Change to the main folder so the function's cwd check passes
import os
original_cwd = os.getcwd()
os.chdir(main_folder)

ARGS = {
    'name_main_folder': 'mergenetic',
    'name_basin': 'cache_dir'
}
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 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
mean_aggregation Ran
ran on a synthesized input
tommasomncttn/merge3/src/mergenetic/analysis/utils.py
code served (permissive licence) · get_code("254de3d2da6d51ac")
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 (2,) 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

torch.manual_seed(0)

# The function takes a tensor and computes mean along dimension 1
# We need a tensor with at least 2 dimensions where dim=1 exists
# Using shape (2, 4) - batch size 2, feature dimension 4
tensor = torch.randn(2, 4)

ARGS = {
    "tensor": tensor
}
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 1, dtype family float, shape (2,) — shape (2,) 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
sigmoid Ran
ran, violated the contract we drafted
tommasomncttn/merge3/src/mergenetic/evaluation/perf_estimation.py
code served (permissive licence) · get_code("a911f9cacbc9faf4")
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 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 numpy as np

def sigmoid(z):
    return 1 / (1 + np.exp(-z))

# Create a small numpy array to pass as argument
z_value = np.array([0.0, 1.0, -1.0, 2.0])

ARGS = {
    "z": z_value
}
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 ndarray, 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
control_if_basin_empty Not yet run
unverified (harvested, no recorded run)
tommasomncttn/merge3/src/mergenetic/utils.py
code served (permissive licence) · get_code("ad669d6920f1ab84")
How it ran

no invocation recorded.

cosine_metric Not yet run
unverified (harvested, no recorded run)
tommasomncttn/merge3/src/mergenetic/analysis/utils.py
code served (permissive licence) · get_code("e4bfa2dbc5c77b3f")
How it ran

no invocation recorded.

evaluate Not yet run
unverified (harvested, no recorded run)
tommasomncttn/merge3/src/mergenetic/evaluation/perf_estimation.py
code served (permissive licence) · get_code("990fcd8a91251235")
How it ran

no invocation recorded.

get_representations Not yet run
unverified (harvested, no recorded run)
tommasomncttn/merge3/src/mergenetic/analysis/representation.py
code served (permissive licence) · get_code("5c61d04821edf18d")
How it ran

no invocation recorded.

Also present in other papers' code

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

FunctionAlso present inEarliest-datedOthers named
sigmoid 7 other papers
5 dated earlier, 2 later
2006.06887 (2020-06)
Stochastic Optimization for Performative Prediction
2007.13819 (2020-07)
MULTI-LEVEL LOCAL SGD: DISTRIBUTED SGD FOR HETEROGENEOUS HIERARCHICAL NETWORKS
2207.09176 (2022-07)
Self-Supervision Can Be a Good Few-Shot Learner
and 4 more not named here
item_curve 3 other papers
2 dated earlier, 1 later
2402.14992 (2024-02)
tinyBenchmarks: evaluating LLMs with fewer examples
2409.03563 (2024-09)
100 instances is all you need: predicting the success of a new LLM on unseen data by testing on a few instances
2506.07673 (2025-06)
How Benchmark Prediction from Fewer Data Misses the Mark

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

Evolutionary model merging enables the creation of high-performing multi-task models but remains computationally prohibitive for consumer hardware. We introduce MERGE 3 , an efficient framework that makes evolutionary merging feasible on a single GPU by reducing fitness computation costs 50× while preserving performance. MERGE 3 achieves this by Extracting a reduced dataset for evaluation, Estimating model abilities using Item Response Theory (IRT), and Evolving optimal merges via IRT-based performance estimators. Our method enables state-of-the-art multilingual and cross-lingual merging, transferring knowledge across languages with significantly lower computational overhead. We provide theoretical guarantees and an open-source library 1 , democratizing high-quality model merging.

For agents

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

get_harvested_code_for_paper("2502.10436")
get_code_for_paper("2502.10436")
have("2502.10436")

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

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

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

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

Connect an agent — have() is free.