SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2509.24496 · ICLR · 2025

LLM DNA: Tracing Model Evolution via Functional Representations

Qian Wang, Bingsheng He, Jizhou Guo, Haodong Zhao, Zhaomin Wu, Ziyang Wang

arXiv · PDF · Open in the Atlas

Code that ran

9 of 11 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, 1 violated it and 0 have no contract verdict; 8 failures of our instrument; 2 no recorded run), measured 2026-11-24; 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/2509.24496.json · badge: /api/ran/2509.24496.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
Xtra-Computing/LLM-DNA canonical (classifier label)
classifier basis: census
9 ran · 2 no recorded run
FunctionStatusWhere it lives
derive_default_output_path Ran
ran; our contract draft was wrong, not the code
Xtra-Computing/LLM-DNA/src/llm_dna/models/get_model_metadata.py
code served (permissive licence) · get_code("02f6727089f3b19b")
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 PosixPath. 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.

from pathlib import Path

ARGS = {
    "list_file": Path("/tmp/test_llm_list.txt"),
}
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 PosixPath — a PosixPath output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a PosixPath 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
fetch_model_metadata Ran
ran; our contract draft was wrong, not the code
Xtra-Computing/LLM-DNA/src/llm_dna/utils/metadata.py
code served (permissive licence) · get_code("773dbb73838dc4ea")
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
from typing import Dict, Any, Optional

torch.manual_seed(0)

# The function fetch_model_metadata takes model_name and token parameters
# Based on the function signature:
# def fetch_model_metadata(model_name: str, token: Optional[str]=None) -> Dict[str, Any]:

