Aletheia MiniLM-L12-v2 (zafaralsathiq/aletheia-minilm-l12)
This is a 12-layer dense sentence embedding model mapping natural language sentences and scientific abstracts into a 384-dimensional dense vector space.
It is optimized for Aletheia Search, a Zero-Hub scientific discovery and synthesis engine that couples dense neural text embeddings with Kim-Vu $d$-regular expander graphs to eliminate citation mega-hub bias and discover unbridged cross-domain research literature.
Model Details
- Model Type: Sentence Transformer (12-layer BERT encoder)
- Base Architecture: MiniLM-L12 (384 hidden dimensions, 12 attention heads, 1536 intermediate size)
- Output Dimensionality: 384 dimensions
- Max Sequence Length: 512 tokens
- Pooling Strategy: Mean pooling over attention-masked token embeddings
- Normalization: L2 unit norm ($|\vec{v}|_2 = 1.0$)
- Weights Format: Zero-copy binary
model.safetensors(128 MB)
Intended Use
- Scientific Literature Retrieval & Clustering: Semantic indexing of peer-reviewed papers, preprints, and clinical trial abstracts.
- Topological Expander Routing: Feeding dense affinity scores into degree-regularized graph routers (e.g. Aletheia Kim-Vu coupling).
- Literature-Based Discovery (LBD): Identifying cross-domain unbridged structural voids and Swanson 2-hop triads ($A \to B \to C$).
- General Text Similarity & Semantic Search: Drop-in replacement for 6-layer
all-MiniLM-L6-v2with greater semantic depth and representation capacity.
Usage
1. Using sentence-transformers (Recommended)
pip install sentence-transformers
from sentence_transformers import SentenceTransformer
# Load model directly from Hugging Face
model = SentenceTransformer("zafaralsathiq/aletheia-minilm-l12")
sentences = [
"Targeting KRAS G12D mutations with small molecule inhibitors",
"Novel therapeutic avenues for pancreatic ductal adenocarcinoma",
"Photosynthetic carbon fixation efficiency in marine red macroalgae",
]
# Generate L2-normalized embeddings
embeddings = model.encode(sentences, normalize_embeddings=True)
print("Embedding shape:", embeddings.shape) # (3, 384)
# Compute cosine similarity via dot product
similarity = embeddings[0] @ embeddings[1]
print(f"Cosine Similarity (Related): {similarity:.4f}")
2. Using Hugging Face transformers & PyTorch
import torch
import torch.nn.functional as F
from transformers import AutoTokenizer, AutoModel
tokenizer = AutoTokenizer.from_pretrained("zafaralsathiq/aletheia-minilm-l12")
model = AutoModel.from_pretrained("zafaralsathiq/aletheia-minilm-l12")
model.eval()
texts = ["Targeting KRAS G12D mutations with small molecule inhibitors"]
# Tokenize
encoded = tokenizer(texts, padding=True, truncation=True, max_length=512, return_tensors="pt")
with torch.no_grad():
outputs = model(**encoded)
token_embeddings = outputs[0]
# Mean pooling
mask = encoded["attention_mask"].unsqueeze(-1).expand(token_embeddings.size()).float()
sum_embeddings = torch.sum(token_embeddings * mask, 1)
sum_mask = torch.clamp(mask.sum(1), min=1e-9)
pooled = sum_embeddings / sum_mask
# L2 Unit Normalization
embeddings = F.normalize(pooled, p=2, dim=1)
print("Vectors:", embeddings.shape)
3. Using Native Rust with Candle
The repository provides zero-copy model.safetensors and tokenizer.json for native execution in Rust without Python:
cargo add candle-core candle-transformers tokenizers safetensors
Empirical Verification
Measured on domain scientific literature pairs:
| Text Pair | Domain Relationship | Cosine Similarity |
|---|---|---|
| KRAS G12D Inhibitors $\longleftrightarrow$ KRAS PROTAC Degraders | Highly Related (Cancer Oncology) | 0.7329 |
| KRAS G12D Inhibitors $\longleftrightarrow$ Marine Algal Photosynthesis | Unrelated Control | 0.0012 |
| Separation Margin | Discriminative Delta | +0.7317 |
Citation & Attribution
If you use this model in your research, cite:
@software{aletheia_search_2026,
author = {Zafar Al Sathiq},
title = {Aletheia Search: Zero-Hub Scientific Discovery Engine},
year = {2026},
publisher = {Hugging Face},
url = {https://huggingface.co/zafaralsathiq/aletheia-minilm-l12}
}