ettin-reranker-32m-v1, mixed-precision INT8 ONNX
A modified copy of cross-encoder/ettin-reranker-32m-v1 (revision b33e5ceb5110773ea9cf5e00c9bedc83a8c2afdd, Apache-2.0), packaged for CPU reranking.
What changed
onnx/model_mx3_q8.onnx is the upstream onnx/model.onnx (the encoder only) with every weight MatMul quantized to INT8 by ONNX Runtime 1.31.0 quantize_dynamic (per channel, signed INT8 weights), except the feed-forward output projection (mlp/Wo) of layers 0, 2 and 6, which stays in float32. The input was first run through onnxruntime.quantization.shape_inference.quant_pre_process. Rebuilding from the same inputs gives a byte-identical file (SHA-256 696de568846f06eaabd5e0def07bf863ef23d27a858a8db4b8de23238b6cd4ff).
Why those layers: with every MatMul quantized, ranking fidelity against float32 drops (Spearman 0.939 over the top 100 candidates); the loss comes from activation outliers at the feed-forward output, concentrated in layers 0, 2 and 6. Keeping those three in float32 gives Spearman 0.995 and top-20 overlap 0.963 against float32, at about half of float32's CPU time. No calibration data is used.
The scoring head is unchanged: 2_Dense, 3_LayerNorm and 4_Dense are the upstream safetensors files, applied to the [CLS] vector of last_hidden_state (Dense without bias, exact GELU, LayerNorm eps 1e-5, Dense to one logit). tokenizer.json and config.json are upstream, unchanged.
Measured
On a MacBook (M1 Max, CPU, four one-thread sessions, batches of 5), reranking the top 100 notes of a chat memory read:
| p50 | p95 | |
|---|---|---|
float32 (upstream model.onnx) | 0.86 s | 1.17 s |
| this file | 0.44 s | 0.61 s |
Evidence recall on LoCoMo multi-hop questions within the Latch memory engine's chat read: float32 0.846, this file 0.847, ettin-reranker-17m-v1 0.819.
License
Apache-2.0, as the original (see LICENSE). The original model is by the cross-encoder (sentence-transformers) authors; its training data includes MS MARCO and GooAQ, as described on the original model card.