ARGS = {
    'model_name': 'meta-llama/Llama-2-7b-chat',
    'token': None
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
huggingface_hub, 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_dataset_name Ran
ran; our contract draft was wrong, not the code
Xtra-Computing/LLM-DNA/src/llm_dna/core/extraction.py
code served (permissive licence) · get_code("0567724e583de370")
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

torch.manual_seed(0)

# The function get_dataset_name takes a dataset_id string and returns a mapped dataset name
# It uses the dataset_id to look up a value in a predefined mapping dictionary
# No complex objects needed - just a string parameter

ARGS = {
    'dataset_id': 'syn'
}
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
is_chat_model Ran
ran, violated the contract we drafted
Xtra-Computing/LLM-DNA/src/llm_dna/utils/check_chat_model.py
code served (permissive licence) · get_code("9dd098bc96d74f94")
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 json
import tempfile
from pathlib import Path

# Create a temporary metadata file with valid model information
temp_dir = tempfile.TemporaryDirectory()
metadata_path = Path(temp_dir.name) / "llm_metadata.json"

# Create metadata with both chat and non-chat models
metadata = {
    "models": [
        {
            "model_name": "Qwen/Qwen2.5-0.5B-Instruct",
            "chat_model": {
                "is_chat_model": True
            }
        },
        {
            "model_name": "Qwen/Qwen2.5-0.5B",
            "chat_model": {
                "is_chat_model": False
            }
        },
        {
            "model_name": "meta-llama/Llama-2-7b-chat",
            "chat_model": {
                "is_chat_model": True
            }
        }
    ]
}

# Write metadata to file
with open(metadata_path, 'w', encoding='utf-8') as f:
    json.dump(metadata, f)

ARGS = {
    "model_name": "Qwen/Qwen2.5-0.5B-Instruct",
    "metadata_file": metadata_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
load_config Ran
ran; our contract draft was wrong, not the code
Xtra-Computing/LLM-DNA/src/llm_dna/utils/DataUtils.py
code served (permissive licence) · get_code("808e6a8a198ccd32")
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 tempfile
import json
import yaml
from pathlib import Path

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

# Create a sample YAML config file
yaml_config_path = temp_dir / "config.yaml"
yaml_config_data = {
    "model": "test_model",
    "learning_rate": 0.001,
    "batch_size": 32,
    "epochs": 10,
    "nested": {
        "key1": "value1",
        "key2": 42
    }
}
with open(yaml_config_path, 'w') as f:
    yaml.dump(yaml_config_data, f)

# Create a sample JSON config file
json_config_path = temp_dir / "config.json"
json_config_data = {
    "model": "test_model",
    "learning_rate": 0.001,
    "batch_size": 32,
    "epochs": 10,
    "nested": {
        "key1": "value1",
        "key2": 42
    }
}
with open(json_config_path, 'w') as f:
    json.dump(json_config_data, f)

# Define ARGS with a valid config path (using the YAML file as default)
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
load_model_list Ran
ran; our contract draft was wrong, not the code
Xtra-Computing/LLM-DNA/src/llm_dna/models/get_model_metadata.py
code served (permissive licence) · get_code("4f5daa5f5ff24245")
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.

from pathlib import Path
import tempfile
import os

# Create a temporary directory and a test file with model names
temp_dir = tempfile.mkdtemp()
list_file_path = Path(temp_dir) / "models.txt"

# Write test content to the file
with open(list_file_path, 'w', encoding='utf-8') as f:
    f.write("# This is a comment\n")
    f.write("model_1\n")
    f.write("model_2\n")
    f.write("\n")  # blank line
    f.write("model_3\n")
    f.write("# Another comment\n")
    f.write("model_4\n")

ARGS = {
    "list_file": list_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 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
load_model_metadata Ran
ran; our contract draft was wrong, not the code
Xtra-Computing/LLM-DNA/src/llm_dna/core/extraction.py
code served (permissive licence) · get_code("ba9008e126dd9906")
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 tempfile
import json
from pathlib import Path

# Create a temporary metadata file with valid model data
with tempfile.NamedTemporaryFile(mode='w', suffix='.json', delete=False, encoding='utf-8') as f:
    metadata = {
        'models': [
            {'model_name': 'gpt2', 'params': 124_000_000, 'context_length': 1024},
            {'model_name': 'gpt3', 'params': 175_000_000_000, 'context_length': 2048},
            {'model_name': 'claude', 'params': 52_000_000_000, 'context_length': 100_000}
        ]
    }
    json.dump(metadata, f)
    metadata_file_path = Path(f.name)

ARGS = {
    'metadata_file': metadata_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 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
load_results Ran
ran; our contract draft was wrong, not the code
Xtra-Computing/LLM-DNA/src/llm_dna/utils/DataUtils.py
code served (permissive licence) · get_code("f67940d46925b905")
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 pickle
import yaml
from pathlib import Path
import tempfile
import numpy as np

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

# Create a test JSON file
json_file = Path(temp_dir) / "test_results.json"
json_data = {"accuracy": 0.95, "loss": 0.05, "epochs": 10}
with open(json_file, 'w') as f:
    json.dump(json_data, f)

# Create a test YAML file
yaml_file = Path(temp_dir) / "test_results.yaml"
yaml_data = {"model": "resnet50", "batch_size": 32, "learning_rate": 0.001}
with open(yaml_file, 'w') as f:
    yaml.dump(yaml_data, f)

# Create a test pickle file
pickle_file = Path(temp_dir) / "test_results.pkl"
pickle_data = {"results": [1, 2, 3], "metadata": {"version": 1}}
with open(pickle_file, 'wb') as f:
    pickle.dump(pickle_data, f)

# Create a test NPZ file
npz_file = Path(temp_dir) / "test_results.npz"
np.savez(npz_file, array1=np.array([1, 2, 3]), array2=np.array([4, 5, 6]))

ARGS = {
    "input_path": json_file,
    "format": "auto",
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, 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
parse_arguments Ran
ran; our contract draft was wrong, not the code
Xtra-Computing/LLM-DNA/src/llm_dna/core/extraction.py
code served (permissive licence) · get_code("f4f4d45a29673b77")
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 Namespace. 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 argparse
from pathlib import Path
from typing import Optional, Dict, Any, List

ARGS = {
    'argv': [
        '--model-name', 'gpt2',
        '--model-type', 'huggingface',
        '--dataset', 'rand',
        '--embedding-merge', 'sum',
        '--probe-set', 'general',
        '--max-samples', '100',
        '--data-root', './data',
        '--extractor-type', 'embedding',
        '--dna-dim', '256',
        '--reduction-method', 'pca',
        '--max-length', '1024',
        '--output-dir', './out',
        '--save-format', 'json',
        '--metadata-file', './configs/llm_metadata.json',
        '--device', 'cpu',
        '--log-level', 'INFO',
        '--random-seed', '42',
        '--trust-remote-code',
    ]
}
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 Namespace — a Namespace output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Namespace 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_cache_dir Not yet run
unverified (harvested, no recorded run)
Xtra-Computing/LLM-DNA/src/llm_dna/utils/DataUtils.py
code served (permissive licence) · get_code("186043b0bc0c9369")
How it ran

no invocation recorded.

get_model_metadata Not yet run
unverified (harvested, no recorded run)
Xtra-Computing/LLM-DNA/src/llm_dna/utils/metadata.py
code served (permissive licence) · get_code("c9bec588fe4b097f")
How it ran

no invocation recorded.

Also present in other papers' code

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

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-24.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

The explosive growth of large language models (LLMs) has created a vast but opaque landscape: millions of models exist, yet their evolutionary relationships through fine-tuning, distillation, or adaptation are often undocumented or unclear, complicating LLM management. Existing methods are limited by task specificity, fixed model sets, or strict assumptions about tokenizers or architectures. Inspired by biological DNA, we address these limitations by mathematically defining LLM DNA as a low-dimensional, bi-Lipschitz representation of functional behavior. We prove that LLM DNA satisfies inheritance and genetic determinism properties and establish the existence of DNA. Building on this theory, we derive a general, scalable, training-free pipeline for DNA extraction. In experiments across 305 LLMs, DNA aligns with prior studies on limited subsets and achieves superior or competitive performance on various tasks. Beyond these tasks, DNA comparisons uncover previously undocumented relationships among LLMs. We further construct the evolutionary tree of LLMs using phylogenetic algorithms, which align with shifts from encoder-decoder to decoder-only architectures, reflect temporal progression, and reveal distinct evolutionary speeds across LLM families.

For agents

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

get_harvested_code_for_paper("2509.24496")
get_code_for_paper("2509.24496")
have("2509.24496")

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

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

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

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

Connect an agent — have() is free.