explaingit

neutralityproject/political-compass-benchmark

Analysis updated 2026-05-18

22PythonAudience · researcherComplexity · 3/5Setup · moderate

TLDR

A benchmark that measures where a language model sits politically across eleven dimensions using thousands of real public opinion survey questions.

Mindmap

mindmap
  root((Political Compass Benchmark))
    What it does
      Scores model political leaning
      Uses public survey data
      Self-anchors to extremes
    Tech stack
      Python
    Use cases
      Measure model leanings
      Compare multiple models
      Rebuild reference data
    Audience
      AI researchers
      Model evaluators

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Measure a language model's political leanings across economic, social, and foreign policy dimensions.

USE CASE 2

Compare multiple AI models against each other using a shared, fixed survey reference.

USE CASE 3

Run neutral, far-left, and far-right persona tests to calibrate a model's own scale.

USE CASE 4

Rebuild the underlying reference answer key with a different set of judge models.

What is it built with?

Python

How does it compare?

neutralityproject/political-compass-benchmarkagno-agi/agent-platform-railwayalexantaluo0/acot-vla-wm
Stars222222
LanguagePythonPythonPython
Setup difficultymoderatemoderatehard
Complexity3/54/55/5
Audienceresearcherdeveloperresearcher

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires access to an OpenAI-compatible model server and time to run thousands of survey questions per model.

In plain English

This project is a tool for measuring where an AI language model sits politically, producing a detailed profile rather than a single label like left or right. It works by having the model answer nearly four thousand real public opinion survey questions taken from established sources like Pew Research and the World Values Survey. Each possible answer has a pre assigned political weight across eleven different dimensions, such as economic views, social views, foreign policy, and attitudes toward religion, and the pattern of a model's answers is turned into a position on each of those scales. To make the results meaningful rather than arbitrary numbers, the tool runs each model three times: once acting neutrally, once instructed to answer as a far left persona, and once as a far right persona. The scale for each dimension is then stretched so that model's own far left and far right answers define the two ends, meaning a score is always measured relative to that specific model's own extremes rather than some universal standard. The project also builds its reference answer key using three separate AI models from three different countries and companies, so no single company or country's assumptions define what counts as a left leaning or right leaning answer. Running the benchmark requires only Python 3.9 or newer with no extra libraries, and it connects to any model server that speaks the common OpenAI style API format, including tools like vLLM, LiteLLM, or OpenAI itself. A single command runs the full process, from asking the survey questions through calculating the final calibrated scores, and results are saved as a JSON file. The README is upfront about the tool's limits, noting that results are relative to each model's own extremes rather than an absolute political scale, that testing one of the reference judge models against itself introduces some circular bias, and that the exact size of scores should be trusted less than their direction and ranking. Several example results from real models are included in the repository's results folder for reference.

Copy-paste prompts

Prompt 1
Help me run mass/run_stance_pipeline.py against my own model server.
Prompt 2
Explain how the self-anchoring calibration works using far-left and far-right personas.
Prompt 3
Walk me through interpreting the anchored dimension scores in the output JSON.
Prompt 4
Show me how to rebuild data/source_option_loadings.csv with different judge models.

Frequently asked questions

What is political-compass-benchmark?

A benchmark that measures where a language model sits politically across eleven dimensions using thousands of real public opinion survey questions.

What language is political-compass-benchmark written in?

Mainly Python. The stack also includes Python.

How hard is political-compass-benchmark to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is political-compass-benchmark for?

Mainly researcher.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.