gitwtfhub

wtf is illusion-of-robustness?

salt-nlp/illusion-of-robustness — explained in plain English

Analysis updated 2026-05-18

2PythonAudience · researcherComplexity · 4/5Setup · moderate

TL;DR

Research code showing that adding irrelevant text to questions barely changes a language model's overall accuracy, but flips many individual answers underneath.

Mindmap

mindmap
  root((illusion-of-robustness))
    What it does
      Adds irrelevant context
      Measures answer flips
      Reports instability metrics
    Tech stack
      Python
      LiteLLM
      transformers
      Hugging Face
    Use cases
      Reproduce paper results
      Evaluate new models
      Study reliability risk
    Audience
      Researchers
      LLM evaluators
    Data
      Task-irrelevant contexts
      Source benchmarks
      Result datasets

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 experiments measuring per-question instability under irrelevant context.

REASON 2

Evaluate how a specific language model's answers shift when unrelated text is added.

REASON 3

Use the released datasets to study context-induced reliability issues in other models.

What's in the stack?

PythonLiteLLMtransformersHugging Face

How it stacks up

salt-nlp/illusion-of-robustness0-bingwu-0/live-interpreter010zx00x1/faresnipe
Stars222
LanguagePythonPythonPython
Setup difficultymoderatemoderateeasy
Complexity4/52/52/5
Audienceresearchergeneralgeneral

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

How do you spin it up?

Difficulty · moderate Time to first run · 1h+

Requires API credentials for a supported LLM provider or a locally loaded open-weight model via transformers.

Wtf does this do

This repository holds the code behind a research paper studying how large language models behave when they are given extra text that has nothing to do with the question being asked. The paper is called The Illusion of Robustness, and its central finding is that while a model's overall accuracy on a benchmark barely changes when unrelated context is added, individual answers underneath that average can flip quite a bit. Some questions get answered better with the irrelevant context added, others get answered worse, and which questions are affected differs from model to model. So a stable looking average score can hide real instability at the level of single predictions. The code lets researchers reproduce this effect. It prepends task irrelevant context, by default random pseudo words, to standalone question answering benchmark questions, then measures how each individual answer's correctness changes. Beyond the overall accuracy and average change, it reports two extra measurements: instability, which is the average size of per question change in either direction, and worst tail degradation, which focuses on how badly the worst affected slice of questions performs. The repository is organized into a pipeline for models accessed through an API, a separate pipeline for locally run open weight models that inspects internal model states more directly, and a set of scripts for building the context and target datasets used in the experiments. There is also a test suite. Setup involves installing Python dependencies and providing API credentials in a configuration file, since the pipeline works with any provider supported by the LiteLLM library. The project releases all of its datasets publicly on Hugging Face, organized by experiment, covering several benchmark sources, different types of irrelevant context such as pseudo words, random web pages, and random tokens, and results across many different models. This makes it possible for others to inspect the exact data and rerun or extend the analysis. The README includes example commands for running both the main API based experiments and the local model experiments.

Yoink these prompts

Prompt 1
Help me install the dependencies and set up API credentials to run this project's pipeline.
Prompt 2
Explain what instability and worst-tail degradation mean in this paper's methodology.
Prompt 3
Walk me through running the API-model pipeline on one of the released benchmark datasets.
Prompt 4
Show me how to run the local open-weight model analysis pipeline on a Hugging Face model.

Frequently asked questions

wtf is illusion-of-robustness?

Research code showing that adding irrelevant text to questions barely changes a language model's overall accuracy, but flips many individual answers underneath.

What language is illusion-of-robustness written in?

Mainly Python. The stack also includes Python, LiteLLM, transformers.

How hard is illusion-of-robustness to set up?

Setup difficulty is rated moderate, with roughly 1h+ to a first successful run.

Who is illusion-of-robustness for?

Mainly researcher.

View the repo → Decode another repo

This repo across BitVibe Labs

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