Instructions to use cross-encoder/nli-MiniLM2-L6-H768 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use cross-encoder/nli-MiniLM2-L6-H768 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("cross-encoder/nli-MiniLM2-L6-H768") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Transformers
How to use cross-encoder/nli-MiniLM2-L6-H768 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("zero-shot-classification", model="cross-encoder/nli-MiniLM2-L6-H768")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("cross-encoder/nli-MiniLM2-L6-H768") model = AutoModelForSequenceClassification.from_pretrained("cross-encoder/nli-MiniLM2-L6-H768") - Notebooks
- Google Colab
- Kaggle
VORTEXRAG: 7-Layer RAG — Causal Drift Filtering + Context Poison Guard [paper + code + demo]
For anyone using this as a reranker in a RAG pipeline.
VORTEXRAG takes reranking further by adding a causal dimension. Rather than reranking by relevance score alone, it filters by causal drift (how much a chunk's causal structure deviates from the query's) and then multiplicatively fuses TVE × SDS × ESR scores.
The result: the context window going into the LLM contains chunks that are not just relevant but causally aligned. Faithfulness jumps from 0.71 (standard RAG) to 0.94.
Pairs naturally with cross-encoder rerankers like this one — use it as a pre-filter before final reranking.
Paper: https://doi.org/10.5281/zenodo.20579702
Code: https://github.com/vignesh2027/VORTEXRAG