Improving Information Retrieval in the Elastic Stack: Introducing ELSER

Source: https://www.elastic.co/search-labs/blog/elastic-learned-sparse-encoder-elser-retrieval-performance
Publisher: Elastic

Summary

Elastic announces ELSER (Elastic Learned Sparse Encoder), their production-grade sparse retrieval model built on SPLADE principles. Reports 17% NDCG@10 improvement over BM25 and describes the distillation-based training approach.

What is ELSER?

ELSER is Elastic’s version of learned sparse retrieval, optimized for the Elasticsearch inverted index infrastructure:

  • Based on SPLADE architecture
  • 100M parameter BERT-based model
  • Produces vocabulary-space sparse vectors (30,522 BERT vocabulary dimensions)
  • Deployed natively in Elasticsearch/OpenSearch

Training Methodology: Knowledge Distillation

ELSER was trained using a powerful ensemble teacher:

Teacher: MiniLM (fast bi-encoder) + MonoT5-3B (large cross-encoder reranker)
    ↓
Generate high-quality labels for MS MARCO + domain data
    ↓
Student: 100M parameter BERT MLM model
    ↓
ELSER: compressed, fast sparse encoder

The teacher ensemble captures complementary signals:

  • MiniLM: semantic similarity
  • MonoT5-3B: nuanced relevance judgment

This is an example of Retrieval Pipeline distillation — compressing a multi-stage pipeline into a single model.

Performance Results

On MS MARCO dev set (NDCG@10):

ModelNDCG@10Notes
BM250.228Lexical baseline
ELSER v10.267+17% over BM25
Dense bi-encoder0.253Semantic only
Hybrid BM25+Dense0.271Best combination

ELSER outperforms both BM25 and standard dense bi-encoders individually, approaching hybrid quality with a single model.

ELSER v2 Improvements

ELSER v2 brings:

  • Better OOD (out-of-distribution) performance
  • Faster inference
  • Lower memory footprint
  • Improved handling of numeric/code content

Integration in Elasticsearch

# Elasticsearch 8.x API
GET /my_index/_search
{
  "query": {
    "text_expansion": {
      "ml.tokens": {
        "model_id": ".elser_model_2_linux-x86_64",
        "model_text": "find documents about machine learning"
      }
    }
  }
}

Elasticsearch stores ELSER sparse vectors natively in its inverted index — no separate vector database required.

ELSER as Hybrid Component

For best results, Elastic recommends ELSER + BM25 hybrid:

{
  "query": {
    "bool": {
      "should": [
        {"match": {"content": "query"}},  // BM25
        {"text_expansion": {"ml.tokens": {"model_id": ".elser_model_2", "model_text": "query"}}}  // ELSER
      ]
    }
  }
}