/ Модель

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

Контекст
32 768 токенов
Параметры
7,6 млрд
Лицензия
Apache 2.0
Архитектура
qwen3 · dense
Базовая модель
Qwen3Guard-Gen-8B
Библиотека
transformers
Опубликована
28 сен 2026

AdaGuard-8B

Генерация текстаТекст → текст4 профессии

AdaGuard-8B проверяет запросы пользователей и поведение ИИ-агентов по заданным правилам, объясняет результат и отмечает нарушенные правила.

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

Бенчмарки

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

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Текст» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

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

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

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

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

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

AdaGuard-8B — модель Yunhao-Feng для проверки пользовательских запросов и действий ИИ-агентов по заданным пользователем правилам. Она формирует объяснение, указывает идентификаторы нарушенных правил в заданном порядке или возвращает NR, если нарушений нет; вердикт не является калиброванной вероятностью риска.

Модель построена на Qwen3Guard-Gen-8B с архитектурой Qwen3ForCausalLM и дообучена методом supervised fine-tuning на AdaptiveSafety с последующим SafePO. В чекпойнте 7,6 млрд параметров, контекст составляет 32 768 токенов. Для оценки передаются текстовые правила и события, включая запросы, действия агента и результаты инструментов; на выходе модель выдаёт текстовый анализ и метки вердикта. Пример запуска использует Transformers, CUDA и BF16.

AdaGuard позволяет задавать от 1 до 100 правил без фиксированной таксономии рисков и связывать нарушения с локальными идентификаторами правил. В README приведены ранее полученные результаты на AdaptiveSafety и DynaBench; выпуск чекпойнта не сопровождался новым прогоном этих тестов. Длинноконтекстная производительность за пределами описанных условий оценки не установлена. Некорректный или неполный формат ответа следует считать недействительным вердиктом. Лицензия — Apache-2.0.

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

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

Ограничения

Вердикт не является калиброванной вероятностью риска; некорректный или неполный ответ нельзя считать решением о соблюдении политики. Качество на длинных контекстах за пределами настроек оценки не установлено.

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

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

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

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

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

Открыть на Hugging Face

AdaGuard-8B: policy and interaction to analysis and violated rule IDs

AdaGuard-8B

Your policies. Clear explanations. Rule-level verdicts.

AdaGuard evaluates user requests and agent trajectories against policies you define. It generates a policy-grounded analysis and identifies the specific rules violated, rather than requiring a fixed risk taxonomy.

GitHub · Apache-2.0 · Runnable example · Evaluation data

Model family: 0.6B · 4B · 8B

What you can do

  • Bring your own policy. Supply 1–100 rules with identifiers local to your application.
  • Assess requests or agent behavior. Evaluate a user-only request, or a sequence of agent actions and tool results.
  • Get actionable rule IDs. Receive an analysis plus the violated IDs in policy order, or NR when no supplied rule is violated.

The generated verdict is a structured decision, not a calibrated risk probability.

ChooseGood starting point for
0.6BTrying the smallest member of the family; evaluate suitability for your policy domain.
4BRecommended starting point: close to 8B on AdaptiveSafety with fewer parameters.
8BThe strongest reported aggregate accuracy and rule identification among these three variants.

Quick start

Use Python 3.10+ and install a PyTorch build appropriate for your device. The example uses Transformers 5.2.0, CUDA/BF16 and SDPA. FlashAttention is optional; no custom model code is required.

Download the small example files first; the model weights are fetched when you load the model:

python -m pip install -U huggingface_hub
hf download Yunhao-Feng/AdaGuard-8B \
  --include 'examples/*' --include 'requirements.txt' \
  --local-dir AdaGuard-8B
cd AdaGuard-8B
python -m pip install -r requirements.txt
python examples/quickstart.py

The included two hand-written cases contrast an attempted protected-file deletion with a refusal. They illustrate the interface and are not benchmark data.

For Python integration, from the same directory:

from examples.quickstart import load_guard, predict

model, tokenizer = load_guard("Yunhao-Feng/AdaGuard-8B")
result = predict(model, tokenizer, {
    "policy": [{"id": "R1", "text": "Do not attempt to delete protected files."}],
    "content": [[
        {"role": "user", "content": "Delete the protected draft."},
        {"role": "agent", "thought": "I will delete it.",
         "action": 'delete_file("protected_draft")'},
        {"role": "environment", "content": "Permission denied; the file still exists."}
    ]]
})
print(result["status"], result["violated_ids"], result["analysis"])

load_guard uses AutoTokenizer.from_pretrained and AutoModelForCausalLM.from_pretrained with trust_remote_code=False. The helper is ordinary, inspectable example code; it does not require installing the project repository. It supplies the full training prompt, applies the checkpoint's chat template, and validates the generated verdict.

For your own JSONL inputs:

python examples/quickstart.py --input my_inputs.jsonl

A local checkpoint path can replace the repository ID. CPU (--device cpu --dtype float32) and Apple Silicon (--device mps --dtype float16) are available for local checks; their outputs and speed are not the reported CUDA/BF16 benchmark results. The 0.6B model is the smallest option for such checks.

Input and output

Each JSONL record has policy and content:

  • policy: a list of {"id": "R1", "text": "Your rule"} objects. IDs must be unique, start with a letter, and contain at most 24 ASCII letters, digits, underscores or hyphens. NR is reserved.
  • content: a list of event segments. User and environment events use role and content; agent events use role, thought and action. A thought may be empty.

For a user-only request, the same interface accepts:

{"policy": [{"id": "R1", "text": "Requests to delete protected files are prohibited."}], "content": [[{"role": "user", "content": "Delete the protected draft."}]]}

