CoolFace
Modelpublic

Tarka-AIR/Tarka-Embedding-30M-V1

sourceHugging Faceapache-2.0updated 9mo agoView on Hugging Face
0likes26downloads
Model Card

Tarka Embedding 30M V1

[!NOTE] ## Features - Compressed model by 20x. - Recovered approx. 86% performance on MTEB(Eng, v2) Benchmark

For more details refer the blog post

Results

MTEB(Eng, V2)

ModelParameters (B)Mean (Task)Mean (TaskType)ClassificationClusteringPair ClassificationRerankingRetrievalSTSSummarization
all-MiniLM-L6-v20.02359.0355.9369.2544.982.3747.1442.9278.9525.96
gte-micro-v40.01958.956.0473.0443.8982.6744.7839.5179.7828.59
snowflake-arctic-embed-xs0.02359.7756.126742.4481.3345.2652.6576.2127.96
gte-micro0.01753.8952.567.4741.8680.7643.1627.6677.8628.76
Qwen3 Embedding 0.6B0.670.764.8885.7654.0584.3748.1861.8386.5733.43
Tarka Embedding 30M V1 (S)0.0346.0745.2260.3741.3766.2938.3419.5664.1526.44
Tarka Embedding 30M V1 (M)0.0351.9649.8866.5243.4770.6640.1230.1569.8128.42
Tarka Embedding 30M V1 (L)0.0360.4356.6979.246.9978.2443.3242.576.9229.63

Usage

python
from sentence_transformers import SentenceTransformer

# We recommend enabling flash_attention_2 for better acceleration and memory saving,
model = SentenceTransformer(
    "Tarka-AIR/Tarka-Embedding-30M-V1",
    trust_remote_code=True,
    model_kwargs={
        "attn_implementation": "flash_attention_2",
        "device_map": "cuda",
        "torch_dtype": "bfloat16",
    },
    tokenizer_kwargs={"padding_side": "left"},
)

# Config the model inference mode ("L","M","S")
model[0].auto_model.configure_subnetwork("L")

# The queries and documents to embed
queries = [
    "What is the capital of China?",
    "Explain gravity",
]
documents = [
    "The capital of China is Beijing.",
    "Gravity is a force that attracts two bodies towards each other. It gives weight to physical objects and is responsible for the movement of planets around the sun.",
]

# Encode the queries and documents. Note that queries benefit from using a prompt
# Here we use the prompt called "query" stored under `model.prompts`, but you can
# also pass your own prompt via the `prompt` argument
query_embeddings = model.encode(queries, prompt_name="query")
document_embeddings = model.encode(documents)

# Compute the (cosine) similarity between the query and document embeddings
similarity = model.similarity(query_embeddings, document_embeddings)
print(similarity)

# tensor([[0.8371, 0.1740],
#         [0.2176, 0.6293]])