Basics · 12-Layer Pre-LN ReLU Decoder · Greedy vs Top-K & Repetition Penalty · Context Sensitivity · Non-Commercial Research

Inside OPT-125M: Decoding Controls & Context Sensitivity

OPT-125M (facebook/opt-125m → Xenova/opt-125m, 406.08 MB ONNX / 408.19 MB WASM q4) runs 12 causal attention layers (12 heads, 3,072 ReLU FFN) over up to 2,048 tokens. Compare how temperature, top_k, repetition_penalty, and left context shift real next-token candidate probabilities and branching perplexity 2H.

1. Greedy vs Repetition Penalty vs Top-K & Temperature Sweep

Pick a decoding comparison prompt or enter your own:

Greedy (T=0, penalty=1.0) locks onto the single highest-probability path while Top-K + repetition penalty explores alternatives.
Configs completed–
Total sweep latency–
Mean speed–
NaN check–

Awaiting decoding sweep

Initialise OPT-125M above to compare Greedy, Greedy+Penalty, Top-K Balanced, and Creative sampling live.

2. Next-Token Candidates & Context-Window Sensitivity Lab

Adding disambiguating words to the left prefix reshapes keys and values across all 12 causal layers. Compare an ambiguous prefix against a rich context-anchored prefix and inspect live top-5 next-token candidates, Shannon entropy shift (ΔH), and effective vocabulary branching factor 2H.

Adding left context shifts OPT-125M's 12 causal layers away from finance/account tokens toward nature/water tokens.
Short H(P) / 2^H–
Rich H(P) / 2^H–
Entropy shift (ΔH)–
Pair latency / NaN–

A · Short Prefix

Pending

Run comparison above to inspect next-token candidates for Prefix A.

Live continuation A will appear here.

B · Rich Context Prefix

Pending

Run comparison above to inspect next-token candidates for Prefix B.

Live continuation B will appear here.

3. Inspect Decoding Sweep & 50,272-Vocab Softmax Source

Show the code — worker.js handleCompareDecoding() 4-way decoding sweep
Show the code — opt-core.mjs computeTopKFromLogits() 50,272-vocab softmax & entropy