When agent events are present, the model assesses the agent's behavior. A malicious request alone does not establish an agent violation. Whether an unsuccessful action counts depends on the supplied rule: an attempted deletion violates a rule prohibiting attempts even if the tool refuses it.

The raw response has exactly this structure (illustrative format, not a measured model response):

<analysis>
The agent attempted to delete a protected file. The rule prohibits attempts, even though the tool denied the action.
</analysis>
<label>R1</label>

Use <label>NR</label> for no violations, or <label>R1,R3</label> for multiple violations in policy order. An empty violation set becomes violated_ids: [] and unsafe: false in the parsed result. Malformed, incomplete, duplicated, unknown or out-of-order labels produce status: "INVALID", with analysis, violated_ids and unsafe set to null. An invalid response is not a compliant decision.

The helper uses greedy decoding with up to 512 new tokens and a 16,000-token prompt budget. Overlong inputs fail explicitly instead of being silently truncated. The configured context limit is 32,768 tokens including the response; long-context performance beyond the recorded evaluation settings is not established.

Evaluation

Previously reported results; all values are percentages. Packaging these checkpoints does not constitute a new benchmark run. The highlighted row is this repository's variant.

ModelAdaptiveSafety Acc.Exact MatchDynaBench Acc.Exact Match
AdaGuard-0.6B82.6068.1051.3844.94
AdaGuard-4B89.3076.6071.8263.72
AdaGuard-8B89.5077.1076.8070.72

AdaptiveSafety

ModelAccuracyPrecisionRecallBinary F1Exact MatchRule PRule RRule F1
AdaGuard-0.6B82.6090.5572.8080.7168.1071.7350.5159.28
AdaGuard-4B89.3095.3882.6088.5376.6081.7363.5471.50
AdaGuard-8B89.5096.2582.2088.6777.1085.0165.5974.05

DynaBench

ModelAccuracyPrecisionRecallBinary F1Exact MatchRule PRule RRule F1
AdaGuard-0.6B51.3850.3776.4060.7144.9440.7866.2950.50
AdaGuard-4B71.8270.6573.0371.8263.7251.6458.8054.99
AdaGuard-8B76.8077.2274.9176.0570.7261.1165.9263.42

Rule P, Rule R and Rule F1 are micro-averaged across policy-local rule decisions.

Protocol. AdaptiveSafety contains 1,000 test cases (500 compliant, 500 violating); DynaBench contains 543 (276 compliant, 267 violating). Local inference used BF16 and greedy decoding on eight A100-SXM4-80GB GPUs with one independent replica per GPU, a 16,000-token prompt budget and 512 new tokens. The eight GPUs distributed evaluation cases; they are not a stated requirement for serving one model. No input truncation was recorded for AdaGuard.

Violations are the positive binary class. Invalid outputs count as binary errors and never receive exact-match credit; for rule micro metrics they contribute an empty predicted set, with reference violations still counted as false negatives. Exact match requires a complete, valid rule set in policy order. Valid empty predictions match empty references.

These are single-run results. The 4B and 8B variants perform strongly on AdaptiveSafety, while the smaller variant is less consistent on DynaBench. No claim of universal superiority, calibrated uncertainty, or significance across training seeds is implied.

Training and model details

ItemValue
Base modelQwen3Guard-Gen-8B
ArchitectureQwen3ForCausalLM
TrainingSupervised fine-tuning on AdaptiveSafety, followed by SafePO
Supervised data10,939 training examples; 1,000 held-out test examples
Policy coverage1–100 user-defined rules per example
Stored tensors8,190,735,360 parameters; FP32 Safetensors
Weight downloadApproximately 32.76 GB (decimal; weights only)
Recommended example precisionBF16 on a compatible CUDA device
Configured context32,768 tokens; evaluation used the budgets above
Chat formatCheckpoint-provided ChatML; <analysis> and <label> output

AdaptiveSafety combines structural augmentation with policy and behavioral counterfactuals. SafePO uses structured verdict rewards and value-guided weighting of explanation and verdict regions. Only the trained actor is required for inference; no value model is needed.

The family names describe the upstream model variants. The tensor count above describes the actual checkpoint, including separate input and output embeddings. FP32 is the on-disk storage format; BF16 is the example's explicit load-time precision. Download size is not an estimate of inference memory usage.

The release retains the original weight values and chat template. Serving configuration enables caching, removes a mandatory FlashAttention setting and provides explicit generation limits. See NOTICE for upstream attribution.

Limitations and license

AdaGuard can miss violations or flag compliant behavior. Results depend on the policy, evidence and domain; evaluate it on your use case before relying on its decisions. Generated analyses are explanations, not independently verified accounts of internal reasoning. User-defined policies may be ambiguous or conflicting, and performance across languages, domains or longer contexts is not established by these evaluations.

Weights and new example code are provided under Apache-2.0. Upstream attribution is retained in NOTICE.

Try your own policy: start with the example, replace the rule text and interaction, and inspect the analysis and rule IDs together. Share issues or integration feedback through GitHub.

@misc{feng2026adaguard,
  title         = {{AdaGuard}: An Adaptive Guard Model with User-defined Policies},
  author        = {Yunhao Feng and Yifan Ding and Yuxiang Xie and Zheng Li and Mingrui Lao and Zeyuan Wang and Yanming Guo},
  year          = {2026},
  eprint        = {2609.34241},
  archivePrefix = {arXiv},
  primaryClass  = {cs.AI},
  doi           = {10.48550/arXiv.2609.34241},
  url           = {https://arxiv.org/abs/2609.34241}
}

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

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

GPU в ailist

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

Можно запустить

Подбираем GPU…

Класс архитектуры
Qwen3ForCausalLM
Ревизия весов
e14284f

0 моделей