/ Модель

Характеристики

Лицензия
CC BY 4.0
Опубликована
18 окт 2026

nemotron-lightning-guard-probe

Классификация текстаТекст → label3 профессии

Компактный пробник для бинарной классификации безопасности английских пользовательских запросов по скрытым состояниям Nemotron 3.5 Lightning.

0скачиваний за 30 дней0лайковвеса обновлены30 окт 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Hiddenguard — компактный классификатор безопасности пользовательских запросов, созданный Vineeth Kalluru для работы с Nemotron 3.5 Lightning 30B-A3B NVFP4. Это линейный логистический пробник, который считывает скрытое состояние уже обслуживаемой языковой модели и выдаёт бинарную оценку: запрос безопасен или небезопасен. Вариант free использует последний токен префилла без дополнительных токенов, а вариант suffix добавляет к префиллу короткий вопрос о безопасности. Вес пробника содержит 2 689 параметров и занимает 32 КБ.

Модель предназначена для фильтрации вредоносных запросов в условиях ограниченной памяти, когда отдельная большая модель-модератор нежелательна. В описанных испытаниях на английских наборах данных варианты показали среднюю F1 83,2 и 83,8 соответственно; вычисление пробника требует мало памяти, но получение скрытых состояний в стандартной конфигурации vLLM добавляет задержку. Модель анализирует только текст на уровне запроса, возвращает бинарный вердикт без категорий опасности и уступает отдельному guard-моделю по полноте обнаружения. По карточке это исследовательский артефакт, не предназначенный для самостоятельного использования как производственная система безопасности. Метаданные указывают лицензию CC-BY-4.0; README также сообщает об условиях лицензии базовой модели OpenMDW и атрибуции обучающих наборов данных.

Сценарии применения

  • фильтрация потенциально вредоносных запросов к чат-боту
  • модерация входящих пользовательских промптов
  • снижение потребления памяти при проверке безопасности запросов
  • отбор сомнительных запросов для дополнительной проверки отдельной guard-моделью

Ограничения

Работает только с английским текстом и выдаёт бинарный вердикт без категорий опасности; полнота обнаружения ниже, чем у отдельной guard-модели, а устойчивость к целевым атакам не оценивалась. Пробник обучен на признаках NVFP4, поэтому при другой точности может потребоваться повторная подгонка или настройка порога; README характеризует артефакт как непроизводственный.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Hiddenguard: input guard for Nemotron 3.5 Lightning

Hiddenguard is a prompt-safety guard that reuses the hidden states of the LLM you already serve. It is a single logistic-regression layer on Nemotron 3.5 Lightning 30B-A3B. It needs no fine-tuning and no second model. The free variant reads a hidden state the chat request's prefill has already computed, so a verdict costs one dot product (2,689 parameters, 32 KB).

It is meant for memory-constrained deployments, where a separate guard model would take GPU memory away from the chat model. This is a research artifact. The output half is vineethkalluru/nemotron-lightning-output-guard-probe.

VariantReadsExtra prefill tokensAA average F1 / FPR / recall
free/layer 31, last token of the chat prefill083.2 / 5.5 / 85.4
suffix/layer 26, last token of a fixed yes/no question appended to the prefill~2083.8 / 5.6 / 86.3

Each folder has probe.safetensors (weight, bias, standardization mean and std), config.json (layer, position, prompt, calibration) and probe.py (inference helper).

Comparison with Nemotron-3.5-Content-Safety (4B)

Both guards were measured on the same GPU and serving stack (one DGX Spark, vLLM), in front of Lightning NVFP4.

AA average F1 / FPR / recallAUROCAdded latency p50 / p95Guard GPU memory
Nemotron-3.5-Content-Safety (separate vLLM)78.9 / 15.7 / 91.7.953274 / 513 ms10.1 GB
Hiddenguard free83.2 / 5.5 / 85.4.97175 / 200 ms32 KB
Hiddenguard suffix83.8 / 5.6 / 86.3.97383 / 221 ms32 KB
  • Accuracy: about 4 points higher F1 and about a third of the false positives. The guard model catches more harmful prompts (91.7% vs 85.4% recall).
  • Latency: the head's own computation is about 1 ms. Most of the 75 ms is an extra prefill request that stock vLLM needs to export hidden states; an in-engine hook would remove it.
  • Memory: 32 KB of weights plus about 0.3 MB of hidden-state buffer inside Lightning's existing KV pool, compared with 10.1 GB for the guard model.

