Basics · Inside Ruri v3 30M · 43.78 MB WASM q8 · Apache-2.0

Inside Ruri v3 30M: Prefixes, Long-Context Window & SentencePiece

Three controlled ablations running live on onnx-community/ruri-v3-30m-ONNX: (1) 1+3 prefix asymmetry, (2) full ModernBERT-Ja context vs 128-token truncation, and (3) 102,400-token SentencePiece subword breakdown without external MeCab segmentation.

1 · On-device Model & Cache

2 · Prefix Asymmetry & Long-Context vs 128-Token Clip

Documents L1 and L2 open with an identical Japanese preamble exceeding 128 tokens and diverge only in Chapter 2 (local Worker vs cloud billing). A 128-token clip cannot see Chapter 2, so both score almost identically; full context (2,048 cap) separates them.

Drop a .txt, .md, .csv, or .json document to tokenize & ablate, paste with Ctrl/Cmd+V, or upload:
Query+Doc margin—
Bare "" margin—
Full-ctx L1−L2 gap—
128-tok L1−L2 gap—
NaN count—

1+3 Prefix Asymmetry Matrix

Prefix scheme ablation scores
Prefix Pair L1 (Relevant) L2 (Distractor) Margin
Waiting for ablation run…

Full Context vs 128-Token Truncation

Context truncation ablation scores
Document Exact Tok Full Cos 128-Tok Cos
Waiting for ablation run…

3 · Japanese SentencePiece Subword & Script Breakdown

Inspect how Ruri v3's 102,400-token SentencePiece vocabulary splits Kanji, Hiragana, Katakana, and ASCII without any external morphological analyzer.

Tokenization presets
Total tokens—
Non-space chars—
Fertility (tok/char)—
Script profile—

4 · Inspect Implementation

Show the code — Idempotent Ruri v3 1+3 prefix formatting
Show the code — Off-thread SentencePiece token extraction