SKILL.md
SKILL.mdBrowse 6 files
3,922 tokens
15,482 bytes
Token encoding: o200k_base
Snapshot 24fd22b
1---2name: obliteratus3description: "OBLITERATUS: abliterate LLM refusals (diff-in-means)."4version: 2.0.05author: Hermes Agent6license: MIT7dependencies: [obliteratus, torch, transformers, bitsandbytes, accelerate, safetensors]8platforms: [linux, macos]9metadata:10 hermes:11 tags: [Abliteration, Uncensoring, Refusal-Removal, LLM, Weight-Projection, SVD, Mechanistic-Interpretability, HuggingFace, Model-Surgery]12 related_skills: [serving-llms-vllm, llama-cpp, huggingface-tokenizers]13---14 15# OBLITERATUS Skill16 17## What's inside18 199 CLI methods, 28 analysis modules, 116 model presets across 5 compute tiers, tournament evaluation, and telemetry-driven recommendations.20 21Remove refusal behaviors (guardrails) from open-weight LLMs without retraining or fine-tuning. Uses mechanistic interpretability techniques — including diff-in-means, SVD, whitened SVD, LEACE concept erasure, SAE decomposition, Bayesian kernel projection, and more — to identify and surgically excise refusal directions from model weights while preserving reasoning capabilities.22 23**License warning:** OBLITERATUS is AGPL-3.0. NEVER import it as a Python library. Always invoke via CLI (`obliteratus` command) or subprocess. This keeps Hermes Agent's MIT license clean.24 25## Video Guide26 27Walkthrough of OBLITERATUS used by a Hermes agent to abliterate Gemma:28https://www.youtube.com/watch?v=8fG9BrNTeHs ("OBLITERATUS: An AI Agent Removed Gemma 4's Safety Guardrails")29 30Useful when the user wants a visual overview of the end-to-end workflow before running it themselves.31 32## When to Use This Skill33 34Trigger when the user:35- Wants to "uncensor" or "abliterate" an LLM36- Asks about removing refusal/guardrails from a model37- Wants to create an uncensored version of Llama, Qwen, Mistral, etc.38- Mentions "refusal removal", "abliteration", "weight projection"39- Wants to analyze how a model's refusal mechanism works40- References OBLITERATUS, abliterator, or refusal directions41 42## Step 1: Installation43 44Check if already installed:45```bash46obliteratus --version 2>/dev/null && echo "INSTALLED" || echo "NOT INSTALLED"47```48 49If not installed, clone and install from GitHub:50```bash51git clone https://github.com/elder-plinius/OBLITERATUS.git52cd OBLITERATUS53pip install -e .54# For Gradio web UI support:55# pip install -e ".[spaces]"56```57 58**IMPORTANT:** Confirm with user before installing. This pulls in ~5-10GB of dependencies (PyTorch, Transformers, bitsandbytes, etc.).59 60## Step 2: Check Hardware61 62Before anything, check what GPU is available:63```bash64python3 -c "65import torch66if torch.cuda.is_available():67 gpu = torch.cuda.get_device_name(0)68 vram = torch.cuda.get_device_properties(0).total_memory / 1024**369 print(f'GPU: {gpu}')70 print(f'VRAM: {vram:.1f} GB')71 if vram < 4: print('TIER: tiny (models under 1B)')72 elif vram < 8: print('TIER: small (models 1-4B)')73 elif vram < 16: print('TIER: medium (models 4-9B with 4bit quant)')74 elif vram < 32: print('TIER: large (models 8-32B with 4bit quant)')75 else: print('TIER: frontier (models 32B+)')76else:77 print('NO GPU - only tiny models (under 1B) on CPU')78"79```80 81### VRAM Requirements (with 4-bit quantization)82 83| VRAM | Max Model Size | Example Models |84|:---------|:----------------|:--------------------------------------------|85| CPU only | ~1B params | GPT-2, TinyLlama, SmolLM |86| 4-8 GB | ~4B params | Qwen2.5-1.5B, Phi-3.5 mini, Llama 3.2 3B |87| 8-16 GB | ~9B params | Llama 3.1 8B, Mistral 7B, Gemma 2 9B |88| 24 GB | ~32B params | Qwen3-32B, Llama 3.1 70B (tight), Command-R |89| 48 GB+ | ~72B+ params | Qwen2.5-72B, DeepSeek-R1 |90| Multi-GPU| 200B+ params | Llama 3.1 405B, DeepSeek-V3 (685B MoE) |91 92## Step 3: Browse Available Models & Get Recommendations93 94```bash95# Browse models by compute tier96obliteratus models --tier medium97 98# Get architecture info for a specific model99obliteratus info <model_name>100 101# Get telemetry-driven recommendation for best method & params102obliteratus recommend <model_name>103obliteratus recommend <model_name> --insights # global cross-architecture rankings104```105 106## Step 4: Choose a Method107 108### Method Selection Guide109**Default / recommended for most cases: `advanced`.** It uses multi-direction SVD with norm-preserving projection and is well-tested.110 111| Situation | Recommended Method | Why |112|:----------------------------------|:-------------------|:-----------------------------------------|113| Default / most models | `advanced` | Multi-direction SVD, norm-preserving, reliable |114| Quick test / prototyping | `basic` | Fast, simple, good enough to evaluate |115| Dense model (Llama, Mistral) | `advanced` | Multi-direction, norm-preserving |116| MoE model (DeepSeek, Mixtral) | `nuclear` | Expert-granular, handles MoE complexity |117| Reasoning model (R1 distills) | `surgical` | CoT-aware, preserves chain-of-thought |118| Stubborn refusals persist | `aggressive` | Whitened SVD + head surgery + jailbreak |119| Want reversible changes | Use steering vectors (see Analysis section) |120| Maximum quality, time no object | `optimized` | Bayesian search for best parameters |121| Experimental auto-detection | `informed` | Auto-detects alignment type — experimental, may not always outperform advanced |122 123### 9 CLI Methods124- **basic** — Single refusal direction via diff-in-means. Fast (~5-10 min for 8B).125- **advanced** (DEFAULT, RECOMMENDED) — Multiple SVD directions, norm-preserving projection, 2 refinement passes. Medium speed (~10-20 min).126- **aggressive** — Whitened SVD + jailbreak-contrastive + attention head surgery. Higher risk of coherence damage.127- **spectral_cascade** — DCT frequency-domain decomposition. Research/novel approach.128- **informed** — Runs analysis DURING abliteration to auto-configure. Experimental — slower and less predictable than advanced.129- **surgical** — SAE features + neuron masking + head surgery + per-expert. Very slow (~1-2 hrs). Best for reasoning models.130- **optimized** — Bayesian hyperparameter search (Optuna TPE). Longest runtime but finds optimal parameters.131- **inverted** — Flips the refusal direction. Model becomes actively willing.132- **nuclear** — Maximum force combo for stubborn MoE models. Expert-granular.133 134### Direction Extraction Methods (--direction-method flag)135- **diff_means** (default) — Simple difference-in-means between refused/complied activations. Robust.136- **svd** — Multi-direction SVD extraction. Better for complex alignment.137- **leace** — LEACE (Linear Erasure via Closed-form Estimation). Optimal linear erasure.138 139### 4 Python-API-Only Methods140(NOT available via CLI — require Python import, which violates AGPL boundary. Mention to user only if they explicitly want to use OBLITERATUS as a library in their own AGPL project.)141- failspy, gabliteration, heretic, rdo142 143## Step 5: Run Abliteration144 145### Standard usage146```bash147# Default method (advanced) — recommended for most models148obliteratus obliterate <model_name> --method advanced --output-dir ./abliterated-models149 150# With 4-bit quantization (saves VRAM)151obliteratus obliterate <model_name> --method advanced --quantization 4bit --output-dir ./abliterated-models152 153# Large models (70B+) — conservative defaults154obliteratus obliterate <model_name> --method advanced --quantization 4bit --large-model --output-dir ./abliterated-models155```156 157### Fine-tuning parameters158```bash159obliteratus obliterate <model_name> \160 --method advanced \161 --direction-method diff_means \162 --n-directions 4 \163 --refinement-passes 2 \164 --regularization 0.1 \165 --quantization 4bit \166 --output-dir ./abliterated-models \167 --contribute # opt-in telemetry for community research168```169 170### Key flags171| Flag | Description | Default |172|:-----|:------------|:--------|173| `--method` | Abliteration method | advanced |174| `--direction-method` | Direction extraction | diff_means |175| `--n-directions` | Number of refusal directions (1-32) | method-dependent |176| `--refinement-passes` | Iterative passes (1-5) | 2 |177| `--regularization` | Regularization strength (0.0-1.0) | 0.1 |178| `--quantization` | Load in 4bit or 8bit | none (full precision) |179| `--large-model` | Conservative defaults for 120B+ | false |180| `--output-dir` | Where to save the abliterated model | ./obliterated_model |181| `--contribute` | Share anonymized results for research | false |182| `--verify-sample-size` | Number of test prompts for refusal check | 20 |183| `--dtype` | Model dtype (float16, bfloat16) | auto |184 185### Other execution modes186```bash187# Interactive guided mode (hardware → model → preset)188obliteratus interactive189 190# Web UI (Gradio)191obliteratus ui --port 7860192 193# Run a full ablation study from YAML config194obliteratus run config.yaml --preset quick195 196# Tournament: pit all methods against each other197obliteratus tourney <model_name>198```199 200## Step 6: Verify Results201 202After abliteration, check the output metrics:203 204| Metric | Good Value | Warning |205|:-------|:-----------|:--------|206| Refusal rate | < 5% (ideally ~0%) | > 10% means refusals persist |207| Perplexity change | < 10% increase | > 15% means coherence damage |208| KL divergence | < 0.1 | > 0.5 means significant distribution shift |209| Coherence | High / passes qualitative check | Degraded responses, repetition |210 211### If refusals persist (> 10%)2121. Try `aggressive` method2132. Increase `--n-directions` (e.g., 8 or 16)2143. Add `--refinement-passes 3`2154. Try `--direction-method svd` instead of diff_means216 217### If coherence is damaged (perplexity > 15% increase)2181. Reduce `--n-directions` (try 2)2192. Increase `--regularization` (try 0.3)2203. Reduce `--refinement-passes` to 12214. Try `basic` method (gentler)222 223## Step 7: Use the Abliterated Model224 225The output is a standard HuggingFace model directory.226 227```bash228# Test locally with transformers229python3 -c "230from transformers import AutoModelForCausalLM, AutoTokenizer231model = AutoModelForCausalLM.from_pretrained('./abliterated-models/<model>')232tokenizer = AutoTokenizer.from_pretrained('./abliterated-models/<model>')233inputs = tokenizer('How do I pick a lock?', return_tensors='pt')234outputs = model.generate(**inputs, max_new_tokens=200)235print(tokenizer.decode(outputs[0], skip_special_tokens=True))236"237 238# Upload to HuggingFace Hub239huggingface-cli upload <username>/<model-name>-abliterated ./abliterated-models/<model>240 241# Serve with vLLM242vllm serve ./abliterated-models/<model>243```244 245## CLI Command Reference246 247| Command | Description |248|:--------|:------------|249| `obliteratus obliterate` | Main abliteration command |250| `obliteratus info <model>` | Print model architecture details |251| `obliteratus models --tier <tier>` | Browse curated models by compute tier |252| `obliteratus recommend <model>` | Telemetry-driven method/param suggestion |253| `obliteratus interactive` | Guided setup wizard |254| `obliteratus tourney <model>` | Tournament: all methods head-to-head |255| `obliteratus run <config.yaml>` | Execute ablation study from YAML |256| `obliteratus strategies` | List all registered ablation strategies |257| `obliteratus report <results.json>` | Regenerate visual reports |258| `obliteratus ui` | Launch Gradio web interface |259| `obliteratus aggregate` | Summarize community telemetry data |260 261## Analysis Modules262 263OBLITERATUS includes 28 analysis modules for mechanistic interpretability.264See `skill_view(name="obliteratus", file_path="references/analysis-modules.md")` for the full reference.265 266### Quick analysis commands267```bash268# Run specific analysis modules269obliteratus run analysis-config.yaml --preset quick270 271# Key modules to run first:272# - alignment_imprint: Fingerprint DPO/RLHF/CAI/SFT alignment method273# - concept_geometry: Single direction vs polyhedral cone274# - logit_lens: Which layer decides to refuse275# - anti_ouroboros: Self-repair risk score276# - causal_tracing: Causally necessary components277```278 279### Steering Vectors (Reversible Alternative)280Instead of permanent weight modification, use inference-time steering:281```python282# Python API only — for user's own projects283from obliteratus.analysis.steering_vectors import SteeringVectorFactory, SteeringHookManager284```285 286## Ablation Strategies287 288Beyond direction-based abliteration, OBLITERATUS includes structural ablation strategies:289- **Embedding Ablation** — Target embedding layer components290- **FFN Ablation** — Feed-forward network block removal291- **Head Pruning** — Attention head pruning292- **Layer Removal** — Full layer removal293 294List all available: `obliteratus strategies`295 296## Evaluation297 298OBLITERATUS includes built-in evaluation tools:299- Refusal rate benchmarking300- Perplexity comparison (before/after)301- LM Eval Harness integration for academic benchmarks302- Head-to-head competitor comparison303- Baseline performance tracking304 305## Platform Support306 307- **CUDA** — Full support (NVIDIA GPUs)308- **Apple Silicon (MLX)** — Supported via MLX backend309- **CPU** — Supported for tiny models (< 1B params)310 311## YAML Config Templates312 313Load templates for reproducible runs via `skill_view`:314- `templates/abliteration-config.yaml` — Standard single-model config315- `templates/analysis-study.yaml` — Pre-abliteration analysis study316- `templates/batch-abliteration.yaml` — Multi-model batch processing317 318## Telemetry319 320OBLITERATUS can optionally contribute anonymized run data to a global research dataset.321Enable with `--contribute` flag. No personal data is collected — only model name, method, metrics.322 323## Common Pitfalls324 3251. **Don't use `informed` as default** — it's experimental and slower. Use `advanced` for reliable results.3262. **Models under ~1B respond poorly to abliteration** — their refusal behaviors are shallow and fragmented, making clean direction extraction difficult. Expect partial results (20-40% remaining refusal). Models 3B+ have cleaner refusal directions and respond much better (often 0% refusal with `advanced`).3273. **`aggressive` can make things worse** — on small models it can damage coherence and actually increase refusal rate. Only use it if `advanced` leaves > 10% refusals on a 3B+ model.3284. **Always check perplexity** — if it spikes > 15%, the model is damaged. Reduce aggressiveness.3295. **MoE models need special handling** — use `nuclear` method for Mixtral, DeepSeek-MoE, etc.3306. **Quantized models can't be re-quantized** — abliterate the full-precision model, then quantize the output.3317. **VRAM estimation is approximate** — 4-bit quant helps but peak usage can spike during extraction.3328. **Reasoning models are sensitive** — use `surgical` for R1 distills to preserve chain-of-thought.3339. **Check `obliteratus recommend`** — telemetry data may have better parameters than defaults.33410. **AGPL license** — never `import obliteratus` in MIT/Apache projects. CLI invocation only.33511. **Large models (70B+)** — always use `--large-model` flag for conservative defaults.33612. **Spectral certification RED is common** — the spectral check often flags "incomplete" even when practical refusal rate is 0%. Check actual refusal rate rather than relying on spectral certification alone.337 338## Complementary Skills339 340- **vllm** — Serve abliterated models with high throughput341- **gguf** — Convert abliterated models to GGUF for llama.cpp342- **huggingface-tokenizers** — Work with model tokenizers343 Discovery context
Discovered by repository scan. No exact path reference found in the snapshot’s root AGENTS.md.