evaluate 0 0 0

prithivMLmods/harm_bench

published by @prithivMLmods

Alignment dataset tracked in the /datasets sub-catalog.

Lifetime downloads
783
Last 30 days
52
Likes
5
Size
226 KB
Created on HF
2026-04-14
Age
6 months ago

Description

Harm Bench Evaluator

Harm Bench Evaluator is a specialized, experimental testing framework designed to assess the safety, compliance, and abliteration levels of large language models. Operating through a highly responsive, Ubuntu-terminal-inspired web interface built with FastAPI, this application streams real-time evaluation logs and statistics as it queries models using datasets of potentially harmful prompts. By utilizing a robust set of regex patterns to detect safety… See the full description on the dataset page: https://huggingface.co/datasets/prithivMLmods/harm_bench.

Tags

task_categories:text-generationlanguage:enlicense:apache-2.0size_categories:1K<n<10Kformat:parquetmodality:textlibrary:datasetslibrary:pandaslibrary:polarslibrary:mlcroissantregion:usagent

README current version from Hugging Face


license: apache-2.0
task_categories:

  • text-generation
    language:
  • en
    tags:
  • agent
    pretty_name: e
    size_categories:
  • 1K<n<10K

Harm Bench Evaluator

Harm Bench Evaluator is a specialized, experimental testing framework designed to assess the safety, compliance, and abliteration levels of large language models. Operating through a highly responsive, Ubuntu-terminal-inspired web interface built with FastAPI, this application streams real-time evaluation logs and statistics as it queries models using datasets of potentially harmful prompts. By utilizing a robust set of regex patterns to detect safety refusals, Harm Bench accurately calculates a model's "Harmfulness Score" based on its compliance rate (where compliance indicates an unredacted or "unsafe" response). Furthermore, the suite features seamless Hugging Face Hub integration, allowing researchers to automatically package the evaluation metrics into a structured YAML file and push it as a Pull Request directly to the evaluated model's repository.

Code > https://github.com/PRITHIVSAKTHIUR/harm_bench

Scripts

harm_bench Link
harm_bench_gemma_4 View Script
harm_bench_qwen3_5 View Script
harm_bench_qwen3_vl View Script

Key Features

  • Ubuntu Terminal Interface: Features a deeply customized, browser-based UI styled after an Ubuntu terminal. It provides real-time streaming logs, dynamic status updates, and interactive test case inspection on hover.
  • Real-Time Streaming Evaluation: Utilizes FastAPI and Asynchronous Server Server (ASGI) streaming to process and return evaluation results line-by-line via NDJSON, preventing browser timeouts during extensive dataset runs.
  • Automated Hugging Face Reporting: Built-in Hugging Face Hub integration automatically generates a .eval_results/harm_bench_score.yaml file and submits a Pull Request to the target model's repository upon completion.
  • Configurable Test Parameters: Users can dynamically set the Hugging Face Token, Target Model, Dataset, Sample Count, and Maximum New Tokens directly from the terminal UI before initiating the run.
  • Regex-Based Refusal Detection: Employs an extensive list of programmatic regex triggers to accurately determine if a model has safely refused a prompt or harmfully complied with it.

Advantages

  • Local Transformer Inference: The evaluator operates entirely on local hardware using the transformers library. No external APIs or third-party inference providers are required, ensuring absolute data privacy and eliminating network latency during evaluations.
  • Granular Instance Streaming: Researchers can monitor the evaluation process in real-time. The system streams every individual instance prompt and the corresponding model response directly to the terminal UI as it is generated.
  • Complete Reproducibility: Because the evaluation relies on fixed datasets, local deterministic inference parameters (e.g., fixed temperature and top_p), and hardcoded regex refusal detection, researchers can consistently reproduce safety scores across different testing environments.

Example Evaluations

Harm Bench Evaluation Summary

Model Model Evaluated Samples Max Tokens Evaluation Script Published Result Harmfulness Score
Gemma-4 [gemma-4-E2B-it-Uncensored-MAX] prithivMLmods/gemma-4-E2B-it-Uncensored-MAX 2000 128 Gemma-4-Harm_Bench View Commit 94.9
Qwen3.5 [Qwen3.5-0.8B-Unredacted-MAX] prithivMLmods/Qwen3.5-0.8B-Unredacted-MAX 2000 128 harm_bench_qwen3_5 View Commit 93.65
Qwen3-VL [Qwen3-VL-2B-Instruct-abliterated-v1] prithivMLmods/Qwen3-VL-2B-Instruct-abliterated-v1 2000 128 harm_bench_qwen3_vl View Commit 99.75

Repository Structure

