SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.12208 · 2024

Knowledge Fusion By Evolving Weights of Language Models

arXiv · PDF · Open in the Atlas

Code that ran

9 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; 9 failures of our instrument; 1 no recorded run), measured 2026-11-22; 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/2406.12208.json · badge: /api/ran/2406.12208.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
duguodong7/model-evolution canonical (classifier label)
classifier basis: census
9 ran · 1 no recorded run
FunctionStatusWhere it lives
MaxMinNorm_Sigmoid Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
duguodong7/model-evolution/src/model_merge/evolver.py
code served (permissive licence) · get_code("1958130a31c6b14f")
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 math

torch_seed = 0

# Analyze the function:
# - score: iterable of numbers (used with min(), max(), iteration)
# - MIN: numeric parameter with default -5
# - MAX: numeric parameter with default 0

score = [1.5, 2.3, 0.8, 3.1]

ARGS = {
    "score": score,
    "MIN": -5,
    "MAX": 0,
}
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
filter_modules_by_regex Ran
ran; our contract draft was wrong, not the code
duguodong7/model-evolution/src/model_merge/misc.py
code served (permissive licence) · get_code("af8fc9a6b079dd80")
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 torch.nn as nn
import re

torch.manual_seed(0)

# Create a base module with a hierarchy of submodules
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.layer1 = nn.Linear(4, 3)
        self.layer2 = nn.Linear(3, 2)
        self.nested = nn.Sequential(
            nn.Linear(2, 4),
            nn.ReLU()
        )
        self.conv_block = nn.Conv2d(1, 2, 3)
    
    def forward(self, x):
        return x

base_module = SimpleModel()

# Define include patterns - will match module names like "layer1", "layer2", "nested"
include_patterns = [r"^layer\d+", r"^nested"]

# Define include types - will match Linear and Conv2d modules
include_type = [nn.Linear, nn.Conv2d]

ARGS = {
    "base_module": base_module,
    "include_patterns": include_patterns,
    "include_type": include_type,
}
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
filter_params_to_merge Ran
ran; our contract draft was wrong, not the code
duguodong7/model-evolution/src/model_merge/misc.py
code served (permissive licence) · get_code("542bdbc6b44e26fe")
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 re

def filter_params_to_merge(param_names, exclude_param_regex):
    params_to_merge = []
    for name in param_names:
        valid = not any([re.match(patt, name) for patt in exclude_param_regex])
        if valid:
            params_to_merge.append(name)
    return params_to_merge

ARGS = {
    "param_names": [
        "layer1.weight",
        "layer1.bias",
        "layer2.weight",
        "layer2.bias",
        "adapter.weight",
        "adapter.bias",
    ],
    "exclude_param_regex": [
        r"adapter\..*",
        r".*\.bias",
    ]
}
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
fmt Ran
ran; our contract draft was wrong, not the code
duguodong7/model-evolution/src/model_merge/base.py
code served (permissive licence) · get_code("89e8e1726d953764")
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 json

def fmt(name, met_dict):
    return '{}\t{}'.format(name, json.dumps(met_dict))

ARGS = {
    'name': 'model_metrics',
    'met_dict': {
        'accuracy': 0.95,
        'loss': 0.042,
        'f1_score': 0.92,
        'precision': 0.94,
        'recall': 0.90
    }
}
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
fmt Ran
ran; our contract draft was wrong, not the code
duguodong7/model-evolution/src/model_merge/evolver.py
code served (permissive licence) · get_code("9c4701cb9ebe6693")
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
import json

torch.manual_seed(0)

# Analyzing the function:
# - fmt(name, met_dict) takes a string 'name' and a dict 'met_dict'
# - It formats them as '{name}\t{json.dumps(met_dict)}'
# - No complex objects needed, just basic Python types

name = "test_metric"
met_dict = {
    "accuracy": 0.95,
    "loss": 0.123,
    "epoch": 5
}

ARGS = {
    "name": name,
    "met_dict": met_dict
}
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
get_optim_param_groups Ran
ran; our contract draft was wrong, not the code
duguodong7/model-evolution/src/model_merge/local_trainer.py
code served (permissive licence) · get_code("38bc054d5c96e237")
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 torch.nn as nn
from transformers.trainer_pt_utils import get_parameter_names

torch.manual_seed(0)

# Create a minimal model with named parameters
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.norm = nn.LayerNorm(3)
        self.linear2 = nn.Linear(3, 2)
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.norm(x)
        x = self.linear2(x)
        return x

model = SimpleModel()

# Create a minimal training_args object with required attributes
class TrainingArgs:
    def __init__(self):
        self.weight_decay = 0.01

training_args = TrainingArgs()

# Define optim_param_regex to filter parameters
optim_param_regex = [r'linear1.*', r'linear2.*']

