SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2403.13187 · 2024

Evolutionary Optimization of Model Merging Recipes

arXiv · PDF · Open in the Atlas

Code that ran

10 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; 3 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 6 failures of our instrument; 2 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/2403.13187.json · badge: /api/ran/2403.13187.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
sakanaai/evolutionary-model-merge canonical (classifier label)
classifier basis: census
10 ran · 2 no recorded run
FunctionStatusWhere it lives
build_prompt Ran
ran; our contract draft was wrong, not the code
sakanaai/evolutionary-model-merge/evomerge/models/llava.py
code served (permissive licence) · get_code("cd57ef201d9c8c10")
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.

import torch
import numpy as np
from typing import List, Union, Optional

torch.manual_seed(0)

# Analyzing the function:
# - text: Union[str, List[str]] - can be a single string or list of strings
# - template: str - a template string with {input} placeholder
# The function formats the template with image markup + text content

# Construct valid arguments
text_single = "This is a sample text input"
text_list = ["First text sample", "Second text sample"]
template_str = "Prompt: {input}\nAnalyze this."

# We'll use the list version to test both branches
ARGS = {
    "text": text_list,
    "template": template_str
}
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 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
default Ran
ran, honoured the contract we drafted
sakanaai/evolutionary-model-merge/evomerge/utils.py
code served (permissive licence) · get_code("e4654baeb9c277cd")
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 int, ndim 0, dtype family int, 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)

# The function `default` takes two parameters: val and d
# It returns val if val is not None, otherwise returns d
# This is a simple utility function with no special requirements

ARGS = {
    "val": None,
    "d": 42
}
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 int, ndim 0, dtype family int, 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
extract_answer_number Ran
ran, honoured the contract we drafted
sakanaai/evolutionary-model-merge/evomerge/eval/ja_mgsm.py
code served (permissive licence) · get_code("e193a4012af89dcf")
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
import numpy as np
from typing import Optional

def extract_answer_number(completion: str) -> Optional[float]:
    import re
    matches = re.findall('\\d*\\.?\\d+', completion)
    if not matches:
        return None
    text = matches[-1]
    return float(text.replace(',', ''))

# Setup test cases for the function
torch.manual_seed(0)

# The function takes a single parameter: completion (str)
# It extracts numbers from the string using regex and returns the last number as a float
# Test with various string inputs

test_completion_1 = "The answer is 42"
test_completion_2 = "Results: 3.14159 and 2.71828"
test_completion_3 = "Value: 1,000.50"
test_completion_4 = "No numbers here"
test_completion_5 = "Multiple: 10, 20, 30.5"

ARGS = {
    "completion": "The final answer is 123.45"
}
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 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
extract_qa Ran
ran; our contract draft was wrong, not the code
sakanaai/evolutionary-model-merge/evomerge/eval/ja_vg_vqa.py
code served (permissive licence) · get_code("039eacb76a8ed92a")
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

def extract_qa(example):
    qa_list = example['qas']
    qa = qa_list[0]
    example['question'] = qa['question']
    example['answer'] = qa['answer']
    return example

ARGS = {
    'example': {
        'qas': [
            {
                'question': 'What is the capital of France?',
                'answer': 'Paris'
            },
            {
                'question': 'What is the capital of Germany?',
                'answer': 'Berlin'
            }
        ],
        'context': 'Some context text'
    }
}
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 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
get_output_ids Ran
ran, honoured the contract we drafted
sakanaai/evolutionary-model-merge/evomerge/models/utils.py
code served (permissive licence) · get_code("f0ff1b02c4ecd888")
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 2, dtype family int, shape (2, 3) 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 logging

logging.basicConfig(level=logging.WARNING)

torch.manual_seed(0)

# Create input_ids: shape (batch_size=2, seq_len=4)
input_ids = torch.randint(0, 100, (2, 4))

# Create output_ids: shape (batch_size=2, total_len=7)
# First 4 tokens match input_ids, last 3 are new generated tokens
output_ids = torch.cat([input_ids, torch.randint(100, 200, (2, 3))], dim=1)

ARGS = {
    "input_ids": input_ids,
    "output_ids": output_ids,
}
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 2, dtype family int, shape (2, 3) — shape (2, 3) 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
instantiate_from_config Ran
ran; our contract draft was wrong, not the code
sakanaai/evolutionary-model-merge/evomerge/utils.py
code served (permissive licence) · get_code("18d8fb19d766c90f")
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 Linear. 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
import importlib

torch.manual_seed(0)

# Create a simple test module and class for the string resolution
class SimpleModule(nn.Module):
    def __init__(self, param1=10, param2=20):
        super().__init__()
        self.param1 = param1
        self.param2 = param2

# Create a config that points to a built-in class that can be instantiated
config_with_target = {
    'target': 'torch.nn.Linear',
    'params': {
        'in_features': 4,
        'out_features': 3
    }
}

config_special_first_stage = '__is_first_stage__'

config_special_unconditional = '__is_unconditional__'

config_without_target = {
    'param1': 10,
    'param2': 20
}

