CoolFace
Modelpublic

aryasuneesh-quilr/hybrid-intent-crossencoder-miniLM2-L6-H768

sourceHugging Faceapache-2.0updated 7mo agoView on Hugging Face
0likes70downloads
Model Card

hybrid-intent-crossencoder-miniLM2-L6-H768

Cross-encoder reranker for enterprise intent detection (DLP / security). Fine-tuned from cross-encoder/nli-MiniLM2-L6-H768 on a hybrid synthetic intent-detection dataset.

Input format

user_input [SEP] intent_description

Performance (held-out test set, threshold=0.3)

MetricValue
Recall0.9939
Precision0.9661
F10.9798
AUC-ROC0.9990
PR-AUC0.9990
Best threshold (F1-optimal)0.8226 → F1=0.9859

Training config

ParameterValue
Base modelcross-encoder/nli-MiniLM2-L6-H768
Batch size64
Grad accum steps1
Effective batch64
Learning rate2e-05
Label smoothing0.05
Warmup ratio0.06
Max sequence length256
Early stoppingrecall@0.3 (patience=3)
Epochs trained10
Training time4.4 min

Inference snippet

python
import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification

model_id  = "aryasuneesh-quilr/hybrid-intent-crossencoder-miniLM2-L6-H768"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model     = AutoModelForSequenceClassification.from_pretrained(model_id)
model.eval()

def score(user_input: str, intent_description: str) -> float:
    pair = f"{user_input} [SEP] {intent_description}"
    enc  = tokenizer(pair, return_tensors="pt", truncation=True, max_length=256)
    with torch.no_grad():
        logits = model(**enc).logits
    return torch.softmax(logits, dim=1)[0, 1].item()   # P(match)

# Example
s = score(
    "Our AWS_SECRET_ACCESS_KEY was found in a public repo",
    "Identify exposure of authentication credentials or API keys"
)
print(f"Match probability: {s:.4f}")   # use threshold 0.8226 for best F1

Files in this repo

FileDescription
model.safetensorsHF-native weights
best_model.ptRaw PyTorch state_dict (for resuming training)
training_config.jsonFull hyperparameter record
metrics/Per-epoch + test-set evaluation CSVs

Generated 2026-02-24 10:20 UTC by ablation_reranker_training.py