LLM Abliteration is an open-source Python toolkit for modifying refusal behavior in large language models without conventional fine-tuning. Built with Hugging Face Transformers, it identifies refusal-related activation directions by comparing responses to harmful and harmless prompts. Researchers can analyze these directions across model layers and selectively remove their influence from model weights. The software supports dense and selected mixture-of-experts architectures, including Llama, Qwen, Mistral, and Gemma models. Batch inference and quantized model loading help reduce processing requirements. Sharded weight modifications allow larger models to be processed with limited memory. Advanced options include norm-preserving transformations, directional projection, and configurable layer strategies. Modified models can be tested and compared, although refusal removal is not guaranteed.
Features
- Refusal Direction Measurement and Analysis
- Transformer-Based Model Abliteration
- Dense and Mixture-of-Experts Model Support
- 4-Bit and 8-Bit Quantized Model Loading
- Memory-Efficient Sharded Weight Processing
- Norm-Preserving and Projection-Based Ablation