alt.freeweights.granite / granite-embedding-30m-sparse
From: ibm-granite <huggingface.co/ibm-granite>Newsgroups: alt.freeweights.graniteSubject:

granite-embedding-30m-sparse

Date: 2026-11-15Commit: ad82b1fSigned: 2DC28CC7B26A283B ✓

Feature extraction model with 30M parameters. Safetensors weights, 373 MB in all. Published by ibm-granite under Apache-2.0.

30M params373MBgranite-embedding-30m-sparsesafetensorspermissive
FactsParams30MSize373 MBFormatssafetensorsTaskfeature extractionLicenseApache-2.0From sourcepermissive
$ fw get ibm-granite/granite-embedding-30m-sparse
# manifest sha256 d33694a93004… · 373 MB · 15 files
$ fw verify ./granite-embedding-30m-sparse ibm-granite/granite-embedding-30m-sparse
From sourceHosted (signed)ibm-granite/granite-embedding-30m-sparseLast check: 2026-11-15 04:12 UTC

Get help: custom fine-tune or private deploy. We review your setup before we quote.

Works with

Evaluate with

Overview

Size
373 MB
Weights
60.7 MB (safetensors)
Parameters
30M
Formats
safetensors
Task
feature extraction
License
Apache-2.0 (permissive)
Files
15, each with a sha256
Publisher
ibm-granite
Added
2026-11-15
Section
alt.freeweights.granite
Lineage

Original release from the publisher.

Where these bytes come from
Publisher at the pinned commit→You

Sources are tried in order. A file counts only when its size and sha256 match the manifest. Sources are checked when you ask for them, not on a timer.

Sources
BadgeHostLast checkResult
From sourcehuggingface.co2026-11-15 04:12 UTCpassed

Model card

From the publisher at commit ad82b1f. Shown as plain text with links; images open at the publisher.

Granite-Embedding-30m-Sparse#

Model Summary: Granite-Embedding-30m-Sparse is a 30M parameter sparse biencoder embedding model from the Granite Experimental suite that can be used to generate high quality text embeddings. This model produces variable length bag-of-word like dictionary, containing expansions of sentence tokens and their corresponding weights and is trained using a combination of open source relevance-pair datasets with permissive, enterprise-friendly license, and IBM collected and generated datasets. While maintaining competitive scores on academic benchmarks such as BEIR, this model also performs well on many enterprise use cases. This model is developed using retrieval oriented pretraining, contrastive finetuning and knowledge distillation for improved performance.

Supported Languages: English.

Intended use: The model is designed to produce variable length bag-of-word like dictionary, containing expansions of sentence tokens and their corresponding weights, for a given text, which can be used for text similarity, retrieval, and search applications.

Usage with Milvus: The model is compatible with Milvus Vector DB and is very easy to use:

First, install the pymilvus library

pip install pymilvus[model]

The model can then be used to encode pairs of text and find the similarity between their representations


from pymilvus import model
from pymilvus import MilvusClient, DataType

client = MilvusClient("./milvus_demo.db")

client.drop_collection(collection_name="my_sparse_collection")

schema = client.create_schema(
    auto_id=True,
    enable_dynamic_fields=True,
)

schema.add_field(field_name="pk", datatype=DataType.VARCHAR, is_primary=True, max_length=100)
schema.add_field(field_name="id", datatype=DataType.VARCHAR, is_primary=False, max_length=100)
schema.add_field(field_name="embeddings", datatype=DataType.SPARSE_FLOAT_VECTOR)

index_params = client.prepare_index_params()

index_params.add_index(field_name="embeddings",
                               index_name="sparse_inverted_index",
                               index_type="SPARSE_INVERTED_INDEX",
                               metric_type="IP",
                               params={"drop_ratio_build": 0.2})
client.create_collection(
    collection_name="my_sparse_collection",
    schema=schema,
    index_params=index_params
)

