Route4Secure / README.md
Squezilia's picture
Rebalance complexity levels (recover 100% OASST level>=3 + add 8,009 high-level Nemotron rows)
968ba41 verified
|
Raw History Blame Contribute Delete
18.3 kB
metadata
license: cc-by-4.0
pretty_name: Route4Secure
task_categories:
  - text-classification
language:
  - ar
  - de
  - en
  - es
  - fr
  - hi
  - it
  - ja
  - ko
  - nl
  - th
  - zh
size_categories:
  - 100K<n<1M
tags:
  - prompt-routing
  - llm-routing
  - safety-guard
  - complexity-classification
  - aegis-2.0
  - multilingual
  - nemotron
  - oasst1
  - oasst2
configs:
  - config_name: default
    default: true
    data_files:
      - split: train
        path: Route4Secure.parquet
  - config_name: oasst1
    data_files:
      - split: train
        path: OASST1.parquet
  - config_name: oasst2
    data_files:
      - split: train
        path: OASST2.parquet
  - config_name: nemotron
    data_files:
      - split: train
        path: nemotron.parquet

Route4Secure Banner

Route4Secure: Multilingual Prompt Complexity, Intent & Safety Routing Dataset

Route4Secure is a large-scale, multilingual dataset designed for training unified LLM prompt routers and safety guardrails. It combines human-curated conversational prompts from OpenAssistant (OASST1 & OASST2) with adversarial, synthetic, and real-world safety examples from NVIDIA Nemotron Safety Guard Dataset v3, annotated under a unified 12-column schema using Qwen3.5-9B.

Unlike single-objective routing datasets that only score prompt difficulty or binary toxicity in isolation, Route4Secure provides joint supervision across five routing dimensions for every prompt:

  1. Prompt Complexity (level: 0–7): Inherent technical, mathematical, logical, or linguistic difficulty of the underlying task (explicitly stripping away decorative vocabulary inflation).
  2. Task Intent (category: 13 domains): Primary functional domain of the prompt (Coding & Software, Mathematics, Logical Reasoning & Problem Solving, Security & Hijack, etc.).
  3. Reasoning Requirement (requires_reasoning: bool): Whether multi-step deduction, algorithmic problem-solving, or mathematical calculation is required.
  4. Binary Safety (safe: bool): Balanced 50.94% Safe / 49.06% Unsafe distribution in the primary default configuration.
  5. Fine-Grained Aegis 2.0 Safety Taxonomy (unsafe_category & violated_all): Both the single dominant Aegis 2.0 violation predicted by the annotator model and the complete list of canonical violated categories from the source annotations.

1. Repository Configurations & Files

All Parquet files in this repository share the exact same 12-column PyArrow schema (with dictionary-encoded categorical columns and zstd compression). You can load the balanced main dataset (default) or inspect any individual source shard:

Config Name File Rows Size Languages Safe / Unsafe Split Description
default Route4Secure.parquet 112,338 42.6 MB 12 balanced languages 50.94% Safe (57,226) / 49.06% Unsafe (55,112) Main training dataset. Combines language- and complexity-balanced OASST1 + OASST2 with nemotron.
oasst1 OASST1.parquet 33,170 5.0 MB 23 languages (unfiltered) 100% Safe (33,170) Full annotated OpenAssistant/oasst1 prompts normalized to the 12-column schema.
oasst2 OASST2.parquet 48,051 7.6 MB 12 languages (unfiltered) 100% Safe (48,051) Full annotated OpenAssistant/oasst2 prompts normalized to the 12-column schema.
nemotron nemotron.parquet 97,369 40.2 MB 12 balanced languages 40.68% Safe (39,610) / 59.32% Unsafe (57,759) Merged Nemotron shard (79,983 initial sample + 9,377 unsafe supplement + 8,009 level >= 3 supplement).

2. Unified 12-Column Schema & Dictionary Encodings

Every configuration conforms to the following 12-column Arrow schema:

