Skip to content
Basics 7Γ—7 = 49 Coarse Patches Prompt Sweep Temperature Calibration

Basics: 7Γ—7 Patch Grid, Prompt Sensitivity & Softmax Calibration

ViT-B/32 sees a 224Γ—224 center crop as exactly 7Γ—7 = 49 spatial 32Γ—32 patches plus [CLS]. Probe how occluding individual 32Γ—32 patches shifts real logits, measure how 6 prompt templates change cosine margins, and tune softmax temperature Ο„ over real model logits.

1 Β· Model, image & candidate concepts

Running the lab computes the unoccluded 224Γ—224 baseline logits (for calibration and patch ablation) plus a 6-template prompt sensitivity sweep.

Loading starter photo…

2 Β· 7Γ—7 = 49 ViT-B/32 coarse-patch grid & occlusion

Click any cell on the 224Γ—224 grid or pick Row/Column (0–6) below to inspect its exact 32Γ—32 px patch coordinates and vision token index (#1..#49 after [CLS] #0), then run real inference with that 32Γ—32 patch occluded.

Vision tokenToken #25 ([CLS] = #0)
Pixel box (224Β²)x:96..128, y:96..128
Baseline top-1–
Occluded top-1–
Target Ξ” logit–
Measured 32Γ—32 patch occlusion impact vs unoccluded 224Γ—224 baseline
Patch Vision token Pixel bounds Top-1 after occlusion Target % Target logit Ξ” Latency
Click "Occlude selected 32Γ—32 patch" or "Probe 5 key patches" after loading the model.
Show the code β€” renderPatchGridCanvas() 7Γ—7=49 ViT-B/32 patch grid & occlusion

3 Β· Prompt-template sensitivity sweep

Tests your candidate concepts across 6 prompt templates sequentially off the main thread. Compare consensus agreement, top-1 margin, and cosine alignment.

Consensus top-1–
Template agreement–
Best margin template–
NaN count–
Live classification metrics across 6 prompt templates
Template Top-1 Top-1 % Margin vs #2 Top cosine Entropy (bits) Latency
Load CLIP ViT-B/32 LAION-2B above to run the 6-template sweep.
Show the code β€” comparePromptTemplateRuns() template sensitivity aggregator

4 Β· Temperature-scaled softmax calibration lab

Rescales the real raw logits_per_image vector from the baseline run by 1 / Ο„ before softmax: low temperature (Ο„ < 1) sharpens top-1 confidence, while higher temperature (Ο„ > 1) softens probability mass and raises Shannon entropy H(p).

Temperature Ο„1.00
Top-1 calibrated–
Margin Δ–
Entropy H(p)–
Eff. choices (2^H)–
Show the code β€” calibrateRankedFromLogits() temperature-scaled softmax