Skip to content

Jasper-Token-Compression-600M Technical Report

optionalcorefrontierpaperrubric 9/122025 · ~30 min

Dun Zhang, Ziyang Zeng, Yudong Zhou, Shuyang Lu

Status

TL;DR. Jasper-Token-Compression-600M starts from Qwen3-Embedding-0.6B and is distilled from two larger embedders, Qwen3-Embedding-8B and QZhou-Embedding (7B), on 12M English and Chinese paragraphs. Its new piece is a token-compression module: after the embedding layer, a small MLP and adaptive average pooling shrink any input over 80 tokens before the transformer runs. A four-stage schedule teaches the model to work at many compression ratios. It reports MTEB English 74.75 and Chinese 73.51 Mean(Task), close to Qwen3-Embedding-8B, while encoding long texts 2× to 7× faster than the uncompressed 0.6B model.

Why it matters now. Embedding cost matters every time a corpus is re-indexed, and RAG and deep-research corpora are large. Most efficiency work shrinks the model or the vector. Jasper shrinks the input sequence, a third lever, and it measures the latency it saves. It is also a compact case study in multi-teacher embedding distillation from open models, with distillation run on four consumer RTX 4090 GPUs.

Distil into a wider student. The teacher vector concatenates two normalised 1024-d parts: the first 1024 dims of Qwen3-Embedding-8B (valid because it was Matryoshka-trained) and QZhou’s first 3072 dims folded into 1024 by summing three segments:

Et=Norm⁡(Norm⁡(Eqwen) ∥ Norm⁡(Eqzhou)).E_t = \operatorname{Norm}\big(\operatorname{Norm}(E_{\text{qwen}}) \,\|\, \operatorname{Norm}(E_{\text{qzhou}})\big) .

The student switches Qwen3-0.6B from last-token to mean pooling and adds a linear map from 1024 to 2048 dims. Stage 1 trains with Lcos=1−Es⋅Et\mathcal{L}_{\text{cos}} = 1 - E_s \cdot E_t (scaled by 10).

Compress the tokens before attention. After the embedding layer, a new SwiGLU MLP transforms each token vector and AdaptiveAvgPool1d averages contiguous windows down to a target length:

