Basics Β· Inside 12-Layer [CLS] Cross-Attention & 512-Token WordPiece Boundaries

Query-Passage Token Budget Audit & Logit Sigmoid Saturation Lab

Every pair enters MS MARCO MiniLM-L-12-v2 as [CLS] query [SEP] passage [SEP] with a hard 512-token WordPiece ceiling. Probe how truncating at 128 β†’ 256 β†’ 384 β†’ 512 tokens hides late answers, how raw logits z ∈ [-12, +6] saturate under Οƒ(z), and how 12-layer cross-attention beats exact-word overlap.

1. Query-Passage Token Budget Audit (128 β†’ 512 WordPiece tokens)

Logit Shift Across 128 β†’ 512 Ceiling

Live WordPiece Truncation Audit

Live logits and WordPiece truncation counts across 128, 256, 384, and 512 tokens
Budget Kept / Total Dropped Logit z Οƒ(z) Tail tokens kept
Run the audit above to inspect live token truncation boundaries.

2. Logit Sigmoid Saturation Curve & Exact-Word vs Paraphrase Contrast

Because Οƒ(z) flattens below z = -5 and above z = +4, raw logits preserve fine ranking order where percentages saturate. Run the 3-way contrast below to plot live pairs onto Οƒ(z).

Sigmoid Saturation Curve z ∈ [-12, +6]

Live 3-Way Pair Contrast

Live raw logit, sigmoid, softmax, and lexical overlap comparison
Candidate Raw logit z Οƒ(z) Softmax Lexical overlap
Waiting for live 3-way contrast forward pass…

Show the code

Show the code: 128β†’512 WordPiece token budget audit in worker (worker.js)
Show the code: overflow-safe logistic sigmoid calibration (marco-core.mjs)