File size: 10,565 Bytes
d975d30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
---
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

[📄 Paper](https://arxiv.org/abs/2611.25735) · [💻 GitHub](https://github.com/TransluceAI/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](https://huggingface.co/Qwen/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](https://arxiv.org/abs/2611.25735) for details and the
[GitHub repository](https://github.com/TransluceAI/PosteriorBench) 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 rendered
  `prompt_token_ids`, and the `wildchat_conversation_hash` of the WildChat-1M conversation it comes
  from), the `behavior` and its `rule`, and `probability`, which is p̂(S) =
  `hit_count / num_responses`. `scored` marks the 108 scored pairs and `benchmark_task` marks 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 `row` in the prompt's corpus, its `token_ids`, and a `reference_duplicate` flag
  (see [Held-out references](#held-out-references)).
- **evaluation**: for each scored pair (`task_id`), the `references` (`row`, `token_ids`, `text`)
  and their `reference_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.

```python
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):

```sh
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.

```python
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](https://huggingface.co/datasets/allenai/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.

```python
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)](https://opendatacommons.org/licenses/by/1-0/). 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 `posteriorbench` 1.0.0.

## Citation

```bibtex
@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}
}
```