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.1.0.tar.gz (23.3 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.1.0-py3-none-any.whl (25.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: eigenbench-0.1.0.tar.gz
  • Upload date:
  • Size: 23.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","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.1.0.tar.gz
Algorithm Hash digest
SHA256 ac54481e6fa40f3af65baa6643ce3104c5ff65b4f85c99a33d9ec615a871d47b
MD5 3aff0cc7048b21b3a5b684a58d7b1398
BLAKE2b-256 230e8725eea8e5dfebc52b6f7e7dac1a3688b659225e9e855952a318b34b3211

See more details on using hashes here.

File details

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

File metadata

  • Download URL: eigenbench-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 25.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5b3c63b86be293a095337807929c0ad18fdc232541c0b7f62b60fc55e0fd95be
MD5 428f223701b0c980753b1628c06279c3
BLAKE2b-256 cf46512e74bfd02ef043ed25530f99352373a8e4a3527c1119c3ca9e1e349f75

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