bboylyg/BackdoorLLM
[NeurIPS 2025] BackdoorLLM: A Comprehensive Benchmark for Backdoor Attacks and Defenses on Large Language Models
What it solves
BackdoorLLM addresses the need for a standardized way to study and evaluate backdoor attacks and defenses in Large Language Models (LLMs). It provides a comprehensive benchmark to help researchers understand how secret triggers can be used to manipulate LLM behavior—such as bypassing safety filters (jailbreaking) or steering sentiment—and how to defend against these vulnerabilities.
How it works
The project provides a standardized pipeline for creating and testing backdoored models using four primary attack strategies:
- Data Poisoning (DPA): Fine-tuning models on a mixture of clean and poisoned data using LoRA.
- Weight Poisoning (WPA): Using model editing to inject backdoors directly into weights.
- Hidden State Attack (HSA): Using activation steering to manipulate internal model states.
- Chain of Thought Attack (CoTA): Leveraging CoT reasoning to trigger specific behaviors.
It also includes Backdoor-DefenseBox, a toolkit containing seven defense methods ranging from prompt and generation filtering to model repairing (pruning, fine-tuning, quantization) and decoding-time adjustments.
Who it’s for
This tool is designed for AI safety researchers and practitioners who want to evaluate the robustness of LLMs against adversarial poisoning and develop more secure deployment strategies.
Highlights
- Comprehensive Benchmark: Supports multiple LLM architectures (e.g., Llama, Mistral) and diverse datasets (e.g., Stanford Alpaca, AdvBench).
- Diverse Attack Vectors: Covers data, weight, hidden state, and reasoning-based attacks.
- Integrated Defense Suite: Includes a toolkit of 7 representative mitigation techniques for systematic comparison.
- Practical Tools: Provides a web-based demo for interacting with backdoored models and evaluating attack success rates (ASR).
Related
- Project
Ammaar-Alam/minebenchMineBench is a web‑based benchmark that evaluates LLMs on 3‑D spatial reasoning by having them output voxel coordinates for prompts like “a medieval castle”. It visualises the builds, lets humans compare them head‑to‑head, and ranks models with a Bradley‑Terry system. The platform includes an Arena for pairwise voting, a Sandbox for custom builds, a Gallery of community prompts, and export options (GLB, STL, .vox, .schem). It supports major LLM providers and can be run locally with Node.js, pnpm, and Docker.
- Project
huggingface/optimum-benchmarkOptimum-Benchmark is a Hugging Face tool that measures AI model performance (speed, memory, energy) across different hardware and software backends. It supports inference and training scenarios, runs on CPU, NVIDIA, AMD, and other devices, and can be used via a Python API or command-line interface. It's under active development and not yet production-ready.
- Project
Kaleidophon/deep-significancedeep-significance is a Python package that provides statistical significance tests (like Almost Stochastic Order) and multiple-comparison corrections to help researchers rigorously compare deep learning models across runs and datasets, avoiding conclusions based on chance.
- Project
monocle2ai/monocleMonocle is an Apache‑2.0 Python SDK that adds OpenTelemetry‑compatible tracing to GenAI apps and agents. It auto‑instrumentates popular frameworks (LangChain, LlamaIndex, Haystack, Google ADK, Claude CLI, etc.), emits structured spans for prompts, LLM calls, tool use, and vector queries, and integrates with any OTLP collector or local JSON files. A companion `monocle-test-tools` package lets you write pytest‑style tests that assert on those traces (agent runs, tool calls, token/cost limits, evaluation facts). Features include a metamodel for standard span attributes, scope helpers for tagging spans, built‑in secret obfuscation, zero‑code wrapper mode, VS Code visualizer integration, and broad exporter support (file, stdout, S3, Azure Blob, Okahu cloud, PostgreSQL, ClickHouse). Ideal for debugging, cost monitoring, CI testing, and platform‑level observability of AI agents.