Basics 16×16 = 256 Patch-14 Tokens Prompt-Framing Sensitivity 432.09 MB WASM q8

Basics: Patch-14 Grid, Prompt Framing & Temperature Calibration

ViT-Large/14 slices a 224×224 center crop into 256 patches of 14×14px (vs 196 in ViT-B/16 and 49 in ViT-B/32). Below, inspect the exact token grid, compare five prompt wrappers on the same scene, and watch how CLIP's logit_scale (≈100×) sharpens a nearly flat T = 1.0 cosine distribution.

1 · Model, study photo & 16×16 Patch-14 grid

Click or hover a cell on the 224×224 crop to inspect its Patch-14 token index.

Active grid16×16 (256)
Sequence (+CLS)257 tokens
Projection dim768-d
Fitted logit_scale–

Loading curated starter photo…

2 · Cosine vs Softmax Temperature Calibration (T = 1.0 vs logit_scale)

Because 768-d unit cosines typically sit in [0.15, 0.35], passing raw cosines straight into softmax() at T = 1.0 produces nearly uniform probabilities. Drag the temperature multiplier below or compare the three calibration regimes computed directly from your live 768-d cosines:

Temperature calibration comparison from live 768-d cosines
Calibration regime Top-1 Top-1 % Margin vs #2 Entropy (bits)
Run the lab above to compare T=1.0, T=0.05, and CLIP logit_scale.
Show the code — computeTemperatureLadder() T=1.0 vs logit_scale calibration

3 · Prompt-Framing Sensitivity across 5 Templates

CLIP was pretrained on image captions, not bare nouns. Watch how wrapping the exact same candidate labels in five prompt templates shifts 768-d cosines, top-1 confidence, and margin.

Consensus top-1–
Agreement–
Best margin template–
NaN count–
Live ViT-Large/14 metrics across 5 prompt templates
Template Top-1 Top-1 % Margin vs #2 Top cosine Entropy (bits) Latency
Run the lab above to compare prompt wrappers.
Show the code — drawPatch14GridCanvas() 224×224 center-crop & 16×16 token grid
Show the code — comparePromptTemplateRuns() consensus & margin aggregation