Ltgt={LinLin≤8080+ρ (Lin−80)otherwise.L_{\text{tgt}} = \begin{cases} L_{\text{in}} & L_{\text{in}} \le 80 \\ 80 + \rho\,(L_{\text{in}} - 80) & \text{otherwise.} \end{cases}

Only the MLP is trainable; the pooling has no weights. Short texts pass through untouched, long ones are shortened, and all transformer layers then run on LtgtL_{\text{tgt}} positions.

Four stages.

  1. Distil with the cosine loss (lr 1e-4, 2 epochs, max 1,030 tokens).
  2. Distil with compression at fixed ρ=0.33\rho = 0.33 (lr 7e-5, 2 epochs).
  3. Dynamic compression for 800 steps: each batch samples ρ\rho (0.33 with probability 0.4; otherwise uniform on 0.1–0.33, 0.33–0.66 or 0.66–1.0). A second loss matches the batch similarity matrices of student and teacher: Ls3=10 Lcos+100 MSE⁡(BsBs⊤,BtBt⊤)\mathcal{L}_{s3} = 10\,\mathcal{L}_{\text{cos}} + 100\,\operatorname{MSE}(B_s B_s^\top, B_t B_t^\top).
  4. Retrieval contrastive learning for 5,000 steps on QZhou’s retrieval data: InfoNCE with K=3K = 3 hard negatives and in-batch negatives (N=16N = 16, τ=0.3\tau = 0.3), plus a KL term matching the student’s and teacher’s softmaxed similarity scores (α=0.1\alpha = 0.1), plus the cosine term: Ls4=Lcl+16 Lsoft+10 Lcos\mathcal{L}_{s4} = \mathcal{L}_{\text{cl}} + 16\,\mathcal{L}_{\text{soft}} + 10\,\mathcal{L}_{\text{cos}}.
Jasper-Token-Compression-600M: pooling token embeddings before the transformer, distilled from two teachers Top row, the student: input token embeddings pass through a new SwiGLU MLP, then adaptive average pooling shrinks a sequence of length L to 80 plus rho times (L minus 80) when L exceeds 80, then the Qwen3-Embedding-0.6B transformer runs on the shorter sequence, followed by mean pooling and a linear map from 1024 to 2048 dimensions. Right: the 2048-dimensional teacher vector concatenates the first 1024 dimensions of Qwen3-Embedding-8B with QZhou-Embedding's first 3072 dimensions folded into 1024 by summing three segments. Bottom: four training stages, plain distillation, distillation with fixed ratio 0.33, distillation with a randomly sampled ratio plus a similarity-matrix loss, and contrastive retrieval training with soft distillation. Student (0.6B): compress tokens before attention L token embeddings SwiGLU MLP new, trainable AdaptiveAvgPool1d no weights; window avg L_tgt tokens if L ≤ 80: no pooling else L_tgt = 80 + ρ · (L − 80) Qwen3-0.6B layers → mean pool → Linear 1024→2048 student E_s (2048-d) Teacher E_t (2048-d) Qwen3-Embedding-8B: first 1024 dims (MRL cut) QZhou-Embedding 7B: 3072 dims → 3×1024, summed normalise each, concatenate Training stages 1 · distil 1 − cos(E_s, E_t) 12M paragraphs 2 · + compress fixed ρ = 0.33 same loss, data 3 · dynamic ρ ρ sampled per batch + sim-matrix MSE 4 · retrieval InfoNCE + soft KD + cosine regulariser
Original sketch. The pooling module sits between the embedding layer and the first transformer layer; the threshold of 80 and the ratio schedule are from the paper's Algorithms 1 and 2.

MTEB, English and Chinese leaderboard portions, evaluated at threshold 80 and ρ = 0.5 (paper Tables 1 and 2).

ModelSizeDimEnglish Mean(Task)Chinese Mean(Task)
Qwen3-Embedding-0.6B (initial student)595M102470.7066.33
Jasper-Token-Compression-600M600M204874.7573.51
Qwen3-Embedding-4B4B256074.6072.27
Qwen3-Embedding-8B (teacher)8B409675.2273.84
QZhou-Embedding (teacher)7B358475.9776.99

Encoding latency per text in ms (Table 4; 1,600 fixed-length texts, batch 32, GPU not stated):

ModelMTEB Mean(Task)128 tok512 tok2048 tok
Qwen3-Embedding-0.6B70.703.2212.2049.99
Jasper, ρ = 0.574.752.627.3925.07
Jasper, ρ = 0.3374.702.525.4117.52
Jasper, ρ = 0.174.212.093.186.95
  • English Retrieval: stage 3 65.53, stage 4 66.19, teacher Qwen3-8B 69.44 (Table 3).
  • Measured cost is partial. Encoding latency is measured; index size (2048-d), search latency and the GPU are not reported, and there is no matched-latency truncation baseline.
  • Retrieval is the weak spot. The authors say their contrastive stage is insufficient to close the gap to the teacher.
  • Short training length. Distillation used at most 1,030 tokens, so quality on longer inputs is untested, even though long inputs are where compression helps most.
  • Simple pooling. Fixed window averaging ignores content; the authors suggest adaptive, trainable compression as future work.
  • Evaluation hygiene. No zero-shot percentage or training-overlap statement; stage-4 data comes from QZhou’s retrieval set. Table 3 and the text disagree on stage-3 Retrieval (65.53 vs 65.33).

Questions to think through

These questions have no single right answer. Write or say your answer before you open the hints. Mark a question once you could defend your answer in a reading group.

  1. Derive / compute

    The compression rule keeps inputs of at most 80 tokens unchanged and otherwise pools a length-L input to 80 + ρ(L − 80) positions. (a) Compute the compressed length and the fraction L_tgt / L for L = 128 and L = 2048 at ρ = 0.5 and ρ = 0.1. (b) Table 4 reports per-text encoding latency of 3.22 ms and 49.99 ms for uncompressed Qwen3-Embedding-0.6B at 128 and 2048 tokens, and 2.62 / 25.07 ms (ρ = 0.5) and 2.09 / 6.95 ms (ρ = 0.1) for Jasper. Compute the measured latency ratios and compare them with a linear-in-length and a quadratic-in-length cost model. What does the comparison say about where a 0.6B encoder spends its time at these lengths?

    What a strong answer covers
    • (a) L = 128: ρ = 0.5 gives 80 + 24 = 104 (0.81); ρ = 0.1 gives 80 + 4.8 ≈ 85 (0.66). L = 2048: ρ = 0.5 gives 80 + 984 = 1064 (0.52); ρ = 0.1 gives 80 + 196.8 ≈ 277 (0.135).
    • (b) Measured ratios: 2.62 / 3.22 = 0.81 and 25.07 / 49.99 = 0.50 at ρ = 0.5; 2.09 / 3.22 = 0.65 and 6.95 / 49.99 = 0.14 at ρ = 0.1. They match the length fractions almost exactly.
    • A quadratic model would predict 0.52² ≈ 0.27 and 0.135² ≈ 0.018 at L = 2048, far below what is measured. Latency is close to linear in the number of positions.
    • Interpretation: for a 0.6B model with FlashAttention up to 2048 tokens, the per-token MLP and projection work dominates, so the saving comes from processing fewer positions, not from avoiding quadratic attention. The paper's "quadratic" motivation matters only at longer lengths.
    • The 80-token floor means short inputs, such as most queries, gain little: at 128 tokens the best case is about 35% faster.
  2. Mechanism

    Explain the compression module and the teacher construction. (a) What does AdaptiveAvgPool1d do to a sequence of length L_in with target L_out, and why does the paper insert a new SwiGLU MLP before it rather than pooling raw token embeddings? (b) Why must the model be trained with compression, rather than switching pooling on at inference? (c) The 2048-d teacher concatenates Qwen3-8B's first 1024 dims with QZhou's first 3072 dims summed in three 1024-d segments. Why is the Qwen3 truncation principled while the QZhou fold is an approximation, and what does the fold do to inner products?

    What a strong answer covers
    • (a) It splits the L_in positions into L_out contiguous windows of about L_in / L_out tokens and replaces each window by its mean, so kernel and stride are set automatically. It has no weights; the paper calls it 1D-convolution-based, but it is a fixed averaging filter.
    • The MLP is the only trainable part of the module. It maps token embeddings into a space where averaging neighbours keeps useful information, instead of blurring raw lexical embeddings that were never meant to be summed.
    • (b) The pretrained transformer has only seen one embedding per token at consecutive positions. Pooled vectors are off-distribution inputs, and positional encoding now indexes windows, not tokens. Stages 2 and 3 adapt all weights to that input; stage 3 samples ρ per batch (40% at 0.33, otherwise uniform in 0.1–0.33, 0.33–0.66 or 0.66–1.0) so one model works across ratios.
    • (c) Qwen3-8B was trained with Matryoshka representation learning, so its first 1024 dims form a trained embedding. QZhou was not, so the authors apply a fixed linear map (sum of three segments). The inner product of folded vectors equals the sum of matching-segment products plus cross-segment terms, which act as noise unless segments are uncorrelated; each part is normalised before concatenation so both teachers count equally.
  3. What if…

    Using Tables 3 and 4, what do the stage-4 contrastive step and the choice of inference compression ratio each contribute? Give the numbers, and say what the reported Mean(Task) changes cannot tell you about the compression mechanism.

    What a strong answer covers
    • Stage 4 (InfoNCE with K = 3 hard negatives, N = 16, plus soft KL distillation and the cosine term) lifts Retrieval from 65.53 to 66.19 (Table 3; the text says 65.33). Mean(Task) moves 74.65 → 74.75; other types change by less than 0.3.
    • Retrieval still trails the Qwen3-8B teacher by about 3.3 points (66.19 vs 69.44), the gap the authors list as the main limitation, while Classification, Clustering and STS match or beat the teacher.
    • Compression ratio at inference (Table 4): Mean(Task) 74.75 at 0.5, 74.70 at 0.33, 74.58 at 0.2, 74.21 at 0.1, while latency at 2048 tokens falls from 25.07 to 6.95 ms.
    • Limits: many MTEB classification, STS and pair-classification inputs are under 80 tokens and are never compressed, so the mean over all tasks dilutes the effect. A per-task or per-length breakdown, and retrieval-only numbers by ratio, would isolate what compression costs.
    • There is no ablation that removes compression from the final recipe, so the cost of compression to quality versus the gain from distillation is not separated.
  4. Critique

    The abstract says the model is "higher efficiency than a traditional 0.6B model while achieving performance comparable to that of an 8B model". As a reviewer focused on retrieval, write three concerns about this claim, covering the efficiency baseline, the storage cost and the evaluation data, and say what experiment would address each.

    What a strong answer covers
    • Efficiency baseline: compare against simple truncation at matched latency. Uncompressed Qwen3-0.6B at 1024 tokens takes 24.24 ms, about the same as Jasper at ρ = 0.5 on 2048 tokens (25.07 ms); the paper does not test truncation, nor give the GPU type.
    • Storage: the output is 2048-d versus 1024-d for Qwen3-0.6B, so the index doubles (8 KB vs 4 KB per fp32 vector). Encoding latency is measured; index size and search latency are not.
    • "Comparable to 8B": English Mean(Task) 74.75 vs 75.22, but Retrieval 66.19 vs 69.44; on Chinese, QZhou-Embedding-Zh (78.52) and Seed models score higher. Averages hide the weakest task type for RAG.
    • Data: stage 4 uses QZhou's retrieval training data and the teachers' training mixes are inherited; the report gives no zero-shot percentage or overlap check against MTEB retrieval sets such as HotpotQA or FEVER.
    • Experiments: matched-latency truncation baseline; Matryoshka or PCA truncation of the 2048-d output; retrieval evaluation on held-out long-document sets, since distillation used at most 1,030 tokens.
  5. Design

    You index a 10M-document English web corpus (median 900 tokens) for a deep-research agent, re-embedding weekly on one GPU, and queries are short. Decide how to use Jasper's compression: which ρ for documents and for queries, whether to use it at all for documents over 1,030 tokens, and how you would validate the choice.

    What a strong answer covers
    • Queries are usually under 80 tokens, so they are never compressed regardless of ρ; the decision only affects documents.
    • At 900 tokens: ρ = 0.33 gives 80 + 0.33 · 820 ≈ 351 positions (≈ 0.39 of the cost under the near-linear scaling in Table 4); ρ = 0.1 gives ≈ 162 (≈ 0.18). Weekly re-embedding of 10M documents scales by the same factor.
    • Documents over 1,030 tokens are outside the distillation length; chunk them (or test late chunking) before compressing, rather than relying on compression to fit long inputs.
    • Storage: 10M · 2048 · 4 B ≈ 82 GB in fp32; consider fp16 or int8 quantisation, since the model has no Matryoshka training for its 2048-d output.
    • Validation: build a held-out query set with relevance labels on this corpus; compare nDCG@10 and Recall@100 for ρ in 0.1 to 0.5 against an uncompressed Qwen3-0.6B and a truncation baseline at the same latency; check per-length buckets for degradation on long documents.
  6. Connect

    An embedding pipeline has three separate cost axes: encoder compute per document, number of vectors per document, and dimensions per vector. Place Jasper's token compression, Matryoshka representation learning and ColBERT-style late interaction on these axes, and explain why Jasper's idea comes from DeepSeek-OCR's vision-token compression.

    What a strong answer covers
    • Jasper reduces encoder compute (fewer positions through the transformer) while still producing one vector; it increases dimensions (2048).
    • Matryoshka reduces dimensions per vector after encoding and leaves encoder compute unchanged; Jasper uses it only on the teacher side (Qwen3-8B's first 1024 dims).
    • ColBERT increases vectors per document (one per token) for finer matching; token pooling or PLAID-style compression then cuts storage, not encoder compute.
    • DeepSeek-OCR shows that a model can read text from far fewer vision tokens than text tokens; Jasper applies the same bet to text, that many adjacent token embeddings are redundant for a pooled document vector.
    • The axes compose: a compressed encoder with a Matryoshka-trained head and int8 vectors would attack all three, which the report leaves to future work.

Done with this page?

Status