CoolFace
Modelpublic

redis/langcache-embed-v1

sourceHugging Faceupdated 10mo agoView on Hugging Face
16likes151kdownloads
Model Card

WARNING: This is an outdated model.

๐Ÿš€ Check out our new v3-small model, trained for improved inference speed, lighter footprint, and better semantic matching for caching.


Redis semantic caching embedding model based on Alibaba-NLP/gte-modernbert-base

This is a sentence-transformers model finetuned from Alibaba-NLP/gte-modernbert-base on the Quora dataset. It maps sentences & paragraphs to a 768-dimensional dense vector space and can be used for semantic textual similarity for the purpose of semantic caching.

Model Details

Model Description
  • โ€”Model Type: Sentence Transformer
  • โ€”Base model: Alibaba-NLP/gte-modernbert-base <!-- at revision bc02f0a92d1b6dd82108036f6cb4b7b423fb7434 -->
  • โ€”Maximum Sequence Length: 8192 tokens
  • โ€”Output Dimensionality: 768 dimensions
  • โ€”Similarity Function: Cosine Similarity
  • โ€”Training Dataset:
  • โ€”Quora <!-- - Language: Unknown --> <!-- - License: Unknown -->
Model Sources
Full Model Architecture
SentenceTransformer(
  (0): Transformer({'max_seq_length': 8192, 'do_lower_case': False}) with Transformer model: ModernBertModel
  (1): Pooling({'word_embedding_dimension': 768, 'pooling_mode_cls_token': True, 'pooling_mode_mean_tokens': False, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
)

Usage

First install the Sentence Transformers library:

bash
pip install -U sentence-transformers

Then you can load this model and run inference.

python
from sentence_transformers import SentenceTransformer

# Download from the ๐Ÿค— Hub
model = SentenceTransformer("redis/langcache-embed-v1")
# Run inference
sentences = [
    'Will the value of Indian rupee increase after the ban of 500 and 1000 rupee notes?',
    'What will be the implications of banning 500 and 1000 rupees currency notes on Indian economy?',
    "Are Danish Sait's prank calls fake?",
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 768]

# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
Binary Classification
MetricValue
cosine_accuracy0.90
cosine_f10.87
cosine_precision0.84
cosine_recall0.90
cosine_ap0.92
Training Dataset
Quora
  • โ€”Dataset: Quora
  • โ€”Size: 323491 training samples
  • โ€”Columns: <code>question1</code>, <code>question2</code>, and <code>label</code>
Evaluation Dataset
Quora
  • โ€”Dataset: Quora
  • โ€”Size: 53486 evaluation samples
  • โ€”Columns: <code>question1</code>, <code>question2</code>, and <code>label</code>

Citation

BibTeX
Redis Langcache-embed Models
bibtex
@inproceedings{langcache-embed-v1,
    title = "Advancing Semantic Caching for LLMs with Domain-Specific Embeddings and Synthetic Data",
    author = "Gill, Cechmanek, Hutcherson, Rajamohan, Agarwal, Gulzar, Singh, Dion",
    month = "04",
    year = "2025",
    url = "https://arxiv.org/abs/2504.02268",
}
Sentence Transformers
bibtex
@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",
}

<!--