Crossposted from my blog. This is an adaptation of my recent paper. See GitHub for the code and Hugging Face for the data.
Open LLMs are heavily remixed, so their lineages are difficult to trace. Existing weight-based model lineage measurements are restricted to models of the same size or tokenizers or do not properly handle model symmetries. Output-based lineage measurements cannot distinguish weight descent from distillation, whereas merged and spliced models can have wildly different outputs despite sharing weights with their parents. Analyses of model lineage should pair weight analysis with behavioral analysis just like biologists analyze both genotype and phenotype.
We introduce Spanner (), a weights-only pseudometric that projects attention and MLP invariants onto shared tokens and compares layer spans with Yanai's GCD. Spanner compares LLMs across architectures, tokenizers, and dimensions while ignoring symmetries such as residual stream rotation that do not change the models' outputs.
Methodology
Check out the paper for details, but each of these steps fulfills a design goal related to detecting weight descent or making invariant to function-preserving model symmetries such as residual stream rotations. Models that share weight ancestry, such as a fine-tuned model and its base, share spans, while independent models are nearly orthogonal.
Genotype vs. phenotype
We use PhyloLM as our main measurement of model behavior or phenotype.
The two methods disagree when weight descent is different from behavioral descent. For example, with PhyloLM, independent models from the same lab are closer than pairs from different labs, while with the two distances are equal. Distilled models are closer to their teachers in their behavior than their weights, whereas merged and spliced models can be closer to their parents' weights than their behavior. These differences highlight the importance of both behavioral and weights-based analyses of model lineage.
Performance and cost
's pairwise distance comparison takes milliseconds because we sketch each model once. Those fast pairwise distance comparisons allow Hub-scale lineage analysis. can calculate a full distance matrix between 1,000 8B models in about 17 hours for $30 on a Hugging Face l40sx1, so our method enables large-scale open model lineage tracing and auditing. We exclude download time because it is the same for all methods.
Spanner in the wild
Community models list parent models, but they are not verified. We audited 101 parent model labels on the Hugging Face Hub and found that disagreed with 2 of them, huggingface-mic/gemma-2-2b-it-mic and inference-optimization/Llama-3.2-0.5B-Instruct, which had large to their listed parents, google/gemma-2-2b-it and meta-llama/Llama-3.2-1B-Instruct respectively. We also found a set of models that had Qwen3-1.7B listed as a parent, but that shows are closer to Qwen3-1.7B-Base.
We did not have to look very hard to find these examples, so a larger sweep of LLMs on the Hugging Face Hub would likely catch more. A bigger sweep may also detect matches for models that were uploaded without a parent tag.
Limitations
requires a shared token set , which may shrink with additional tokenizers. Distances are not directly comparable across studies unless they share a fixed .
saturates near . Sketch bias and weak overlap in weights between independently trained models can cause to decrease to slightly below , so values near saturation are not proof of shared weight lineage.
cannot detect distillation, so it should be paired with PhyloLM or another behavioral lineage measurement.
We did not test against an adversary. An attacker could potentially hide a model's true lineage.
Discussion
Does measure compatibility for merging models? Can predict retained performance after quantization? Under fine-tuning, at what do the base model's alignment safeguards stop working? If we teach model a new fact to make , what is ? We will soon apply Spanner to various tasks in LLM engineering and safety.
LLM lineages are not trees. LLMs can merge, splice, or assemble into MoE models in a way that is more like hybridization or horizontal gene transfer. We need lineage measurements that can detect both mimicry and weight descent between models. As LLM adoption and remixing continue, Spanner and other measurements like it will be crucial for tracking model evolution and adaptive radiation.
Crossposted from my blog. This is an adaptation of my recent paper. See GitHub for the code and Hugging Face for the data.
Open LLMs are heavily remixed, so their lineages are difficult to trace. Existing weight-based model lineage measurements are restricted to models of the same size or tokenizers or do not properly handle model symmetries. Output-based lineage measurements cannot distinguish weight descent from distillation, whereas merged and spliced models can have wildly different outputs despite sharing weights with their parents. Analyses of model lineage should pair weight analysis with behavioral analysis just like biologists analyze both genotype and phenotype.
We introduce Spanner ( ), a weights-only pseudometric that projects attention and MLP invariants onto shared tokens and compares layer spans with Yanai's GCD. Spanner compares LLMs across architectures, tokenizers, and dimensions while ignoring symmetries such as residual stream rotation that do not change the models' outputs.
Methodology
Check out the paper for details, but each of these steps fulfills a design goal related to detecting weight descent or making invariant to function-preserving model symmetries such as residual stream rotations. Models that share weight ancestry, such as a fine-tuned model and its base, share spans, while independent models are nearly orthogonal.
Genotype vs. phenotype
We use PhyloLM as our main measurement of model behavior or phenotype.
The two methods disagree when weight descent is different from behavioral descent. For example, with PhyloLM, independent models from the same lab are closer than pairs from different labs, while with the two distances are equal. Distilled models are closer to their teachers in their behavior than their weights, whereas merged and spliced models can be closer to their parents' weights than their behavior. These differences highlight the importance of both behavioral and weights-based analyses of model lineage.
Performance and cost
l40sx1, so our method enables large-scale open model lineage tracing and auditing. We exclude download time because it is the same for all methods.Spanner in the wild
Community models list parent models, but they are not verified. We audited 101 parent model labels on the Hugging Face Hub and found that disagreed with 2 of them, to their listed parents, shows are closer to Qwen3-1.7B-Base.
huggingface-mic/gemma-2-2b-it-micandinference-optimization/Llama-3.2-0.5B-Instruct, which had largegoogle/gemma-2-2b-itandmeta-llama/Llama-3.2-1B-Instructrespectively. We also found a set of models that had Qwen3-1.7B listed as a parent, but thatWe did not have to look very hard to find these examples, so a larger sweep of LLMs on the Hugging Face Hub would likely catch more. A bigger sweep may also detect matches for models that were uploaded without a parent tag.
Limitations
Discussion
Does measure compatibility for merging models? Can predict retained performance after quantization? Under fine-tuning, at what do the base model's alignment safeguards stop working? If we teach model a new fact to make , what is ? We will soon apply Spanner to various tasks in LLM engineering and safety.
LLM lineages are not trees. LLMs can merge, splice, or assemble into MoE models in a way that is more like hybridization or horizontal gene transfer. We need lineage measurements that can detect both mimicry and weight descent between models. As LLM adoption and remixing continue, Spanner and other measurements like it will be crucial for tracking model evolution and adaptive radiation.