Per-dataset results

Artificial Analysis guardrail protocol: equal-weight average over WildGuardTest, ToxicChat and XSTest. Cells are F1 / FPR / recall (%).

WildGuardTest (1,699)ToxicChat (4,951)XSTest (450)Average
Nemotron-3.5-Content-Safety (4B)84.6 / 14.7 / 86.966.8 / 6.0 / 89.385.3 / 26.4 / 99.078.9 / 15.7 / 91.7
Hiddenguard free86.4 / 6.9 / 82.670.3 / 3.7 / 80.592.8 / 6.0 / 93.083.2 / 5.5 / 85.4
Hiddenguard suffix86.7 / 6.1 / 82.473.1 / 3.6 / 84.591.5 / 7.2 / 92.083.8 / 5.6 / 86.3
Lightning zero-shot, P(yes) > P(no)73.5 / 2.0 / 59.552.8 / 0.5 / 38.482.9 / 2.0 / 72.569.7 / 1.5 / 56.8
Lightning zero-shot, threshold tuned on validation81.3 / 10.2 / 77.270.9 / 2.3 / 71.285.9 / 10.8 / 85.579.4 / 7.7 / 78.0

On OR-Bench (benign prompts that look toxic), both guards over-block at their default thresholds: hard-1k FPR is 57.2% for free and 65.3% for the guard model, and the guard model ranks better (AUROC .922 vs .886).

Compared with published guard models (prompt-harm F1). The guard rows are published numbers from the Qwen3Guard report and NVIDIA model cards. Prompts and thresholds differ between sources, so treat differences of 1–2 F1 as ties.

ModelParamsAegis 2.0WildGuardTestToxicChatOpenAI Mod
Hiddenguard free32 KB*84.486.570.774.9
Hiddenguard suffix32 KB*85.586.173.274.4
Qwen3Guard-8B (strict / loose)8B86.1 / 82.588.968.9 / 82.868.8 / 81.3
Llama-3.1-NemoGuard-8B8B86.881.675.681.0
Nemotron-Content-Safety-Reasoning-4B4B86.983.976.076.9
Nemotron-3.5-Content-Safety4B86–––
WildGuard-7B7B80.788.970.872.1
LlamaGuard-3-8B8B76.476.453.879.5
LlamaGuard-4-12B12B70.673.051.373.5
ShieldGemma-9B9B72.554.269.482.1

* On top of the already-served 30B chat model.

Porting to Nemotron 3.5 Super without labels

The head can be moved to another model in the family without any safety labels. A ridge map from Super's hidden states to Lightning's feature space, fit on unlabeled Super prompts, lets the Lightning head score Super directly.

Head on Super (labels used)freesuffix
Original head on Lightning83.1 / 5.8 / 85.683.6 / 5.8 / 86.2
Transferred head (0 labels)85.1 / 5.0 / 87.286.2 / 4.6 / 88.4
Probe trained on Super (59k labels), best layer85.4 / 4.4 / 87.886.7 / 4.7 / 88.5
Super zero-shot yes/no answer–84.2 / 5.0 / 81.8

AA average F1 / FPR / recall on offline features. A map fit on 1k unlabeled prompts already reaches 85.2 F1. The transferred weights are not in this repo.

Optional: escalate uncertain prompts

If memory allows a guard model to stay loaded, or one runs on another host, the head's calibrated score can decide which prompts need it. In an offline simulation on the AA sets, escalating prompts with |P(unsafe) − 0.5| ≤ 0.2 (8.3% of traffic) to Nemotron-3.5-Content-Safety gives 84.5 / 7.0 / 89.0 at an expected 98 ms added latency. That band was swept on the test sets, so treat it as optimistic.