embeddings_model = model.sparse.SpladeEmbeddingFunction(
    model_name="ibm-granite/granite-embedding-30m-sparse", 
    device="cpu",
    batch_size=2,
    k_tokens_query=50,
    k_tokens_document=192
)

# Prepare documents to be ingested
docs = [
    "Artificial intelligence was founded as an academic discipline in 1956.",
    "Alan Turing was the first person to conduct substantial research in AI.",
    "Born in Maida Vale, London, Turing was raised in southern England.",
]

# SpladeEmbeddingFunction.encode_documents returns sparse matrix or sparse array depending
# on the milvus-model version. reshape(1,-1) ensures the format is correct for ingestion.
doc_vector = [{"embeddings": doc_emb.reshape(1,-1), "id": f"item_{i}"} for i, doc_emb in enumerate(embeddings_model.encode_documents(docs))]


client.insert(
    collection_name="my_sparse_collection",
    data=doc_vector
)

# Prepare search parameters
search_params = {
    "params": {"drop_ratio_search": 0.2},  # Additional optional search parameters
}

# Prepare the query vector

queries = [
      "When was artificial intelligence founded", 
      "Where was Turing born?"
]
query_vector = embeddings_model.encode_documents(queries)

res = client.search(
    collection_name="my_sparse_collection",
    data=query_vector,
    limit=1, #top k documents to return
    output_fields=["id"],
    search_params=search_params,
)

for r in res:
    print(r)

Usage with Sentence Transformers:

First install the Sentence Transformers library:

pip install -U sentence-transformers

Then you can load this model and run inference.


from sentence_transformers import SparseEncoder

# Download from the 🤗 Hub
model = SparseEncoder("ibm-granite/granite-embedding-30m-sparse")

# Run inference
docs = [
    "Artificial intelligence was founded as an academic discipline in 1956.",
    "Alan Turing was the first person to conduct substantial research in AI.",
    "Born in Maida Vale, London, Turing was raised in southern England.",
]
docs_embeddings = model.encode_document(docs, max_active_dims=192)
print(docs_embeddings.shape)
# [3, 50265]

queries = ["When was artificial intelligence founded", "Where was Turing born?"]
queries_embeddings = model.encode_query(queries, max_active_dims=50)
print(queries_embeddings.shape)
# [2, 50265]

# Get the similarity scores for the embeddings
similarities = model.similarity(queries_embeddings, docs_embeddings)
print(similarities.shape)
# [2, 3]

for i, query in enumerate(queries):
    best_doc_index = similarities[i].argmax().item()

    print(f"Query: {query}")
    print(f"Best doc associate: Similarity: {similarities[i][best_doc_index]:.4f}, Doc: {docs[best_doc_index]}")
    intersection = model.intersection(queries_embeddings[i], docs_embeddings[best_doc_index])
    decoded_intersection = model.decode(intersection, top_k=10)
    print("Top 10 tokens influencing the similarity:")
    for token, score in decoded_intersection:
        print(f"Token: {token}, Score: {score:.4f}")

# Query: When was artificial intelligence founded
# Best doc associate: Similarity: 12.3641, Doc: Artificial intelligence was founded as an academic discipline in 1956.
# Top 10 tokens influencing the similarity:
# Token: ĠAI, Score: 2.7591
# Token: Ġintelligence, Score: 2.2971
# Token: Ġartificial, Score: 1.7654
# Token: Ġfounded, Score: 1.3254
# Token: Ġinvention, Score: 0.9808
# Token: Ġlearning, Score: 0.4847
# Token: Ġcomputer, Score: 0.4789
# Token: Ġrobot, Score: 0.3466
# Token: Ġestablishment, Score: 0.3371
# Token: Ġscientific, Score: 0.2804
# Query: Where was Turing born?
# Best doc associate: Similarity: 17.1359, Doc: Born in Maida Vale, London, Turing was raised in southern England.
# Top 10 tokens influencing the similarity:
# Token: uring, Score: 2.9761
# Token: ĠTuring, Score: 2.4544
# Token: Ġborn, Score: 2.4314
# Token: ing, Score: 1.7760
# Token: ure, Score: 1.7626
# Token: Ġcomput, Score: 1.3356
# Token: Ġraised, Score: 1.3285
# Token: able, Score: 1.1940
# Token: Ġphilosopher, Score: 0.4118
# Token: Ġmachine, Score: 0.3977

