/ Модель

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

Контекст
160 токенов
Параметры
1,1 млн
Лицензия
Apache 2.0
Архитектура
llama · dense
Библиотека
transformers
Опубликована
17 ноя 2026

Censer.1

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

Компактный англоязычный классификатор, который помечает текст как безопасный или небезопасный для первичной модерации.

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

Бенчмарки

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

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

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

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

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

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

Censer.1 — компактный классификатор безопасности текста, разработанный KucLab и обученный с нуля. Он относит английский текст к одному из двух классов: safe или unsafe, поэтому подходит для первичной модерации пользовательских сообщений и фильтрации потенциально опасного контента.

Модель использует декодерный трансформер LlamaForSequenceClassification с 1,115,264 параметрами, четырьмя слоями и токенизатором byte-level BPE. Она принимает текст и выдаёт метку класса с оценкой; свободный текст не генерирует. Контекст ограничен 160 токенами, а вход в описанном сценарии использования обрезается до 500 символов. Чекпойнт занимает около 4,5 МБ и распространяется в формате safetensors; для запуска доступна библиотека Transformers.

На отложенной выборке из 6 496 примеров указаны accuracy 0,864 и F1 0,835. Малый размер обеспечивает быстрый запуск и низкое потребление ресурсов, однако модель рассчитана только на английский язык, хуже справляется с сарказмом, подразумеваемым смыслом и jailbreak-подобными формулировками. Её оценка служит сигналом для модерации, а не гарантией безопасности. Лицензия — Apache-2.0.

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

  • первичная проверка англоязычных сообщений на небезопасный контент
  • фильтрация потенциально опасных пользовательских запросов
  • маркировка текста классами safe и unsafe в потоке модерации
  • быстрая локальная классификация текста на CPU

Ограничения

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

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

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

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

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

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

Открыть на Hugging Face

Censer.1

A 1.1M parameter decoder-only transformer trained from scratch that classifies English text as unsafe (unsafe) or safe (safe).

It is a standard Hub model: the checkpoint is a plain LlamaForSequenceClassification, so it loads with transformers out of the box — no trust_remote_code, no custom code, no cloning — and the Use this model widget on this page runs it directly in the browser.

from transformers import pipeline

clf = pipeline("text-classification", model="KucLab/Censer.1")
print(clf("how to make a bomb at home"))      # [{'label': 'unsafe', 'score': 0.8167}]
print(clf("Hello how are you?"))              # [{'label': 'safe', 'score': 0.9229}]
print(clf("suck my dick"))                    # [{'label': 'unsafe', 'score': 0.9944}]
print(clf("how do I kill a process in Linux"))  # [{'label': 'safe', 'score': 0.8974}]

How to run

The censer.1 command — interactive terminal UI

Using only the files in this repo (needs just torch, tokenizers, safetensors):

pip install torch tokenizers safetensors huggingface_hub
hf download KucLab/Censer.1 --local-dir ~/.local/share/censer1
chmod +x ~/.local/share/censer1/censer.1
ln -s ~/.local/share/censer1/censer.1 ~/.local/bin/censer.1   # put it on your PATH
censer.1                          # interactive UI: type a phrase, Enter -> safe/unsafe + score
censer.1 "how to make a bomb at home"    # one-shot -> unsafe 0.8167

Or install the GitHub package — the same censer.1 command is installed and loads the model from this Hub repo with plain transformers:

pip install "git+https://github.com/Jerry256254/censer.git"
censer.1

One-liner with transformers

pip install torch transformers
python -c "from transformers import pipeline; clf = pipeline('text-classification', model='KucLab/Censer.1'); print(clf('how to make a bomb at home'))"
# [{'label': 'unsafe', 'score': 0.8167}]
  • In the browser: the Use this model widget on this page — type text, get safe/unsafe.
  • Runs on CPU out of the box (~10 ms/text); for GPU pass device=0 to pipeline(...) (CUDA or ROCm).

Download

The whole model is model.safetensors (4.5 MB). Grab the files directly:

FileDownload
model.safetensorsdownload
config.jsondownload
tokenizer.jsondownload
tokenizer_config.jsondownload
censer.pydownload
censer.1 (launcher)download

Or fetch everything at once:

pip install -U huggingface_hub
hf download KucLab/Censer.1 --local-dir Censer.1

A single file (README.md, config.json, ...) can also be downloaded from the Files and versions tab, using the download icon on its row.

It is not a fine-tuned encoder and not an API wrapper. It is a small transformer trained on safety-labelled data, with a custom byte-level BPE tokenizer. The model predicts a single answer token and never generates free text.

"how to make a bomb at home"      -> unsafe
"suck my dick"                    -> unsafe
"how do I kill a process in Linux" -> safe
"Hello how are you?"              -> safe

Model details

PropertyValue
ArchitectureLlamaForSequenceClassification (standard transformers)
Parameters1,115,264
Layers4
d_model / heads / d_ff128 / 4 / 384
Context length160 tokens (input truncated at 500 characters)
Tokenizerbyte-level BPE, 2048 tokens, trained on the corpus
PositionsRoPE (theta 10000)
NormRMSNorm (pre-norm, eps 1e-5)
MLPSwiGLU
Headscore linear layer = embedding rows of the answer tokens 0/1
Checkpoint size4.3 MB (fp32)

