basics · see inside · 6-layer start/end logits · top_k & max_answer_len · Apache-2.0

Inside 6-Layer Start/End Logit Extraction & top_k Span Decoding

See how distilbert/distilbert-base-uncased-distilled-squad (Xenova/distilbert-base-uncased-distilled-squad, 66.98 MB q8 WASM) turns raw 6-layer start_logits and end_logits over [CLS] question [SEP] context [SEP] into ranked candidate spans constrained by top_k (1 → 5) and max_answer_len — including WordPiece ## subword splits.

1 · Initialise DistilBERT Uncased SQuAD

2 · top_k (1 → 5) Candidate Span Explorer & max_answer_len

Initialise DistilBERT Uncased SQuAD above to inspect raw start/end logits and WordPiece ## subword boundaries.

Top Span Score—
Best Span Σ Logit—
Margin vs #2—
[CLS] Logit Sum (Untrained)—
Span Tokens / ## Subwords—
Finite Check—

DOM mirror: run logit inspection to inspect peak start/end WordPiece tokens and SQuAD v1.1 scores.

Highlighted Span & Offsets

Click any candidate span on the right to inspect its UTF-16 offsets and token boundary.

top_k Candidate Spans (≤ max_answer_len)

3 · WordPiece ## Subword & [CLS] question [SEP] context [SEP] Boundary Inspector

DistilBERT uses uncased WordPiece (do_lower_case: true, 30,522 vocab) with NO token_type_ids: a single [SEP] separates question from context. Dotted amber chips mark ## subword continuations; green chips mark the active [seqStart..seqEnd] span boundary.

Total Seq Tokens—
Question Span—
Context Span—
Active Token Span—

4 · Show the code

Show the code — worker.js raw DistilBERT start/end logit & subword pass
Show the code — distil-core.mjs top_k & max_answer_len span decoder