ARGS = {
    'config': config_with_target
}
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 Linear — a Linear output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Linear 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
load_config Ran
ran; our contract draft was wrong, not the code
sakanaai/evolutionary-model-merge/evomerge/utils.py
code served (permissive licence) · get_code("8407509c5387f1eb")
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 json
import os
import yaml
import tempfile

# Create a temporary directory for test files
temp_dir = tempfile.mkdtemp()

# Create a test YAML config file
yaml_config_path = os.path.join(temp_dir, 'config.yaml')
with open(yaml_config_path, 'w', encoding='utf-8') as f:
    yaml.dump({'model': 'test_model', 'learning_rate': 0.001}, f)

# Create a test JSON config file
json_config_path = os.path.join(temp_dir, 'config.json')
with open(json_config_path, 'w') as f:
    json.dump({'model': 'test_model', 'learning_rate': 0.001}, f)

# The function expects a config_path parameter
# We'll test with the YAML file
ARGS = {
    'config_path': yaml_config_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
yaml — 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
mean Ran
ran, violated the contract we drafted
sakanaai/evolutionary-model-merge/evomerge/eval/metrics.py
code served (permissive licence) · get_code("63cf7ec10b164550")
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 torch

torch.manual_seed(0)

# The function 'mean' takes a list 'l' and computes sum(l) / len(l)
# It needs a list of numeric values that support addition and division

ARGS = {
    "l": [1, 2, 3, 4, 5]
}
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 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
rouge Ran
ran; our contract draft was wrong, not the code
sakanaai/evolutionary-model-merge/evomerge/eval/metrics.py
code served (permissive licence) · get_code("5182ae0258f4968e")
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
from rouge_score import rouge_scorer, scoring

torch.manual_seed(0)

# The function takes:
# - refs: A list of reference strings
# - preds: A list of predicted strings

# Create some simple reference and predicted strings for testing
refs = [
    "The quick brown fox jumps over the lazy dog . This is a test .",
    "Machine learning is a subset of artificial intelligence . It is very useful ."
]

preds = [
    "A quick brown fox jumps over the lazy dog . This is a sample .",
    "Machine learning is part of AI . It has many applications ."
]

ARGS = {
    "refs": refs,
    "preds": preds
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, rouge_score, 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
set_model_kwargs Ran
ran; our contract draft was wrong, not the code
sakanaai/evolutionary-model-merge/evomerge/models/utils.py
code served (permissive licence) · get_code("043403691e740f93")
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

torch.manual_seed(0)

ARGS = {
    'model_kwargs': {
        'torch_dtype': 'torch.float32',
        'some_other_param': 'value'
    }
}
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 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
rouge_ja Not yet run
unverified (harvested, no recorded run)
sakanaai/evolutionary-model-merge/evomerge/eval/metrics.py
code served (permissive licence) · get_code("01b7721df0fc97f4")
How it ran

no invocation recorded.

set_template Not yet run
unverified (harvested, no recorded run)
sakanaai/evolutionary-model-merge/evomerge/models/utils.py
code served (permissive licence) · get_code("e8eb5c57d221d550")
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, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 1 the same month, 2 later) and 10 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
instantiate_from_config 24 other papers
12 dated earlier, 3 the same month, 9 later · 7 only as an assembly brick
2006.11239 (2020-06)
Denoising Diffusion Probabilistic Models
2102.05379 (2021-02)
Argmax Flows and Multinomial Diffusion: Learning Categorical Distributions
2206.02262 (2022-06)
Diffusion-GAN: Training GANs with Diffusion
and 21 more not named here
mean 5 other papers
4 dated earlier, 1 later
1909.13584 (2019-09)
Interpretations are useful: penalizing explanations to align neural networks with prior knowledge
2007.01332 (2020-07)
Meta-Learning Stationary Stochastic Process Prediction with Convolutional Neural Processes
2009.12789 (2020-09)
Learning Optimal Representations with the Decodable Information Bottleneck
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

Large language models (LLMs) have become increasingly capable, but their development often requires substantial computational resources. While model merging has emerged as a cost-effective promising approach for creating new models by combining existing ones, it currently relies on human intuition and domain knowledge, limiting its potential. Here, we propose an evolutionary approach that overcomes this limitation by automatically discovering effective combinations of diverse open-source models, harnessing their collective intelligence without requiring extensive additional training data or compute. Our approach operates in both parameter space and data flow space, allowing for optimization beyond just the weights of the individual models. This approach even facilitates cross-domain merging, generating models like a Japanese LLM with Math reasoning capabilities. Surprisingly, our Japanese Math LLM achieved state-of-the-art performance on a variety of established Japanese LLM benchmarks, even surpassing models with significantly more parameters, despite not being explicitly trained for such tasks. Furthermore, a culturally-aware Japanese VLM generated through our approach demonstrates its effectiveness in describing Japanese culture-specific content, outperforming previous Japanese VLMs. This work not only contributes new state-of-the-art models back to the open-source community, but also introduces a new paradigm for automated model composition, paving the way for exploring alternative, efficient approaches to foundation model development.

For agents

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

get_harvested_code_for_paper("2403.13187")
get_code_for_paper("2403.13187")
have("2403.13187")

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

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

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

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

Connect an agent — have() is free.