gitwtfhub

wtf is mirror?

umaraslam66/mirror — explained in plain English

Analysis updated 2026-05-18

0PythonAudience · researcherComplexity · 4/5LicenseSetup · hard

TL;DR

Mirror is a research codebase showing a small statistical person model predicts individual survey answers better than LLM personas, while LLMs win at zero-shot questions and crowd influence.

Mindmap

mindmap
  root((Mirror))
    What it does
      Person embedding model
      LLM persona comparison
      Crowd influence simulation
    Tech stack
      Python
      PyTorch
      CUDA
    Use cases
      Reproduce paper results
      Run eval protocol
      Simulate partisan crowds
    Audience
      Researchers

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

Why would anyone build with this?

REASON 1

Reproduce the paper's comparison between a statistical person model and LLM persona agents.

REASON 2

Run the evaluation protocol against General Social Survey panel data.

REASON 3

Simulate how opinions spread through a partisan crowd using LLM or DeGroot models.

What's in the stack?

PythonPyTorchCUDA

How it stacks up

umaraslam66/mirror0xallam/my-recipe0xhassaan/nn-from-scratch
Stars00
LanguagePythonPythonPython
Last pushed2022-11-22
MaintenanceDormant
Setup difficultyhardmoderatemoderate
Complexity4/52/54/5
Audienceresearchergeneraldeveloper

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

How do you spin it up?

Difficulty · hard Time to first run · 1day+

Requires manually downloading GSS survey data and a partisan-crowds replication dataset from external sources before running.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

Wtf does this do

Mirror is a research project and accompanying code release that tests how well AI language models can imitate a specific real person's survey answers, compared with a more traditional statistical approach. It uses real survey data from the long running General Social Survey along with a repeat of an earlier academic study on how opinions spread through partisan crowds. The main finding is that a small, purpose built statistical model that learns an embedding, a kind of numeric fingerprint, for each person turns out to predict that person's individual survey answers more accurately than having a language model play the role of that person through a written persona, even when using a strong, more expensive model. Language model personas do better in two other situations though: answering brand new questions the models were never trained on, and modeling how opinions shift inside a simulated crowd of people influencing each other, where they outperform a classic mathematical model of social influence. All of the results are checked against accuracy targets set before the tests were run, and results that did not support the researchers' hopes are reported alongside the ones that did. The repository contains the full data processing pipeline, the evaluation code, the statistical and neural models being compared, the code for generating and testing personas, and scripts to reproduce every experiment in order, starting with a script that fixes the random data split used for testing. Running it requires Python 3.12, and the neural network training step can run on a CUDA GPU, an Apple GPU, or plain CPU automatically depending on what is available. Since the underlying survey data is not owned by the project, you need to separately download it from the two original sources named in the instructions before the processing scripts will work. The written paper describing the study is included as a PDF, and the code is released under the MIT license.

Yoink these prompts

Prompt 1
Walk me through downloading the GSS and partisan crowds data Mirror needs before running experiments.
Prompt 2
Explain what scripts/freeze_holdout.py does and why it must run first.
Prompt 3
Help me run Mirror's LLM persona baseline with a specific model and sample size.
Prompt 4
Summarize Mirror's headline accuracy results comparing its person model against LLM personas.

Frequently asked questions

wtf is mirror?

Mirror is a research codebase showing a small statistical person model predicts individual survey answers better than LLM personas, while LLMs win at zero-shot questions and crowd influence.

What language is mirror written in?

Mainly Python. The stack also includes Python, PyTorch, CUDA.

What license does mirror use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is mirror to set up?

Setup difficulty is rated hard, with roughly 1day+ to a first successful run.

Who is mirror for?

Mainly researcher.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.