basics Β· see inside Β· cased vs lowercased Β· top_k & doc_stride Β· Apache-2.0

Cased vs Lowercased Context, Logit Decoding & Sliding-Window Stride

See how distilbert/distilbert-base-cased-distilled-squad (Xenova/distilbert-base-cased-distilled-squad, 65.81 MB q8 WASM) preserves uppercase acronyms and mixed-case proper nouns with do_lower_case: false (28,996 WordPiece vocab), decodes top_k spans under max_answer_len, and chunks long passages with overlapping sliding windows.

1 Β· Initialise DistilBERT Cased SQuAD

2 Β· Cased vs Lowercased Comparison & Span Parameters

Initialise DistilBERT Cased SQuAD above to compare cased vs lowercased tokenization, start/end logits, and sliding-window stride.

Top Span Scoreβ€”
Best Span Ξ£ Logitβ€”
Margin vs #2β€”
[CLS] Null Gapβ€”
Cased vs Lower Ξ”β€”
Token Split (Cased/Lower)β€”
Sliding Stride Resultβ€”
Finite Checkβ€”

DOM mirror: run logit inspection to inspect peak start/end cased WordPiece tokens and [CLS] null logits.

Highlighted Span & Offsets

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

top_k Candidate Spans (≀ max_answer_len)

3 Β· Cased WordPiece (do_lower_case: false, 28,996 vocab) Token Ribbon

DistilBERT Cased preserves capitalization with NO token_type_ids: a single [SEP] separates question from context. Indigo chips highlight uppercase/mixed-case tokens (e.g. NASA, GDPR, iPhone); dotted amber chips mark ## subword continuations; green chips mark the active [seqStart..seqEnd] span.

Total Seq Tokensβ€”
Upper / Mixed-Caseβ€”
Context Spanβ€”
Active Token Spanβ€”

4 Β· Show the code

Show the code β€” worker.js raw DistilBERT Cased start/end logit & subword pass
Show the code β€” squad-cased-core.mjs cased-vs-lowercased delta & 384/512 token window chunker