SAVRN
Search Contact SAVRN

Open-weight model · Sentence similarity

semantic-lite-2

by Zulfah ukung/semantic-lite-2

Semantic-Lite-2 is a lightweight multilingual sentence embedding model that produces 256-dimensional semantic vectors. It is designed for semantic search, sentence similarity, clustering, retrieval, and retrieval-augmented generation (RAG) tasks.

Parameters460M
Context1,048,576
Weights1.6 GB
Licenseapache-2.0
AccessOpen weights
Monthly Downloads

Runs On

What it takes to serve semantic-lite-2 (460M parameters): the memory its weights need at each precision, and the cheapest way to rent enough data-center GPUs to hold them.

PrecisionWeightsMemory neededCheapest setupPer hourAlso fits
16-bit 0.9 GB 1.1 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
8-bit 0.5 GB 0.6 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00
4-bit 0.2 GB 0.3 GB 1x MI300X (192 GB)
Vultr
$1.85 1x H100 $1.99 · 1x MI325X $2.00

Memory is the weights at that precision plus 20% for the runtime and a short context; a long context needs more. Prices are the lowest on-demand hourly rates in the SAVRN Index, read Sep 18, 2026.

Model Card

By Zulfah, published under apache-2.0, revision c166225b932a.

Semantic-Lite-2 is a lightweight multilingual sentence embedding model that produces 256-dimensional semantic vectors. It is designed for semantic search, sentence similarity, clustering, retrieval, and retrieval-augmented generation (RAG) tasks. The model is built on top of the Spark-X2.5-1.7B backbone using a frozen-backbone plus trainable-projection-head approach. The 256-dimensional output keeps vector storage compact while preserving strong retrieval quality. Vectors are L2-normalized, so cosine similarity is computed as a simple dot product. Evaluated on 500 Indonesian NLI evaluation pairs (retrieval task, chance level 0.2%): Cross-lingual evaluation (10 languages, 20 pairs per…

Read Zulfah's full model card

Semantic-Lite-2 is a lightweight multilingual sentence embedding model that produces 256-dimensional semantic vectors. It is designed for semantic search, sentence similarity, clustering, retrieval, and retrieval-augmented generation (RAG) tasks. The model is built on top of the Spark-X2.5-1.7B backbone using a frozen-backbone plus trainable-projection-head approach.

The 256-dimensional output keeps vector storage compact while preserving strong retrieval quality. Vectors are L2-normalized, so cosine similarity is computed as a simple dot product.

Model Architecture

input -> embedding (frozen)
      -> 2 backbone layers (frozen)       # pretrained knowledge
      -> 2 attention-head layers (trained) # projection head
      -> mean pooling
      -> Linear(2048 -> 256)
      -> L2 normalization
      -> 256-dimensional semantic vector
Component Parameters Status
Embedding table (131072 x 2048) 268.4M frozen
2 backbone layers 102.8M frozen
2 attention-head layers 88.1M trainable
Linear projection (2048 -> 256) 0.52M trainable

Performance

Evaluated on 500 Indonesian NLI evaluation pairs (retrieval task, chance level 0.2%):

Metric Semantic-Lite-2 all-MiniLM-L6-v2
top-1 accuracy 82.4% 64.0%
top-5 accuracy 91.0% 75.8%
MRR 0.863 0.696

Cross-lingual evaluation (10 languages, 20 pairs per language): 64.5% versus MiniLM 44.5%.

Quantized Versions

The model is available in three precision levels. Quality is measured on the same 500 Indonesian NLI evaluation pairs.

Version File Size top-1 top-5 MRR
fp16 model.safetensors 919 MB 82.8% 91.2% 0.864
q8 model_q8.safetensors 471 MB 82.6% 91.0% 0.863
q4 model_q4.safetensors 241 MB 80.0% 89.6% 0.847

Quantization uses per-group quantization (group size 128) applied to the 2D weight tensors. Small tensors (biases and layer norms) remain in fp16. The q8 variant is practically lossless, while the q4 variant reduces top-1 accuracy by roughly 3% in exchange for a roughly 75% reduction in size.

Quick Start

from transformers import AutoTokenizer, AutoModel
import torch

model = AutoModel.from_pretrained("ukung/semantic-lite-2", trust_remote_code=True)
tokenizer = AutoTokenizer.from_pretrained("ukung/semantic-lite-2")

def embed(texts):
    enc = tokenizer(texts, padding=True, truncation=True, return_tensors="pt")
    with torch.no_grad():
        v = model(input_ids=enc["input_ids"], attention_mask=enc["attention_mask"])
    return v  # already L2-normalized, shape (n, 256)

v1 = embed(["a cat sleeps on the sofa"])
v2 = embed(["a cat is sleeping on top of the sofa"])
similarity = (v1 * v2).sum(-1)  # cosine similarity
print(similarity.item())

For the quantized variants, use the quant_loader.py helper:

from quant_loader import load_quantized_model, encode
from transformers import AutoTokenizer

model = load_quantized_model("ukung/semantic-lite-2", bits=8)  # or bits=4
tokenizer = AutoTokenizer.from_pretrained("ukung/semantic-lite-2")
v = encode(model, tokenizer, ["an example sentence in English"])
print(v.shape)  # (1, 256)

Use Cases

This section provides ready-to-use recipes for the most common semantic tasks developers implement with sentence embeddings.

1. Semantic Search

Find the most relevant documents for a query by comparing cosine similarity against a precomputed index.

import torch

def embed(texts):
    enc = tokenizer(texts, padding=True, truncation=True, return_tensors="pt")
    with torch.no_grad():
        return model(input_ids=enc["input_ids"], attention_mask=enc["attention_mask"])

# index your corpus once
corpus = [
    "how to apply for an online loan",
    "traditional beef rendang recipe",
    "train schedule from Jakarta to Bandung",
    "requirements for making a new passport",
]
corpus_vectors = embed(corpus)  # (4, 256)

# search at query time
query = embed(["how do I borrow money through an app"])
scores = (query @ corpus_vectors.T).squeeze(0)  # cosine similarity
rank = torch.argsort(scores, descending=True)
for i in rank:
    print(f"{scores[i].item():.3f}  {corpus[i]}")

2. Sentence Similarity and Paraphrase Detection

Measure how similar two sentences are, or detect whether two sentences express the same meaning.

def similarity(a, b):
    va = embed([a])
    vb = embed([b])
    return (va * vb).sum(-1).item()

print(similarity("cheap flight ticket prices", "affordable airfare"))  # high
print(similarity("cheap flight ticket prices", "how to grow rice"))     # low

# threshold-based paraphrase detection
THRESHOLD = 0.75
is_paraphrase = similarity(text_a, text_b) > THRESHOLD

3. Clustering and Topic Grouping

Group related texts into clusters without labels using KMeans on the embedding space.

from sklearn.cluster import KMeans

texts = [...]  # your documents
X = embed(texts).numpy()

kmeans = KMeans(n_clusters=5, n_init=10, random_state=42)
labels = kmeans.fit_predict(X)

for text, label in zip(texts, labels):
    print(label, text)

4. Duplicate and Near-Duplicate Detection

Identify duplicate or near-duplicate records in a dataset using pairwise similarity.

import torch

X = embed(texts)
sim = X @ X.T  # (n, n) cosine similarity matrix

# find pairs above a high threshold (excluding self-comparison)
n = X.shape[0]
mask = torch.triu(torch.ones(n, n), diagonal=1).bool()
high = (sim > 0.92) & mask
idx = high.nonzero(as_tuple=False)
for i, j in idx.tolist():
    print(f"duplicate: {texts[i]}  <->  {texts[j]}")

5. Retrieval-Augmented Generation (RAG)

Retrieve relevant context for a language model from a vector store.

# build an index (here using a simple in-memory list)
chunks = [...]      # your knowledge-base chunks
chunk_vectors = embed(chunks)

query_vector = embed([user_question])
scores = (query_vector @ chunk_vectors.T).squeeze(0)
top_k = torch.topk(scores, k=3)

context = "
".join(chunks[i] for i in top_k.indices.tolist())
prompt = f"Context:
{context}

Question: {user_question}
Answer:"
# pass `prompt` to your generative LLM

For production RAG, pair the model with a vector database such as FAISS, Qdrant, Chroma, or Pinecone.

6. Zero-Shot Classification

Classify text into predefined categories without training a classifier, by comparing the text against label descriptions.

labels = [
    "a question about payment",
    "a question about shipping",
    "a question about returns and refunds",
]
label_vectors = embed(labels)

text_vector = embed(["how long will my package take to arrive"])
scores = (text_vector @ label_vectors.T).squeeze(0)
predicted = labels[torch.argmax(scores).item()]
print(predicted)

7. Cross-Lingual Matching

Match queries and documents written in different languages. The backbone is multilingual, so Indonesian, English, Arabic, Chinese, Japanese, Korean, Russian, Thai, Hindi, Vietnamese, Amharic, and Swahili share the same vector space.

q = embed(["how to brew coffee"])
docs = embed([
    "how to brew coffee",
    "how to grow rice",
])
scores = (q @ docs.T).squeeze(0)
print(scores)  # the coffee sentence should score highest

8. Recommendation by Content Similarity

Recommend items that are semantically similar to an item the user already likes.

items = [...]  # item descriptions
item_vectors = embed(items)

liked = embed(["a smartphone with a great camera"])
scores = (liked @ item_vectors.T).squeeze(0)
top_k = torch.topk(scores, k=5)
for i in top_k.indices.tolist():
    print(items[i])

9. Semantic Deduplication for Training Data

Clean a training corpus by removing semantically redundant examples, which improves downstream model quality.

seen = []
keep = []
for text in texts:
    v = embed([text])
    if seen and max((v @ torch.stack(seen).T).squeeze(0)).item() > 0.95:
        continue  # near-duplicate, skip
    seen.append(v)
    keep.append(text)

10. FAQ and Chatbot Intent Matching

Route a user message to the most relevant FAQ entry or intent.

faq = [
    ("how do I reset my password", "reset_password"),
    ("how to track my order", "track_order"),
    ("what is the refund policy", "refund_policy"),
]
faq_questions = [q for q, _ in faq]
faq_vectors = embed(faq_questions)

user_vector = embed(["I forgot my account password"])
scores = (user_vector @ faq_vectors.T).squeeze(0)
best = torch.argmax(scores).item()
print(faq[best][1])  # intent

Tips

  • The output vectors are already L2-normalized. Use a dot product for cosine similarity.
  • For large corpora, precompute and cache the corpus vectors once, then only embed new queries.
  • For production vector storage, any vector database that accepts 256-dimensional float vectors works.
  • The q8 variant is recommended for most deployments: it halves the model size with negligible quality loss.

Credits and License

The backbone originates from XHToken/Spark-X2.5-1.7B (Apache-2.0). This model is licensed under Apache-2.0.

Configuration

Architecture
SemanticLiteEmbedder
Context length (tokens)
1,048,576
Layers
2
Hidden size
2,048
Feed-forward size
6,656
Attention heads
8
Key/value heads
2
Head dimension
256
Vocabulary size
131,072
Sliding window (tokens)
512
Model type
semantic_lite

Identity and Version

Repository
ukung/semantic-lite-2
Publisher
Zulfah
Task
Sentence similarity
Modality
Text
Library
transformers
Parameters
460M parameters
Languages
id, en, ar, zh, ja, ko, ru, th
Revision
c166225b932ae2ea67f0788df7a5949a7f9e4430
First published
2026-09-18
Last updated
2026-09-18

Files and Weights

16 files, 1.6 GB in total. The weights are 3 files totalling 1.6 GB in safetensors.

Weights3 files · 1.6 GB
Configuration7 files · 32.6 KB
Tokenizer4 files · 14.7 MB
Documentation1 file · 9.7 KB
Repository1 file · 1.5 KB
Every file
FileTypeSizeSHA-256
model.safetensorsWeights919.8 MB 3b3e4555ffc4
model_q4.safetensorsWeights240.8 MB 6bd5918de619
model_q8.safetensorsWeights470.7 MB 30eae091f5a0
config.jsonConfiguration1.0 KB
configuration_semantic_lite.pyConfiguration4.5 KB
model_q4_config.jsonConfiguration1.3 KB
model_q8_config.jsonConfiguration1.3 KB
modeling_semantic_lite.pyConfiguration21.4 KB
quant_loader.pyConfiguration3.1 KB
special_tokens_map.jsonConfiguration156 B
README.mdDocumentation9.7 KB
.gitattributesRepository1.5 KB
merges.txtTokenizer1.6 MB
tokenizer.jsonTokenizer10.1 MB
tokenizer_config.jsonTokenizer4.8 KB
vocab.jsonTokenizer3.0 MB

License and Download

License
apache-2.0
Access
Open weights, no gate
Download size
1.6 GB
Download from Zulfah

Released by Zulfah through its official repository on Hugging Face. Read the license.

Built From

  • Derived from XHToken/Spark-X2.5-1.7B

Memory Requirements

PrecisionWeights in memory
As published1.6 GB
16-bit0.9 GB
8-bit0.5 GB
4-bit0.2 GB

Weights only, from the published parameter count; the key-value cache and runtime add to this.

Questions About semantic-lite-2

How much GPU memory does semantic-lite-2 need?

About 1.1 GB at 16-bit and 0.3 GB at 4-bit: the weights (460M parameters) plus a working margin. A long context needs more.

What is the cheapest GPU to run semantic-lite-2 on?

At 16-bit, 1x MI300X from $1.85 an hour; at 4-bit, 1x MI300X from $1.85 an hour, at the lowest on-demand prices the SAVRN Index lists.

Can I use semantic-lite-2 commercially?

Yes. semantic-lite-2 is released under Apache License 2.0. The Apache License 2.0 is a permissive open-source license. It permits commercial use, modification and redistribution. It requires keeping the license and copyright notices and any NOTICE file, stating significant changes, and it includes an express patent grant from contributors.

What is semantic-lite-2's context length?

1,048,576 tokens, from the maximum position embeddings in its published configuration.

Similar Models

Model · Sentence similarity

LaBSE

Sentence Transformers

This is a port of the LaBSE model to PyTorch. It can be used to map 109 languages to a shared vector space. Using this model becomes easy when you have sentence-transformers installed: Then you can use the model like this: Have a look at LaBSE for the respective publication that describes LaBSE.

Open weights apache-2.0 471M parameters 512 tokens sentence-transformers

Model · Sentence similarity

nomic-embed-text-v2-moe

Nomic AI

This model was presented in the paper Training Sparse Mixture Of Experts Text Embedding Models. nomic-embed-text-v2-moe is a SoTA multilingual MoE text embedding model that excels at multilingual retrieval: Transformer-based text embedding models have improved their performance on benchmarks like MIRACL and BEIR by increasing their parameter counts. However, this scaling approach introduces significant deployment challenges, including increased inference latency and memory usage. These challenges are particularly severe in retrieval-augmented generation (RAG) applications, where large models' increased memory requirements constrain dataset ingestion capacity, and their higher latency…

Open weights apache-2.0 475M parameters sentence-transformers

Model · Sentence similarity

gte-large-en-v1.5

Alibaba-NLP

We introduce gte-v1.5 series, upgraded gte embeddings that support the context length of up to 8192, while further enhancing model performance. The models are built upon the transformer++ encoder backbone (BERT + RoPE + GLU). The gte-v1.5 series achieve state-of-the-art scores on the MTEB benchmark within the same model size category and prodvide competitive on the LoCo long-context retrieval tests (refer to Evaluation). We also present the gte-Qwen1.5-7B-instruct, a SOTA instruction-tuned multi-lingual embedding model that ranked 2nd in MTEB and 1st in C-MTEB. Models for Multilingual Text Retrieval](https://arxiv.org/pdf/2407.19669) Use the code below to get started with the model. It is…

Open weights apache-2.0 434M parameters 8,192 tokens transformers

Model · Sentence similarity

all-roberta-large-v1

Sentence Transformers

This is a sentence-transformers model: It maps sentences & paragraphs to a 1024 dimensional dense vector space and can be used for tasks like clustering or semantic search. Using this model becomes easy when you have sentence-transformers installed: Then you can use the model like this: Without sentence-transformers, you can use the model like this: First, you pass your input through the transformer model, then you have to apply the right pooling-operation on-top of the contextualized word embeddings. The project aims to train sentence embedding models on very large sentence level datasets using a self-supervised contrastive learning objective. We used the pretrained roberta-large model and…

Open weights apache-2.0 355M parameters 514 tokens sentence-transformers

Model · Sentence similarity

snowflake-arctic-embed-l-v2.0

Snowflake

12/11/2024: Release of Technical Report - 12/04/2024: Release of snowflake-arctic-embed-l-v2.0 and snowflake-arctic-embed-m-v2.0 our newest models with multilingual workloads in mind. Snowflake arctic-embed-l-v2.0 is the newest addition to the suite of embedding models Snowflake has released optimizing for retrieval performance and inference efficiency. Arctic Embed 2.0 introduces a new standard for multilingual embedding models, combining high-quality multilingual text retrieval without sacrificing performance in English. Released under the permissive Apache 2.0 license, Arctic Embed 2.0 is ideal for applications that demand reliable, enterprise-grade multilingual search and retrieval at…

Open weights apache-2.0 568M parameters 8,194 tokens sentence-transformers

Model · Sentence similarity

lt-un-data-fine-fine-fr

Dell Research Harvard

This is a LinkTransformer model. At its core this model this is a sentence transformer model sentence-transformers model- it just wraps around the class. It is designed for quick and easy record linkage (entity-matching) through the LinkTransformer package. The tasks include clustering, deduplication, linking, aggregation and more. Notwithstanding that, it can be used for any sentence similarity task within the sentence-transformers framework as well. It maps sentences & paragraphs to a 1024 dimensional dense vector space and can be used for tasks like clustering or semantic search. Take a look at the documentation of sentence-transformers if you want to use this model for more than what we…

Open weights 337M parameters 514 tokens sentence-transformers