This repository contains the mathematically optimal, low-damaged abliterated weights for Ideogram 4 (ideogram-ai/ideogram-4-fp8, 9.28B single-stream Diffusion Transformer).
Using Tier 1 Gateway Adapter Nullification ($W^ = W(I - v v^\top)$) lifted to BF16*, refusal vectors in text conditioning space are extinguished with machine precision before reaching the 34 single-stream transformer blocks, while preserving 99.57% of original model weights.
| Metric | Measured Value | Standard / Threshold | Status |
|---|---|---|---|
| Gateway Weight Distortion | $|\Delta W|_F / |W|_F = \mathbf{0.4295%}$ | $< 1.0%$ | ✅ 0.43% Minimal Distortion |
| Backbone Block Distortion | $|\Delta W_{\text{blocks}}| \equiv \mathbf{0.0}$ | $= 0.0$ | ✅ 100% Parameter Preservation |
| Benign Semantic Fidelity | Mean Cosine Similarity $= \mathbf{0.9811}$ | $> 0.95$ | ✅ 98.11% Semantic Retention |
| Refusal Erasure Rate (RER) | Medical Anatomy: $\mathbf{99.23%}$, Combat: $\mathbf{90.21%}$ | $> 85.0%$ | ✅ High Refusal Suppression |
| Spatial Variance Restoration | Combat: $\mathbf{+194.3%}$ variance restored | $> 0%$ | ✅ Clean Refusal Basin Escape |
| BF16 Numerical Leakage | $|W^*_{\text{BF16}} v| / |W v| = \mathbf{0.0188}$ | $< 0.02$ | ✅ Zero Requantization Error |
safety.py): External Hive Moderation API wrapper. Contains 0 model parameters; bypassed when running without Hive API keys.(0, 3, 6, ..., 33, 35) concatenated into 53,248 dimensions. Late layers 27–35 carry 66.86% of refusal steering energy into the DiT; early layers (0–9) carry only 4.40% (Layer 0: 0.01%).llm_cond_proj): Linear projection ($53,248 \to 4,608$, 245.37M parameters). This is the sole entry point of text conditioning into the DiT. The null space $\dim \ker W \ge 48,640$ extinguishing $>91.3%$ of Qwen3-VL features.Under Gateway Adapter Nullification $W^* = W (I - v v^\top)$: $$\Delta W_k = - (W v) v_k^\top \implies |\Delta W_k|_F = |W v|2 \cdot |v_k|2$$ Evaluating the ratio of surgery between the final block column ($W{35}$) and initial block column ($W_0$): $$\frac{|\Delta W{35}|_F}{|\Delta W_0|F} = \frac{0.5423}{0.0105} \approx \mathbf{51.65\times}$$ Surgery on $W{35}$ is 51.65 times more intensive than on $W_0$. The low-level lexical syntax and typographic glyph structures remain virtually untouched, explaining why text rendering and prompt fidelity achieve $>98.1%$.
import torch
from safetensors.torch import load_file
from diffusers import DiffusionPipeline
# 1. Load official base Ideogram 4 pipeline
pipeline = DiffusionPipeline.from_pretrained(
"ideogram-ai/ideogram-4-fp8",
torch_dtype=torch.bfloat16,
)
# 2. Load the ablated Gateway Adapter weights from this repository
ablated_weights = load_file("ideogram4_gateway_ablated.safetensors")
# 3. In-place fold into the transformer
with torch.no_grad():
pipeline.transformer.llm_cond_proj.weight.copy_(ablated_weights["llm_cond_proj.weight"])
if "llm_cond_proj.bias" in ablated_weights:
pipeline.transformer.llm_cond_proj.bias.copy_(ablated_weights["llm_cond_proj.bias"])
print("Successfully loaded abliterated Gateway Adapter!")
ap-4IxzcRfhqKvZfuvu4SRg02 / ap-8XWz4HHNSQLxHAzKjyYDhlideogram-ai/ideogram-4-fp8 (9.28B single-stream DiT)ideogram4_gateway_ablated.safetensors 491 MBv_refusal_conditioning.pt 214.7 kBv_refusal_output_space.pt 20.2 kB