# Soft-Elo reproduction code Companion dataset: [kbora/SoftElo](https://huggingface.co/datasets/kbora/SoftElo). Project repository: [kargibora/SoftElo](https://github.com/kargibora/SoftElo). This package loads the released judge annotations and reproduces the paper's Hard-Elo, Soft-Elo, constant-smoothing and historical conformal calculations. It also rebuilds tables from archived model-level measurements without rerunning fits. These are separate commands so cached reconstruction is not mistaken for an independent numerical reproduction. ## Install From this directory, using Python 3.12: ```bash uv sync --locked --python 3.12 uv run python -m unittest discover -s tests ``` The lock file pins the numerical libraries. NumPy, pandas, SciPy and scikit-learn versions match the versions found in the original research environment. That installed environment is evidence of compatibility, not a record of every historical experiment's environment. Without uv, create a Python 3.12 virtual environment and run `pip install .`. This installs the declared dependencies, but does not reproduce `uv.lock`. In the published dataset, this directory is `code/`; the examples below assume the dataset files are one directory above it. ## Load annotations ```python from softelo_release.data import load_annotations frame = load_annotations( "..", corpus="lmarena100k", judge="GPT-OSS-120B", subset="paper_valid" ) shared = load_annotations("..", corpus="lmarena100k", subset="shared_valid") ``` Use `subset="all", collapse_preferences=False` to retain all exported rows and raw weak preferences. The default applies the original score-validity filter and maps preferences within 0.26 of 0.5 to ties. Scores are returned as Python dictionaries. Rows remain in their original order within each judge. For a remote release, replace `".."` with its Hugging Face dataset ID and pass `revision=` with the published commit hash. No remote repository name is assumed. To retrieve original conversation records, request them from the upstream repository at the revision in each annotation row: ```python from softelo_release.data import load_source_rows row = frame.iloc[0] source = load_source_rows( row.source_dataset, [row.source_id], revision=row.source_revision ) ``` ## Validate and reconstruct the archived tables ```bash uv run softelo-validate .. --report outputs/dataset-validation.json uv run softelo-reproduce --cached-results ../results --out outputs/cached-tables ``` The second command checks 176 values against the archived summaries: main MAE, rank correlations, model counts and fitted temperatures; conformal coverage and width statistics. It also rebuilds the label-smoothing table and computes its means before rounding. A mismatch raises an error. The output includes `main_results.csv`, `conformal_results.csv`, `label_smoothing_results.csv`, `tables.md` and `validation.json` with source hashes. ## Run the verified suites From the dataset's `code/` directory: ```bash uv run python -m softelo_release.suite --data .. --suite main --judge GPT-OSS-120B uv run python -m softelo_release.suite --data .. --suite all --jobs 2 ``` The full command runs 31 judge/protocol combinations across LMArena100K and LMArena140K, compares fresh fits with archived references, and exits with an error if a comparison fails. Individual suites are `main`, `smoothing`, `conformal-historical` and `lmarena140k`. See [VERIFICATION.md](VERIFICATION.md) for the completed audit and comparison scope. ## Recompute from annotations ```bash uv run softelo-reproduce --data .. --corpus lmarena100k \ --judge GPT-OSS-120B --protocol main --out outputs/main-gpt120 uv run softelo-reproduce --data .. --corpus lmarena100k \ --judge GPT-OSS-120B --protocol smoothing --out outputs/smoothing-gpt120 uv run softelo-reproduce --data .. --corpus lmarena100k \ --judge GPT-OSS-120B --protocol conformal-historical --out outputs/conformal-gpt120 ``` Repeat with the judge names in `manifest.json`. This release also includes `--corpus lmarena140k`. These computations use CPU; they make no judge API calls and need no GPU. Each command writes the effective settings and core-code hash to `run_config.json` alongside model-level predictions and summaries. | Protocol | Temperature fitting | Purpose | | --- | --- | --- | | `main` | Refit on anchor-only battles for each held-out model | Main Table 2; source experiment 91 | | `pooled` | Fit once on the judge's full valid battle pool | Historical pooled-temperature point-estimate baseline | | `smoothing` | Pooled Soft-Elo baseline; fixed constants 0.55–0.95 | Appendix E.1; constants compared retrospectively | | `conformal-historical` | Pooled temperature, original bootstrap and split settings | Historical Table 3 | The historical conformal mode preserves the original quantile interpolation, tie policy and seeds. Hard-Elo resamples anchor battles during the bootstrap; Soft-Elo keeps its anchors fixed, matching the original implementation. Its bracketed width statistics are the 2.5th and 97.5th percentiles across five splits. The original quantile routine differs from the usual direct conformal order statistic; it is retained here to reproduce saved results. Do not describe it as a new implementation of the exact order-statistic rule. The extraction manifest records the source of each numerical function. ## Export from the original research checkout ```bash uv run softelo-export --repo-root /path/to/LLM-vs-Human-Judge \ --source-revisions source_snapshots.json --out /path/to/new-dataset ``` The exporter selects the corpora listed in `source_snapshots.json` from the original 22-input manifest. The supplied configuration exports 15 LMArena files. It preserves the aggregated and available per-order scores, checks upstream IDs, models and human preferences, and exports an explicit field allowlist. Raw prompts, model responses, user/session identifiers, provider credentials and free-text judge explanations are not exported. A completed export is immutable: choose a new output directory to produce another version. Compatible upstream snapshots are pinned in `source_snapshots.json`; they are verified joins, not a claim that the original annotation jobs recorded those exact commit IDs. See [VERIFICATION.md](VERIFICATION.md) for executed checks and their limits. ## Scope and provenance The package includes LMArena100K and LMArena140K, with eight paper judges where available. Auxiliary prompt-variation experiments and the author re-annotation study are outside this release. Reproduction commands cover the core rating, conformal and smoothing analyses; they do not regenerate every appendix figure. `historical_core.py` preserves the numerical operations extracted from the research repository. `core_provenance.json` records paths, source hashes and a docstring correction that leaves the executable code unchanged. `NOTICE` identifies the extracted OpenJury code; its Apache-2.0 license is included. Dataset terms are separate in `../DATA_LICENSES.md`.