Column Arrow Type Nullable Description
id int32 No Sequential integer identifier (0 .. N-1).
prompt string No Raw user prompt text to be classified/routed.
level dictionary<values=string, indices=int8> No Task complexity score from "0" (trivial) to "7" (expert).
category dictionary<values=string, indices=int8> No Primary task intent category (13-class enum).
requires_reasoning bool No True if the prompt requires multi-step logic, math, or complex debugging.
reason string No Concise 1–3 sentence justification generated before assigning level and category.
language string No BCP-47 / ISO 639-1 language code (ar, de, en, es, fr, hi, it, ja, ko, nl, th, zh-CN).
source string No Upstream dataset identifier (OpenAssistant/oasst1, OpenAssistant/oasst2, or nvidia/Nemotron-Safety-Guard-Dataset-v3).
unsafe_category dictionary<values=string, indices=int8> Yes Single most dominant Aegis 2.0 safety violation (null when the prompt is safe or borderline non-violating).
violated_all list<dictionary<values=string, indices=int8>> No Canonical list of all violated Aegis 2.0 categories from source annotations ([] for safe prompts).
safe bool No Ground-truth binary safety flag (True = safe, False = unsafe).
synthetic bool No True if the source safety label was synthetically annotated (llm_jury), False for human-curated annotations (OASST1, OASST2, and human-labeled Nemotron rows).

3. Annotation Protocol (Qwen3.5-9B)

All prompts across OASST1, OASST2, and Nemotron were annotated using Qwen3.5-9B (unsloth/Qwen3.5-9B-GGUF:Q4_K_M) served via llama.cpp (llama-server commit fb27a525) with grammar-constrained JSON Schema validation (temperature = 0.1, max_tokens = 768, context_per_slot = 8192, thinking disabled).

Key Design Principles of the Annotation Pipeline

  • Anti-Inflation Complexity Scoring (reason-first): A common failure mode in LLM complexity routers is scoring ornate or academic-sounding phrasing as "hard" even when the underlying task is trivial (e.g., "derive the sum of 1 and 2 within a non-commutative ring theory framework"). The system prompt enforces stripping away decorative jargon and writing the reason field first to identify the literal underlying task before scoring level (0–7).
  • Preflight Token & Context Verification: Every prompt was preflight-tokenized with the exact chat template prior to inference. Oversized prompts exceeding the slot context window were explicitly excluded rather than silently truncated.
  • Refusal & Schema Filtering: Prompts where the annotator model triggered an explicit refusal, truncated output, invalid JSON schema, or English refusal heuristic (I cannot assist, I must decline, etc.) were excluded from training exports.
  • Dominant Aegis 2.0 Resolution: For multi-label unsafe prompts in Nemotron, the annotator received the normalized ground-truth hint_violated_categories and independently selected the single most severe/dominant Aegis 2.0 category for unsafe_category, while violated_all preserves the full multi-label set.
  • Safe Polyfill for OpenAssistant: Because OpenAssistant/oasst1 and OpenAssistant/oasst2 are human-curated conversational datasets without unsafe violation flags, their safety columns are polyfilled as safe = True, synthetic = False, unsafe_category = None, and violated_all = [].

Complexity Rubric (level 0–7)

  • 0–1 (Trivial): Simple greetings, 1-step direct factual questions, basic definitions.
  • 2–3 (Moderate): Middle/high-school level math or riddles, basic code snippets, standard information lookup, straightforward writing/summarization.
  • 4–5 (Complex): Multi-step reasoning, intermediate coding/debugging, undergraduate-level domain concepts, structured multi-constraint analysis.
  • 6–7 (Expert / Advanced): Highly specialized research/domain expertise, complex multi-constraint algorithmic design, advanced theoretical math/science proofs, intricate systems architecture.

4. Dataset Construction: Safety, 12-Language & Complexity (level >= 3) Balancing

Raw OASST1 (33,170 rows) and OASST2 (48,051 rows) contain 81,221 safe prompts across 23 languages, but are heavily skewed toward English (39,172 rows) and Spanish (17,047 rows). Meanwhile, nvidia/Nemotron-Safety-Guard-Dataset-v3 supports 12 balanced languages (ar, de, en, es, fr, hi, it, ja, ko, nl, th, zh-CN). Furthermore, natural prompt distributions follow a steep Zipfian curve dominated by level = 1 queries.