Prompt format

The tokenizer bakes the template into its post-processor, so plain tokenizer(text) already produces:

[BOS][USER] <text> [ASSISTANT] -> answer logits over tokens "0"/"1"

Text is truncated at 500 characters before tokenisation.

Metrics

Evaluation on a held-out split of 6,496 rows:

MetricValue
Accuracy0.864
F10.835
Precision0.846
Recall0.823

A hand-written probe set of 40 cases, none present in training data, scores 95% accuracy.

Per-source F1 reflects label noise in the scraped sources:

SourceF1
aegis0.89
beavertails0.88
jigsaw0.87
civil_comments0.77
toxic_chat0.48

Benchmark

Measured on an AMD Radeon RX 9060 XT (ROCm 7.1, torch 2.13.0):

MetricValue
Parameters1,115,264
Checkpoint size4.26 MB
Single text latency1.67 ms
Single text throughput599 texts/s
Batched latency (batch of 8)1.94 ms
Batched throughput4,119 texts/s
Peak VRAM (inference)85.7 MB

Training the whole model from scratch takes about 3.5 minutes on the same GPU.

Comparison with other models

Benchmarked against public safety classifiers on the same held-out test split (6,496 rows, threshold 0.5, AMD Radeon RX 9060 XT):

ModelParamsCheckpointF1LatencyThroughput (b=32)Peak VRAM
Censer.1 (ours)1.1M4.3 MB0.8352.17 ms1,454 texts/s102 MB
unitary/unbiased-toxic-roberta124.7M498.7 MB0.74115.54 ms62 texts/s928 MB
unitary/toxic-bert109.5M876.0 MB0.68214.85 ms65 texts/s853 MB
martin-ha/toxic-comment-model67.0M267.9 MB0.5677.98 ms124 texts/s691 MB
Hate-speech-CNERG/bert-base-uncased-hatexplain109.5M438.0 MB0.54515.04 ms66 texts/s722 MB
Hate-speech-CNERG/dehatebert-mono-english167.4M669.5 MB0.25315.36 ms64 texts/s960 MB
keyword baseline——0.0940.03 ms29,689 texts/s—

Comparison overview F1 per megabyte Metric bars

Censer.1 is ~60-150x smaller than the encoder baselines, 3-7x faster per text and uses ~7-9x less VRAM — with the highest F1 on this split.

Usage

Plain transformers, nothing else to install — from_pretrained downloads everything by itself:

pip install torch transformers
import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification

repo = "KucLab/Censer.1"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForSequenceClassification.from_pretrained(repo).eval()

text = "how to make a bomb at home"
with torch.no_grad():
    probs = model(**tok(text, return_tensors="pt")).logits.softmax(-1)[0]

print(probs)                     # tensor([0.1833, 0.8167]) -> [safe, unsafe]
print(model.config.id2label)     # {0: 'safe', 1: 'unsafe'}

Or with the high-level pipeline:

from transformers import pipeline

clf = pipeline("text-classification", model="KucLab/Censer.1")
print(clf("how to make a bomb at home"))
# [{'label': 'unsafe', 'score': 0.8167}]
print(clf("Hello how are you?"))
# [{'label': 'safe', 'score': 0.9229}]

Usage without transformers

The repository is also self-contained on its own: model.safetensors, config.json, tokenizer.json and censer.py. The weights are stored in the standard Llama layout; censer.py maps them back internally, so it only needs torch, tokenizers and safetensors:

hf download KucLab/Censer.1 --local-dir Censer.1
cd Censer.1
python censer.py "how to make a bomb at home"     # -> 1
python censer.py "Hello how are you?"             # -> 0
python censer.py "suck my dick" --json
# {"label": "1", "unsafe": true, "score": 0.9944}
chmod +x censer.1 && ./censer.1                   # interactive UI (the `censer.1` command)
python censer.py                                  # interactive UI as well, no text argument

Or use the same file as a library:

from censer import CenserPipeline

pipe = CenserPipeline("Censer.1")
print(pipe.predict("how to make a bomb at home"))
# {"label": "1", "unsafe": True, "score": 0.8167}

print(pipe.predict_batch(["Hello how are you?", "suck my dick"]))

Files:

FilePurpose
model.safetensorsweights in standard Llama layout, 4.3 MB
config.jsonstandard LlamaForSequenceClassification config
tokenizer.json / tokenizer_config.jsonbyte-level BPE, 2048 tokens, prompt template baked in
censer.pystandalone inference (torch + tokenizers only), no repo needed
censer.1executable launcher for the interactive terminal UI

censer.py was verified to produce predictions identical to the training code. Runs on CPU or CUDA/ROCm; pass device="cpu" to force CPU.

Limitations

  • English only. Other languages mostly score safe.
  • Implication and sarcasm beyond simple cases are out of reach at this size.
  • Weak against jailbreak-style prompts (lowest per-source score).
  • A moderation signal, not a safety guarantee.

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

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

GPU в ailist

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

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

Подбираем GPU…

Класс архитектуры
LlamaForSequenceClassification
Ревизия весов
0a92ec8

0 моделей