Evaluation:

Granite-Embedding-30m-Sparse is competive in performance to the naver/splade-v3-distilbert despite being half the parameter size. We also compare the sparse model with similar sized dense embedding counterpart ibm-granite/granite-embedding-30m-english. The performance of the models on MTEB Retrieval (i.e., BEIR) is reported below. To maintain consistency with results reported by naver/splade-v3-distilbert, we do not include CQADupstack and MS-MARCO in the table below.

ModelParamters (M)Vocab SizeBEIR Retrieval (13)
naver/splade-v3-distilbert673052250.0
granite-embedding-30m-english305026550.6
granite-embedding-30m-sparse305026550.8

Model Architecture: Granite-Embedding-30m-Sparse is based on an encoder-only RoBERTa like transformer architecture, trained internally at IBM Research.

Modelgranite-embedding-30m-sparse
Embedding size384
Number of layers6
Number of attention heads12
Intermediate size1536
Activation FunctionGeLU
Vocabulary Size50265
Max. Sequence Length512
# Parameters30M

Training Data: Overall, the training data consists of four key sources: (1) unsupervised title-body paired data scraped from the web, (2) publicly available paired with permissive, enterprise-friendly license, (3) IBM-internal paired data targetting specific technical domains, and (4) IBM-generated synthetic data. The data is listed below:

DatasetNum. Pairs
SPECTER citation triplets684,100
Stack Exchange Duplicate questions (titles)304,525
Stack Exchange Duplicate questions (bodies)250,519
Stack Exchange Duplicate questions (titles+bodies)250,460
Natural Questions (NQ)100,231
SQuAD2.087,599
PAQ (Question, Answer) pairs64,371,441
Stack Exchange (Title, Answer) pairs4,067,139
Stack Exchange (Title, Body) pairs23,978,013
Stack Exchange (Title+Body, Answer) pairs187,195
S2ORC Citation pairs (Titles)52,603,982
S2ORC (Title, Abstract)41,769,185
S2ORC (Citations, abstracts)52,603,982
WikiAnswers Duplicate question pairs77,427,422
SearchQA582,261
HotpotQA85,000
Fever109,810
Arxiv2,358,545
Wikipedia20,745,403
PubMed20,000,000
Miracl En Pairs9,016
DBPedia Title-Body Pairs4,635,922
Synthetic: Query-Wikipedia Passage1,879,093
Synthetic: Fact Verification9,888
IBM Internal Triples40,290
IBM Internal Title-Body Pairs1,524,586

Notably, we do not use the popular MS-MARCO retrieval dataset in our training corpus due to its non-commercial license.

Infrastructure: We train Granite Embedding Models using IBM's computing cluster, Cognitive Compute Cluster, which is outfitted with NVIDIA A100 80gb GPUs. This cluster provides a scalable and efficient infrastructure for training our models over multiple GPUs.

Ethical Considerations and Limitations: The data used to train the base language model was filtered to remove text containing hate, abuse, and profanity. Granite-Embedding-30m-Sparse is trained only for English texts, and has a context length of 512 tokens (longer texts will be truncated to this size).

Resources

Citation#

