Skip to content

feat(althing): condition GlobalOpinionQA on althing population packs - #359

Merged
the-data-viking merged 1 commit into
mainfrom
feat/country-mix-conditioning
Oct 10, 2026
Merged

the-data-viking merged 1 commit into
mainfrom
feat/country-mix-conditioning

Conversation

@the-data-viking

@the-data-viking the-data-viking commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds synthbench run --persona-pack <id> (althing provider only). It conditions GlobalOpinionQA questions on an Althing population pack, e.g. global-respondents.

Without --country, a GlobalOpinionQA question's ground truth is the unweighted mean over the countries that answered it. Runs used to answer every sample under one generic persona with no country. With --persona-pack global-respondents, SynthBench passes each question's respondent population, and Althing chooses the personas from the pack and splits the samples across them. Althing is the conditioning harness (DataViking-Tech/Althing#593); SynthBench only supplies dataset metadata and measures the result.

The conditioning uses survey-design information (which countries were asked each question). It never sees the human answers.

Changes

  • Question.respondent_population: {"country": [...]}, with one entry per group the ground truth averages over (repeats kept). GlobalOpinionQA fills it with plain country names: canonical_country() turns "Brazil (Non-national sample)" into "Brazil" and "S. Korea" into "South Korea". So a country surveyed twice gets twice the weight, as it does in the human average. With --country X the population is just X.
  • AlthingProvider(persona_pack=...): get_population_distribution() calls althing.population.allocate_population and renders each persona with Althing's persona_system_prompt. It samples each persona's share and pools them by sample count (providers.base.pool_distributions). The provider name gets pack=<id>, which gives these runs their own config_id, and the pack's content feeds the prompt-template hash.
  • Runner: sends each question's population to a provider with a pack, stamps config.persona_pack, and fails early (exit 2) on datasets without populations.
  • CLI: --persona-pack. Non-althing providers reject it.

Results

Haiku 5.5 (althing/claude-code:haiku), GlobalOpinionQA, the same 100 questions (question_set_hash 4f27a038…), 30 samples per question, structured elicitation. These come from real synthbench run invocations:

SPS [95% CI] P_dist P_rank P_refuse
unconditioned 0.742 [0.707, 0.777] 0.622 0.625 0.980
--persona-pack global-respondents 0.815 [0.787, 0.843] 0.761 0.706 0.980
  • Paired per-question gain: +0.073 [+0.046, +0.102]. There were no parse failures and no refusals. The run took 22 minutes on a Claude subscription.
  • For reference on these questions: the 3-model ensemble scores 0.813, Sonnet 4 via Althing 0.797, and the random baseline 0.774.
  • An earlier pilot, which used SynthBench-side personas and the raw dataset labels, scored 0.817. The Althing pack reproduces it.

Dependencies

Testing

  • tests/test_population_conditioning.py (16 tests):
    • canonical_country mappings, and the population with repeats and with --country;
    • every alias target exists in the Althing pack;
    • pooling math;
    • runner population pass-through, the config stamp, and the provider-name knob;
    • rejection on datasets without populations;
    • a distinct config_id, and CLI rejection for non-althing providers;
    • AlthingProvider.get_population_distribution with a fake client (repeat weighting, Brazil 20 / Japan 10).
  • Full suite: 1,213 passed. The 3 deselected tests also fail on main on Windows.
  • Ruff 0.15.22 is clean.

🤖 Generated with Claude Code

@the-data-viking the-data-viking added the semver:minor Triggers minor version bump on merge label Oct 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Dataset change detected

This PR touches src/synthbench/datasets/**. Per
DATASETS.md, dataset additions
and substantive adapter changes are gated behind maintainer
review.

Before this PR can merge:

  • A dataset-proposal issue exists and has been approved
    (linked above, ideally).
  • Inclusion criteria are documented in the PR description
    (representativeness, coverage, license tier, vertical fit,
    maintenance).
  • Tests under tests/ cover the new adapter.
  • A maintainer applies the dataset-approved label.

The gate job below will fail until dataset-approved is set
by a maintainer. PR authors cannot self-apply this label —
the label event is checked against the actor.

Touched files:

src/synthbench/datasets/base.py
src/synthbench/datasets/globalopinionqa.py

@the-data-viking
the-data-viking marked this pull request as draft October 10, 2026 00:28
GlobalOpinionQA's ground truth (without --country) averages over the
countries that answered each question. `--persona-pack global-respondents`
has althing answer each question with personas from those countries:
SynthBench supplies the question's respondent population, althing (the
conditioning harness) allocates samples and renders the personas.

- Question.respondent_population ({"country": [...]}, repeats kept);
  GlobalOpinionQA fills it with plain country names (canonical_country
  maps "Brazil (Non-national sample)", "S. Korea", ...).
- AlthingProvider(persona_pack=...): get_population_distribution uses
  althing.population.allocate_population + persona_system_prompt and
  pools per-persona samples; provider name gets `pack=<id>`, so these
  runs hash to their own config_id; the pack content feeds the prompt
  hash.
- Runner sends each question's population to a pack provider and stamps
  config.persona_pack; datasets without populations exit 2 up front.
- `synthbench run --persona-pack` (althing only).
- providers.base.pool_distributions.

Uses survey-design metadata (which countries were asked), never answers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@the-data-viking
the-data-viking force-pushed the feat/country-mix-conditioning branch from 5298ad6 to 79b8a81 Compare October 10, 2026 00:40
@the-data-viking the-data-viking changed the title feat(conditioning): country-mix persona conditioning for GlobalOpinionQA feat(althing): condition GlobalOpinionQA on althing population packs Oct 10, 2026
@the-data-viking
the-data-viking marked this pull request as ready for review October 10, 2026 01:04
@the-data-viking the-data-viking added the dataset-approved Maintainer approval for src/synthbench/datasets/ changes (DATASETS.md) label Oct 10, 2026
@the-data-viking
the-data-viking merged commit bc69001 into main Oct 10, 2026
23 of 25 checks passed
@the-data-viking
the-data-viking deleted the feat/country-mix-conditioning branch October 10, 2026 01:07
the-data-viking added a commit that referenced this pull request Oct 10, 2026
althing 1.8.0 ships althing.population and the global-respondents pack,
which --persona-pack (#359) calls. With 1.7.0 the flag fails with an
upgrade message and the population tests skip.

Co-authored-by: the-data-viking <wesley@thedataviking.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
the-data-viking pushed a commit that referenced this pull request Oct 10, 2026
--persona-pack (#359) gave conditioned runs their own config_id, but the
leaderboard grouped rows by (display name, framework, dataset, effort,
template), so a conditioned run silently merged with the same model's
unconditioned run.

- publish: persona_pack joins the dedupe, run-count, coverage, and
  per-question rollup keys; entries and run-index rows carry
  persona_pack.
- leaderboard: _parse_provider_base strips " pack="; MODEL_MAP entries
  for the subscription-CLI providers (althing/claude-code:haiku,
  althing/codex:gpt-6-luna) as product rows.
- findings: the ensemble-vs-best-single comparison excludes persona-pack
  rows (the lever measured is blending, not conditioning).
- site: SynthBench Index keys and labels variants by persona pack; explore
  shows a pack= tag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
the-data-viking added a commit that referenced this pull request Oct 10, 2026
… (+ persona-pack leaderboard rows) (#361)

* fix(leaderboard): keep persona-pack runs as their own rows

--persona-pack (#359) gave conditioned runs their own config_id, but the
leaderboard grouped rows by (display name, framework, dataset, effort,
template), so a conditioned run silently merged with the same model's
unconditioned run.

- publish: persona_pack joins the dedupe, run-count, coverage, and
  per-question rollup keys; entries and run-index rows carry
  persona_pack.
- leaderboard: _parse_provider_base strips " pack="; MODEL_MAP entries
  for the subscription-CLI providers (althing/claude-code:haiku,
  althing/codex:gpt-6-luna) as product rows.
- findings: the ensemble-vs-best-single comparison excludes persona-pack
  rows (the lever measured is blending, not conditioning).
- site: SynthBench Index keys and labels variants by persona pack; explore
  shows a pack= tag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* data(globalopinionqa): Haiku 5.5 and GPT-6 Luna via subscription CLIs

Five 100-question x 30-sample GlobalOpinionQA runs, produced with althing
1.8.0 subscription providers (claude-code:haiku, codex:gpt-6-luna) under
option parser v2 and refusal detector v3:

- Haiku 5.5: natural 0.695, structured 0.742,
  structured + global-respondents pack 0.815
- GPT-6 Luna: structured 0.765, structured + global-respondents pack 0.809

Gated human_distribution stripped; all five pass synthbench validate
--rehydrate-canonical. Findings block and FINDINGS.md regenerated (adds the
Haiku 5.5 natural vs structured elicitation comparison).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: the-data-viking <wesley@thedataviking.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dataset-approved Maintainer approval for src/synthbench/datasets/ changes (DATASETS.md) datasets-change semver:minor Triggers minor version bump on merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants