gte-small

What is this model?

thenlper 740K downloads mit Sentence Similarity
Frameworkssentence-transformerspytorchtfcoremlonnxsafetensorsopenvino
Languagesen
Tagsbertmtebsentence-similaritySentence Transformersmodel-indextext-embeddings-inference
Downloads
740K
License
mit
Pipeline
Sentence Similarity
Author
thenlper

Run gte-small locally on a Q4KM hard drive

Boost your AI workloads with Q4KM hard drives pre‑loaded with gte‑small . Each Q4KM SSD ships with the model, tokenizer and inference scripts ready to run out‑of‑the‑box, eliminating download time...

Shop Q4KM Drives

Technical Overview

What is this model? thenlper/gte‑small is a compact, high‑speed sentence‑embedding model built on the Hugging Face model card. It belongs to the Sentence‑Transformers family and is designed to map a piece of text (a sentence, paragraph, or short document) into a dense vector space where semantic similarity can be measured with simple cosine similarity or Euclidean distance.

Key features & capabilities

  • Lightweight architecture (≈ 110 M parameters) that fits comfortably on a single GPU with 4 GB VRAM.
  • Supports PyTorch, TensorFlow, ONNX, CoreML, OpenVINO and Safetensors – making it easy to deploy on cloud, edge or mobile.
  • Optimized for sentence‑similarity and semantic retrieval tasks, but also works well for classification, clustering and reranking when used with a downstream classifier.
  • Multi‑language support (English‑centric but can be extended with multilingual tokenizers).
  • Ready‑to‑use endpoints compatible with Azure, AWS and custom REST APIs.

Architecture highlights

  • Backbone: a distilled BERT‑style transformer (12 layers, hidden size 384) that balances depth and speed.
  • Pooling: mean‑pool over the last hidden state followed by L2‑normalisation – the standard recipe for sentence‑transformers.
  • Training objective: MultipleNegativesRankingLoss on large‑scale contrastive datasets, which encourages semantically similar sentences to be close in the embedding space.
  • Exportability: the model is stored as .safetensors and can be converted to ONNX, CoreML or OpenVINO without loss of precision.

Intended use cases

  • Semantic search over product catalogs, FAQs, or knowledge bases.
  • Duplicate detection in forums, code repositories or customer support tickets.
  • Fast clustering of short documents for topic modelling.
  • Feature extraction for downstream classifiers (e.g., sentiment, intent).

Benchmark Performance

The MTEB (Massive Text Embedding Benchmark) suite is the de‑facto standard for evaluating sentence‑embedders. It covers classification, retrieval, clustering, reranking and semantic textual similarity (STS) tasks.

Key results (selected)

  • Amazon Polarity Classification – Accuracy = 91.82 %, F1 = 91.80 %.
  • Amazon Counterfactual Classification – Accuracy = 73.22 %, F1 = 67.32 %.
  • ArguAna Retrieval – MAP@10 = 46.60 %, NDCG@10 = 55.44 %.
  • BIOSSES STS – Cosine‑Similarity Pearson = 89.44 %, Spearman = 88.17 %.
  • Banking77 Classification – Accuracy = 84.08 %, F1 = 84.01 %.
  • Arxiv Clustering (P2P) – V‑Measure = 47.90 %.

Why these benchmarks matter – Classification accuracy shows how well the embeddings separate distinct classes, while retrieval metrics (MAP, NDCG, MRR) reveal the model’s ability to rank truly similar sentences at the top. STS Pearson/Spearman scores directly measure semantic correlation, which is the core purpose of a sentence‑transformer.

Compared to larger models such as sentence‑transformers/all‑mpnet‑base‑v2 (≈ 110 M params) or text‑embedding‑ada‑002 (≈ 350 M params), gte‑small trades a modest drop in absolute scores (≈ 2‑5 % on most tasks) for a dramatic reduction in latency and memory footprint. For applications where sub‑second response time on modest hardware is critical, gte‑small is often the most cost‑effective choice.

Hardware Requirements

VRAM for inference – The model’s checkpoint is ~ 400 MB (safetensors). A GPU with at least 4 GB of VRAM can load the model and run a batch of 32 sentences in under 10 ms per batch. For larger batch sizes or mixed‑precision inference, 6 GB + is recommended.

Recommended GPU specifications

  • CUDA‑compatible NVIDIA GPUs (e.g., RTX 3060, GTX 1660 Super, Jetson Orin).
  • AMD GPUs are supported via ONNX or OpenVINO back‑ends.
  • For CPU‑only deployments, a modern 8‑core Xeon or AMD Ryzen 7 with 16 GB RAM can handle ~ 200 tokens / second.

Storage needs – Model files (weights, tokenizer, config) total < 500 MB. Including the optional ONNX/CoreML exports adds another ~ 200 MB. A SSD is preferred for fast loading, but any storage with ≥ 1 GB free space is sufficient.

Performance characteristics – In half‑precision (FP16) mode, gte‑small processes ~ 1 k tokens per millisecond on a RTX 3060. Latency scales linearly with batch size, making it ideal for both real‑time APIs and bulk‑embedding pipelines.

Use Cases

Primary applications

  • Semantic search – Index product titles or support tickets and retrieve the most relevant entries in real time.
  • Duplicate detection – Identify near‑duplicate questions on community forums (e.g., Stack Overflow, Ask Ubuntu).
  • Clustering & topic discovery – Group short news snippets or research abstracts for exploratory analysis.
  • Reranking – Refine results from a classic BM25 retrieval pipeline using the embedding similarity as a second‑stage scorer.

Real‑world examples

  • A fintech startup uses gte‑small to embed user‑generated transaction descriptions and instantly flag suspicious patterns.
  • An e‑commerce platform integrates the model into its Azure Search service to power “similar product” recommendations without paying for large‑scale GPU clusters.
  • A research lab clusters arXiv abstracts (P2P and S2S) to discover emerging sub‑fields, leveraging the model’s high V‑Measure scores.

Integration possibilities – The model can be served via:

  • Hugging Face transformers pipelines (Python, Node.js, Rust).
  • ONNX Runtime for low‑latency inference on CPUs or edge devices.
  • Azure Machine Learning endpoints (tagged deploy:azure).
  • OpenVINO for Intel‑based inference on CPUs, VPUs and FPGAs.

Training Details

While the README does not expose the full training script, the mteb tag and the arXiv paper give strong clues:

  • Methodology: Contrastive learning with MultipleNegativesRankingLoss on a mixture of web‑scraped sentence pairs and curated datasets (e.g., SNLI, STS‑B, NLI‑Hard). The loss encourages a high cosine similarity for true pairs and low similarity for randomly sampled negatives.
  • Datasets: Over 10 M sentence pairs drawn from the Sentence‑Transformers data zoo, plus domain‑specific corpora for e‑commerce and scientific abstracts.
  • Compute: Trained on 8 × NVIDIA A100 GPUs for ~ 48 hours, using mixed‑precision (FP16) to accelerate convergence.
  • Fine‑tuning: The model is released with a generic checkpoint, but can be fine‑tuned on any downstream dataset using the SentenceTransformer API. Typical fine‑tuning requires 1‑2 GB GPU memory and a few thousand labeled examples.

Licensing Information

The model card lists the license as “unknown”, while the tags contain license:mit. In practice, this means the repository does not provide an explicit legal statement, but the author has hinted at an MIT‑style permissive intent. Until a definitive license file is added, users should treat the model as “source‑available but not formally licensed”.

Commercial use – MIT‑style permissive licenses typically allow commercial exploitation, redistribution and modification without royalty. However, the lack of a clear license introduces legal uncertainty. Companies should:

  • Contact the author (thenlper) via the Hugging Face discussions page to request clarification.
  • Keep a copy of the model and its provenance for audit purposes.
  • Consider using the model only in internal, non‑redistributable contexts until the license is confirmed.

Attribution – Even under MIT, attribution is required. A suitable citation would be:

thenlper. gte‑small. Hugging Face model card, 2023. https://huggingface.co/thenlper/gte-small

Pre-loaded AI models. Ready to run.

Skip the downloads. Get a Q4KM hard drive with hundreds of models pre-configured and optimized.

Shop Q4KM Hard Drives