Basics · 8,192-Token Context Proof & CLS Inspector

Needle-in-a-Haystack: Full 8,192 tokens vs 256-token truncation

What does an 8,192-token context window actually buy you? Below are four ~820-token enterprise handbooks sharing an identical ~700-token governance preamble, with the decisive clause buried at the end. We embed the exact same documents twice through Granite R2 — once at full 8,192-token context, and once artificially sliced at a short-context boundary — so you can measure the exact retrieval gain.

Run the truncation experiment

Full 8,192-token Granite R2 ranking

Run the comparison to rank all 4 handbooks at full context.

    Truncated 256-token Granite R2 ranking

    Run the comparison to see what happens when the tail is sliced off.

      Exact tokenizer cutoff & [CLS] vector shift

      The ModernBERT tokenizer slices the target document right at the chosen cutoff. Everything shaded below the red line never enters the short-context forward pass — while Granite R2 attends across the entire document.

      Run the comparison to inspect the exact tokenizer boundary.

      Full 8,192-token [CLS] fingerprint (first 96 dims)

      –

      Truncated [CLS] fingerprint (first 96 dims)

      –

      Show the code

      Inspect the exact vanilla ES module functions running in this tab — no build step, no server proxy.

      Show the code: exact ModernBERT token counting & cutoff slicing
      Show the code: CLS-pooled feature-extraction forward pass
      Show the code: deterministic 2D PCA basis recovery