Semantic Pushforward Uncertainty Head
Implementation & benchmark of arXiv:2607.17447 — Calibrating Semantic Uncertainty from Observable Language-Model Probabilities
Source paper: Calibrating Semantic Uncertainty from Observable Language-Model Probabilities arXiv:2607.17447 ⓘ · analyzed Aug 30, 2026
AI-generated research hypothesis, automatically tested. Not peer-reviewed.
Idea description
Convert an LM's probabilities over a controlled set of verbal continuations into probabilities over application states using a fixed semantic map, then calibrate the resulting state vector on held-out labeled examples. This replaces unconstrained verbal confidence with an auditable posterior estimate whose error can be directly evaluated.
Formulas
Mathematical statement
The paper defines the semantic pushforward of a continuation probability measure by $(\phi_{\#}Q_{u})(B\mid C_{u}(y))=Q_{u}(\phi^{-1}(B)\mid C_{u}(y))$, where $y$ is evidence, $u$ is a presentation or prompt rule, $C_u(y)$ is the resulting LM context, $Q_u(\cdot\mid C_u(y))$ is the probability measure over complete verbal continuations $\mathcal R$, $\phi:\mathcal R\to\mathcal X_0$ maps each continuation to a declared state, and $B$ is a measurable subset of the target state space $\mathcal X_0$. For finite states $\{x_1,\ldots,x_K\}$ and a deterministic map, this becomes $p_j(y,u)=\sum_{r:\phi(r)=x_j}Q_u(\{r\}\mid C_u(y))$. The paper evaluates the resulting distribution against a reference posterior using total variation $d_{\rm TV}(\mu,\nu)=\sup_A|\mu(A)-\nu(A)|$; on finite states, $d_{\rm TV}(p,q)=\frac12\sum_{j=1}^K|p_j-q_j|$. We add a calibration map $g_\theta$ from raw semantic probabilities $p$ to a calibrated posterior $\hat\pi$.
Implementation notes
Integrate this at inference time between the LM's generation probabilities and the application decision layer. First define a finite state set $x_1,\ldots,x_K$, such as {urgent, non-urgent} or {up, flat, down}, and a finite response grammar containing several semantically equivalent verbal continuations for each state. Store a deterministic map $\phi(r)$ assigning every allowed response $r$ to exactly one state; route malformed responses to an additional abstain state. Given evidence $y$ and prompt template $u$, run the transformer with constrained decoding or enumerate a small candidate response set. Compute each response probability by summing token log-probabilities, normalize over the allowed set, and aggregate with p[j] += prob[r] whenever phi[r] == j, which implements the pushforward formula. Fit calibration parameters $(a_j,b_j)$ on a held-out dataset of evidence-state pairs by minimizing multinomial negative log likelihood with a ridge penalty; use $\hat\pi=\operatorname{softmax}(a\odot\log(p+\varepsilon)+b)$ at test time. Measure held-out negative log likelihood, Brier score, expected calibration error, prediction-set coverage, and finite-state total variation to known labels or reference posteriors. The first experiment should use a 2B-7B open model on a three-way synthetic classification task with exact Bayesian posteriors, comparing raw verbal probabilities, printed confidence, and the semantic head. Success is lower total-variation error and valid 90% prediction-set coverage with less than one extra forward pass.
Verification
Stage 1 · Toy mechanism gate: Passed ✓
Stage 2 · Mechanism transferred to benchmark: Confirmed ✓
Stage 2 · Practical benchmark result: No measurable effect
Methodology: 8 paired seeds, permutation test (p<0.05) against a learning-rate-tuned baseline. How verification works
Stage 1 — Mechanism check agent confidence 8/10
Built a finite-state semantic pushforward and calibrated uncertainty head MVP. The core aggregation identity was exact up to floating-point error, and synonym redistribution preserved state probabilities. Across gamma values 0.5–2.0, fitted calibration slopes satisfied gamma*a approximately 1 (0.916–1.026), while calibration substantially reduced posterior TV and ECE; this confirms the proposed mechanism in the controlled synthetic setting.
- Agent confidence
- 8/10
- Baseline
- At gamma=2.0: NLL 0.8894, Brier 0.4904, TV 0.1420, ECE 0.1324, 90% set coverage 0.8884.
- Idea
- At gamma=2.0: calibrated NLL 0.7791, Brier 0.4599, TV 0.0070, ECE 0.0175, 90% set coverage 0.9680; pushforward and synonym-splitting errors were 0.0 and 1.11e-16.
Limitations: This is a controlled synthetic experiment rather than a transformer integration: candidate response probabilities are generated analytically, not obtained from token log-probabilities. It does not test prompt sensitivity, malformed LM outputs in practice, real semantic-map errors, compute overhead, or calibration transfer under distribution shift; the optimizer reported non-success despite converging to useful parameters for gamma 0.5 and 2.0.
How to run: python3 experiment.py
Stage 2 — Benchmark vs. tuned baseline (arXiv:2607.17447)
No significant difference vs. the tuned baseline (−-0.0%, p=1, wins 5 / 8 paired seeds).
- Benchmark
- Semantic_pushforward_classification
- Model
- mlp_tiny
- Paired seeds
- 8
- Baseline mean
- 0.2784
- Idea mean
- 0.2784
- Effect (Δ)
- 0 (−-0.0%; negative = idea better)
- Wins
- 5 / 8 paired seeds
- p-value
- 1 (permutation test, 20 000 shuffles)
- Smallest detectable effect
- ±1.1%
- Mechanism
- Confirmed ✓
- Practical effect
- No effect
- Baseline tuning
- swept over 9 configs
This custom benchmark uses synthetic evidence and response logits rather than a real language model with token-level constrained decoding, malformed generations, prompt sensitivity, or semantic-map errors. The primary bench metric is classification error, so calibration benefits may not appear in it; NLL, Brier score, ECE, prediction-set coverage, compute overhead, and distribution-shift calibration were not included in the final harness report. The baseline and idea share the same trained response architecture and differ only by the calibration head, while the full baseline sweep covered nine configurations and the idea evaluated the same temperature and learning-rate union at three settings.
How to run: python3 run_bench.py
Verdict computed by deterministic test code from paired-seed statistics — not by the language model.
Stage 2 — Benchmark latest Failed ✗
Agent confidence: 9/10
Built and benchmarked an end-to-end semantic pushforward system using a shared MLP backbone, nine response continuations, deterministic state aggregation, and trainable calibration parameters. The exact pushforward checks passed, and trained models showed conserved state mass (mean error 1.19e-7) plus a nontrivial calibration change, confirming the mechanism signature. However, eight paired seeds produced identical mean test error for baseline and idea (0.2784375), delta 0.0, permutation p=1.0; therefore the idea did not improve the standard task metric.
- Baseline
- Test classification error mean 0.2784375, std 0.0445452; best config lr=0.003, temperature=1.0, epochs=18, weight_decay=0.
- Idea
- Test classification error mean 0.2784375, std 0.0458758; selected cfg lr=0.003, temperature=1.0, epochs=18, weight_decay=0. Idea wins on 5/8 seeds but paired delta is 0.0 and p=1.0.
- Mechanism signature
- Confirmed: aggregation error 0.0, mass conservation error 4.44e-16 in the direct check; trained-model observed mass error mean 1.19e-7, calibrated-vs-raw probability difference 0.00750, learned calibration slopes [1.0525, 1.0695, 1.0371].
- Paired delta
- 0.0 lower-is-better error units; permutation p-value 1.0; verdict no measurable effect
Benchmark result
No significant difference vs. the tuned baseline (−-0.0%, p=1, wins 5 / 8 paired seeds).
- Benchmark
- Semantic_pushforward_classification
- Model
- mlp_tiny
- Paired seeds
- 8
- Baseline mean
- 0.2784
- Idea mean
- 0.2784
- Effect (Δ)
- 0 (−-0.0%; negative = idea better)
- Wins
- 5 / 8 paired seeds
- p-value
- 1 (permutation test, 20 000 shuffles)
- Smallest detectable effect
- ±1.1%
- Mechanism
- Confirmed ✓
- Practical effect
- No effect
- Baseline tuning
- swept over 9 configs
This custom benchmark uses synthetic evidence and response logits rather than a real language model with token-level constrained decoding, malformed generations, prompt sensitivity, or semantic-map errors. The primary bench metric is classification error, so calibration benefits may not appear in it; NLL, Brier score, ECE, prediction-set coverage, compute overhead, and distribution-shift calibration were not included in the final harness report. The baseline and idea share the same trained response architecture and differ only by the calibration head, while the full baseline sweep covered nine configurations and the idea evaluated the same temperature and learning-rate union at three settings.
How to run: python3 run_bench.py
Artifacts
- README.md 1.4 KB View
- bench_report.json 4.1 KB View Raw
- experiment.py 4.9 KB View Raw
- report.md 1.5 KB View
- report_bench_2026-08-31T120042.md 6.0 KB View
- results.json 4.6 KB View Raw
- run_bench.py 4.8 KB View Raw
- semantic_track.py 1.0 KB View Raw