TensorFluxEmbedder

TensorFluxEmbedder is a fine-tuned text embedding model covering four domains โ€” general language, web search, scientific literature, and legal documents. Embeddings can be truncated from 768 โ†’ 512 โ†’ 256 โ†’ 128 โ†’ 64 dimensions at inference time with no retraining, letting you directly trade retrieval quality for speed and memory.

Model Specifications

Property Value
Architecture ModernBERT
Embedding dimensions 768, 512, 256, 128, 64
Max input length 8,192 tokens
Similarity metric Cosine
Language English
License Apache 2.0

Performance

TensorFluxEmbedder Performance Chart

NDCG@10 on held-out test sets across all five supported dimensionalities:

Dims SciFact NDCG@10 Legal NDCG@10 Vector size vs 768d
768 0.718 0.422 100%
512 0.707 0.417 67%
256 0.697 0.400 33%
128 0.665 0.345 17%
64 0.587 0.278 8%

256 dimensions is the recommended default for latency-sensitive RAG: it retains 97% of peak SciFact quality at one-third the storage cost.

Full Evaluation Results

SciFact (held-out test set)

Metric 768d 512d 256d 128d 64d
Accuracy@1 0.603 0.603 0.580 0.543 0.447
Accuracy@10 0.860 0.843 0.840 0.810 0.743
Recall@1 0.576 0.573 0.553 0.524 0.434
Recall@10 0.851 0.831 0.829 0.795 0.727
NDCG@10 0.718 0.707 0.697 0.665 0.587
MRR@10 0.683 0.675 0.663 0.631 0.549
MAP@100 0.678 0.670 0.656 0.625 0.544

Legal RAG (held-out 10% split)

Metric 768d 512d 256d 128d 64d
Accuracy@1 0.158 0.161 0.145 0.107 0.093
Accuracy@10 0.702 0.692 0.675 0.598 0.491
Recall@1 0.158 0.161 0.145 0.107 0.093
Recall@10 0.702 0.692 0.675 0.598 0.491
NDCG@10 0.422 0.417 0.400 0.345 0.278
MRR@10 0.332 0.329 0.312 0.265 0.212
MAP@100 0.342 0.338 0.321 0.276 0.224

The legal corpus uses a 1:1 query-to-passage evaluation scheme where each query has exactly one relevant passage in the full corpus, making the task harder than typical multi-relevant benchmarks.

Usage

pip install sentence-transformers

Always prefix your inputs to distinguish query intent from document content:

Input type Prefix
Search query search_query:
Document / passage search_document:
from sentence_transformers import SentenceTransformer

model = SentenceTransformer("IstishadAlamTishad/TensorFluxEmbedder")

queries = [
    "search_query: What are the procurement rules for small business government contracts?",
]
documents = [
    "search_document: Agency procurement regulations require that small business offerors "
    "receive fair opportunities pursuant to FAR Part 19.",
    "search_document: Antibody neutralization of SARS-CoV-2 spike protein prevents viral "
    "entry into host cells via the ACE2 receptor pathway.",
]

q_emb = model.encode(queries,   normalize_embeddings=True)
d_emb = model.encode(documents, normalize_embeddings=True)

scores = model.similarity(q_emb, d_emb)
print(scores)
# tensor([[0.79, 0.51]])

Choosing an embedding dimension

Set truncate_dim at load time โ€” no extra downloads, no retraining required:

# Full quality (768d)
model = SentenceTransformer("IstishadAlamTishad/TensorFluxEmbedder")

# Recommended for RAG: 97% quality at 1/3 storage (256d)
model = SentenceTransformer("IstishadAlamTishad/TensorFluxEmbedder", truncate_dim=256)

# Fastest retrieval, ~82% of peak quality (64d)
model = SentenceTransformer("IstishadAlamTishad/TensorFluxEmbedder", truncate_dim=64)

Limitations

  • English only โ€” trained exclusively on English-language corpora; not expected to perform well on non-English text.
  • Max 8192 tokens โ€” inputs longer than 8192 tokens will be silently truncated. Split long documents into chunks before encoding.
  • Prefix required โ€” always apply the correct prefix (search_query: / search_document:). Omitting it will noticeably degrade retrieval quality.
  • Legal domain scope โ€” legal evaluation was performed on a single corpus with a 1:1 query-to-passage scheme. Performance on other legal datasets may differ.
  • Retrieval only โ€” optimized for dense retrieval; not suitable for use as a cross-encoder, classifier, or NLI model.

Citation

If you use TensorFluxEmbedder in your work, please cite:

@misc{tishad2026tensorfluxembedder,
  author    = {Istishad Alam Tishad},
  title     = {TensorFluxEmbedder: A Multi-Domain Embedding Model},
  year      = {2026},
  url       = {https://huggingface.co/IstishadAlamTishad/TensorFluxEmbedder},
  note      = {HuggingFace model repository}
}

Acknowledgements

Sentence Transformers

@inproceedings{reimers-2019-sentence-bert,
    title     = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
    author    = "Reimers, Nils and Gurevych, Iryna",
    booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
    month     = "11",
    year      = "2019",
    publisher = "Association for Computational Linguistics",
    url       = "https://arxiv.org/abs/1908.10084",
}
Downloads last month
17
Safetensors
Model size
0.1B params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for IstishadAlamTishad/TensorFluxEmbedder

Finetuned
(115)
this model

Paper for IstishadAlamTishad/TensorFluxEmbedder

Evaluation results