ARGS = {
    'model': model,
    'training_args': training_args,
    'optim_param_regex': optim_param_regex
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, transformers — 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_reweight_factor Ran
ran; our contract draft was wrong, not the code
duguodong7/model-evolution/src/model_merge/net.py
code served (permissive licence) · get_code("d150cc5adcf9981b")
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 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

torch.manual_seed(0)

# Construct freq_dist: maps label_id to (count_of_0s, count_of_1s)
freq_dist = {
    0: (10.0, 5.0),
    1: (8.0, 12.0),
    2: (15.0, 3.0),
}

# Construct labels: binary tensor of shape (batch_size, num_labels)
# batch_size=2, num_labels=4
labels = torch.tensor([
    [0, 1, 0, 1],
    [1, 0, 1, 0]
], dtype=torch.long)

# schema: either 'freq' or 'sqrt'
schema = 'freq'

ARGS = {
    'freq_dist': freq_dist,
    'labels': labels,
    'schema': schema,
}
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 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
get_submodule Ran
ran; our contract draft was wrong, not the code
duguodong7/model-evolution/src/model_merge/ot_merger.py
code served (permissive licence) · get_code("253168af406c0497")
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

torch.manual_seed(0)

# The function get_submodule navigates through nested module attributes
# using dot-separated names. We need to construct a module with nested submodules.

class SimpleSubmodule(nn.Module):
    def __init__(self):
        super().__init__()
        self.layer = nn.Linear(4, 3)

class MiddleModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.sub = SimpleSubmodule()

class RootModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.middle = MiddleModule()
        self.linear = nn.Linear(4, 2)

# Create the root module with nested structure
root_module = RootModule()

# Test the function with different nesting levels
ARGS = {
    "m": root_module,
    "name": "middle.sub.layer"
}
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
most_common Ran
ran; our contract draft was wrong, not the code
duguodong7/model-evolution/src/model_merge/ensembler.py
code served (permissive licence) · get_code("2ed51eac60e5be2a")
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 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.

from collections import Counter

def most_common(lst):
    data = Counter(lst)
    return max(lst, key=data.get)

# Setup code
ARGS = {
    "lst": [1, 2, 2, 3, 3, 3, 4, 4, 4, 4]
}
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 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
create_stl_model Not yet run
unverified (harvested, no recorded run)
duguodong7/model-evolution/src/model_merge/net.py
code served (permissive licence) · get_code("4ab1c0097d7c1338")
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 9 distinct functions with an identity, 6 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 0 the same month, 0 later) and 3 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
most_common 3 other papers
3 dated earlier
2305.09955 (2023-05)
Knowledge Card: Filling LLMs' Knowledge Gaps with Plug-in Specialized Language Models
2305.18395 (2023-05)
Knowledge-Augmented Reasoning Distillation for Small Language Models in Knowledge-Intensive Tasks
2310.04408 (2023-10)
RECOMP: Improving Retrieval-Augmented LMs with Compression and Selective Augmentation
create_stl_model 1 other paper
1 dated earlier
2212.09849 (2022-12)
Dataless Knowledge Fusion by Merging Weights of Language Models
filter_modules_by_regex 1 other paper
1 dated earlier
2212.09849 (2022-12)
Dataless Knowledge Fusion by Merging Weights of Language Models
filter_params_to_merge 1 other paper
1 dated earlier
2212.09849 (2022-12)
Dataless Knowledge Fusion by Merging Weights of Language Models
get_reweight_factor 1 other paper
1 dated earlier
2212.09849 (2022-12)
Dataless Knowledge Fusion by Merging Weights of Language Models
get_submodule 1 other paper
1 dated earlier
2212.09849 (2022-12)
Dataless Knowledge Fusion by Merging Weights of Language Models

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

Fine-tuning pre-trained language models, particularly large language models, demands extensive computing resources and can result in varying performance outcomes across different domains and datasets. This paper examines the approach of integrating multiple models from diverse training scenarios into a unified model. This unified model excels across various data domains and exhibits the ability to generalize well on out-of-domain data. We propose a knowledge fusion method named Evolver, inspired by evolutionary algorithms, which does not need further training or additional training data. Specifically, our method involves aggregating the weights of different language models into a population and subsequently generating offspring models through mutation and crossover operations. These offspring models are then evaluated against their parents, allowing for the preservation of those models that show enhanced performance on development datasets. Importantly, our model evolving strategy can be seamlessly integrated with existing model merging frameworks, offering a versatile tool for model enhancement. Experimental results on mainstream language models (i.e., encoder-only, decoder-only, encoder-decoder) reveal that Evolver outperforms previous state-of-the-art models by large margins. The code is publicly available at {https://github.com/duguodong7/model-evolution}.

For agents

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

get_harvested_code_for_paper("2406.12208")
get_code_for_paper("2406.12208")
have("2406.12208")

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

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

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

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

Connect an agent — have() is free.