TL;DR: On 140 real entity pairs from a production knowledge-graph linking pipeline, the open CLM-v0.1-8B
(Contrastive-LM, with its official encoder Qwen3-8B BF16 on vLLM) could not replace JEV
(typesafe-ai/jev, hosted) as a yes/no "are these two entities related?" judge:
| CLM (last 2048 tokens, default) | CLM (full input) | JEV | |
|---|---|---|---|
| AUC vs. 40 gold labels | 0.77 | 0.64 | 0.998 |
| Output range of P(related) | 0.22 – 0.77 | 0.49 – 0.64 | 0.07 – 0.86 |
| Spearman correlation with JEV | 0.29 | 0.06 | – |
| Same 3-band decision as JEV (0.2 / 0.5 thresholds) | 44 % | 19 % | – |
| Latency per pair, p50 | 0.52 s (DGX Spark) | 1.10 s (DGX Spark) | 0.28 s (API) |
Note on data: the real documents and entity pairs are private and are not part of this gist. All example inputs shown here are synthetic demo data (invented names and texts) that only reproduce the structure and typical size of the real inputs. The numbers in the tables are the real, aggregated results.
This is one use case with long, structured inputs. It is not a general verdict on CLM, and it comes with caveats (listed below). The point: a "local JEV" that works nicely on short demo prompts does not automatically transfer to real workloads. Measure on your own data before you switch.
The task. A knowledge-graph pipeline proposes candidate links between two entities, e.g. a database name on one side and a table or tool on the other. A judge gets both entities plus their evidence quotes and answers one boolean question: are these two entities related? The probability routes each pair:
p < 0.2→ not related0.2 ≤ p < 0.5→ needs reviewp ≥ 0.5→ related (then typed by another model)
JEV (typesafe-ai/jev) is the production judge, called through the Vercel AI Gateway (evaluation-model
endpoint, question type boolean).
CLM (https://github.com/Contrastive-LM/CLM, commit bb42c6c5) is an open "System One" engine. A Qwen3-8B
pooling encoder feeds trained projection heads, and the answer comes out in the same typed-question format
(noul = probability that a statement is true). It is advertised as a drop-in for TypeSafe-style requests, so the
exact production question and state could be sent unchanged.
| Component | Detail |
|---|---|
| CLM package | repo commit bb42c6c5bf914fd449bed2f6ca65be80602cb1f7; heads on CPU (torch 2.14 CPU), CLM's own embedder client |
| CLM head | Contrastive-LM/CLM-v0.1-8B, file CLM_v0.1-8B.pt, SHA-256 b2b4a8c9c2d39263eff78a351eb909a342ce9b3bf21a3f07c1d1bf15f1c4eda5 (matches the Hub LFS OID) |
| Encoder | the official setup: vllm serve Qwen/Qwen3-8B --runner pooling --dtype bfloat16 --enforce-eager --enable-prefix-caching, last-token pooling, on an NVIDIA DGX Spark (GB10), --max-model-len 8448 |
| Truncation | server-side via truncate_prompt_tokens (vLLM keeps the last tokens): 2048 for the default variant, none for the full-input variant |
| JEV | production configuration, called through the Vercel AI Gateway |
Encoder parity checks
- Tokenization is identical. The vLLM server and the official Qwen3-8B tokenizer (no special tokens, as in CLM's recipe) produce the same token ids, and the prompt token counts match. CLM L2-normalizes embeddings itself.
- End-to-end against the example values in CLM's README: 3 of 4 values are close (
0.989vs0.939,2.000vs1.984,0.994vs0.997). One differs clearly (urgency.noul0.837vs0.410), even on the official BF16 encoder. So the README values were probably produced with a different head or code version. - Cross-check with a quantized encoder: Qwen3-8B Q8_0 (llama.cpp) vs. BF16 (vLLM) embeddings on 20 real inputs: cosine min 0.99986, mean 0.99990. An earlier Q8_0 run on a 16 GB NVIDIA A2 gave the same picture (AUC 0.84 / 0.65), so quantization is not the issue.
Input length. 129 of 140 inputs are longer than 2048 tokens (max ≈ 8.3k). Two CLM variants were run:
- the default truncation to the last 2048 tokens,
- the full input, with the encoder context raised to 8448 tokens as the README suggests for long states.
- 140 unique entity pairs from 8 production linking runs. Each pair has the stored JEV probability (38 not related / 77 needs review / 25 related at the 0.2/0.5 thresholds).
- Inputs rebuilt with the production code that produced the original JEV requests. The pair hashes match the stored ones for all 140 pairs.
- Each input is a JSON object: two entities (name, type) plus a list of evidence quotes from the source documents, 2k–14k characters.
- Gold: 40 pairs, stratified 12/16/12 by JEV band. Labeled blind (without seeing any model score) by an LLM (Claude) from the evidence and the exact production instruction, not human-reviewed. 10 related / 30 not related, 7 low-confidence labels. The not-related side is skewed: many pairs combine one off-topic document with unrelated entities.
- JEV repeatability: 82 fresh JEV calls on a stratified subset, made during normal production load.
- The underlying documents are private. Only aggregate numbers are published here.
- Example input:
example-request-synthetic.jsonin this gist is synthetic demo data: invented entities (orders_db↔Grafana), 24 evidence quotes, ~8.9k characters. It has the same shape and typical size as a real request (real inputs: 5–59 quotes per pair, avg 24; 2k–14k characters). The instruction text is a paraphrase, not the production prompt. The same body can be sent to JEV (Vercel AI Gateway) and to a CLM server (with the question typenoul).
CLM with the default 2048-token truncation, rows = JEV band, columns = CLM band:
| JEV \ CLM | not related | needs review | related |
|---|---|---|---|
| not related (38) | 0 | 27 | 11 |
| needs review (77) | 0 | 47 | 30 |
| related (25) | 0 | 11 | 14 |
- CLM never outputs
p < 0.2(minimum 0.22), so the "not related" band is unreachable. - 11 pairs that JEV rejects outright are marked "related" by CLM; 11 of 25 JEV-related pairs are not.
- The best possible CLM thresholds (grid search) reach only 57 % band agreement (full input: 55 %).
- Spearman with JEV: 0.29 (full input: 0.06). With full input, CLM calls 139 of 140 pairs "related".
| Metric | CLM (2048) | CLM (full) | JEV |
|---|---|---|---|
| AUC | 0.77 | 0.64 | 0.998 |
| Precision / recall at p ≥ 0.5 | 0.40 / 0.60 | 0.25 / 1.00 | 0.83 / 1.00 |
| Best F1 (threshold) | 0.56 (0.48) | 0.48 (0.59) | 0.95 (0.51) |
- JEV made 2 errors, both on borderline pairs within 0.05 of the threshold.
- CLM missed obvious cases. The same tool named on both sides with explicit evidence scored 0.48 (JEV: 0.73–0.86). Pairs whose only link was a document header or a loose topic scored 0.55–0.62.
- 80 × HTTP 200, 1 × 500, 1 × 503 (2.4 % errors under production load)
- fresh vs. stored probability: mean absolute difference 0.025, max 0.15, Spearman 0.985
- 7 band flips, all on pairs next to a threshold
- CLM: p50 0.52 s / p90 0.55 s per pair (2048 tokens), p50 1.10 s / p90 1.52 s (full input), sequential requests, BF16 encoder on a DGX Spark, heads on CPU.
- JEV: p50 0.28 s / p90 0.50 s.
- Domain mismatch. Inputs are long, structured JSON with evidence lists. CLM's examples are short natural-language states. This test measures CLM on this workload, not in general.
- Truncation. 92 % of inputs exceed CLM's default 2048-token window. Feeding the full input made results worse, not better.
- No fine-tuning. CLM ships a fine-tuning script. A head trained on in-domain pairs might do much better; that was out of scope.
- Small gold set (n = 40), labeled by an LLM, not by humans.
- CLM is v0.1. Later heads may behave differently; one README example could not be reproduced.
For this production relatedness task, CLM-v0.1-8B out of the box is not a replacement for JEV:
- it separates related from unrelated pairs much worse (AUC 0.77 or 0.64 vs 0.998),
- it never reaches the "not related" band and disagrees with JEV on more than half of the routing decisions,
- even on its official BF16 encoder on a DGX Spark it is about 2× slower per pair than the hosted API.
The broader lesson: "local drop-in replacement" claims should be checked on your own data, with your own input lengths and your own decision thresholds, before switching.
{
"task": "boolean relatedness judgment between two knowledge-graph entities with evidence",
"pairs": 140,
"jev_bands_stored": {"not_related": 38, "needs_review": 77, "related": 25},
"thresholds": {"unrelated": 0.2, "related": 0.5},
"clm": {
"repo_commit": "bb42c6c5bf914fd449bed2f6ca65be80602cb1f7",
"head": "Contrastive-LM/CLM-v0.1-8B",
"head_sha256": "b2b4a8c9c2d39263eff78a351eb909a342ce9b3bf21a3f07c1d1bf15f1c4eda5",
"encoder": "Qwen/Qwen3-8B BF16 (vLLM --runner pooling, last-token pooling, NVIDIA GB10)",
"truncated_last_2048": {"band_agreement_with_jev": 0.436, "spearman_with_jev": 0.294, "gold_auc": 0.77,
"p_range": [0.217, 0.7677], "latency_ms_p50": 519, "latency_ms_p90": 548},
"full_input": {"band_agreement_with_jev": 0.186, "spearman_with_jev": 0.06, "gold_auc": 0.637,
"p_range": [0.4903, 0.6377], "latency_ms_p50": 1102, "latency_ms_p90": 1521},
"encoder_crosscheck_q8_0_vs_bf16_cosine": {"n": 20, "min": 0.99986, "mean": 0.9999}
},
"jev": {"gold_auc": 0.998, "fresh_calls": 82, "http_errors": {"500": 1, "503": 1},
"fresh_vs_stored_mean_abs_diff": 0.025, "band_flips": 7, "latency_ms_p50": 280, "latency_ms_p90": 498},
"gold": {"n": 40, "related": 10, "not_related": 30, "labeler": "LLM (blind), not human-reviewed"},
"date": "2026-09-25"
}