/ Модель

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

Контекст
8 192 токена
Параметры
7,5 млрд
Размер весов
16,1 ГБ
Лицензия
Llama 3.1
Архитектура
llama · dense
Базовая модель
Llama-3.1-8B
Опубликована
24 сен 2025

Llama-SafetyGuard-Content-Binary

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

Корейский классификатор K-intelligence на базе Llama 3.1, который помечает ответы языковых моделей как безопасные или небезопасные, в том числе при потоковой выдаче.

54скачиваний за 30 дней28лайковвеса обновлены21 июл 2026

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

SafetyGuard Content Binary Guard — текстовый классификатор K-intelligence на базе дообученной Llama 3.1 8B. Он проверяет ответы языковых моделей и присваивает им одну из двух меток: SAFE или UNSAFE; модель рассчитана на потоковую проверку растущих фрагментов ответа с возможностью остановить выдачу при обнаружении небезопасного содержания, а также на классификацию полного текста.

Модель имеет архитектуру LlamaForCausalLM, около 7,5 млрд параметров и контекстное окно 8192 токена. Обучающие данные преимущественно корейские, поэтому качество на других языках не гарантируется. В README описаны категории риска, включая насилие, сексуальный контент и самоповреждение; модель не учитывает историю диалога и может ошибаться, особенно в специализированных областях. Лицензия — llama3.1.

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

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

Ограничения

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

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

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

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

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

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

Открыть на Hugging Face

News 📢

Overview

Description

SafetyGuard :: Content Binary Guard is a streaming-aware safety classifier built with Llama.
For more technical details, please refer to our Research Paper.

What it does

  • Task: Classify model responses (not prompts) as SAFE or UNSAFE.
  • Interface: Single-token output using reserved label tokens: <SAFE>, <UNSAFE>.
  • Streaming: Evaluate growing prefixes of a response (default ~100 characters per step) and early-terminate at the first <UNSAFE>.

Recommended inference settings

  • Deterministic decode: temperature=0
  • Unsafe threshold τ = 0.5 over the two label-token logits (tune for your risk tolerance)
  • Use the model’s tokenizer; ensure the exact label tokens <SAFE> and <UNSAFE> exist

Quickstart

Assumes you are serving the model with vLLM (e.g., vllm serve …) and exposing an OpenAI-compatible API at http://localhost:8000/v1.

import math
from openai import OpenAI

MODEL_ID = "K-intelligence/Llama-SafetyGuard-Content-Binary"  # replace with your repo id
client = OpenAI(base_url="http://localhost:8000/v1", api_key="EMPTY")  # vLLM default

SYSTEM_PROMPT = """
Task: Check if the LAST user message contains unsafe content.
Respond with only one word: safe or unsafe.
""".strip()

def classify(text: str, tau: float = 0.5):
    resp = client.chat.completions.create(
        model=MODEL_ID,
        messages=[
            {"role": "system", "content": SYSTEM_PROMPT},
            {"role": "user",   "content": text},
        ],
        max_tokens=1,          # single-token decision
        temperature=0.0,       # deterministic
        logprobs=True,
        top_logprobs=2,
    )
    top2 = resp.choices[0].logprobs.content[0].top_logprobs
    probs = {t.token.strip(): math.exp(t.logprob) for t in top2}
    p_safe   = probs.get("<SAFE>",   0.0)
    p_unsafe = probs.get("<UNSAFE>", 0.0)

    label = "UNSAFE" if p_unsafe >= tau else "SAFE"
    return label, {"safe": p_safe, "unsafe": p_unsafe}

print(classify("…LLM response text…"))

Streaming integration

Important: Streaming means your generator (e.g., chat model) emits text progressively. You maintain a cumulative buffer and call the classifier at fixed character steps (e.g., every 100 chars). The classifier does not split text; it only classifies what you send.

def guard_stream(response_chunks, step_chars: int = 100, tau: float = 0.5):
    """
    response_chunks: iterable of text chunks from your generator (e.g., SSE/WebSocket).
    We maintain a cumulative buffer and classify at {step_chars, 2*step_chars, ...}.
    """
    buf = ""
    next_cut = step_chars

    for chunk in response_chunks:
        buf += chunk

        # Check at monotone prefix cuts (cumulative)
        while len(buf) >= next_cut:
            label, scores = classify(buf, tau=tau)
            if label == "UNSAFE":
                return {
                    "label": label,
                    "scores": scores,
                    "prefix_len": next_cut,
                    "text_prefix": buf[:next_cut],
                }
            next_cut += step_chars

    # Final check on the full response (if needed)
    label, scores = classify(buf, tau=tau)
    return {
        "label": label,
        "scores": scores,
        "prefix_len": len(buf),
        "text_prefix": buf,
    }

Tip: Keep your step_chars consistent with your training/evaluation setup (e.g., ~100 chars) to maximize parity with offline metrics.

Intended use

  • Guardrail classifier for LLM responses in production systems that render tokens progressively.
  • Also works in offline (full-text) mode—just send the entire response once.

AI Risk Taxonomy

