A bilingual (English + Russian) word filter for search vocabularies. Given one word form, it answers whether it is a technical term worth indexing or ballast to drop — the inflected function words, chopped identifier fragments and boilerplate that a harvest of identifiers, comments, docs and commit messages is mostly made of.
What makes it different: frequency cut-offs throw away rare technical terms, which are
exactly the ones worth searching for. This model makes the call per word from meaning — and the
whole learned decision is 384 numbers and a bias, a single affine on top of a frozen, unchanged
multilingual-e5-small. No second model, no scikit-learn at inference: a dot product you can apply
in any language. It filters ~800 words/s on a CPU core and ~17 800/s on a laptop GPU.
emb = session.run(None, {"input_ids": ids, "attention_mask": mask})[0] # [B, 384], pooled + L2
p_keep = 1 / (1 + np.exp(-(emb @ w + b))) # the whole classifier
224 held-out words (95 keep / 129 drop). Like for like, the alternative is the same encoder with a naive head — a logistic fit on seed word lists, which is the supervision you have without a training corpus. Both arms cut at the same number of stripped words (93); AUC needs no threshold at all:
| arm | AUC | keep-F1 | strip precision | technical words wrongly dropped | words/s |
|---|---|---|---|---|---|
| this model — trained head | 0.878 | 0.752 | 0.892 | 10 / 95 | 5 396 |
multilingual-e5-small + seed head |
0.767 | 0.681 | 0.806 | 18 / 95 | 4 380 |
multilingual-e5-base + seed head (2× wider, 2.4× bigger) |
0.875 | — | 0.935 | 6 / 95 | 1 340 |
Speeds are onnxruntime CUDA FP32, batch 64 × seq 40.
multilingual-e5-base matches it on AUC and loses fewer
terms, for a quarter of the throughput and 470 MB against 76 MB. If size and speed do not
constrain you, it is a fair alternative.At the shipped default threshold (0.95) the INT8 engine strips with precision 0.89 and recall 0.77, wrongly dropping 12 of 95 technical words.
Batch 64 × seq 40, laptop Intel Core Ultra 9 275HX + RTX 5060:
| lane | words/s |
|---|---|
| TensorRT FP16, RTX 5060 | 17 790 |
| OpenVINO INT8, Intel iGPU | 1 140 |
| OpenVINO INT8, CPU — the default lane | 770 – 850 |
| OpenVINO INT4, NPU (batch 16) | 277 |
| ONNX Runtime FP32, CPU | 341 |
The CPU lane filters a repository's whole harvested vocabulary in seconds without a GPU; CPU, iGPU and NPU together reach ~2 000 words/s.
"vocab: " — the head was trained on prefixed
embeddings, so the boundary does not line up without it. Sequence budget 40 tokens.P(ballast) = 1 − P(keep) ≥ strip_threshold (default
0.95, in denoise_head.json). It is high on purpose — dropping a real term is the expensive
error, keeping some ballast is not. Lower it to strip more.import json, numpy as np, onnxruntime as ort, sentencepiece as spm
sp = spm.SentencePieceProcessor(model_file="sentencepiece.bpe.model")
sess = ort.InferenceSession("model.onnx", providers=["CPUExecutionProvider"])
head = json.load(open("denoise_head.json")) # {dim, w[384], b, strip_threshold}
w, b, thr = np.array(head["w"], np.float32), head["b"], head["strip_threshold"]
def p_keep(words, max_len=40):
toks = [[2, *sp.encode("vocab: " + x)[: max_len - 2], 3] for x in words] # bos … eos
L = max(len(t) for t in toks)
ids = np.array([t + [0] * (L - len(t)) for t in toks], dtype=np.int64) # pad = 0
mask = (ids != 0).astype(np.int64)
emb = sess.run(None, {"input_ids": ids, "attention_mask": mask})[0] # [B, 384]
return 1.0 / (1.0 + np.exp(-(emb @ w + b)))
scores = p_keep(["mutex", "tensorrt", "пожалуйста", "asdfgh"])
strip = (1.0 - scores) >= thr # strip only confident ballast
Not suited to: phrases or sentences; scripts other than Latin and Cyrillic (pruned out); term-vs-stopword calls outside software.
intfloat/multilingual-e5-small, frozen — its weights are unchanged. Mean
pooling and L2 were fused into the export, and the graph quantized to INT8.(w, b) and temperature-scaled so the threshold stays in charge across its range.| file | what it is |
|---|---|
denoise_head.json |
required — w, b, strip_threshold; the ONNX alone emits embeddings, not a decision |
model.onnx |
FP32, pruned, with pooling, L2 and the id remap fused — the build source and the standalone path |
model.safetensors, config.json |
the encoder as a BertModel for AutoModel, table unfolded back to raw SentencePiece ids; apply mean-pool + L2 yourself (config.json → ultracode), then the head; the Apple (MLX) build is prepared from this pair |
sentencepiece.bpe.model, tokenizer_config.json |
the tokenizer |
code-daemon-denoise-v1-s_ov2026.4_{cpu,igpu_lnl}_int8_b64_s40.{xml,bin} |
OpenVINO 2026.4 INT8 — the default CPU lane and the Intel iGPU |
code-daemon-denoise-v1-s_ov2026.4_npu_int4_b16_s40.{xml,bin} |
OpenVINO INT4 for Intel NPUs |
code-daemon-denoise-v1-s_{win_x64,linux_x64}_trt11.0_sm_{75,80,86,89,120}.engine |
TensorRT FP16 per OS × GPU; sm_90 (H100/H200) Linux only |
code-daemon-denoise-v1_{win_x64,linux_x64}_tvm0.25_vulkan.{dll,so} |
TVM Vulkan, for non-NVIDIA GPUs |
coreml_ane/embed.mlpackage/ |
Core ML for the Apple Neural Engine, function b64 s40; load with cpuAndNeuralEngine |
The encoder weights are intfloat/multilingual-e5-small
(MIT), redistributed here in compiled form unchanged — MIT permits that redistribution and
sublicensing, so this repository ships under Apache-2.0 with the encoder's MIT notice intact.
The trained head and the build/quantization tooling are original. Backbone: XLM-RoBERTa. Not
legal advice.
Used by the Code-Daemon code assistant, though nothing about the model is specific to it.
model.safetensors 470 MBmodel_gpu_mlx0.32/model.safetensors 470 MBmodel.onnx 306 MBcoreml_ane/embed.mlpackage/Data/com.apple.CoreML/weights/weight.bin 237 MBcode-daemon-denoise-v1-s_ov2026.4_cpu_int8_b64_s40.bin 79 MBcode-daemon-denoise-v1-s_ov2026.4_igpu_lnl_int8_b64_s40.bin 79 MBcode-daemon-denoise-v1-s_ov2026.4_npu_int4_b16_s40.bin 69 MBintfloat/multilingual-e5-smallHave the files? Submit a torrent.
Submit a torrentHave the complete files and permission to share them? Replace the example folder path. The script checks the files, makes a torrent and submits its magnet and checksums. Keep your torrent client seeding. Get your community key from your settings, and read the script before running it.
curl -fsSL https://pirateface.co/package.sh | bash -s -- --repo faxenoff/code-daemon-denoise-v1 ./model-folder