# Population genetics of public fine-tunes
MIT License, Bryan Cheng, 2026.
The public LoRA adapters of one base model (Qwen2.5-0.5B-Instruct) are treated as a genetic population:
- **Genotypes** are expressed weight updates: the update weighted by the base model's input covariance, E = Delta V
Lambda^{1/2}. Per-module principal axes of the expressed updates are the loci.
- **Phenotypes** are a fixed behavioural battery of 53 reliable traits.
- **Relatedness** has two layers: descent (shared initialization) and function.
Seven association estimators are scanned: naive, PC, MM-f, MM-fd, WF-d, WF-r and DUP-AFE. Each is calibrated against
interventions (transplants, knockouts and dosing), randomized crosses and spike-ins.
Status, decisions and results:
- `STATUS.md`: what is running and what comes next.
- `RESEARCH_PLAN.md`: the pre-registered plan.
- `DECISIONS.md`: every deviation, with date and reason.
- `TRAINING_LOG.md`: every compute job.
- `RESULTS.md`: every reported number, with its source file.
## Data, models and code
- Code, documents, paper and job logs: this repository.
- Data and results: the Hugging Face dataset
[bryan7264/lorapop](https://huggingface.co/datasets/bryan7264/lorapop). It holds processed genotypes and kinship
matrices for every population, phenotype tables, scans, interventions, crosses, E1/E6/E7 outputs, the Hugging Face
index and the reference corpus, plus a copy of this code under `code/`.
- Adapters we trained (seed siblings, opposite and trait-targeted fine-tunes on Qwen2.5-0.5B-Instruct and TinyLlama): the
Hugging Face model repository [bryan7264/lorapop-adapters](https://huggingface.co/bryan7264/lorapop-adapters).
- Not redistributed: the third-party public adapters and reduced full fine-tunes (re-download with `src/data/`; repo
ids are in the index), the HarmBench behaviour list (download it from its source) and intermediate gradient files.
## Layout
| path | content |
|---|---|
| `src/lorapop/` | core library: adapter loading (`adapters.py`), base covariances (`basecov.py`), genotypes and alleles (`genotype.py`), kinship (`kinship.py`), bank-mode low-rank updates (`deltas.py`), behavioural battery (`battery.py`) |
| `src/data/` | Hugging Face enumeration and adapter download |
| `src/train/` | controlled training: seed siblings, opposite and trait-targeted fine-tunes |
| `src/run/` | GPU and CPU stages: `phenotype.py`, `genotypes.py`, `scan_run.py`, `intervene.py`, `cross.py`, `spikein.py`, `repair.py` |
| `src/analysis/` | population build, scans and diagnostics, intervention planning, calibration, crosses, spike-ins, architecture, forecasts, prediction, audit, meta-analysis |
| `tests/` | unit tests (`pytest -q tests`) |
| `slurm/` | job scripts and the two lane runners (`lane.sh` for devel GPU, `lane_cpu.sh` for devel CPU) with their queues |
| `results/` | outputs of every stage, one JSON or NPZ per unit |
| `paper/` | LaTeX sections and the verified bibliography (`tools/make_bib.py`) |
| `novelty/` | literature search, the verified reference list and the novelty report |
## Pipeline (Qwen2.5-0.5B-Instruct)
1. Enumerate and download adapters:
- `src/data/hf_enumerate.py`
- `src/data/fetch_adapters.py --index data/raw/hf_index/