Run the ablation — five modes, one model
The thinking mode always gets at least 512 new tokens (the worker maximum) so the <|channel>thought trace has
room to close before the answer. Decoding is greedy (no sampling), so reruns are comparable.
Checking for a local copy of Gemma 4 E2B…
Live output
Thinking trace (<|channel>thought)
Prompt token mix of the active mode
Counted from the real input_ids once a mode prefills.
Results — side by side
| Mode | Status | TTFT | tok/s | Out tok | Text | <|image|> | <|audio|> | Keywords | NaN |
|---|
Time to first token (lower is better)
Run at least one mode.
Decode speed, tok/s (higher is better)
Run at least one mode.
Prompt token mix per mode
Each finished mode adds its real text / image / audio bar here.
The inputs every mode shares
Image: solar station plate
Loading the procedural plate…
Audio: JFK inaugural, 16 kHz mono
Loading the ledgered clip…
What each mode adds
- Text-only: the baseline. Only the decoder and the 1.3 GB per-layer embedding table run, so the prompt is a few dozen text tokens and TTFT is as low as it gets.
- Text + Thinking: the same text path with
enable_thinking. Gemma writes a<|channel>thoughttrace before the answer, so you pay for more output tokens (and more total time) to get the reasoning. - Vision VQA: adds the 187.5 MB fp16 vision encoder. The plate is cut into 16 px patches, pooled 3×3 and spliced in as up to 280
<|image|>soft tokens, which lengthens prefill. - Direct 16 kHz audio: adds the 92.3 MB conformer audio encoder. Raw PCM goes in with no separate ASR model; every 40 ms of sound becomes one
<|audio|>token. - Unified omni pass: both encoders and the text prompt in one sequence (audio → image → text). Compare its prompt length with the vision and audio rows added together.
Speeds depend on your GPU and driver; the first run after initialisation also pays shader compilation. Run all five twice if you want warm numbers.
How it works
Each mode calls Gemma4Engine.generate() in a module Web Worker with the mode's prompt, optional
RGBA plate and optional 16 kHz PCM. The worker reports the real token split at prefill, streams tokens
back, and the page scores the final answer with the pure helper below.