Skip to main content

EigenBench: LLM evaluation with Bradley-Terry models and EigenTrust scoring

Project description

EigenBench

Modules

api.py

LLM API wrappers. All models route through OpenRouter via get_model_response.

evaluation.py

Framework for generating r_{ijk} pairwise comparison samples.

Functions:

  • collect_responses — get evaluee responses to a scenario
  • collect_reflections — judge reflects on each response (multiturn only)
  • collect_comparison — single pairwise comparison r_{ijk}
  • evaluate_scenario — full evaluation of one scenario
  • run_evaluation — run over a dataset, saves JSONL incrementally

Modes (via args):

  • mode='criteria' — per-criterion evaluation with <criterion_N_choice> tags (default)
  • mode='constitution' — single constitution with <choice> tags
  • multiturn=True — judge reflects on each response before comparing (default)
  • multiturn=False — direct comparison, no reflection step
  • efficient=True — track usage counts, prefer least-used judges/evaluees (inverse-weighted by alpha)

data_utils.py

Extract structured comparison tuples from raw evaluation data and handle inconsistencies.

Functions:

  • extract_comparisons_with_ties — for <choice> format → [scenario, judge, eval1, eval2, score]
  • extract_comparisons_with_ties_criteria — for <criterion> format → [criterion, scenario, judge, eval1, eval2, score]
  • handle_inconsistencies_with_ties — convert inconsistent pairs to ties (constitution)
  • handle_inconsistencies_with_ties_criteria — same for criteria format
  • load_evaluations — load from JSON or JSONL

bt.py

Bradley-Terry / Bradley-Terry-Davidson model fitting.

Models:

  • VectorBT — dot-product BT (binary)
  • VectorBT_norm — euclidean-distance BT (binary)
  • VectorBT_bias — dot-product BT with judge bias (binary)
  • VectorBTD — dot-product BTD with ties (constitution, ternary)
  • VectorBTD_criteria — BTD with separate judge embeddings per criterion (ternary)

Training:

  • train_vector_bt — unified training loop (BCE for BT, CE for BTD)

eigentrust.py

EigenTrust algorithm — compute trust scores from trained BT model.

Functions:

  • compute_trust_matrix — trust matrix from BT model (no ties)
  • compute_trust_matrix_ties — trust matrix from BTD model (with ties)
  • row_normalize, damp_matrix, eigentrust — EigenTrust iteration
  • load_vector_bt, load_vector_btd — load saved models

config.py

Personas, constitutions, criteria. Copied from original. Requires JSON data files in data/.

Tests

In test/:

  • test_evaluation.py — run evaluation, save JSONL
  • test_data_bt.py — extract comparisons from saved JSONL, fit BTD model
  • test_full_transcript.py — data_utils + bt on full 37-model transcript
  • test_eigentrust.py — full pipeline: data_utils → bt → eigentrust

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

eigenbench-0.2.0.tar.gz (24.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

eigenbench-0.2.0-py3-none-any.whl (26.9 kB view details)

Uploaded Python 3

File details

Details for the file eigenbench-0.2.0.tar.gz.

File metadata

  • Download URL: eigenbench-0.2.0.tar.gz
  • Upload date:
  • Size: 24.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for eigenbench-0.2.0.tar.gz
Algorithm Hash digest
SHA256 9eec22b6c4137cdda5b4ca2edd9d9b703c12176972996d849bcc32d010754dfc
MD5 6dc426d8da1cbd9dab5880015509b926
BLAKE2b-256 7825024007ed74a97b871aa2515b36a9ca156ed1ae707b941e84ae598638ef46

See more details on using hashes here.

File details

Details for the file eigenbench-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: eigenbench-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 26.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.7 {"installer":{"name":"uv","version":"0.10.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for eigenbench-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e822f5acc6f95de3cbd2e21f293e970995ec04a1fca767ba7e87f2c6d3dabe8b
MD5 7517b62716a47a23513754ba629a4860
BLAKE2b-256 85d81cb22184fa2faebf1277f6090bb31afb565012a052c3665015436d763e6c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page