# Oxidizing Cross-Encoders

DevFeed: [Oxidizing Cross-Encoders](<https://devfeed.tech/articles/oxidizing-cross-encoders-62450.md>)

Original publisher: [Read original article](<https://qdrant.tech/blog/oxidizing-cross-encoders/>)

Author: info@qdrant.tech (Andrey Vasnetsov)

Published: 2026-09-25T00:00:00Z

Content type: article

Language: en

Sources: [Qdrant Blog on Qdrant - Vector Search Engine](<https://devfeed.tech/sources/qdrant-blog-on-qdrant-vector-search-engine.md>)

Topics: [Python](<https://devfeed.tech/topics/python.md>), [onnx runtime](<https://devfeed.tech/topics/onnx-runtime.md>), [tokenizers](<https://devfeed.tech/topics/tokenizers.md>), [LLM optimization](<https://devfeed.tech/topics/llm-optimization.md>), [Transformers](<https://devfeed.tech/topics/transformers.md>)

Tags: [approximate-nearest-neighbor-search](<https://devfeed.tech/tags/approximate-nearest-neighbor-search.md>), [bert](<https://devfeed.tech/tags/bert.md>), [embeddings](<https://devfeed.tech/tags/embeddings.md>), [fasttext](<https://devfeed.tech/tags/fasttext.md>), [hnsw](<https://devfeed.tech/tags/hnsw.md>), [image-search](<https://devfeed.tech/tags/image-search.md>), [knn-algorithm](<https://devfeed.tech/tags/knn-algorithm.md>), [matching](<https://devfeed.tech/tags/matching.md>), [neural-network](<https://devfeed.tech/tags/neural-network.md>), [onnx](<https://devfeed.tech/tags/onnx.md>), [onnx-runtime](<https://devfeed.tech/tags/onnx-runtime.md>), [python](<https://devfeed.tech/tags/python.md>), [qdrant](<https://devfeed.tech/tags/qdrant.md>), [recommender-system](<https://devfeed.tech/tags/recommender-system.md>), [rust](<https://devfeed.tech/tags/rust.md>), [saas](<https://devfeed.tech/tags/saas.md>), [sentence-transformers](<https://devfeed.tech/tags/sentence-transformers.md>), [simaes-networks](<https://devfeed.tech/tags/simaes-networks.md>), [similarity](<https://devfeed.tech/tags/similarity.md>), [transformer](<https://devfeed.tech/tags/transformer.md>), [vector-search](<https://devfeed.tech/tags/vector-search.md>), [vector-search-engine](<https://devfeed.tech/tags/vector-search-engine.md>), [vectors](<https://devfeed.tech/tags/vectors.md>), [word2vec](<https://devfeed.tech/tags/word2vec.md>)

## AI overview

The article describes rewriting cross-encoder inference in Rust as the cross-encode-rs library and comparing it with Python implementations that use the same ONNX Runtime C++ engine. The Rust version was 1.1x faster at the median on a small reranking model and about 1.4x faster on a larger one, while model load time did not improve.

## Source excerpt

We rewrote cross-encoder inference in Rust, benchmarked it against Python, and on a small reranking model it came out only 1.1x faster at the median. That is not a sign of a slow Rust implementation. The Python libraries we compared against, fastembed and sentence-transformers, hand the same work to the same C++ engine, onnxruntime, so all three spend almost all of their time in the same compiled code. In the Rust community, rewriting code in Rust is called "oxidizing" it, since rust is also what iron turns into when it oxidizes. This post covers how we oxidized cross-encoder inference into a library, cross-encode-rs, how it works, where it does pull ahead (about 1.4x on a larger model), and where it does not (model load time).