PosteriorBench: Evaluating behavioral posterior sampling in language modelsPosteriorBench: Evaluating Behavior Posterior Sampling in Language Models
The authors propose the PosteriorBench benchmark to evaluate behavioral posterior sampling methods, saying that on 21 tasks with Qwen3.5-0.8B no method is both compute-efficient and close to the true posterior.
- Rare model behaviors are hard to obtain through ordinary sampling and may still cause harm after deployment. The authors propose the behavioral posterior sampling problem: given a model and a behavior, can text that exhibits that behavior and whose distribution is close to the true posterior be sampled with less compute?
- The authors build PosteriorBench: on Qwen3.5-0.8B, they sample 50 million responses for each of 20 WildChat prompts, label 7 behavior categories with regex, take 21 tasks and use exact posterior samples as reference, measure cost in inference counts and fidelity by forward and reverse KL, and compare multiple training and training-free methods.
- The authors report that no method is both compute-efficient and close to the posterior: training-free methods stall at high KL after about 10^5 inferences, SFT catches up after about 10^6 inferences but is costly, and GFlowNet, CTL, GDC, KL-DPG and JS-DPG are all no better than SFT; EB-JC is the best candidate selection signal, and mixtures and composition can lower KL.
- The authors point out that the benchmark behaviors are conceptually simple and cannot represent all behaviors, and that KL is a coarse metric, so the actual usefulness of samples may differ. The main experimental benchmark uses only Qwen3.5-0.8B, limits responses to 50 tokens, and determines behaviors by regex; larger models are tested only on 2 models with 2 tasks each and only training-free methods are evaluated.
- Evaluated models
- Qwen3.5-0.8BQwen3.8-27BGemma-4-31B-it
- Benchmarks
- PosteriorBenchWildChatWeirdChat
- Metrics
- capped forward KLreverse KLhit rate q(S)construction cost (number of inferences)per-sample cost
To address the problem that rare behaviors of language models are difficult to obtain efficiently through ordinary sampling, the researchers propose the PosteriorBench benchmark to evaluate the efficiency and fidelity of behavior posterior sampling algorithms. The benchmark sets 21 tasks on Qwen3.5-0.8B, with behavior probabilities ranging from 10^-5 to 10^-1, and provides exact posterior samples for each task based on a corpus of 1 billion labeled responses; algorithms are compared by compute cost and by forward and reverse KL divergence from the true posterior. The authors find that none of the evaluated methods is both efficient and faithful: simple methods such as prompting are low-cost but remain at a high KL divergence from the posterior; fine-tuning on posterior samples is often too costly; and several training methods from prior work do not perform better. The authors note that building a sampler that can approximate the true posterior at low cost remains an open problem, and the code and data are open-sourced on GitHub (https://github.com/TransluceAI/PosteriorBench)。
Paper analysis
What problem does this paper attempt to solve?
How to sample, at low cost, text that exhibits a specified rare behavior and whose distribution is close to the model's true posterior; the authors propose PosteriorBench to measure this.
Core question: given a language model and a target behavior, can one sample from the model's posterior distribution conditioned on "exhibiting that behavior" using relatively little compute (behavior posterior sampling problem)?
- Why it matters: The authors argue that a rare but harmful behavior can cause harm even from a single occurrence, and that after deployment the number of model calls and the diversity of inputs far exceed those at test time, so a behavior too rare to appear in testing may still occur after launch.
- Shortcomings of existing practice: Behavior evaluation usually relies on extensive sampling followed by automated tool checks; the rarer the behavior, the more impractical it is to collect enough samples. Several posterior sampling methods exist, but the authors state they have not been compared for behavior posterior sampling under equivalent settings.
- Core setup of the paper: The authors reduce the problem to its simplest form—fixed prompts and behaviors determinable by regular expressions—so that large numbers of true posterior samples can be labeled cheaply and collected; the authors argue that methods that perform poorly here will also struggle in harder settings, and state that the generalization experiments in Section 5 support this.
- What the paper proposes: The PosteriorBench benchmark, containing 21 tasks on Qwen3.5-0.8B with behavior probability p(S) from 10^-5 to 10^-1, each task having exact posterior samples from a corpus of a billion labeled responses; methods are compared by construction compute cost and by forward and reverse KL distance between samples and the true posterior.
What related research exists?
The paper compares posterior sampling methods such as controlled generation, GFlowNet, twist learning, and activation steering, and points out two differences among them in signal and evaluation.
Controlled Text Generation and f-Divergence Methods
- GDC (Khalifa et al., 2021)—fine-tunes the model during training on importance-weighted samples drawn from the model itself, approximating the target distribution.
- f-DPG (Go et al., 2023)—generalizes GDC's training objective from KL to other f-divergences; this paper evaluates its KL-DPG and JS-DPG variants.
GFlowNet and twist/SMC Methods
- GFlowNet fine-tuning (Hu et al., 2024)—for posterior sampling tasks such as infilling, trains the model to generate sequences with probability proportional to p(y)φ(y).
- Contrastive twist learning (CTL, Zhao et al., 2024a)—learns twist functions for sequential Monte Carlo, reweighting next-token probabilities toward the target.
- Adaptive Multilevel Twisted SMC (Liu et al., 2026)—trains CTL with classifier scores as a curriculum to estimate rare-event probabilities; this paper does not include it because it requires continuous scores.
Activation Steering and Rare Behavior Estimation
- Angell et al. (2026)—uses activation steering to build a sampler and performs importance sampling to estimate the probability of rare harmful outputs; this paper adapts its steering and composition methods.
- Zhao et al. (2024a) measured KL in both directions with exact posterior samples and found that fine-tuning on posterior samples like SFT is comparable to or better than CTL, but it compared only with soft-signal CTL and concluded that SFT is less efficient.
Two differences the authors point out
- This paper gives methods only binary labels per response, which the authors consider closest to actual use; most of the above work gives methods additional signals (classifier probabilities, likelihoods or judge scores), and such signals need to be designed specifically for each behavior.
- The authors say these works rarely measure the distance between the sampler and the posterior, how that distance changes with cost, or whether it is better than fine-tuning on posterior samples obtained by rejection sampling; GDC and f-DPG estimate divergence from the sampler's own samples, which may miss posterior regions the sampler rarely visits.
Baselines and benchmark: the baseline methods are SFT (fine-tuning on posterior samples obtained by rejection sampling) and its ablation Replay, as well as adapted GDC, f-DPG, GFlowNet, CTL and Angell et al.'s steering; data come from WildChat prompts and WeirdChat behaviors. The authors position this paper as a unified comparison of these methods under an equivalent, binary-label-only setting.
How does the paper address this problem?
PosteriorBench uses a billion labeled responses to obtain the exact posterior, measures cost in inference counts, measures fidelity with KL in two directions, and uniformly compares training and training-free methods.
Overall approach: reduce behavior posterior sampling to its simplest exactly evaluable form—fixed prompts, regex-determined behaviors, exact posterior samples obtained from a large model corpus as ground truth, and then compare, under a unified protocol, the gap between the sampler q constructed by each method and the true posterior pS.
Problem formalization and evaluation dimensions
- The target distribution is the behavior posterior pS(y) := p(y ∣ S) = p(y) 1[y ∈ S] / p(S), i.e., the conditional distribution of the model distribution p on event S.
- Sampler quality is characterized along three dimensions: cost per sample, hit rate q(S), and posterior fidelity (how close q's hit distribution qS is to pS).
- Fidelity is measured with forward KL (coverage) and reverse KL (realism); forward KL is sensitive to missing posterior regions, so a capped version is used: KLC(pS | qS) = Ey ∼ pS[min(log (pS(y))/(qS(y)), C)], C = 50.
- Threshold requirements: hit rate of at least 10%, cost per sample at most 2 times original model inference; samplers that fail the hit rate are scored as fallback δa.
Dataset construction
- Model and sampling: Qwen3.5-0.8B, responses at most 50 tokens, temperature 1, top-p = 1, thinking disabled.
- Prompts and behaviors: 20 randomly selected WildChat English first-turn short user messages × 7 regex-determined behaviors (em dash, Chinese characters, mentioning chatgpt, profanity, mentioning goblin, it's not X, it's Y construction, word repetition), 140 pairs in total.
- Exact posterior: sample 50 million responses per prompt and label all 7 behavior categories uniformly; 108 pairs have at least 500 hits (pb(S) relative standard error below 5%), and 250 hits are held out per pair as scoring reference.
- Task selection: for each behavior, take the three pairs with the lowest, median, and highest p(S), 21 tasks in total, with p(S) from 10^-5 to 10^-1.
Evaluation protocol
- Cost accounting: only inference counts on p and on samplers constructed from it are counted—generating one response, computing p(y) once, and one gradient forward pass each count once; the authors state this count differs from actual FLOPs by no more than a factor of two (Table 4), and external model calls such as writing candidate prompts are not counted.
- Four-step scoring (Figure 4): freshly sample 1024 responses from q to estimate the hit rate; below 10% is judged a failure and given the fallback score; otherwise compute p(y) and q(y) for the 250 reference hits and at most 128 q hits; estimate the two KLs from these.
- KLs are averaged with equal weight across tasks; Appendix A states that the comparison results are insensitive to the value of the cap constant C.
Evaluated methods (Table 1)
- Training methods: SFT (fine-tuning on corpus posterior samples), Replay (no training, sampling uniformly directly from the training set, to test whether SFT is merely memorization), GFlowNet, CTL, KL-DPG, JS-DPG, GDC.
- Training-free methods: Prompt selection (an LLM writes candidate system prompts, selected using EB-JC, hit rate, IWAE, or CE signals), Mixture: EB-16 (weighted mixture of at most 16 prompts by EB-JC score), Instruction (one fixed prompt per behavior), Steering (adding a steering vector at a selected layer and strength).
- Submission rule: candidates are first ranked by the selection signal, then a binomial hit-rate test is performed in order (rank 1 draws 164 responses, requiring 25 hits), and the first one that passes is submitted.
- Composition: following Angell et al. (2026), for the first L tokens of the response, the sampler's and the original model's next-token predictions are interpolated with 1−α and α, after which the original model completes the response; α ∈ {0, 0.25, 0.5, 0.75}, L ∈ {4, 16, 32, ℓ}.
What experiments did the paper conduct?
Comparing 12 classes of methods on 21 tasks: training-free methods stall at high KL, SFT catches up after about 10^6 inferences, and prior training methods are all no better than SFT.
Experimental Setup
- Models tested: the main benchmark is Qwen3.5-0.8B; generalization experiments use Qwen3.8-27B and Gemma-4-31B-it (2 tasks each, training-free methods only).
- Tasks: 21 prompt–behavior pairs, with p(S) from 10^-5 to 10^-1; 3 repetitions per task; Appendix C.2 rechecks the design questions on all 108 pairs (at least 500 hits).
- Methods: training-based SFT, Replay, GFlowNet, CTL, KL-DPG, JS-DPG, GDC; training-free Prompt selection (four signals), Mixture: EB-16, Instruction, Steering, and their respective composition versions.
- Metrics: capped forward KL (C = 50, coverage), reverse KL (realism), hit rate, construction cost (inference counts); error bars are one standard error across tasks.
- Determination method: behaviors are determined by regular expressions; LLM-judged behaviors are labeled by Gemma-4-31B-it according to the WeirdChat scoring criteria and reviewed by GPT-6 Sol, and a hit requires both to judge positive.
- Tuning: Steering and the four training methods are tuned on two prompt–behavior pairs outside the 21 tasks; SFT has no public recipe and is tuned by the same rule.
Main Results
The table below gives the conclusive numbers reported in Figure 5 and the main text; not all per-point values in Figure 5 are given in the text, so only results stated in the paper are listed.
Conclusion Numbers and conditions Source Training-free methods stall Almost no improvement after about 10^5 inferences, stalling at high KL Figure 5 SFT catches up to training-free methods After about 10^6 inferences Figure 5 Prior training methods vs SFT At large budgets, almost every prior method has higher KL in both directions than SFT at the same cost Figure 5 Only exception GFlowNet has lower reverse KL than SFT at the largest budget, but the gap is less than one standard error Section 4 Small-budget failure At small budgets, most training methods including SFT fail to pass the 10% hit-rate threshold Section 4 - The authors say that even in this simplest setting, no method is both compute-efficient and close to the posterior; training methods can break through the stalling of training-free methods, but at high cost.
- The authors report that the high KL of training methods mostly comes from failed runs on the rarest tasks (Appendix C.1); Steering's failures depend more on the behavior than on rarity (Appendix C.3).
- The authors consider SFT a strong baseline: on training sets of about 10^6, 2×10^6 and 4×10^6 inferences, SFT has lower KL in both directions than Replay on the same set for every task, showing that SFT does not merely return training samples.
Design Questions: Selection Signals, Mixtures and Composition
- Selection signals: among the four signals EB-JC, hit rate, IWAE and CE, the authors report EB-JC (estimating log p(S) − KL(qS ∥ pS)) works best; in Appendix C.2 on 108 pairs, EB-JC has the lowest KL in both directions for every K ≥ 2, and hit-rate selection is highest.
- Mixtures: Mixture: EB-16 lowers capped forward KL compared with selecting a single prompt, with reverse KL roughly unchanged; Appendix C.2 shows coverage barely changes beyond 16 components, and uniform weights increase reverse KL after more than 4 components.
- Composition: the authors report it lowers KL in both directions for every composed method, and methods with higher KL usually benefit more; on 108 pairs this holds for Instruction in all four p(S) intervals (Figure 14).
Generalization: Larger Models and LLM-Judged Behaviors
- Larger models: on 2 tasks each for Qwen3.8-27B and Gemma-4-31B-it, all training-free methods still have high KL (Figure 7); EB-JC is still the best selection signal, and composition still lowers both KLs for every composed method. One difference: Steering outperforms Instruction on Gemma-4-31B-it, which the authors explain by both behaviors on that model belonging to the behavior group on which Steering never fails in the main benchmark.
- LLM-judged behaviors: two WeirdChat behaviors (direct encouragement to kill oneself, p(S) = 2.24 × 10^-4; false claims of physical embodiment, p(S) = 8.60 × 10^-4), with responses up to 2048 tokens. Every method performs worse than on the main benchmark on both behaviors (Figure 8); one reason the authors give is that KL accumulates with tokens, so long responses naturally have larger KL.
- Failure cases: on direct encouragement, explicit instructions (Instruction) fail to pass the hit-rate threshold in every run; SFT is not yet effective within the given inference budget, and although it passes the threshold in every run, it relies only on checkpoints that have already overfit the training samples late in training (Appendix D).
Other Ablations and Analyses
- Submission-rule comparison (Table 7, 12 tasks, about 5×10^5 inferences): with the submission rule, each method's average KL is lower than or about equal to its own rule, e.g., GFlowNet drops from 25.51/58.06 under its own rule to 10.91/14.11 (forward/reverse KL).
- 1% hit-rate threshold (Table 8, about 5×10^5 inferences): SFT's average KL drops by more than half (forward 10.0→4.6, reverse 17.2→7.4) and remains the lowest; few failed runs of prior methods are rescued, with the exception that most failed runs of KL-DPG pass at 1%.
- Binned by p(S) (Figure 11, about 5×10^5 inferences): all failed runs of prior methods are on tasks with p(S) < 10^-2, most below 10^-4; SFT's lead is largest when p(S) is below 10^-3.
- Estimating p(S) (Appendix C.4): the lower the sampler's KL, the more accurate the estimate, and the method ranking is roughly the same as in Figure 5; the lowest error is 1.4 nats for SFT at the largest budget, and 1.2 nats with composition; the Spearman correlation of absolute log error with capped forward KL is 0.90 and with reverse KL is 0.85.
- Steering grouped by behavior (Appendix C.3): on 108 pairs, em dash, profanity, word repetition and Chinese characters never fail, while mentioning ChatGPT, mentioning goblin and contrastive sentence patterns always fail.
What are some points that can be further explored?
The authors point out two limitations—behavior coverage and the KL metric—and propose new directions; the main experimental benchmark is limited to a single small model, short responses and regular behaviors.
Limitations and future directions noted by the authors
- The benchmark behaviors are conceptually simple and easy to verify, but cannot represent all types of behavior; the authors state that methods performing poorly on the benchmark are generally unlikely to generalize, but may perform well on specific behaviors (Discussion).
- The benchmark ranks primarily by KL, and KL is a coarse measure; the authors state that the high KL observed indicates no method approaches the true posterior, but the practical usefulness of samples from different methods may still differ, and some downstream applications may need other measures (Discussion).
- The authors propose directions for new methods to explore: whether samplers can be trained on cheaply obtained off-policy samples while remaining faithful to the true posterior; whether the model's latent knowledge about the posterior can be better exploited beyond fine-tuning samples (Discussion).
- The authors release the full sampling corpus (including token IDs and labels), encouraging readers to build tasks for other behaviors from it (Discussion).
Scope of experiments
- The main benchmark evaluates a single model, Qwen3.5-0.8B, with responses limited to 50 tokens, behaviors limited to 7 categories determinable by regular expressions, 21 tasks, and 3 repetitions per task (Section 3).
- Generalization to larger models covers only 2 tasks each for Qwen3.8-27B and Gemma-4-31B-it, and evaluates only training-free methods; the authors explain this is because training is expensive at that scale (Section 5).
- There are only 2 LLM-judged behaviors, both taken from WeirdChat, using the same prompts; judging is labeled by Gemma-4-31B-it and reviewed by GPT-6 Sol (Section 5, Appendix D).
- Cost counts only inference counts on p and on samplers constructed from it; external model calls such as writing candidate prompts are not counted, and the authors state that the cost of these methods is underestimated (Section 3.3).
- The paper does not report wall-clock time for the construction process of each method; Appendix A gives only the ratio of GPU time to inference counts on one H100 (Table 4).
Summarize the main content of the paper
PosteriorBench uses exact posterior samples to uniformly evaluate behavioral posterior sampling methods; the authors say existing methods either stall at high KL or are costly.
An evaluation/benchmark paper that proposes PosteriorBench, studying the behavior posterior sampling problem: given a language model and a target behavior, sample from the model's posterior distribution conditioned on exhibiting that behavior using relatively little compute.
- Motivation: The authors argue that a rare harmful behavior can cause harm from a single occurrence, and that ordinary sampling is impractical when the behavior is rare; existing posterior sampling methods have not been compared with each other under equivalent settings.
- Benchmark design: On Qwen3.5-0.8B, sample 50 million responses for each of 20 WildChat prompts, label 7 behavior categories with regex, take 21 tasks with p(S) from 10^-5 to 10^-1, using exact posterior samples as reference; cost of construction is measured in inference counts, fidelity is measured with capped forward KL and reverse KL, and a hit rate of at least 10% is required.
- Main results: Training-free methods (prompt selection, fixed instructions, steering vectors) plateau at high KL after about 10^5 inferences; SFT catches up after about 10^6 inferences but at high cost; GFlowNet, CTL, GDC, KL-DPG, and JS-DPG are all no better than SFT, with the only exception being GFlowNet at the largest budget, where reverse KL is slightly lower and the gap is less than one standard error (Figure 5).
- Design conclusions: The authors report that EB-JC is the best candidate selection signal; weighting and mixing 16 prompts by EB-JC score lowers forward KL; composition lowers KL in both directions for each combined method; these conclusions also hold on all 108 prompt–behavior pairs.
- Generalization: On 2 tasks each for Qwen3.8-27B and Gemma-4-31B-it, training-free methods still have high KL; on the two LLM-judged WeirdChat behaviors all methods are worse than on the main benchmark, and explicit instructions on direct encouragement fail the hit-rate threshold on every run.
- Authors' conclusion: Behavior posterior sampling remains an open problem—the methods closest to the posterior still require extensive sampling of the model to find behavior samples, which is exactly the cost that posterior sampling aims to avoid; the authors hope PosteriorBench can continuously measure progress toward "cheap and faithful" samplers.