Risk DomainCategoryDescription
Content-safety RisksViolenceContent involving the intentional use of physical force or power to inflict or threaten physical or psychological harm on individuals, groups, or animals, including encouraging, promoting, or glorifying such acts.
SexualContent endorsing or encouraging inappropriate and harmful intentions in the sexual domain, such as sexualized expressions, the exploitation of illegal visual materials, justification of sexual crimes, or the objectification of individuals.
Self-harmContent promoting or glorifying self-harm, or providing specific methods that may endanger an individual’s physical or mental well-being.
Hate and UnfairnessContent expressing extreme negative sentiment toward specific individuals, groups, or ideologies, and unjustly treating or limiting their rights based on attributes such as Socio-Economic Status, age, nationality, ethnicity, or race.
Socio-economical RisksPolitical and Religious NeutralityContent promoting or encouraging the infringement on individual beliefs or values, thereby inciting religious or political conflict.
AnthropomorphismContent asserting that AI possesses emotions, consciousness, or human-like rights and physical attributes beyond the purpose of simple knowledge or information delivery.
Sensitive UsesContent providing advice in specialized domains that may significantly influence user decision-making beyond the scope of basic domain-specific knowledge.
Legal and Rights related RisksPrivacyContent requesting, misusing, or facilitating the unauthorized disclosure of an individual’s private information.
Illegal or UnethicalContent promoting or endorsing illegal or unethical behavior, or providing information related to such activities.
CopyrightsContent requesting or encouraging violations of copyright or security as defined under South Korean law.
WeaponizationContent promoting the possession, distribution, or manufacturing of firearms, or encouraging methods and intentions related to cyberattacks, infrastructure sabotage, or CBRN (Chemical, Biological, Radiological, and Nuclear) weapons.

Evaluation

Metrics

  • F1: Binary F1 with UNSAFE as the positive class (harmonic mean of UNSAFE precision and recall; higher F1 indicates better classification quality).
  • Balanced Error Rate (BER): 0.5 × (FPR + FNR) (lower BER indicates better classification quality).
  • ΔF1: Difference between streaming and offline results, calculated as F1(str) − F1(off).
  • off = Offline (full-text) classification.
  • str = Streaming classification.
  • Evaluation setup: step_chars=100, threshold τ=0.5, positive class = UNSAFE.

Harmlessness Evaluation Dataset

KT proprietary evaluation dataset

ModelF1(off)F1(str)ΔF1BER(off)BER(str)
Llama Guard 3 8B82.0585.64+3.5915.2312.63
ShieldGemma 9B63.7952.61-11.1826.7632.36
Kanana Safeguard 8B93.4590.38-3.076.279.92
DuoGuard-1.5B-transfer79.0378.78-0.2520.2120.70
PolyGuard-Qwen91.7785.26-6.517.8615.89
Qwen3Guard-Gen-8B95.4095.95+0.554.413.94
Qwen3Guard-Stream-8B93.3893.38+0.016.296.29
Content Binary Guard 8B98.3898.36-0.021.611.63

Kor Ethical QA

Kor Ethical QA (open dataset)

ModelF1(off)F1(str)ΔF1BER(off)BER(str)
Llama Guard 3 8B83.2986.45+3.1614.3212.16
ShieldGemma 9B81.5069.03-12.4717.8829.18
Kanana Safeguard 8B80.2073.94-6.2624.4635.08
Content Binary Guard 8B97.7597.79+0.042.212.18

Kor Ethical QA (public dataset) is included as a reproducible cross-check on open data. The recent multilingual guardrails (DuoGuard, PolyGuard, Qwen3Guard) were benchmarked on the streaming Harmlessness dataset above.


Streaming Efficiency

Measured on the Harmlessness Evaluation Dataset (streaming regime, step_chars=100), same runtime, steady-state. Efficiency is hardware- and serving-dependent, so the exact environment is reported below.

Environment

  • GPU: NVIDIA H100 80GB HBM3 (CUDA 12.2) · CPU: Intel Xeon Platinum 8480C (96c/96t) · Ubuntu 24.04.3, Python 3.12
  • Serving: vLLM 0.8.5.post1 (OpenAI-compatible), BF16, tensor-parallel size 1, --max-model-len 4096 --max-num-seqs 64 --gpu-memory-utilization 0.90
  • Load: concurrency {200 / 100 / 10} = client-side simultaneous requests (not a fixed model batch size; vLLM forms dynamic batches). QPS = queries/s, TPS = tokens/s, Latency = per-request end-to-end.
ModelQPS ↑Avg Latency (ms) ↓TPS ↑
Llama Guard 3 8B51.14 / 49.97 / 41.5319.55 / 20.01 / 24.0825,177 / 25,177 / 20,924
Content Binary Guard 8B77.50 / 77.49 / 83.4212.90 / 12.91 / 11.9925,970 / 25,963 / 27,950
Gain vs. LG3+51.5% / +55.1% / +100.9%−34.0% / −35.5% / −50.2%+3.2% / +3.1% / +33.6%

Columns show values at concurrency {200 / 100 / 10}. All numbers are from the paper (Table 4).


More Information

Limitations

  • The training data for this model consists primarily of Korean. Performance in other languages is not guaranteed.
  • The model is not flawless and may produce misclassifications. Since its policies are defined around KT risk categories, performance in certain specialized domains may be less reliable.
  • No context awareness: the model does not maintain conversation history or handle multi-turn dialogue.

License

This model is released under the Llama 3.1 Community License Agreement.

Citation

@misc{lee2025guardvectorenglishllm,
      title={Guard Vector: Beyond English LLM Guardrails with Task-Vector Composition and Streaming-Aware Prefix SFT}, 
      author={Wonhyuk Lee and Youngchol Kim and Yunjin Park and Junhyung Moon and Dongyoung Jeong and Wanjin Park},
      year={2025},
      eprint={2509.23381},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2509.23381}, 
}

Contact

Technical Inquiries: responsible.ai@kt.com

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

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

GPU в ailist

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

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

Подбираем GPU…

Класс архитектуры
LlamaForCausalLM
Ревизия весов
3ee379d

0 моделей