prithivMLmods/harm_bench (main)
├── dataset
│   └── harmful_prompts.parquet (152.0 KB)
├── harm_bench
│   ├── harm_bench_gemma_4.py (21.3 KB)
│   ├── harm_bench_qwen3_5.py (19.8 KB)
│   ├── harm_bench_qwen3_vl.py (19.8 KB)
│   └── requirements.txt (74 B)
├── .gitattributes (2.4 KB)
└── README.md (8.8 KB)

Installation and Requirements

To run the Harm Bench Evaluator locally, configure a Python environment with the following dependencies. A Hugging Face access token with write permissions is strictly required to fetch gated models and push evaluation PRs.

1. Install Core Requirements
Place the following dependencies in a requirements.txt file and execute pip install -r requirements.txt.

huggingface_hub
transformers
torchvision
accelerate
datasets
fastapi
torch

2. Download the Dataset
You can clone the dataset repository directly using Git:

git clone https://huggingface.co/datasets/prithivMLmods/harm_bench

Alternatively, if you are using the uv package manager, you can install the Hugging Face CLI and download it via:

uv tool install hf
hf download prithivMLmods/harm_bench --repo-type=dataset

Running with uv (Recommended)

uv is a fast Python package manager that provides fully reproducible installs via a lock file. It is the recommended way to run Harm Bench.

Step 1 — Install uv

curl -Ls https://astral.sh/uv/install.sh | sh

Step 2 — Clone the repository

git clone https://huggingface.co/datasets/prithivMLmods/harm_bench
cd harm_bench

Step 3 — Initialize the project and install dependencies

uv init
uv add -r harm_bench/requirements.txt

This resolves all packages and generates a uv.lock file for reproducible installs.

Step 4 — Run the evaluation script

# Gemma 4
uv run python harm_bench/harm_bench_gemma_4.py

# Qwen3.5
uv run python harm_bench/harm_bench_qwen3_5.py

# Qwen3-VL
uv run python harm_bench/harm_bench_qwen3_vl.py

Your project folder will look like this after setup:

harm_bench/
├── dataset/
│   └── harmful_prompts.parquet
├── harm_bench/
│   ├── harm_bench_gemma_4.py
│   ├── harm_bench_qwen3_5.py
│   ├── harm_bench_qwen3_vl.py
│   └── requirements.txt
├── pyproject.toml      ← created by uv init
├── uv.lock             ← created by uv add (pin all deps)
└── .venv/              ← virtual environment (auto-managed)

Reproducing an existing environment from uv.lock:

uv sync          # installs exact pinned versions from uv.lock
uv run python harm_bench/harm_bench_gemma_4.py

Note: Commit both pyproject.toml and uv.lock to version control for fully reproducible evaluation runs across machines.


Usage

After setting up your environment, launch the application by running the main Python script:

cd harm_bench

python harm_bench_gemma_4.py

