ONNX Model Zoo

jamie8johnson/code-reranker-v1

By jamie8johnson · ↓ 19 · ♥ 0 · Updated 2026-03-21

What's in this repo

This page lists the files in jamie8johnson/code-reranker-v1, including model.onnx.

  • 1 ONNX models (.onnx files)
  • 8 files, including 4 .json, 1 .md, 1 .onnx, 1 .txt
  • Last updated 2026-03-21

ONNX files

File Size Download
onnx/model.onnx — Download

How to use

These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.

README

code-reranker-v1

A cross-encoder reranker for code search, trained on CodeSearchNet pairs. Experimental — does not improve retrieval in our benchmarks. Published for reproducibility.

Status: Negative Result

This reranker regresses retrieval quality on our hard eval (55 confusable function pairs):

Config Recall@1 Delta
No reranker 90.9% —
Web-trained cross-encoder 80.0% -10.9pp
This model (code-trained) 9.1% -81.8pp

Root cause: Trained with random same-language negatives, which are too easy for cross-encoders. The model learns surface-level language patterns instead of semantic code discrimination. A V2 with BM25 hard negatives may fix this.

Training

  • Architecture: Cross-encoder (BERT-base)
  • Data: 50,000 CodeSearchNet pairs + 7,500 docstring pairs
  • Epochs: 3
  • Negatives: Random same-language (this was the mistake)

Usage (if you want to experiment)

# In cqs — NOT default, opt-in only
CQS_RERANKER_MODEL=jamie8johnson/code-reranker-v1 cqs "query" --rerank

License

Apache 2.0.

Model info

text-classification sentence-transformers
sentence-transformers onnx bert cross-encoder reranker code-search text-classification en code dataset:code_search_net license:apache-2.0 text-embeddings-inference
↓ 19 ♥ 0

Created: 2026-03-20

Updated: 2026-03-21

View on Hugging Face

Files (8)

.gitattributes
README.md
config.json
onnx/model.onnx ONNX
special_tokens_map.json
tokenizer.json
tokenizer_config.json
vocab.txt

Related models