Skip to main content
The optimized method replaces manual hyperparameter selection with automated Bayesian optimization. Instead of using fixed projection strengths, Optuna TPE search finds the per-layer ablation weights that minimize the (refusal rate, KL divergence) Pareto front. On top of the optimizer, optimized adds two novel preservation techniques: CoT-Aware Ablation and KL-Divergence Co-Optimization. Method configuration from source:

Parametric Kernel Optimization (Bayesian / Optuna TPE)

The optimizer searches over 7 global parameters that define a bell-curve layer weighting kernel: At each trial, the optimizer assigns a projection weight to every layer using the Gaussian-shaped kernel, applies the projection, evaluates refusal rate and KL divergence, and records the result. After bayesian_trials=50 trials, it applies the parameters from the Pareto-optimal trial.
The Bayesian optimizer is inspired by Heretic (p-e-w, 2025) which pioneered Optuna TPE for abliteration. OBLITERATUS extends it with MoE-aware granularity (per-expert directions), multi-direction SVD instead of single diff-of-means, and SAE feature-level precision.

CoT-Aware Ablation

Chain-of-thought reasoning models encode their reasoning process in the residual stream before generating the final answer. Some of those reasoning directions are geometrically close to refusal directions — they both appear in similar hidden state positions and can be confused by SVD extraction. cot_aware=True enables CoT-Aware Ablation:
  1. Multi-position activation collection: instead of capturing only the last token’s activation, the pipeline collects activations at the last token, the 75th-percentile position, and the 50th-percentile position, then averages them
  2. Reasoning-critical direction identification: any direction that is used by the model to generate CoT reasoning tokens (high activation at reasoning positions) is flagged as _cot_preserve_directions
  3. Orthogonalization: before applying each refusal direction, it is orthogonalized against all identified CoT directions — ensuring the projection doesn’t bleed into reasoning-critical subspaces
This preserves chain-of-thought quality on reasoning models (DeepSeek-R1 distillations, Qwen3 thinking mode, QwQ) while still removing refusal.

KL-Divergence Co-Optimization

With use_kl_optimization=True and kl_budget=0.5, the optimizer includes KL divergence as a second objective alongside refusal rate. The kl_budget is a soft ceiling: projections that would push the model’s output distribution more than kl_budget nats away from the original are partially reverted. The process:
  1. Before EXCISE, the pipeline captures baseline logits for a set of evaluation prompts (_capture_baseline_kl_logits)
  2. After each projection step, it measures the KL divergence between the current and baseline distributions per layer (_kl_contributions)
  3. Layers where KL exceeds budget get their projection strength reduced — partially reverting the weight change for that layer only
This creates a per-layer feedback loop: remove as much refusal as possible, but pull back when a specific layer’s projection is damaging general capability.

Best for

  • Cases where capability preservation is critical and you have compute budget to run 50 optimization trials
  • Reasoning models (DeepSeek-R1, Qwen3-thinking, QwQ) where CoT preservation is required
  • Models where advanced achieves acceptable refusal removal but slightly too much perplexity drift
  • MoE models where precision matters but surgical’s full EGA is overkill
optimized takes significantly longer than advanced due to the 50 Bayesian trials. Each trial requires a full excision pass and evaluation pass. On a 7B model, expect 30-90 minutes depending on hardware, vs 5-15 minutes for advanced.

CLI usage

Python API usage

Output metrics to expect

Typical ranges on a 7-8B instruct model with optimized (50 trials):
If you want the best quality but can’t afford 50 Bayesian trials, use informed instead. The InformedAbliterationPipeline uses analysis modules to warm-start the optimizer’s search space, often converging on near-optimal parameters in fewer trials.