use case · basics · decoding strategy & entropy lab · onnx-community/ettin-decoder-150m-ONNX

Decoding Strategy & Entropy Step-Through Lab

The exact same causal transformer weights produce dramatically different continuations depending on how you decode the 50,368-token logit distribution. Compare Greedy against Nucleus Sampling (temperature, top_p, repetition_penalty) on the exact same prefix, or step 1 token at a time to watch live probabilities, Shannon entropy, and perplexity evolve step by step.

1. Initialise Ettin-Decoder-150M & Prefix

Initialise Ettin-Decoder-150M above, then run a side-by-side comparison or step token by token.

2. Side-by-Side: Greedy vs Nucleus Sampling

Greedy (Deterministic Argmax)

Always chooses argmax(logits) — reproducible, lowest surprise, prone to loops.

Waiting for comparison run…

TTFT: – · Total: – · Speed: –

Nucleus Sampling (Temperature + top_p)

Scales logits by 1/T and samples from the smallest probability mass summing to top_p.

Waiting for comparison run…

TTFT: – · Total: – · Speed: –

3. Token-by-Token Entropy Step-Through

Click Step +1 Token to append the top-1 token, OR click any candidate bar below to append that specific token and immediately compute the next position's real 50,368-token probability distribution!

Current Context

Steps: 0 · Current entropy: – · Path perplexity: –

Next-Token Top-10 (Click Any Token to Append)

Step-by-step trace of chosen tokens, probabilities, logits, and Shannon entropy
Step Chosen Token Prob Logit Entropy (bits) Cumulative Perplexity
Click "Step +1 Token" to inspect position 1.

4. Under the Hood — Exact Worker Code

Inspect the exact off-main-thread nextTokenTopK forward-pass implementation in worker.js that computes the full-vocab logits and Shannon entropy on your device.

Show the code — nextTokenTopK() forward pass & full-vocab entropy
Show the code — generate() streaming TextStreamer & sampling