Repository navigation
Drop-in prefix-free 384d bilingual (ZH/EN) embeddings for XERJ rc.105+ (39.3% → 92.0% R@1 at 5.96 ms/q) + Apache-2.0 calibrated reranker #3674
wasabihu
started this conversation in
Show and tell
Replies: 1 comment
|
Quick ecosystem update building on top of XERJ
Happy to share benchmarks or hear edge-case feedback! |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Following up on the CJK financial & clinical RAG field report (#3371) and reference corpora (#3372): after testing XERJ
v1.0.0-rc.105's newxerj_cjkanalyzer (#3377) and single-request nativehybridRRF, we fine-tuned and open-sourced two clean-room bilingual (ZH-Hans / ZH-Hant / EN) models built to match XERJ's exact retrieval wire contract:Stage-1 Retriever —
wasabihu/xerj-bilingual-fin-law-384(MIT)intfloat/multilingual-e5-small(BertModel, 12 layers, 384d, 512 max tokens,pad_token_id=0)."query: "/"passage: "prefix needed), matching XERJ's in-engine tokenization, attention-mask mean pooling, and L2 normalization 1:1.model.safetensors(448.8 MB): zero-sidecar drop-in for stockxerj --embed-mode neural(local_model_dir).onnx/model.onnx(448.44 MB, FP32 opset 17):5.42 ms/qon CPU,1.000000mean (0.9999999min) cosine vs PyTorch FP32,0.9999999pad_id=0batch invariance.onnx/model_fp16_io32.onnx(224.38 MB, 2.00× smaller): FP16 weights with FP32 I/O (tensor(float)),0.999998mean (0.999996min) cosine vs FP32,0.00ppR@1 drop offline and live. (Dynamic INT8 was evaluated and rejected at0.955–0.966cosine, below our0.995parity gate.)Stage-2 Reranker —
wasabihu/VeriCorpus-Reranker-0.6B(Apache-2.0)Qwen/Qwen3-Reranker-0.6B(1.11 GiBBF16), trained with Groupwise Listwise InfoNCE + Pointwise BCE +Qwen/Qwen3-32B-AWQteacher soft-score distillation.yes/nologit contract (sigmoid(logit("yes") - logit("no"))) and<think>\n\n</think>\n\nsuffix.Live Isolated XERJ
v1.0.0-rc.105Retrieval BenchmarkMeasured on Apple Silicon CPU with isolated ephemeral XERJ nodes (
150stratified queries =50Clinical Trials +50PRC Statutes +50SEC Filings,238passages):n=20)n=34)n=50)rc.105lexical(semantic_text)39.33%63.33%76.00%0.498060.00%5.88%14.00%0.67 ms/qrc.105bm25_xerj_cjk(#3377CJK + T→S)82.00%96.00%100.00%0.887680.00%97.06%88.00%0.89 ms/qrc.105neural_candle(model.safetensors)89.33%98.00%99.33%0.9367100.00%97.06%100.00%20.44 ms/qrc.105proxy_onnx(onnx/model.onnxFP32)89.33%98.00%99.33%0.9367100.00%97.06%100.00%5.42 ms/qrc.105nativehybridRRF (1:1.5, FP32 ONNX)92.00%100.00%100.00%0.9539100.00%97.06%100.00%5.96 ms/q(Using
onnx/model_fp16_io32.onnxgives identical accuracy at8.86 ms/qstandalone and9.69 ms/qin hybrid RRF.)On the full held-out blind split (
606queries,673passages across6unseen statutes,11unseen SEC tickers, and14unseen clinical docs):multilingual-e5-small:52.48%R@1 /0.6148MRR@10 → fine-tuned:81.52%R@1 (+29.04pp) /0.8789MRR@10.rc.105proxy_onnxFP32:83.99%R@1 /97.19%R@5 /98.84%R@10 /0.8974MRR@10; nativehybridRRF (1:1.5) pushes Recall@10 to99.17%for Stage-2 reranking.Stage-2 Reranker Calibration (
240Zero-Leakage Eval Groups,19Unseen Entities)Stock
Qwen3-Reranker-0.6Boften ranks the right passage first (86.25%Top-1) yet assigns>0.56mean probability to wrong-caliber negatives — making threshold-based refusal (pos >= 0.70,neg <= 0.30) unusable (20.83%StrictCal pass). Fine-tuning with listwise + pointwise + teacher distillation fixes both ranking and probability separation:n=240groups,0/0/0/0leakage)Qwen3-Reranker-0.6BVeriCorpus-Reranker-0.6B86.25%100.00%+13.75pp0.9188 / 0.93581.0000 / 1.0000+0.0812 / +0.0642pos >= 0.70&all neg <= 0.30)20.83%98.33%+77.50pp0.9851 / 0.56210.9938 / 0.0065neg -0.5556pos - max_neg)+0.2070+0.9743+0.7673Per-trap breakdown (exact held-out group counts):
consolidated_vs_parent(n=6): Top-133.33% → 100.00%, StrictCal0.00% → 100.00%, Margin-0.0024 → +0.9994gaap_vs_nongaap(n=8): Top-150.00% → 100.00%, StrictCal0.00% → 100.00%, Margin+0.0130 → +1.0000summary_vs_footnote(n=23): Top-160.87% → 100.00%, StrictCal0.00% → 95.65%, Margin-0.0022 → +0.9358single_quarter_vs_cumulative(n=17): Top-170.59% → 100.00%, StrictCal0.00% → 94.12%, Margin-0.0011 → +0.9297cross_fiscal_year(n=42): Top-178.57% → 100.00%, StrictCal0.00% → 100.00%, Margin+0.0091 → +0.9971statute_article_trap(n=144): Top-198.61% → 100.00%, StrictCal34.72% → 98.61%, Margin+0.3422 → +0.9765(Caveat:
consolidated_vs_parentandgaap_vs_nongaapare small held-out slices atn=6andn=8under strict entity-level separation; the shift in mean probability margin from near-zero to~+1.00is the more informative signal there.)Quickstart with XERJ
v1.0.0-rc.105+Option A — Stock prebuilt
xerjbinary (zero sidecar, Candleneuralmode):Option B — Native
onnx-experimentalmode (5.42 ms/qFP32 or224 MBFP16-IO32):Index mapping + single-request
hybridRRF query:Clean-Room Provenance
Both repos include
CLEAN_ROOM_AUDIT.jsonandSHA256SUMS.txt(0CNINFO,0HKEX,0proprietary records, and0entity/doc/query overlap between train and held-out splits). Benchmark scripts and open corpora are maintained inwasabihu/vericorpus.Feedback welcome — especially if anyone tests
onnx-experimentalon Linux x86_64 AVX-512 or CUDA EP with themodel_fp16_io32.onnxartifact.All reactions