dgemDecision Model on DiffusionGemma
v0.4 · Apache 2.0·GoogleCloudPlatform / dgem·DiffusionGemma

One forward pass.
Calibrated decisions across every slot.

Turn declarative .json.tmpl schemas into zero-shot Decision Policies that unmask up to 8 choice, boolean, or ordinal score slots simultaneously in ~135–265 ms on a warm GPU—returning exact per-option probabilities and pre-fusion normalized hesitation (raw_normalized_entropy) across Decision Studio, MCP, REST, and Go.

~135–265 msSingle-pass warm GPU readout
Up to 8 SlotsSimultaneous discrete unmasking
H_raw = H / ln KPre-fusion [0, 1] hesitation gate
Live 1-Pass Slot Readout Simulator (Illustrative)
INPUT STATEtemplates/support_triage.json.tmpl
Why Discrete Diffusion for Decisions

Stop decoding JSON punctuation one token at a time.

Autoregressive models spend sequential forward passes emitting braces, quotes, and field names with uncalibrated verbalized confidence. dgem places masked decision slots directly in the prompt and unmasks all of them in a single forward pass.

Autoregressive JSON Decoding

O(T) Sequential Steps
Token-by-token latency scales with output lengthVerbalized confidence is poorly calibrated

dgem Single-Pass Slot Denoise

O(1) Step · ~135–265 ms Warm GPU
department = billing (0.94)priority = p1 (0.92)sentiment = 2.34 / 3escalate = true (0.90)
Up to 8 slots unmasked simultaneouslyExact softmax probabilities + H_raw ∈ [0, 1]
End-to-End Workflow

Four primitives, one calibrated decision loop.

Author a declarative .json.tmpl policy, unmask up to 8 slots in one diffusion pass, gate Stage 2 cascades on pre-fusion hesitation, and serve over Studio, MCP, HTTP, or CLI.

templates/support_triage.json.tmplPolicy-as-Template
{
  "schema": {
    "instructions": "Triage the customer support ticket.",
    "questions": [
      { "id": "department", "type": "choice",
        "options": [{"name": "billing"}, {"name": "technical"}, {"name": "account"}] },
      { "id": "sentiment", "type": "score", "levels": ["calm", "frustrated", "furious"] }
    ],
    "samples": {{ default 1 .samples | toJson }}
  },
  "state": { "ticket": {{ default "No ticket text" .ticket | toJson }} }
}
terminal — dgem decide
$
✓ Unmasked 4 decision slots in 1 forward pass (~155 ms warm GPU)
✓ department = billing (p=0.942, raw_normalized_entropy=0.062 · CLEAR <16%)
✓ sentiment = frustrated (expected_score=2.34 / 3.00)
stage2_escalated: false · backend: vertex
terminal — listwise decision reranking
$
Scoring candidate passages + grounding gates in 1 diffusion pass (MaxSlotsPerPass = 8)...
Softmax expectation E[r_i] = sum(g * p_i,g) computed across ordinal levels
✓ Top passage: chunk_03 (E=3.84/4) · raw_normalized_entropy: 0.08 (CLEAR)
Single-Pass Slot Readout (MaxSlotsPerPass = 8)● O(1) Step
Query: "How do I enable Cloud Run GPU failover in dgem?"
chunk_03 (gateway.md)E[r] = 3.84 · p(exact)=0.86
chunk_01 (cloud-run.md)E[r] = 3.41 · p(exact)=0.58
answerability_gateANSWERABLE · p = 0.964 · H_raw = 0.05
terminal — dgem bench-calibration
$
Gating on pre-fusion raw_normalized_entropy = H / ln(K) (< 0.16 Clear)
Fusing priors via FusePriorWithGateMode (--prior-gate-mode hesitant)
✓ High-hesitation tail escalated to gemini-3.8-flash
Selective Cascade Lift Across Policy Suites (Illustrative)H_raw = 0.16 Gate
82%
95%
AgentDrift
88%
97%
PromptInj
79%
93%
AggreFact
76%
92%
ChaosNLI
Stage 1 Single-Pass (illustrative)Stage 1 + Stage 2 Cascade (illustrative)
terminal — Decision Studio + MCP + HTTP Gateway
$
✓ Decision Studio Web UI listening on http://localhost:8090
✓ Streamable HTTP MCP Server ready at POST /mcp (6 native tools)
✓ REST Gateway active at POST /api/decide/{template} (vertex_first)
OpenTelemetry Request Waterfall (dgem serve)vertex_first
● POST /api/decide/support_triageX-DGem-Backend: vertex_first
├─ RenderTemplatesupport_triage.json.tmpl (0.4 ms)
├─ VertexDedicatedEndpoint/v1/systemone (~155 ms warm GPU)
└─ HesitationGateH_raw=0.062 < 0.16 → 200 OK
Confidence Beyond Shannon

Normalize across K. Always gate before fusing priors.

Raw Shannon entropy (H = -∑ p_i ln p_i) grows with option count ln K: a 2-option boolean gate maxes out at 0.693 nats while a 52-option choice reaches 3.951 nats. dgem normalizes hesitation onto [0, 1] via raw_normalized_entropy = H / ln K and separates Stage 2 cascade gating from empirical prior fusion.

  • Scale-free hesitation bands — < 0.16 Clear (fast-path exit), 0.16–0.50 Somewhat unsure, and > 0.50 Very unsure across any K.
  • Pre-fusion cascade gate — try switching the simulator to always with low p_top: an un-gated strong prior artificially depresses post-fusion entropy below 0.16! dgem gates Stage 2 strictly on pre-fusion raw_normalized_entropy and fuses priors with --prior-gate-mode hesitant (decisionindex.FusePriorWithGateMode).
  • Wide-option catalogs (K > 26) — combine --labels az_aa / az_lower (up to 52 options), --bracket-size 20 two-stage tournaments, or --shortlist-topk M (decisionindex.PriorLogitsShortlist).
Interactive Pre-Fusion Hesitation & Prior Gate Labτ = 0.16 Threshold
Raw Shannon H
1.982 nats
Max ln(26) = 3.26 nats
Pre-Fusion H_raw (Gate)
0.608
Very unsure (> 0.50)
Post-Fusion H_norm
0.312
Mode: hesitant
Interactive Policy Workbench

Six production decision patterns, three live code views.

Select any domain below and toggle between its declarative .json.tmpl schema, CLI / REST invocation, and structured JSON receipt.

    Five Caller Surfaces · Three Serving Backends

    Author once. Call from Studio, MCP, REST, CLI, or Go.

    Click any caller interface or GPU/Metal target below to trace its execution path and copy its launch command.

    Documentation Suite

    Everything you need from laptop prototype to dedicated GPU fleet.