Basics
8K ALiBi & Token-Length Scaling
Sweep 128 → 2,048+ tokens live on WASM and prove why raising model_max_length past 512 rescues tail answers.
text-ranking · text · WASM q8 · 38.30 MB
Distilled 6-layer, 37.8M-parameter JinaBERT cross-encoder with symmetric bidirectional ALiBi and GEGLU feed-forward blocks. Reads each query and candidate passage together across up to 8,192 tokens (distinct from the smaller 4-layer 33M Tiny model) in a compact 38.30 MB q8 WebAssembly download.
| Model ID | jinaai/jina-reranker-v1-turbo-en |
|---|---|
| Task / pipeline | text-ranking via AutoTokenizer + AutoModelForSequenceClassification (num_labels = 1) |
| Architecture | JinaBERT (6 layers, 12 attention heads, hidden 384, GEGLU 1536, ALiBi, 61,056 vocab, 37.8M params) |
| Context window | 8,192 tokens via ALiBi (worker overrides tokenizer_config.json's 512 default to 8,192; verified 128–4,096 tok in CPU WASM) |
| Quantization & size | q8 (onnx/model_quantized.onnx, 38.30 MB · 38,295,104 B) |
| Backend | WebAssembly (shared lib/webai.js Transformers.js 3.7.5 off-main-thread Web Worker; runs anywhere, no WebGPU needed) |
| License | Apache-2.0 (apache-2.0) |
| Web APIs | WebAssembly, Web Workers, Cache Storage, Blob/File API — all Baseline widely available |
Tip: drag-and-drop a .txt, .md, .csv, or .json file here, or paste text/files with Ctrl/Cmd+V outside inputs.
| Rank | Shift | Passage | Logit | Sigmoid σ(z) | Softmax | Margin | Tokens | Lexical |
|---|---|---|---|---|---|---|---|---|
| Initialise the model above to score and rerank candidate passages. | ||||||||
Every candidate pair is tokenized jointly as <s> query </s></s> passage </s>
using RoBERTa-style byte-level BPE (61,056 vocab). Below, each passage's raw unbounded logit z
is mapped onto the logistic calibration curve σ(z) = 1 / (1 + e−z) alongside the
leading joint pair tokens fed into the 6-layer ALiBi stack.
Run a query to inspect the live <s> query </s></s> passage token stream.
Two-stage retrieval pairs a fast bi-encoder or keyword retriever with a cross-encoder reranker. At
38.30 MB, jina-reranker-v1-turbo-en brings a 6-layer, 8K-context cross-encoder
directly into client-side WebAssembly (~35 ms per short pair on CPU) so sensitive architectural ADRs, clinical
notes, and legal clauses stay strictly on-device.
Basics
Sweep 128 → 2,048+ tokens live on WASM and prove why raising model_max_length past 512 rescues tail answers.
Practical
Upload RFC 4180 CSV/JSON/MD/TXT corpora, run cancellable FIFO eval batches, and measure real MRR@5, nDCG@5, and Top-1 accuracy.
Wild
Probe negation traps, BM25 keyword stuffing, antonym flips, zero-overlap synonyms, 1,200-tok needles, and noisy typos.
Multi-model
Chain Jina v2 Small EN (32.77 MB bi-encoder) into Jina Reranker v1 Turbo EN (38.30 MB cross-encoder) with live Spearman ρ.
import { AutoTokenizer, AutoModelForSequenceClassification } from "@huggingface/transformers";
const tokenizer = await AutoTokenizer.from_pretrained("jinaai/jina-reranker-v1-turbo-en");
tokenizer.model_max_length = 8192; // override tokenizer_config 512 default for ALiBi 8K
const model = await AutoModelForSequenceClassification.from_pretrained(
"jinaai/jina-reranker-v1-turbo-en",
{ device: "wasm", dtype: "q8" }
);
const enc = tokenizer(passages.map(() => query), {
text_pair: passages,
padding: true,
truncation: true,
max_length: 4096
});
const { logits } = await model(enc); // one raw relevance logit per (query, passage) pair