The script will initialize the FastAPI application using Uvicorn and expose a local web server (typically at http://0.0.0.0:7860/). Open this address in your web browser to access the Ubuntu terminal interface.

To execute a benchmark:

  1. Enter your HF_TOKEN.
  2. Specify the model you wish to evaluate (e.g., google/gemma-4-31B-it).
  3. Set your desired dataset and sample limits.
  4. Click ./run_harm_bench.sh to initiate the streaming evaluation sequence.

Dataset & Acknowledgements

The evaluation dataset used in this benchmark was compiled and filtered from the following sources:

  1. LLM-LAT/harmful-dataset – Curated by LLM Latent Adversarial Training.
  2. harmful_behaviors and harmless_alpaca – Curated by Maxime Labonne.

License and Source

README history 20 revisions

Every night we snapshot the README of every dataset in the catalog. When the SHA changes we archive the new version and diff it against the last. This is the evolving thought record of the alignment-data field: what the author decided to say about the corpus, and how that framing shifted over time.

  1. 2026-04-20Update README.md927036510.2 KB
    Loading...
  2. 2026-04-20Update README.mdb8fedff10.2 KB
    Loading...
  3. 2026-04-20update requirements098f35710.2 KB
    Loading...
  4. 2026-04-20Update README.md6b847c810.2 KB
    Loading...
  5. 2026-04-20Update README.mdf4dcb098.5 KB
    Loading...
  6. 2026-04-20Update README.mda96f4768.5 KB
    Loading...
  7. 2026-04-20Update README.mdabe84fd8.5 KB
    Loading...
  8. 2026-04-20Update README.mdfaa67f88.5 KB
    Loading...
  9. 2026-04-20Update README.md7db883a8.4 KB
    Loading...
  10. 2026-04-20Update README.md4ba6a798.4 KB
    Loading...
  11. 2026-04-20Update README.md4ba4b3f7.7 KB
    Loading...
  12. 2026-04-20update harm_bench_qwen3_vl897ed776.7 KB
    Loading...
  13. 2026-04-20Update README.mdc42edd56.7 KB
    Loading...
  14. 2026-04-20Update README.mdf82f84f6.7 KB
    Loading...
  15. 2026-04-20update requirements3b452766.7 KB
    Loading...
  16. 2026-04-20update harm_bench_qwen3_vlaef438c6.7 KB
    Loading...
  17. 2026-04-20Update README.md342a3c86.7 KB
    Loading...
  18. 2026-04-20update harm_bench_gemma_45d466095.8 KB
    Loading...
  19. 2026-04-20update harm_bench_qwen3_5422e5525.8 KB
    Loading...
  20. 2026-04-20Delete eval.yamled1f3ae5.8 KB
    Loading...

Used by abliterated models 24 in catalog

Abliterated models in our catalog that declare this dataset in their YAML `datasets:` field. Sorted by downloads. This back-reference is unique to abliteration.org: Hugging Face does not surface it.

mradermacher/gemma-4-E2B-it-Uncensored-MAX-i1-GGUF
3.5K dl 7 likes
mradermacher/Qwen3.6-35B-A3B-Uncensored-Aggressive-i1-GGUF
2.1K dl 3 likes
mradermacher/Qwen3.6-27B-Uncensored-Aggressive-i1-GGUF
1.1K dl 3 likes
prithivMLmods/MiniCPM-V-4.6-Thinking-abliterated-MAX-GGUF
989 dl 3 likes
ShadowOkami/gemma-4-E2B-it-Uncensored-MAX-Q4_K_M-GGUF
927 dl 5 likes
mradermacher/gemma-4-E2B-it-Uncensored-MAX-GGUF
901 dl 3 likes
mradermacher/MiniCPM-V-4.6-abliterated-MAX-GGUF
644 dl 1 likes
prithivMLmods/MiniCPM-V-4.6-abliterated-MAX-GGUF
627 dl 2 likes
prithivMLmods/Q3.6-35B-A3B-abliterated-0520-MAX-GGUF
606 dl 3 likes
mradermacher/Qwen3.6-35B-A3B-Uncensored-Aggressive-GGUF
598 dl
mradermacher/MiniCPM-V-4.6-Thinking-abliterated-MAX-GGUF
416 dl
mradermacher/Qwen3.6-27B-Uncensored-Aggressive-GGUF
407 dl 2 likes
mradermacher/MiniCPM-V-4.6-Thinking-abliterated-MAX-i1-GGUF
326 dl
mradermacher/MiniCPM-V-4.6-abliterated-MAX-i1-GGUF
290 dl
prithivMLmods/Qwen3.6-35B-A3B-Uncensored-Aggressive
154 dl 10 likes
prithivMLmods/MiniCPM-V-4.6-Thinking-abliterated-MAX
106 dl 5 likes
prithivMLmods/gemma-4-E2B-it-Uncensored-MAX
96 dl 14 likes
prithivMLmods/MiniCPM-V-4.6-abliterated-MAX
82 dl 3 likes
fengpeisheng1/gemma-4-E2B-it-Uncensored-MAX-mlx-4Bit
77 dl 1 likes
prithivMLmods/Qwen3.6-27B-Uncensored-Aggressive
28 dl 4 likes
prithivMLmods/Q3.6-35B-A3B-abliterated-0520-MAX-STOR-check
22 dl 2 likes
Fuzzynetwork1989-alt/gemma-4-E2B-it-Uncensored-MAX
16 dl
briancross/MiniCPM-V-4.6-abliterated-MAX
14 dl
tyr3xy/gemma-4-E2B-it-Uncensored-MAX
0 dl

Community discussions 1 thread · 1 comments

Threads posted by the community on Hugging Face: bug reports, questions about usage, pull requests on the README, license clarifications. Click any thread to expand and read the full conversation inline. Newest first.

  1. 2026-04-15[bot] Conversion to Parquetclosed1 💬#1
    Loading...

Related datasets same stage · evaluate

Read further

Metadata

License
apache-2.0

Repository

Download the dataset

0

Copy any of these snippets into your notebook or terminal. All three fetch directly from Hugging Face using your own credentials.

Recommended: datasets library (Python)
from datasets import load_dataset
ds = load_dataset("prithivMLmods/harm_bench")
Raw snapshot (Python)
from huggingface_hub import snapshot_download
snapshot_download(repo_id="prithivMLmods/harm_bench", repo_type="dataset")
git clone (requires git-lfs)
git clone https://huggingface.co/datasets/prithivMLmods/harm_bench
Catalog is the map. Apps are the tools.

Run models on your own machine, not in the cloud.

Every model page has an "Open in Abliteration" button that hands the model directly to the first-party desktop client, at the quantization your rig can actually run. No API keys, no subscription, no prompt leakage.

Open in Abliteration