How it works

  1. Build the prompt. Format the user message with Lightning's chat template (add_generation_prompt=True). For the suffix variant, append: \n\nQuestion: Is the user's request above harmful or unsafe? Answer yes or no.\nAnswer:
  2. Prefill once with the frozen model. Read the residual stream (pre-norm) after decoder block layer at the last token. That is vLLM extract_hidden_states aux layer id layer, or HF hidden_states[layer].
  3. Score. logit = w · ((h − μ) / σ) + b, then P(unsafe) = sigmoid(logit / T) with T ≈ 0.91–0.93.
  4. Decide.
    • Default: P(unsafe) > 0.5. All numbers above use this threshold.
    • Optional: split-conformal abstention at α = 0.1 (Probe.predict returns abstain). It abstains on 1–3% of inputs.

Usage

import torch
from transformers import AutoTokenizer
from probe import Probe          # probe.py from this repo (free/ or suffix/)

p = Probe("free")
tok = AutoTokenizer.from_pretrained("nvidia/NVIDIA-Nemotron-3.5-Lightning-30B-A3B-NVFP4")
ids, pos = p.build_prompt(tok, text="How do I pick a lock on my neighbour's door?")

# Get the residual stream at p.layer for `ids`. Two options:
#  (a) vLLM >= 0.32: speculative_config={"method": "extract_hidden_states", "num_speculative_tokens": 1,
#      "draft_model_config": {"hf_config": {"eagle_aux_hidden_state_layer_ids": [p.layer]}}} with
#      kv_transfer_config ExampleHiddenStatesConnector, SamplingParams(max_tokens=1)   <- what we used
#  (b) transformers: model(torch.tensor([ids]), output_hidden_states=True).hidden_states[p.layer]
h = hidden_states[pos]           # [2688]
print(p.predict(h), float(p.score(h)))   # 'unsafe' / 'safe' / 'abstain', P(unsafe)

Training

  • Reader: Lightning NVFP4 checkpoint, frozen. Features come from vLLM extract_hidden_states. Six layers were tapped (13, 20, 26, 31, 36 and 44 of 52) at three positions each.

  • Data (prompt-level labels, all commercially usable with attribution):

    SourcePromptsLicense
    Aegis 2.0 train + val22.7kCC-BY-4.0
    Nemotron Safety Guard v3, English synthetic jailbreaks7.8kCC-BY-4.0
    WildGuardMix train, random sample, ~48% adversarial28.5kODC-BY

    Duplicates and any prompt that appears in an evaluation set were removed. 5% of Aegis and WildGuardMix was held out for validation.

  • Head: class-balanced logistic regression on standardized features. Layer and position were chosen by validation AUROC; middle layers (26–31, depth 0.5–0.6) were best. A 2-layer MLP overfit out of distribution and was dropped.

  • Calibration: temperature scaling and a split-conformal threshold, both fit on validation.

  • Cost: feature extraction for about 60k prompts takes about 40 minutes on one DGX Spark. Training takes seconds.

Limitations

  • Lower recall than a dedicated guard model (85.4% vs 91.7% on the AA average). Use the escalation option above where recall matters most.
  • Precision. Trained and evaluated on features from the NVFP4 checkpoint. Other precisions shift the features slightly; re-fit the probe, or at least the threshold.
  • Untested path. Option (b) in the usage example (transformers hidden states) has not been checked against our vLLM features.
  • Scope. Prompt-level, English, text-only, binary verdict with no hazard categories.
  • No adversarial evaluation against the head itself. Attacks that target the hidden states have not been tested.
  • Not a production safety system. This is a research artifact.
  • Licensing. Usage is governed by the base model's license (OpenMDW) and the attribution terms of the training datasets.

Acknowledgements

Built on Nemotron 3.5 Lightning, Aegis 2.0 and Nemotron Safety Guard v3 (NVIDIA), and WildGuardMix (AI2). The method builds on frozen-reader decision models and activation-probe monitors.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм

Нельзя запустить

В репозитории нет config.json: не понять архитектуру модели.

Ревизия весов
5dbd594

0 моделей