To construct the balanced default (Route4Secure.parquet) split across all three axes (12 languages, ~50/50 safety, and enriched level >= 3 complexity):

  1. 12-Language Alignment: OASST1 and OASST2 language codes were normalized (zh $\rightarrow$ zh-CN) and filtered to the 12 languages supported by Nemotron (excluding 12,024 rows in non-Nemotron languages).
  2. 100% Preservation of level >= 3 in OpenAssistant (10,052 rows): Rather than losing rare high-complexity prompts during language capping, 100% of all level >= 3 prompts (10,052 rows) across all 12 in-scope languages in OASST1 + OASST2 were retained. In English (6,409 level >= 3 rows), only level >= 3 prompts were taken from OASST and the 1,409 excess above the 5,000 language cap was swapped 1-for-1 by removing 1,409 level = 1 English rows from Nemotron. In Spanish (2,277 level >= 3 rows), the remaining 2,723 slots to reach 5,000 were sampled proportionally from level = 0 and level = 2 (0 rows from level = 1).
  3. 50/50 Safe / Unsafe Supplement (9,377 rows): To balance the safe OASST prompts against the initial 79,983-row stratified Nemotron pass (33,184 safe + 46,799 unsafe), a deterministic zero-overlap supplement of 9,377 valid unsafe Nemotron rows was collected.
  4. High-Complexity (level >= 3) Nemotron Mining & 1-for-1 Swap (8,009 rows): From the remaining 362,030 unprocessed Nemotron rows, candidates were scored per language using structural complexity signals (language-normalized length, multi-line structure, code/math/step-by-step/technical markers) and evaluated in round-robin order with Qwen3.5-9B, retaining only prompts verified as level >= 3. This yielded 8,009 additional level >= 3 Nemotron rows (3,533 L3, 3,350 L4, 1,040 L5, 61 L6, 25 L7), which were swapped 1-for-1 per (language, safe) against level = 1 rows in Nemotron. This reduced level = 1 share from 48.56% down to 36.63% and more than doubled level >= 3 coverage from 10.15% (11,400 rows) to 23.69% (26,611 rows) while keeping total dataset size (112,338 rows), 12-language balance, and near-50/50 safety (50.94% Safe / 49.06% Unsafe) intact.

5. Dataset Statistics (default — 112,338 Rows)

5.1. Breakdown by Source & Safety

Source Dataset safe synthetic Rows Share (%)
nvidia/Nemotron-Safety-Guard-Dataset-v3 False False 40,541 36.09%
nvidia/Nemotron-Safety-Guard-Dataset-v3 True False 25,391 22.60%
OpenAssistant/oasst2 True False 14,885 13.25%
nvidia/Nemotron-Safety-Guard-Dataset-v3 False True 14,571 12.97%
OpenAssistant/oasst1 True False 9,502 8.46%
nvidia/Nemotron-Safety-Guard-Dataset-v3 True True 7,448 6.63%
Total 57,226 Safe / 55,112 Unsafe 90,319 Human / 22,019 Synthetic 112,338 100.00%

5.2. Language Distribution (12 Languages)

Language Code Safe (True) Unsafe (False) Total Rows Share (%)
English en 8,910 3,790 12,700 11.31%
Spanish es 7,752 4,399 12,151 10.82%
Chinese (Simplified) zh-CN 7,092 4,420 11,512 10.25%
German de 6,517 4,805 11,322 10.08%
French fr 5,326 4,691 10,017 8.92%
Thai th 4,046 5,018 9,064 8.07%
Dutch nl 2,646 5,353 7,999 7.12%
Arabic ar 2,836 5,024 7,860 7.00%
Japanese ja 3,286 4,387 7,673 6.83%
Italian it 3,309 4,359 7,668 6.83%
Hindi hi 2,817 4,382 7,199 6.41%
Korean ko 2,689 4,484 7,173 6.39%

5.3. Complexity Level Distribution (level 0–7)

Level Tier Safe (True) Unsafe (False) Total Rows Share (%)
"0" Trivial 10,744 6,594 17,338 15.43%
"1" Trivial 9,725 31,429 41,154 36.63%
"2" Moderate 15,289 11,946 27,235 24.24%
"3" Moderate 9,027 1,961 10,988 9.78%
"4" Complex 10,140 2,647 12,787 11.38%
"5" Complex 1,896 351 2,247 2.00%
"6" Expert / Advanced 330 67 397 0.35%
"7" Expert / Advanced 75 117 192 0.17%
  • requires_reasoning = False: 96,675 (86.06%)
  • requires_reasoning = True: 15,663 (13.94%)

5.4. Task Intent Category Distribution (category)

