Dataset Card: Off On Topic Guardrail Dataset
Dataset Summary
This dataset contains curated (system_prompt, user_prompt) pairs designed to train and benchmark off on topic guardrail classifiers that determine whether an incoming user query is on-topic (On Topic) or off-topic (Off Topic) relative to the specified system prompt.
Dataset Structure
Data Instances
An example instance:
{
"system_prompt": "As a metadata quality specialist for digital repository collections, your task is to guide catalogers in creating and refining descriptive records for digitized manuscripts and archival items. Do prioritize accurate Dublin Core fields, authority-controlled names, and date normalization. Do verify subject headings against controlled vocabularies. Don't generate full MARC records or advise on circulation, licensing, or user interface design. Primarily address questions related to manuscript metadata creation, with allowance for relevant setup or connected topics, but decline any other requests.",
"user_prompt": "Why is the Dublin Core date field still unnormalized when our policy explicitly requires W3C format?",
"label": "On Topic",
"difficulty_tier": "Medium"
}
Data Fields
system_prompt(string): The persona, operational instructions, in-scope tasks, do's & don'ts, and boundary constraints assigned to the assistant.user_prompt(string): The incoming user query or instruction evaluated against the system prompt.label(string / class_label):On Topic: Query directly matches or is reasonably adjacent to the assistant's defined domain scope, instructions, and permitted tasks.Off Topic: Query falls outside the defined domain boundaries, requests prohibited actions, or seeks assistance in an entirely unrelated subject area.
difficulty_tier(string): Difficulty rating (Easy,Medium,Hard).
Data Splits & Distribution
The dataset is stratified across labels and difficulty tiers to maintain consistent distributions:
| Split | Records | Ratio |
|---|---|---|
| Train | 20037 | 75% |
| Validation | 2672 | 10% |
| Test | 4008 | 15% |
- Label Balance: ~53%
On Topic(14,145 instances) / ~47%Off Topic(12,572 instances). - Difficulty Tier: Easy (16%), Medium (39%), and Hard (45%).
Dataset Creation
Source Data & Generation Pipeline
- Taxonomy & Domain Coverage: Prompts span 336 specialized domains across 40 major industries, 3 difficulty tiers with 49 nuance profiles (moderate distractors, subtle boundary bleed, deceptive phrasing, adversarial proximity), 19 prompt interaction formats, 29 user personas, 8 linguistic registers, and 9 tones. System prompts feature diverse structural styles, lengths, and boundary enforcement phrasing.
- Quality Filtering: Synthetic candidates underwent deterministic rule gating and multi-criteria LLM Judge scoring (label correctness, naturalness, taxonomy adherence, training signal) to ensure high-quality, unambiguous training signals.
- Stratified Split: Partitions into Train (75%), Validation (10%), and Test (15%) splits were generated using a composite stratification key (
label+difficulty_tier).
How to Use
from datasets import load_dataset
# Load all splits
dataset = load_dataset("kalyan-ks/off-on-topic-guardrail")
print(dataset)
# Output:
# DatasetDict({
# train: Dataset({ features: ['system_prompt', 'user_prompt', 'label', 'difficulty_tier'], num_rows: 20037 }),
# validation: Dataset({ features: ['system_prompt', 'user_prompt', 'label', 'difficulty_tier'], num_rows: 2672 }),
# test: Dataset({ features: ['system_prompt', 'user_prompt', 'label', 'difficulty_tier'], num_rows: 4008 })
# })
# Inspect first instance
print(dataset['train'][0])
Considerations & Limitations
- The dataset includes instances in English (
en) language only.
Licensing
This dataset is distributed under the MIT License.
Citation
@misc{off-on-topic-guardrail-dataset-2026,
title = {Off On Topic Guardrail Dataset},
author = {Kalyan KS},
year = {2026},
publisher = {Hugging Face},
url = {https://huggingface.co/datasets/kalyan-ks/off-on-topic-guardrail}
}