Datasets:
Download README.md from Transluce/PosteriorBench: direct link, hf CLI and curl.
- Browser
- Download file 10.6 kB
-
https://huggingface.co/datasets/Transluce/PosteriorBench/resolve/main/README.md
- Command line
-
hf download hf://datasets/Transluce/PosteriorBench/README.md
-
curl -L -o README.md https://huggingface.co/datasets/Transluce/PosteriorBench/resolve/main/README.md
license: odc-by
language:
- en
pretty_name: PosteriorBench
not-for-all-audiences: true
size_categories:
- 1B<n<10B
task_categories:
- text-generation
tags:
- rare-behaviors
- posterior-sampling
- language-model-sampling
- benchmark
configs:
- config_name: tasks
default: true
data_files:
- split: train
path: tasks/tasks.parquet
- config_name: corpus
data_files:
- split: train
path: corpus/*/*.parquet
PosteriorBench
PosteriorBench measures how well a method can sample the responses of a language model that show a
rare behavior. To build it, we sampled one billion responses from
Qwen3.5-0.8B to 20 WildChat prompts (50 million per
prompt) and labeled each response for seven behaviors, such as using an em dash or mentioning a
goblin. The responses that show a behavior are exact samples from the model conditioned on that
behavior. Some of them are given to methods as training data, and others are held out as references
for evaluation. We include all one billion responses with their token IDs and labels, together with
the files used by the posteriorbench Python package. See the paper for details and the
GitHub repository for the package.
Content warning. The responses are unfiltered outputs of a small language model and were not reviewed by people. They contain offensive language (one of the behaviors is profanity) and racial slurs; responses that discuss suicide or self-harm, a few of which urge the reader to kill themselves; and false statements. The prompts are messages that real users sent to a chatbot.
What's here
| Path | Files | Rows | One row is |
|---|---|---|---|
tasks/tasks.parquet |
1 | 140 | a prompt–behavior pair: prompt, rule, hit count, p̂(S) |
hits/<prompt_id>/<behavior>.parquet |
108 | 45,646,759 | a hit of a scored pair, for methods to train on (3.42 GB in all) |
evaluation/evaluation.parquet |
1 | 108 | a scored pair's 250 held-out references and its fallback response (5.5 MB) |
corpus/<prompt_id>/part-*.parquet |
1,000 | 1,000,000,000 | a response, with its token IDs and the seven labels (146 GB) |
Pairing every prompt with every behavior gives 140 prompt–behavior pairs. A pair's hits are the responses to the prompt that show the behavior. The fraction of hits among the prompt's 50 million responses is p̂(S), our estimate of the behavior's probability. We score methods on the 108 pairs that have at least 500 hits; their p̂(S) ranges from 1e-5 to 0.1. Each scored pair has 250 references (hits held out for evaluation) and a fallback response. The benchmark's 21 tasks are the scored pairs with the lowest, median and highest p̂(S) for each behavior.
- tasks:
task_id(<prompt_id>/<behavior>), the prompt (prompt_id,prompt, its renderedprompt_token_ids, and thewildchat_conversation_hashof the WildChat-1M conversation it comes from), thebehaviorand itsrule, andprobability, which is p̂(S) =hit_count / num_responses.scoredmarks the 108 scored pairs andbenchmark_taskmarks the benchmark's 21 tasks. - hits: one file per scored pair, containing all of the pair's hits except its references. Each
row has the hit's
rowin the prompt's corpus, itstoken_ids, and areference_duplicateflag (see Held-out references). - evaluation: for each scored pair (
task_id), thereferences(row,token_ids,text) and theirreference_logp, and a fallback response (fallback_text,fallback_token_ids,fallback_logp). The fallback is a fixed response that shows the behavior, written in advance by a language model; a sampler whose hit rate is below 10% receives the fallback's scores. This file is only for evaluation and should never be read by a method. - corpus:
prompt_id,row(0 to 49,999,999 within the prompt),token_ids,text(the decoded response) and one boolean column per behavior. Within each prompt the rows are in a random order, so any range of rows is a uniform random sample of that prompt's responses.
Behaviors
Each behavior is defined by an exact rule on the decoded text y of a response. The rule is stored
as a Python expression in the rule column of the task table. Each rule is a substring or a
regular expression that stands in for a broader behavior; for example, profanity is a single
substring.
| Label | Rule | Scored pairs |
|---|---|---|
em_dash |
"—" in y |
20 |
chinese_character |
re.search(r"[㐀-䶿一-鿿]", y) |
20 |
chatgpt_mention |
"chatgpt" in y.lower() |
12 |
profanity |
"fuck" in y.lower() |
9 |
goblin_mention |
"goblin" in y.lower() |
8 |
contrastive_phrasing |
re.search(r"\b(?:it|this|that)(?:['’]s not| is not| isn['’]t) [^.!?\n]{2,60}?[,;:—–-]+\s*(?:it|this|that)(?:['’]s| is)\b", y, re.IGNORECASE) |
19 |
word_repetition |
re.search(r"\b([^\W\d_]{1,20})(?:\s+\1\b){2,}", y, re.IGNORECASE) |
20 |
Loading
The task table is the default configuration, and the corpus is available as the corpus
configuration. The hit files and the evaluation file can be read directly as Parquet files.
import pandas as pd
from datasets import load_dataset
tasks = load_dataset("Transluce/PosteriorBench", "tasks", revision="v1.0.0", split="train")
hits = pd.read_parquet(
"hf://datasets/Transluce/PosteriorBench@v1.0.0/hits/wc_1853/goblin_mention.parquet"
)
To download everything except the corpus (3.4 GB):
hf download Transluce/PosteriorBench --repo-type dataset --revision v1.0.0 \
--include "tasks/*" --include "evaluation/*" --include "hits/*" --local-dir PosteriorBench
We recommend loading the corpus configuration with streaming=True; otherwise datasets
downloads all 146 GB.
To run the benchmark, use the posteriorbench package. It downloads only the hit files that are
requested, and it charges a method 1/p̂(S) inferences for each distinct hit it uses, which is the
expected number of samples from the model needed to find one hit by rejection sampling.
import posteriorbench as pb
bench = pb.Benchmark()
task = bench.task("wc_1853/goblin_mention") # prompt, behavior, rule, p̂(S)
ledger = pb.Ledger()
hits = bench.corpus(task, ledger).take_first(64) # 64 training hits, charged 64 / p̂(S)
Held-out references
The 250 references of each pair are a uniform random sample of its hits, and they are excluded from
the pair's hit file. A few hits have exactly the same token IDs as a reference. These are kept in
the hit file with reference_duplicate set to true, and the package excludes them by default.
Note that references are held out per pair: a reference of one pair may appear in the hit file of another pair on the same prompt, so a sampler for a pair should be built only from that pair's own hits. If you read the corpus directly, you need to exclude the pair's reference rows yourself.
How the responses were generated
| Setting | Value |
|---|---|
| Model | Qwen/Qwen3.5-0.8B (revision 2fc06364715b967f1860aea9cf38778875588b17), bfloat16 weights |
| Prompts | 20 drawn at random from the first user turns in WildChat-1M (revision 7d6490e462285cf85d91eabea0f9a954fbddcd1f) that have 10–100 characters, whose letters are all ASCII, that WildChat labels as English and that it does not mark as redacted |
| Prompt format | the user turn as the only message, rendered with the model's chat template with thinking off (enable_thinking=False); no system prompt |
| Sampling | temperature 1, top-p 1, no top-k or min-p truncation; at most 50 new tokens; generation stops at <|im_end|> or <|endoftext|> |
| Engine | SGLang 0.5.10 |
All responses were sampled independently, and they cannot be regenerated from a seed. Responses are
truncated at 50 tokens, and 98.85% of them reach this limit. A small number of responses are
irregular: a response that was truncated inside a multi-byte character ends in U+FFFD, some
responses decode to an empty string, and some contain <think> or </think> even though thinking
was off. Each of these cases affects fewer than 1% of a prompt's responses. The log p values in the
evaluation file were computed with the same engine and may differ under another runtime.
Adding a behavior
A new behavior can be added without sampling from the model again. Any rule on the text defines a new pair: its probability is the fraction of rows that match, and the matching rows are samples from the model conditioned on the rule.
import re
from datasets import load_dataset
rows = load_dataset(
"Transluce/PosteriorBench", data_files="corpus/wc_0670/*.parquet", split="train",
revision="v1.0.0", streaming=True, columns=["text"],
)
hits = sum(re.search(r"\bdragons?\b", row["text"], re.IGNORECASE) is not None for row in rows)
probability = hits / 50_000_000
With 50 million responses per prompt, a behavior with probability 1e-5 has about 500 hits. The
package's repository includes a tool, tools/add_behavior.py, that builds the files for a new
pair.
Limitations
- The dataset covers one model and one sampling setting: Qwen3.5-0.8B, a small model, with thinking off, at temperature 1.
- There are 20 prompts, all short English first user turns from WildChat, and responses are at most 50 tokens long.
- p̂(S) is an estimate from 50 million responses. Its estimated relative standard error is below 5% on the scored pairs. The 32 pairs with fewer than 500 hits are not scored and have no references.
License
This dataset is released under the Open Data Commons Attribution License (ODC-BY). The prompts come from WildChat-1M, which is also released under ODC-BY; please cite WildChat when you use them. The responses were generated by Qwen3.5-0.8B, which is released by Qwen under Apache 2.0.
Changelog
- v1.0.0: Initial release, read by
posteriorbench1.0.0.
Citation
@article{xun2026posteriorbench,
title={PosteriorBench: Evaluating Behavior Posterior Sampling in Language Models},
author={Zhiyang Xun and Daniel D. Johnson and Sarah Schwettmann and Neil Chowdhury},
year={2026},
eprint={2611.25735},
archivePrefix={arXiv}
}