Skip to content

Glossary & Mental Models

New to DiffusionGemma (dgem)? Because dgem sits at the intersection of Classical Search/Tabular ML, Formal Language Automata, and Discrete Diffusion Generative Models, engineers arriving from different specialties often bring different terminology for overlapping ideas.

Use this page as a Decoder Ring to translate between disciplines.


1. Quick-Start Mental Model Matrix (By Reader Background)

Section titled “1. Quick-Start Mental Model Matrix (By Reader Background)”
If You Come From…Think of dgem (steps=1, think=0) As…Think of .json.tmpl Templates As…Think of EXP-05b Entropy Cascade As…
Software / Platform EngineeringA sub-second (~460–712 ms) type-safe RPC call that returns guaranteed JSON booleans, enums, and scores without hallucinated syntax.Policy-as-Code (like OpenPolicyAgent .rego or JSON Schema, but for semantic natural language & code rules).An automatic circuit breaker that routes 66% of easy traffic on the fast path (712 ms) and escalates 34% of hard edge cases.
Search, Ranking & Tabular ML (GTR, DeBERTa, TabPFN)A zero-shot multi-head Cross-Encoder where all target heads (slot_1 <-> slot_2) mutually attend in 1 forward pass with zero training rows (N=0N=0).A declarative classification head compiler—changing a label set takes 0 seconds instead of relabeling + retraining.A scale-invariant Selective Prediction / Abstention Gate ($\tilde{H}_m = H_m / \ln
LLM / GenAI Infrastructure (vLLM, CoT)Replacing an O(L)O(L) sequential token generation loop with an O(1)O(1) parallel block-diffusion logit readout over masked slot positions.Constrained single-token decoding ([A–Z], yes/no, 1..5) evaluated simultaneously across all slots.Adaptive Test-Time Compute (think=0 -> think>0): only spending reasoning scratchpad tokens when Pass-1 epistemic entropy spikes.

  • In Plain English: Reading the exact probability of every valid answer (yes/no, AZ, 15) directly from masked blanks in a single forward pass instead of generating words one by one.
  • Under the Hood: Given a causal prompt prefix and a seeded canvas containing masked slot positions s1,,sM\langle s_1, \dots, s_M \rangle, the engine runs 1 denoising step (steps=1, think=0), slices the raw vocabulary logits zm,kz_{m,k} restricted to the valid single-token options kVmk \in \mathcal{V}_m, and normalizes via softmax.
  • Where You See It in dgem: pkg/client/client.go (ParseStructuredContentWithLogprobs) and structured_server.py.
  • In Plain English: Every input word directly inspects every policy rule and every decision blank—and the decision blanks inspect each other simultaneously (slot_1 <-> slot_2).
  • Under the Hood: Standard LLM decoders apply a lower-triangular causal mask (tt can only see <t<t). DiffusionGemma uses a hybrid attention mask (TRITON_ATTN in vLLM): causal over the prompt prefix (for KV-cache reuse) and all-to-all bidirectional over the 256-token diffusion canvas.
  • Where You See It in dgem: Enables joint 3-slot triage (urgent + team + sentiment) in 458.9 ms (EXP-01).
  • In Plain English: A declarative JSON file where you define decision questions (boolean, choice, score) and natural-language rubrics that execute immediately with zero model training.
  • Under the Hood: Go text/template files compiled by dgem decide -t into structured slot schemas and single-token option maps ([A–Z]).
  • Where You See It in dgem: templates/ (templates/calibration/*.json.tmpl, templates/secops_conditional_dag.json.tmpl).

Conditional Policy DAG (depends_on & ask_if)

Section titled “Conditional Policy DAG (depends_on & ask_if)”
  • In Plain English: A multi-stage decision flowchart where follow-up questions are only evaluated if an upstream gate question resolves to true (or a specific option).
  • Under the Hood: Topological sorting in pkg/schema partitions questions into stages. If Stage 1 (is_prompt_injection) evaluates to false, downstream forensic slots are pruned in 1 pass (682 ms), saving 50% of compute on benign traffic.
  • Where You See It in dgem: Experiment EXP-06.

Relative Tie-Detection vs. Target-Domain Probability Calibration

Section titled “Relative Tie-Detection vs. Target-Domain Probability Calibration”
  • In Plain English: dgem’s single-pass logprob scores tell you whether the model is torn between your template choices (relative routing ambiguity), not the real-world base rate of how often a class appears in your database.
  • Why This Matters: True statistical calibration (P(Gold=Ap^=0.80)=0.80P(\text{Gold}=A \mid \hat{p}=0.80) = 0.80) depends on the target environment’s class prior Ptarget(Y)P_{\text{target}}(Y) and always requires post-hoc target data (Platt scaling, temperature scaling, or conformal prediction). What dgem provides zero-shot in 1 forward pass is a tie-detector over the user-supplied option letters (A..Z)—eliminating the 10×50×10\times\text{–}50\times token-cost multiplier of multi-sample autoregressive confidence rollouts.

Distributional Discrete Regression (score Slots)

Section titled “Distributional Discrete Regression (score Slots)”
  • In Plain English: Turning continuous regression (like a 1..5 severity score) into a probability histogram over discrete levels so that classification confidence and regression variance come out of the exact same softmax formula.
  • Under the Hood: Instead of a point-estimate MSE head or quantile pinball loss, dgem evaluates the restricted-softmax probabilities pm,1,,pm,Lp_{m,1}, \dots, p_{m,L} over the discrete numeric bins v1,,vLv_1, \dots, v_L (pkg/client/client.go), yielding the continuous expected value E[v]=kvkpm,k\mathbb{E}[v] = \sum_k v_k p_{m,k}, ordinal variance Var(v)=kpm,k(vkE[v])2\text{Var}(v) = \sum_k p_{m,k}(v_k - \mathbb{E}[v])^2, and normalized entropy H~m=H(p)/lnL\tilde{H}_m = H(p) / \ln L in 1 pass.
  • Where You See It in dgem: Every score primitive in .json.tmpl templates (sentiment, risk_score, severity).
  • In Plain English: A universal 0.0 to 1.0 uncertainty meter that adjusts for how many answer choices a question has (2 options vs. 26 options).
  • Under the Hood: Raw Shannon entropy Hm=kVmpm,klnpm,kH_m = -\sum_{k \in \mathcal{V}_m} p_{m,k} \ln p_{m,k} has a theoretical maximum of lnVm\ln|\mathcal{V}_m| (0.693 nats for binary vs. 3.258 nats for 26-way choice). Dividing by lnVm\ln|\mathcal{V}_m| yields the dimensionless normalized entropy: H~m=HmlnVm[0,1]\tilde{H}_m = \frac{H_m}{\ln|\mathcal{V}_m|} \in [0, 1]
  • Where You See It in dgem: --normalize-entropy --cascade-threshold 0.16 in dgem bench-calibration (cmd/bench_calibration.go).
  • In Plain English: The bug that happens when you apply a single raw entropy cutoff (like 0.35 nats) to questions with different numbers of choices—causing confident 26-choice questions to falsely escalate while uncertain 3-choice questions slip through!
  • Under the Hood: On b77-01 (Banking77, V=26|\mathcal{V}|=26), tiny residual probabilities across 25 classes yield H=0.5162 natsH = 0.5162\text{ nats} even when dgemma is 88.6% confident and right (H~=0.158<0.160\tilde{H} = 0.158 < 0.160). Meanwhile, on anli-01 and anli-02 (V=3|\mathcal{V}|=3), entropy spikes 2.5×–3.3× above baseline to H=0.1847H = 0.1847 and 0.2464 nats0.2464\text{ nats}—which is below 0.35 nats in raw units, but above 0.160 once normalized by ln(3)\ln(3) (H~=0.168\tilde{H} = 0.168 and 0.2240.224).
  • Where You See It in dgem: Solved in Experiment EXP-05b, lifting ANLI-R3 from 33.3% \to 100.0% (3/3).
  • In Plain English: Handing Stage 2 not just the original question, but also Stage 1’s exact probability breakdown ({entailment: 94.2%, neutral: 4.9%, contradiction: 0.9%}) as a diagnostic clue to double-check.
  • Under the Hood: formatTier1PriorBlock (cmd/bench_calibration.go) injects [TIER-1 DISCRETE DIFFUSION PRIOR TELEMETRY] sorted by restricted-softmax probability descending, acting as a cognitive counter-anchor that forces Stage 2 to verify why dgemma’s entropy spiked before committing to a label.
  • Where You See It in dgem: benchmarks/results_calibration_cascade_normalized.json (98.0% overall accuracy, 49/50).

  • In Plain English: A bi-encoder architecture that compresses the input text into one vector uu and the label description into another vector vkv_k independently, then compares the two vectors at the very end.
  • Under the Hood: Because u=Ex(x)Rdu = E_x(x) \in \mathbb{R}^d is computed before the model sees the policy rules or hypothesis ckc_k, token-to-token alignment (like checking whether a specific SQL argument matches an allowlist or comparing 50–75% against 100%) is lost during vector pooling (Late Interaction Bottleneck).
  • Where You See It in dgem: Contrasted with dgem’s early all-to-all cross-attention in Discrete Diffusion vs. Autoregression (§5).
  • In Plain English: A foundation model pre-trained on millions of synthetic spreadsheets that predicts a missing target column by attending across labeled example rows (in-context learning for tables).
  • Under the Hood: TabPFN approximates Bayesian posterior inference P(ytestXtest,Xtrain,ytrain)P(y_{\text{test}} \mid X_{\text{test}}, X_{\text{train}}, y_{\text{train}}) in a single forward pass. However, it requires labeled support rows (Nsupport>0N_{\text{support}} > 0) in its context window and operates on pre-extracted tabular columns—meaning pairing GTR + TabPFN still suffers from GTR’s pooling bottleneck and cannot compile zero-shot (N=0) natural-language .json.tmpl policies.

Fixed-Depth Circuits (TC0\mathsf{TC}^0) vs. Test-Time Compute

Section titled “Fixed-Depth Circuits (TC0\mathsf{TC}^0TC0) vs. Test-Time Compute”
  • In Plain English: Why a single forward pass (think=0) can verify direct relational facts in 712 ms, whereas multi-step mental arithmetic (2015 + 4 = 2019 > 2018) requires generating scratchpad tokens (think > 0).
  • Under the Hood: A transformer with fixed layer depth LL and no scratchpad generation (think=0) is bounded by the circuit complexity class TC0\mathsf{TC}^0. When a contradiction depends on an intermediate state not present in the input text (anli-02’s latent year 2019), test-time compute (--cascade-self-think 256 or Tier-2 reasoning) allocates working-memory tokens to materialize the intermediate state.

5. Spatial Grounding & Vision-Language Terminology (EXP-09)

Section titled “5. Spatial Grounding & Vision-Language Terminology (EXP-09)”

DETR Object Queries (Detection Transformer)

Section titled “DETR Object Queries (Detection Transformer)”
  • In Plain English: Instead of scanning an image with thousands of sliding-window guesses and filtering duplicates afterward (Non-Maximum Suppression), DETR creates a fixed number of parallel “empty parking spots” (Object Queries—e.g., obj1 and obj2). Because all query slots attend to the image and to each other simultaneously, obj2 sees that obj1 already claimed the left object and automatically claims the right object in a single pass.
  • Under the Hood: In dgem, templates/multimodal/bbox_multi_object_detr.json.tmpl places obj1_[ymin,xmin,ymax,xmax] and obj2_[ymin,xmin,ymax,xmax] on the same bidirectional [MASK] canvas (reads=1), allowing the query slots to co-adapt without autoregressive left-to-right drift.
  • Where You See It in dgem: dgem bench-bbox (bbox-t3-01-detr-dual-buttons, bbox-t3-02-detr-stacked-banner-cta).

Softmax Expectation (DFL / Distribution Focal Loss) Sub-Bin Regression

Section titled “Softmax Expectation (DFL / Distribution Focal Loss) Sub-Bin Regression”
  • In Plain English: Turning 21 coarse 5% coordinate bins (00, 05, 10, ..., 100) into a smooth, continuous coordinate (32.4%) by taking the probability-weighted average across all 21 bins rather than picking only the single winning bin (argmax).
  • Under the Hood: When an edge lies at 32.5%, dgemma splits probability mass between bin 30 (P=0.50) and bin 35 (P=0.50). Discrete argmax suffers a 2.5% quantization penalty (or collapses narrow objects like 008.png onto xmin=55, xmax=55 \rightarrow 0.000 IoU), whereas Softmax Expectation: c^m=k=020(5k)P(slotm=bink)\hat{c}_m = \sum_{k=0}^{20} (5k) \cdot P(\text{slot}_m = \text{bin}_k) recovers the continuous coordinate (+8.75% mIoU across EXP-09 and 0.000 \rightarrow 0.504 IoU on 008.png).
  • Where You See It in dgem: cmd/bench_bbox.go (computeEdgeMetrics).

Per-Edge Occlusion Entropy (H~edge\tilde{H}_{\text{edge}})

Section titled “Per-Edge Occlusion Entropy (H~edge\tilde{H}_{\text{edge}}H~edge​)”
  • In Plain English: Traditional object detectors give you a single confidence number for an entire box, hiding which side of the object is blocked. Because dgem evaluates ymin, xmin, ymax, and xmax as 4 independent 21-bin distributions, an object covering the bottom edge causes entropy to spike specifically on ymax (1.37× higher on live Cloud Run dgemma) while the 3 visible edges stay sharp.
  • Under the Hood: Computed per edge m{ymin,xmin,ymax,xmax}m \in \{\text{ymin}, \text{xmin}, \text{ymax}, \text{xmax}\} as H~m=Hm/ln(21)[0,1]\tilde{H}_m = H_m / \ln(21) \in [0, 1].
  • Where You See It in dgem: dgem bench-bbox --annotate and scratch/render_bbox_results.py.