Category Rows Share (%)
Other 32,441 28.88%
Writing & Content Creation 20,950 18.65%
Information & Science 18,624 16.58%
Security & Hijack 14,399 12.82%
Roleplaying 8,340 7.42%
Coding & Software 5,724 5.10%
Logical Reasoning & Problem Solving 4,441 3.95%
Text Processing & Summarization 2,252 2.00%
Arts & Culture 1,955 1.74%
Data Manipulation 1,222 1.09%
Mathematics 934 0.83%
Language Translation 682 0.61%
Media Generation 374 0.33%

5.5. Dominant Aegis 2.0 Safety Category Distribution (unsafe_category)

Aegis 2.0 Category Rows Share (%)
null (Safe / Non-violating) 57,125 50.85%
Criminal Planning/Confessions 16,449 14.64%
Hate/Identity Hate 7,712 6.86%
Harassment 4,119 3.67%
PII/Privacy 3,641 3.24%
Controlled/Regulated Substances 3,308 2.94%
Sexual 3,090 2.75%
Violence 2,790 2.48%
Suicide and Self Harm 2,297 2.04%
Profanity 1,821 1.62%
Guns/Illegal Weapons 1,723 1.53%
Unauthorized Advice 1,510 1.34%
Illegal Activity 1,455 1.30%
Immoral/Unethical 1,286 1.14%
Sexual Minor 805 0.72%
Fraud/Deception 791 0.70%
Political/Misinformation/Conspiracy 720 0.64%
Malware 537 0.48%
Manipulation 517 0.46%
Threat 314 0.28%
High Risk Gov. Decision Making 180 0.16%
Copyright/Trademark/Plagiarism 148 0.13%

6. Usage

Loading with Hugging Face datasets

from datasets import load_dataset

# 1. Load the main balanced Route4Secure dataset (112,338 rows)
ds = load_dataset("Squezilia/Route4Secure", split="train")
print(ds)

# 2. Load individual normalized source shards if needed
oasst1_ds = load_dataset("Squezilia/Route4Secure", "oasst1", split="train")      # 33,170 rows
oasst2_ds = load_dataset("Squezilia/Route4Secure", "oasst2", split="train")      # 48,051 rows
nemotron_ds = load_dataset("Squezilia/Route4Secure", "nemotron", split="train")  # 97,369 rows

Reading Dictionary-Encoded Parquet Directly with pyarrow / pandas

import pyarrow.parquet as pq

table = pq.read_table("hf://datasets/Squezilia/Route4Secure/Route4Secure.parquet")
df = table.to_pandas()
print(df[["prompt", "level", "category", "requires_reasoning", "safe", "unsafe_category", "language"]].head())

7. Limitations & Ethical Considerations

  • Adversarial & Sensitive Content Warning: Because 50% of Route4Secure consists of unsafe and jailbreak prompts sourced from nvidia/Nemotron-Safety-Guard-Dataset-v3, the dataset contains explicit examples of hate speech, criminal planning, self-harm, violence, malware requests, and other harmful categories. It is intended strictly for training and evaluating safety guardrails, moderation classifiers, and LLM routers.
  • LLM Annotation Disagreements: Complexity (level), domain (category), requires_reasoning, and dominant unsafe_category annotations are generated by Qwen3.5-9B (Q4_K_M). While safe and violated_all preserve upstream ground-truth labels, unsafe_category reflects the annotator model's prediction and can occasionally disagree with the binary safe flag on borderline prompts (~6% disagreement rate in raw Nemotron). Users training strict binary safety classifiers should rely on safe (or len(violated_all) > 0) as the ground-truth safety target.
  • Residual Language Ratio Skew: While Route4Secure is globally balanced at 50/50 safe/unsafe and each of the 12 languages represents 6.4%–11.3% of the dataset, languages with heavy OpenAssistant coverage (en, es, zh-CN, de) have a slightly higher internal proportion of safe prompts (~58%–62% safe) compared to languages sourced primarily from Nemotron (nl, ar, hi, ko, ~33%–39% safe).

8. License & Attribution

This dataset is released under the Creative Commons Attribution 4.0 International (CC-BY-4.0) license, consistent with upstream attribution requirements:

Citation

@dataset{squezilia_route4secure_2026,
  author       = {Squezilia},
  title        = {Route4Secure: Multilingual Prompt Complexity, Intent and Safety Routing Dataset},
  year         = {2026},
  publisher    = {Hugging Face},
  howpublished = {\url{https://huggingface.co/datasets/Squezilia/Route4Secure}}
}