@misc{awasthy2025graniteembeddingmodels,
      title={Granite Embedding Models}, 
      author={Parul Awasthy and Aashka Trivedi and Yulong Li and Mihaela Bornea and David Cox and Abraham Daniels and Martin Franz and Gabe Goodhart and Bhavani Iyer and Vishwajeet Kumar and Luis Lastras and Scott McCarley and Rudra Murthy and Vignesh P and Sara Rosenthal and Salim Roukos and Jaydeep Sen and Sukriti Sharma and Avirup Sil and Kate Soule and Arafat Sultan and Radu Florian},
      year={2025},
      eprint={2502.20204},
      archivePrefix={arXiv},
      primaryClass={cs.IR},
      url={https://arxiv.org/abs/2502.20204}, 
}

Files

15 files · 373 MBWeights 60.7 MB (safetensors). Sizes and sha256 from the signed manifest.
Hide all 15 files with their sha256
FileSizesha256
.gitattributes1.52 KB11ad7efa24975ee4b0c3c3a38ed18737f0658a5f75a0a96787b576a78a023361
1_SpladePooling/config.json106 B07580f9ee2553c16b418853be6811a7b0abd7393ee96c487f32b6b0ba1a5e6b4
README.md12.7 KB2330bb29111ba00dd29f78a41af8af71b845bd5ee29182e12383345ff443d86d
config.json688 B6a5eb43349f9708c99940b5c297d87708746190ba723fb2a7160629cf27b3c4c
config_sentence_transformers.json274 B44e5b5295415281c3f61341f0670bf6752ce1d85880380faeebae3752889d718
merges.txt456 KBfe36cab26d4f4421ed725e10a2e9ddb7f799449c603a96e7f29b5a3c82a95862
model.safetensors60.7 MB08632803138e24c4ba36ca59e76a78a8cc1a21f29257c5fd87461a3d912e1a66
modules.json274 B49d17c5888db1d0f18dde2855770b5f796240df89ddf56f8589380072479e1e3
pytorch_model.bin310 MB414e5f24f6a14f6c336c9ca2174c3a9dfb8a803b29ed5fc22cbbdeb696c5c2cf
sentence_bert_config.json57 B948201d8329907aae938fa62f9ceeed53f5694dacc2b87b9f3b78b37ee986529
special_tokens_map.json239 B378eb3bf733eb16e65792d7e3fda5b8a4631387ca04d2015199c4d4f22ae554d
tokenizer.json1.36 MB33465117406b9007673e8ba283f7f1383d9b5094df947481af60eec94ed7d7bd
tokenizer_config.json1.18 KB37d6615d67cc6d6ca861957eafd9edee2bcec5c5b3301c4acb629bde1925f2cb
vocab.json798 KBed19656ea1707df69134c4af35c8ceda2cc9860bf2c3495026153a133670ab5e
zero_to_fp32.py23.6 KB061bdb6df821b30589945691c45ddf5731de7baf150f76b0555f850187e4062f
VersionsEach time the pinned upstream commit or file list changed in this repo. Newest first.
Upstream commitDateContents
ad82b1fd09 pinned now2026-11-15 04:12 UTC15 files · 373 MB

Use it

$ fw get ibm-granite/granite-embedding-30m-sparse
# manifest sha256 d33694a93004… · 373 MB · 15 files
$ fw verify ./granite-embedding-30m-sparse ibm-granite/granite-embedding-30m-sparse
fw.pyChecks the signature and every sha256, tries each source in order, resumes.
$ python3 fw.py get https://freeweights.allternit.com/manifests/ibm-granite/granite-embedding-30m-sparse.json --dir ./granite-embedding-30m-sparse $ python3 fw.py verify ./granite-embedding-30m-sparse ./ibm-granite__granite-embedding-30m-sparse.json
hfThe Hugging Face CLI with one setting. Same repo id.
$ HF_ENDPOINT=https://freeweights.allternit.com hf download ibm-granite/granite-embedding-30m-sparse --revision ad82b1fd09541c998c8d45045d601c51fdb8a9b7 --local-dir ./granite-embedding-30m-sparse
transformersLoad the weights in Python.
import os os.environ["HF_ENDPOINT"] = "https://freeweights.allternit.com" from transformers import AutoModel, AutoTokenizer tok = AutoTokenizer.from_pretrained("ibm-granite/granite-embedding-30m-sparse", revision="ad82b1fd09541c998c8d45045d601c51fdb8a9b7") model = AutoModel.from_pretrained("ibm-granite/granite-embedding-30m-sparse", revision="ad82b1fd09541c998c8d45045d601c51fdb8a9b7", device_map="auto")
sentence-transformersEmbed text with sentence-transformers.
import os os.environ["HF_ENDPOINT"] = "https://freeweights.allternit.com" from sentence_transformers import SentenceTransformer model = SentenceTransformer("ibm-granite/granite-embedding-30m-sparse", revision="ad82b1fd09541c998c8d45045d601c51fdb8a9b7") vectors = model.encode(["Hello"])

License

Name
Apache License 2.0
Id
Apache-2.0
Class
Permissive
Redistribution
yes
Listing
Hosted (signed)
Decided
License as declared by the publisher. No person read it. 2026-11-15
Text in
README.md
Text sha256
2330bb29111ba00dd29f78a41af8af71b845bd5ee29182e12383345ff443d86d
Terms gate
No extra terms beyond the license.

Read the license text

Licenses are checked against the license table. A custom license passes only after a person reads it.

Provenance

From: ibm-granite <huggingface.co/ibm-granite>Newsgroups: alt.freeweights.graniteSubject: granite-embedding-30m-sparseDate: 2026-11-15Commit: ad82b1fSigned: 2DC28CC7B26A283B ✓
Upstream
ibm-granite/granite-embedding-30m-sparse
Pinned commit
ad82b1fd09541c998c8d45045d601c51fdb8a9b7
Manifest
granite-embedding-30m-sparse.json · .minisig
Manifest sha256
d33694a930047ebf89213a9688a5dcf2190f6a662ee2dbe5bf2acac30f8fdca8
Signature
minisign, Ed25519, key 2DC28CC7B26A283B
Created
2026-11-15 04:12 UTC
Generator
freeweights-manifest/0.1.0
Takedowns
None.

How to verify

$ curl -O https://freeweights.allternit.com/manifests/ibm-granite/granite-embedding-30m-sparse.json $ curl -O https://freeweights.allternit.com/manifests/ibm-granite/granite-embedding-30m-sparse.json.minisig $ minisign -Vm granite-embedding-30m-sparse.json -P RWQ7KGqyx4zCLXtUFOqvfv8L3g+8fpKJ1FsuxPyOYMF+4KufbUxKq1Oq $ shasum -a 256 <file> # compare with the Files tab

A manifest whose signature fails must be rejected. A file whose size or sha256 does not match must be discarded. Verify a download

Model tree

No related models in this catalog.Nothing here lists this model as its parent, and it names no parent.
Get it
Download
$ HF_ENDPOINT=https://freeweights.allternit.com hf download ibm-granite/granite-embedding-30m-sparse
Open in Freeweights Studio

Pull, verify and run it in the Allternit app on Desktop, web or phone.

Signed manifest
minisign, key 2DC28CC7B26A283B. granite-embedding-30m-sparse.json. Provenance. Takedown history: none.
From: ibm-granite <huggingface.co/ibm-granite>Subject: GneissWeb.7B_ablation_model_on_350B_FineWeb.Edu.seed1
From: ibm-granite <huggingface.co/ibm-granite>Subject: GneissWeb.7B_ablation_model_on_350B_FineWeb.Edu.seed2
From: ibm-granite <huggingface.co/ibm-granite>Subject: GneissWeb.7B_ablation_model_on_350B_FineWeb.Edu.seed3
From: ibm-granite <huggingface.co/ibm-granite>Subject: GneissWeb.7B_ablation_model_on_350B_FineWeb.seed1
From: ibm-granite <huggingface.co/ibm-granite>Subject: GneissWeb.7B_ablation_model_on_350B_FineWeb.seed2
From: ibm-granite <huggingface.co/ibm-granite>Subject: GneissWeb.7B_ablation_model_on_350B_FineWeb.seed3