Discrete Diffusion vs. Autoregression
1. The Bottleneck of Autoregressive LLMs
Section titled “1. The Bottleneck of Autoregressive LLMs”Standard Large Language Models (LLMs) operate under a sequential autoregressive factorization:
Each forward pass generates exactly one token. Even if the model only needs to output a single boolean decision or three fields of a JSON object:
- It must sequentially predict structural characters (
{,\n,",k,e,y,",:,). - It suffers from high memory bandwidth pressure: loading billions of parameters from memory to compute a single token’s logits.
- It takes dozens or hundreds of forward passes (2–17.5 seconds across cloud or consumer GPUs).
2. Discrete Block Diffusion & Multi-Canvas Sampling
Section titled “2. Discrete Block Diffusion & Multi-Canvas Sampling”DiffusionGemma (dgemma) breaks this sequential bottleneck by using discrete block diffusion:
- Block-Autoregressive Canvas: The decoder works on a 32-to-256-token canvas with bidirectional self-attention.
- Iterative Denoising: The entire block of tokens begins as masked slots and is denoised in parallel across a single pass (
steps: 1,think: 0) or a small number of steps. - Joint Multi-Slot Conditioning (
slot_1 <-> slot_2): Unlike independent classification heads, all masked decision slots attend to the prompt and to each other simultaneously in forward passes (458.9 mson Cloud Run 1×L4).
3. How Discrete Diffusion Slot Readout Works
Section titled “3. How Discrete Diffusion Slot Readout Works”In a structured decision query (steps: 1, think: 0), no conversational prose is generated:
- Canvas Seeding: The known policy template (e.g.
urgent: @\nteam: @\nsentiment: @) is pre-seeded into the canvas, where@represents masked tokens at the candidate decision slots. - Single-Pass Readout: A single forward pass executes across the causal prompt prefix and bidirectional canvas (~458–880 ms).
- Restricted-Softmax Logit Readout: Rather than decoding free-form text, the engine extracts the raw logits restricted to the valid single-token candidate vocabulary (
{"yes","no"}forboolean,[A–Z]forchoice,1..5forscore) and normalizes via softmax:
Seeded Canvas:[<|channel>thought\n<channel|>urgent: @ \nteam: @ \nsentiment: @ ] ▲ ▲ ▲ Slot 1 Slot 2 Slot 3 [p(yes), p(no)] [p(A)..p(Z)] [p(1)..p(5)] |V_1| = 2 |V_2| = 26 |V_3| = 54. Empirical Uncertainty & Cardinality-Normalized Entropy (EXP-05b)
Section titled “4. Empirical Uncertainty & Cardinality-Normalized Entropy (EXP-05b)”Single-pass restricted-softmax readout provides calibrated epistemic uncertainty at every decision slot :
- Raw Shannon Entropy ():
- Cardinality-Normalized Epistemic Entropy (): Because maximum entropy scales logarithmically with option count ( for binary
booleanvs. for 26-waychoice),dgemnormalizes each slot’s entropy by its theoretical ceiling :
💡 Concept Aside: Why does Raw Entropy ($H_m$) cause "Multi-Slot Scale Inversion" without $\ln|\mathcal{V}_m|$ normalization? (click to expand)
- In Plain English: A 26-option banking classifier naturally leaks tiny probability crumbs across 25 runner-up classes even when it is 88.6% confident and right, inflating its raw entropy (
0.516 nats). Meanwhile, a 3-option NLI slot (entailment/neutral/contradiction) has a tiny maximum ceiling (1.099 nats), so a massive 3.3× epistemic spike (0.246 nats) looks smaller in raw nats than the 26-way slot! - How Fixes It: Dividing by puts every slot onto a universal uncertainty scale (
--normalize-entropy --cascade-threshold 0.16):b77-01(Banking77, , Correct Pass-1): Early-Exits in754 ms!anli-01&anli-02(ANLI-R3, , Adversarial Traps): and Both Escalate to Stage 2 (0% -> 100%)!
- Full Reference: See Experiment
EXP-05band the Glossary entry on Multi-Slot Scale Inversion.
- Adaptive Sampling & Prior-Guided Escalation:
- Low Normalized Entropy (,
66%of suite): The decision is decisive.dgemearly-exits immediately after 1 forward pass (712 msmean latency) with 100.0% early-exit precision (33/33). - High Normalized Entropy (,
34%of suite):dgemforwards the Pass-1 Slot Prior Distribution ([TIER-1 DISCRETE DIFFUSION PRIOR TELEMETRY]) to Stage 2—either an Intra-Model Self-Cascade (--cascade-self-think 256on the samedgemmaGPU) or a Cross-Model Cascade (gemini-3.8-flash), lifting overall accuracy from86.0%98.0%(49/50).
- Low Normalized Entropy (,
How dgem Computes Confidence & Entropy from Template Logprobs (Step-by-Step)
Section titled “How dgem Computes Confidence & Entropy from Template Logprobs (Step-by-Step)”In standard autoregressive LLM pipelines, estimating whether the model is confident on a custom task—without generating long Chain-of-Thought rationales or running Monte Carlo rollouts (self-consistency)—multiplies token costs by orders of magnitude.
dgem avoids that token-cost explosion by turning your .json.tmpl policy into a single-token logprob tie-detector across 4 concrete steps:
- Step 1 — Map User-Supplied Classes to Single Letters (
A,B,C…) in the Prompt: When you define custom classes in a template (even for a domain not in the model’s training distribution),dgemformats them into a single-letter legend in the prompt prefix and places one masked blank (@) per question on the diffusion canvas:Prompt Prefix:Slot 'intent' options:A = billing_disputeB = account_compromiseC = feature_requestSeeded Diffusion Canvas (1 token per slot):intent: @ - Step 2 — Run 1 Forward Pass (
think=0) & Readlogprobsof Only Those Letters: Instead of generating free-form text,dgemexecutes 1 forward pass (~460–712 ms) and inspects the raw token logits at that exact@blank. It discards the other ~255,997 words in the vocabulary and runs a softmax strictly over the valid letters (A,B,C) you supplied: (For numericscoreslots like1..5, it does the exact same thing over the digit tokens'1'..'5', computing the weighted average and spread from those 5 probabilities). - Step 3 — Measure Whether the Top Letters Are in a Close Race ():
- If the restricted probabilities are
{A: 97.5%, B: 1.5%, C: 1.0%}, letterAdominates (). We takeAimmediately and pay zero generation tokens. - If the restricted probabilities are
{A: 54.0%, B: 42.0%, C: 4.0%}, the model’s attention is torn betweenAandB().
- If the restricted probabilities are
- Step 4 — Divide by to Scale the “Tie Meter” from
0.0to1.0(): Why can’t we use the same raw entropy cutoff () for a 2-choiceyes/noquestion and a 26-choiceA..Zquestion? Because a flat dead tie between 2 choices has a maximum entropy of , while a flat tie between 26 choices has a maximum entropy of . Dividing by : scales our “tie meter” onto0.0(one letter dominates) to1.0(dead tie) regardless of how many classes you put in your template. When ,dgemescalates the query to a reasoning pass (think > 0or Tier-2 LLM) and passes along the Pass-1 letter breakdown ({A: 54%, B: 42%}) so the reasoning model knows which two candidates to disambiguate.
5. Architectural FAQ: Can Dual-Encoders (GTR) + TabPFN Replace a Decision Model, or Do You Need Test-Time Compute?
Section titled “5. Architectural FAQ: Can Dual-Encoders (GTR) + TabPFN Replace a Decision Model, or Do You Need Test-Time Compute?”Engineers from search, retrieval, and tabular ML backgrounds frequently ask a foundational design question:
“Could the goal of a fast, reasoning-capable classifier be achieved without a generative model—specifically by pairing a GTR-style Dual Encoder (
Sentence-T5) with a TabPFN / TabFM zero-shot tabular classification foundation model? Or do you strictly need a decoder and test-time compute (think > 0) to pull off reasoning?”
The Operative Decoder Ring (5 Core Concepts in Plain English)
Section titled “The Operative Decoder Ring (5 Core Concepts in Plain English)”For readers arriving from different specialties (Platform Engineering, Search/Retrieval, or LLM Infrastructure), here is how the five architectural terms map to plain English:
| Term | 10-Word Plain-English Mental Model | Canonical Example |
|---|---|---|
Dual Encoder (GTR / T5) | Compresses input and label into two separate vectors, then compares. | Semantic search & topical intent (Banking77 similarity). |
Tabular FM (TabPFN / TabFM) | Predicts a spreadsheet column by attending to labeled example rows. | Few-shot classification over numerical/embedding feature grids. |
Cross-Attention Canvas (dgem) | Every input word directly inspects every policy rule and slot. | Zero-shot AgentDrift security audit & LLM-AggreFact grounding. |
| Normalized Entropy () | A universal 0.0–1.0 uncertainty gauge adjusted for option count. | Early-exiting b77-01 () while escalating anli-01 (). |
Test-Time Compute (think > 0) | Scratchpad tokens generated only when a problem needs multi-step math. | Solving 2015 + 4 = 2019 > 2018 in anli-02 (--cascade-self-think 256). |
💡 Concept Aside: Late Interaction (`GTR` Pooling Bottleneck) vs. Early All-to-All Cross-Attention (`dgem`) (click to expand)
1. GTR Dual-Encoder + TabPFN (Late Interaction / Vector Bottleneck): Input Text (1,000 tokens) ──► [T5 Encoder] ──► Single Vector u (R^768) ──┐ ├──► [TabPFN Grid] ──► Prediction Policy Rules / Labels ──► [T5 Encoder] ──► Label Vectors v_k ──┘ ⚠️ Bottleneck: Input tokens never attend to Policy tokens! Fine-grained numbers, negations ("NOT in allowlist"), and variable bindings are crushed during pooling.
2. DiffusionGemma Canvas Readout (Early Token-Level Cross-Attention): [Policy Rules (.json.tmpl) + Input Text (1,000 tokens) + Masked Slots <s_1, s_2, s_3>] │ ┌────────────────────────┴────────────────────────┐ │ All 26B-A4B Layers: Every token in Input, │ │ Policy, and Slots <s_1 <-> s_2> mutually attend │ └────────────────────────┬────────────────────────┘ ▼ Joint Calibrated Readout (458.9 ms)- Why Normalization +
TabPFNCannot Undo Pooling Loss: By the Data Processing Inequality, once compresses a multi-clause passage or tool trajectory into a fixed vector , information about which specific quantifier modifies which entity is lost.TabPFNis a powerful Bayesian decision boundary estimator over tabular columns, but it can only partition the features it is given—and it requires in-context labeled support rows (), whereasdgemexecutes declarative.json.tmplpolicies with zero support rows ().
💡 Concept Aside: Why Fixed-Depth Circuits (`think=0`) Cannot Solve Latent Multi-Hop Arithmetic Without Test-Time Compute (`think > 0`) (click to expand)
- The Circuit-Depth Bound (): Any single forward pass through a transformer of fixed depth (
GTR,DeBERTa,TabPFN, ordgemmaatsteps=1, think=0) executes a constant number of sequential layer operations. - Concrete Proof (
anli-02indgem bench-calibration):- Premise: “Mira joined the lab in 2015 and became its second director four years later, succeeding the founder.”
- Hypothesis: “Mira led the lab before 2018.”
- Notice that the number
2019never appears in the input tokens! To recognize the contradiction, the model must (1) bind2015+four years later, (2) compute the latent sum2019, and (3) evaluate2019 < 2018(Falsecontradiction).
- Why
dgemSolves This Without Slowing Down Easy Traffic: In Pass 1 (think=0),dgemmaoutputsentailment, but its normalized epistemic entropy spikes 3.0× above baseline to0.224()! That spike triggers Pass 2 (think > 0with the Pass-1 prior block), which computes2015 + 4 = 2019on its scratchpad and flips the answer tocontradiction(100%3/3onANLI-R3).
Architectural Comparison Matrix
Section titled “Architectural Comparison Matrix”| Capability / Dimension | GTR Dual-Encoder + TabPFN / TabFM | Fine-Tuned Cross-Encoder (DeBERTa-v3) | dgem Single-Pass Canvas (steps=1, think=0) | dgem Prior-Guided Cascade (EXP-05b, think=0 → think>0) |
|---|---|---|---|---|
| Token-to-Policy Cross-Attention | ❌ No (Late pooling into ) | ✅ Yes (Full cross-attention) | ✅ Yes (Full 26B-A4B cross-attention) | ✅ Yes (Full 26B-A4B cross-attention) |
| Zero-Shot Policy Onboarding | ⚠️ Partial (TabPFN requires support rows) | ❌ No (Requires fine-tuning per head) | ✅ Yes (0 s via .json.tmpl, rows) | ✅ Yes (0 s via .json.tmpl, rows) |
Joint Multi-Slot Readout (s_1 <-> s_2) | ❌ No (1 target column per pass) | ❌ No (Independent linear heads) | ✅ Yes (boolean + choice + score in 1 pass) | ✅ Yes (boolean + choice + score in 1 pass) |
1-Hop Relational Grounding (AgentDrift, AggreFact) | ⚠️ Brittle (Pooling loses parameter/negation scope) | ✅ Strong (If fine-tuned on domain) | ✅ 100.0% (7/7 AgentDrift, 2/2 AggreFact) | ✅ 100.0% (7/7 AgentDrift, 2/2 AggreFact) |
Latent Multi-Hop Arithmetic (ANLI-R3 anli-01..03) | ❌ Fails (Fixed circuit depth, no scratchpad) | ❌ Fails (Fixed circuit depth, no scratchpad) | ❌ 0.0% (0/3) (Single-pass limit) | ✅ 100.0% (3/3) ( triggers think>0 + Priors) |
| Overall 50-Case Calibration Suite Accuracy | — | — | 86.0% (43/50) | 98.0% (49/50) ⭐ |
| Mean Wall-Clock Latency (Cloud Run L4) | ~15–45 ms | ~15–30 ms | 712 ms (458.9 ms 3-slot triage) | 1,259 ms blended (66% exit @ 712 ms) |
6. Terminology: Discrete Diffusion Slot Readout vs. “Jev-Style”
Section titled “6. Terminology: Discrete Diffusion Slot Readout vs. “Jev-Style””In community discourse and open-source benchmarks (such as open-jev and vLLM PR #57250), single-pass canvas evaluation was informally termed “Jev-style” following commercial evaluations published by startup TypeSafe AI.
From a computer science and machine learning perspective, the formal technique is Discrete Diffusion Slot Readout (or bidirectional masked logit extraction). It builds directly upon foundational literature:
- Masked Language Modeling (BERT, 2018): Evaluating logits across bidirectional transformer encoder layers.
- Non-Autoregressive Sequence Generation (Mask-Predict, 2019): Parallel canvas denoising.
- Discrete Denoising Diffusion (D3PM, 2021; MDLM, 2024): Denoising categorical state spaces.
- DiffusionGemma (Google DeepMind, 2025/2026): The 26B-A4B MoE architecture providing an autoregressive prefix encoder paired with a discrete diffusion decoder with bidirectional attention.
dgem uses stock, unmodified weights from Google DeepMind (google/diffusiongemma-26B-A4B-it) and implements this technique directly.