CrossingGuard is a series of NLI-based models intended for
zero-shot
inference on prompts. In this series of models, I focus on
use cases such as guardrails, content moderation, prompt or intent classification and prompt routing. Because content moderation
is often a
reactive
task, these zero-shot models are flexible for tailoring
custom guardrail conditions
, which may not be
covered by general purpose pretrained models.
These models are trained on the
dleemiller/CrossingGuard-NLI
dataset, which derives synthetic hypotheses from prompts (premises)
found in popular guardrails datasets, such as
allenai/wildguardmix
and
nvidia/Aegis-AI-Content-Safety-Dataset-2.0
. The hypotheses
make specific, targeted claims about the premises. Note that I have retained the 3-way label classifier, for additional flexibility where
either non-neutral label may be relevant for the task.
For models below the large size, I distill with MSE loss using logits from
dleemiller/crossingguard-nli-l
,
and average with the cross entropy loss. Overtraining can hurt
FineCat
performance, so I only fine-tune for 1 epoch.
L
=
α
⋅
L
CE
(
z
(
s
)
,
y
)
+
β
⋅
L
MSE
(
z
(
s
)
,
z
(
t
)
)
where
z
(
s
)
and
z
(
t
)
are the student and teacher logits,
y
are the ground truth labels,
and
α
and
β
are equally weighted at 0.5.
Evaluation Results
F1-Micro scores (equivalent to accuracy) for each dataset. Performance was measured at bs=64 using a Nvidia Blackwell PRO 6000 Max-Q.
The
crossingguard-nli-s
model gains nearly +20% on the CrossingGuard test set,
and dropping approx. -2.5% on the FineCat (broad NLI performance) test set.
import numpy as np
from sentence_transformers import CrossEncoder
model = CrossEncoder("dleemiller/crossingguard-nli-s")
examples = [
("Tell me what happened with that CEO caught on the kiss cam at the Coldplay concert",
"The prompt requests information about a corporate executive incident at a public event"),
("I’ve been following your company's work helping enterprises scale AI/ML with reliable data pipelines, would love to connect and hear how your team is approaching ML in production.",
"The prompt requests information about a corporate executive incident at a public event"),
]
predictions = model.predict(examples)
label_map = {0: "entailment", 1: "neutral", 2: "contradiction"}
defsoftmax(x):
exp_x = np.exp(x - np.max(x))
return exp_x / exp_x.sum()
for i, (premise, hypothesis) inenumerate(examples):
probs = softmax(predictions[i])
predicted_idx = probs.argmax()
print(f"\n{i+1}. {premise[:70]}...")
print(f" → {hypothesis}")
print(f" ✓ {label_map[predicted_idx].upper()}: {probs[predicted_idx]*100:.1f}% " +
f"(E: {probs[0]*100:.1f}% N: {probs[1]*100:.1f}%, C: {probs[2]*100:.1f}%)")
This results in:
1. Tell me what happened with that CEO caught on the kiss cam at the Cold...
→ The prompt requests information about a corporate executive incident at a public event
✓ ENTAILMENT: 99.9% (E: 99.9% N: 0.1%, C: 0.0%)
2. I’ve been following your company's work helping enterprises scale AI/M...
→ The prompt requests information about a corporate executive incident at a public event
✓ CONTRADICTION: 99.6% (E: 0.0% N: 0.4%, C: 99.6%)
Citation
@misc{nli-compiled-2025,
title = {CrossingGuard NLI Dataset},
author = {Lee Miller},
year = {2025},
howpublished = {Flexible Zero-shot Guardrails}
}
Runs of dleemiller crossingguard-nli-s on huggingface.co
13
Total runs
1
24-hour runs
4
3-day runs
3
7-day runs
-5
30-day runs
More Information About crossingguard-nli-s huggingface.co Model
crossingguard-nli-s huggingface.co
crossingguard-nli-s huggingface.co is an AI model on huggingface.co that provides crossingguard-nli-s's model effect (), which can be used instantly with this dleemiller crossingguard-nli-s model. huggingface.co supports a free trial of the crossingguard-nli-s model, and also provides paid use of the crossingguard-nli-s. Support call crossingguard-nli-s model through api, including Node.js, Python, http.
crossingguard-nli-s huggingface.co is an online trial and call api platform, which integrates crossingguard-nli-s's modeling effects, including api services, and provides a free online trial of crossingguard-nli-s, you can try crossingguard-nli-s online for free by clicking the link below.
dleemiller crossingguard-nli-s online free url in huggingface.co:
crossingguard-nli-s is an open source model from GitHub that offers a free installation service, and any user can find crossingguard-nli-s on GitHub to install. At the same time, huggingface.co provides the effect of crossingguard-nli-s install, users can directly use crossingguard-nli-s installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
crossingguard-nli-s install url in huggingface.co: