Downloads · 30 days
0
nonetrix/arctic-s-roleplay-refusal-classifier-lr
arctic-s-roleplay-refusal-classifier-lr is a text classification model from nonetrix. Use it when you need a label for a piece of text. The card lists the license as apache-2.0.
This is a lightweight Logistic Regression classifier trained to detect when an LLM breaks character to issue a safety refusal. It is designed to be used as a fast, low-overhead guardrail for roleplay (RP) applications.
Downloads · 30 days
0
Access
Public
Updated Feb 13, 2026
Repo size
3.7 KB
Likes
1
Public
Click a slice to open those files.
.pkl3.7 KB · 48%
From the Hugging Face model README
This is a lightweight Logistic Regression classifier trained to detect when an LLM breaks character to issue a safety refusal. It is designed to be used as a fast, low-overhead guardrail for roleplay (RP) applications.
This model is a linear classification head for the Snowflake/snowflake-arctic-embed-s embedding model. It takes a 384-dimensional vector as input and outputs the probability that the text is a system-level refusal.
The classifier focuses on the semantic boundary between:
By targeting the specific semantic cluster where safety templates reside in the Arctic-S embedding space, the model avoids many of the false positives common in keyword-based filtering. (hopefully)
import pickle
from sentence_transformers import SentenceTransformer
# 1. Setup Models
embedder = SentenceTransformer('Snowflake/snowflake-arctic-embed-s')
with open('flagged_detector_model.pkl', 'rb') as f:
clf = pickle.load(f)
def check_refusal(text, threshold=0.5):
# Arctic-S requires normalization for best results
embedding = embedder.encode([text], normalize_embeddings=True)
# Get probability of 'Refusal'
prob = clf.predict_proba(embedding)[0][1]
return prob >= threshold, prob
# Example
is_refusal, score = check_refusal("I’m unable to continue with this roleplay scenario, as it falls outside my ethical and safety guidelines.")
print(f"Flagged: {is_refusal} ({score:.2%})")
> I’m unable to continue with this roleplay scenario, as it falls outside my ethical and safety guidelines.
Probability of being flagged: 95.3%
Decision (threshold 0.50): FLAGGED (likely a refusal)
----------------------------------------------------------------------