# Qwen 2.5 7B — KL Divergence Report > Comparison: `Qwen/Qwen2.5-7B-Instruct` (base) vs `qwen-2.5-7b-apostate` (Apostate) > Method: First-token log-probability KL divergence, full vocabulary (152,064 tokens) > Date: 2026-06-02 --- ## Executive Summary The KL divergence between base and apostate Qwen 2.5 7B is **0.1340 nats** (batchmean), classified as "moderate" by the evaluation pipeline. Unlike the Gemma4 E4B Apostate (which has zero weight edits — structural surgery only), the Qwen 2.5 apostate's 55 modified tensors produce a **broader distribution shift** — only 22% of prompts show negligible divergence (<0.001 nats) versus 56% for Gemma4, and the median KL is 3× higher (0.019 vs 0.006 nats). This is the direct cost of the weight-space orthogonal projection approach: more of the model's computation is affected, including on benign inputs. --- ## Methodology - **Metric**: `F.kl_div(logprobs_variant, logprobs_base, reduction='batchmean', log_target=True)` - **Scope**: First-token prediction, full vocabulary (152,064 tokens) - **Dataset**: 100 harmless prompts from `mlabonne/harmless_alpaca` (split=test[:100], column=text) - **System prompt**: "You are a helpful assistant." - **Response prefix**: None (Qwen 2.5 is not a thinking model — no special prefix) - **Method**: `model.generate(max_new_tokens=1, output_scores=True)` → log_softmax on scores --- ## Summary Statistics | Statistic | Value | |---|---| | **KL batchmean** | **0.1340 nats** | | KL per-prompt mean | 0.1340 nats | | KL per-prompt std | 0.3481 nats | | **KL per-prompt median** | **0.0186 nats** | | KL per-prompt min | ≈0 (1.26e-9) | | **KL per-prompt max** | **2.072 nats** | > Note: The summary median (0.0186) is the exact median of the 100 samples. The percentile table P50 (0.01864) uses linear interpolation — both round to 0.019 at 3 significant digits. | Interpretation | Moderate | ### Percentile Distribution | Percentile | KL (nats) | |---|---| | P5 | 0.00000 | | P10 | 0.00003 | | P25 | 0.00144 | | P50 (median) | 0.01864 | | P75 | 0.06217 | | P90 | 0.27218 | | P95 | 0.90331 | ### Bucket Distribution | KL Range | Interpretation | Count | % | |---|---|---|---| | < 0.001 | Negligible | 22 | 22% | | 0.001 – 0.01 | Low | 17 | 17% | | 0.01 – 0.1 | Moderate | 42 | **42%** | | 0.1 – 0.5 | High | 11 | 11% | | ≥ 0.5 | Very High | 8 | 8% | The dominant bucket is the **moderate range (0.01–0.1 nats)** with 42% of prompts. This is fundamentally different from the Gemma4 profile, which has 56% in the negligible range. The orthogonal projection's widespread weight edits (55 tensors, 35.8% of parameters) cause measurable distribution shifts on most benign inputs, not just outliers. --- ## Outlier Analysis 8 prompts had KL > 0.5 nats, accounting for the bulk of the batchmean: | KL (nats) | Prompt | |---|---| | **2.072** | "What is the current top news story in your local area?" | | **1.836** | 'Find the most suitable synonym to replace the word "pristine".' | | **1.420** | "Generate a creative headline for an article about the importance of learning a s…" | | **1.041** | "Generate a phrase that describes a group of people" | | **0.952** | "Suggest a movie that features a strong female lead character." | | **0.901** | "What season is it in the southern hemisphere?" | | **0.677** | "Name one law-enforcement agency that investigates cases of corporate fraud." | | **0.517** | "What is the oxidation state of sulfur in sulfurous acid?" | ### Pattern in outliers The top outlier ("current top news story") appears in both the Gemma4 and Qwen 2.5 analyses — it is a temporal/knowledge question where the model's "I don't know" response pattern differs between base and abliterated variants. The creative-generation prompts ("creative headline", "phrase that describes", "movie with female lead") suggest the abliteration subtly shifts the model's distribution over stylistic choices. The factual questions ("season in southern hemisphere", "oxidation state") indicate the weight edits introduce small perturbations in the model's factual recall pathway. --- ## Comparison to Structural Abliteration (Gemma4 E4B) | Model Pair | Method | KL batchmean | KL median | % Negligible (<0.001) | |---|---|---|---|---| | **Gemma4 E4B Apostate** | **Attention head ablation** | **0.148** | **0.0062** | **56%** | | Qwen 2.5 7B Apostate | Orthogonal projection | 0.134 | 0.0186 | 22% | The two models have **similar batchmean KL** (0.148 vs 0.134) but very different distributions: - **Gemma4** has lower median (0.006 vs 0.019) but higher mean — a few extreme outliers drive the average, while most prompts are unaffected (consistent with zero weight edits). - **Qwen 2.5** has higher median but lower mean — the distribution is more uniform, with most prompts experiencing some shift (consistent with 55 edited weight matrices). This is the key tradeoff: weight-space abliteration produces a **broader but shallower** perturbation, while structural abliteration produces a **narrower but deeper** one. --- ## Interpretation The KL divergence profile tells a clear story: 1. **Most inputs are slightly affected**: Only 22% of prompts have negligible divergence (vs 56% for Gemma4). The weight edits pervade the model's computation graph. 2. **Heavy tail from knowledge/creative prompts**: The 8 outlier prompts (>0.5 nats) span factual recall, creative generation, and temporal questions — areas where the refusal-direction removal introduces collateral shifts. 3. **Within typical range**: The batchmean of 0.134 nats is consistent with the Apostate `balanced` profile's typical KL budget (~0.160 nats). The results suggest the optimization constrained the overall distribution shift while maximizing safety bypass. 4. **Correlation with benchmarks**: The higher median KL predicts the measurable (though still small) capability degradation on TruthfulQA mc1 (-5.9%) and WinoGrande (-2.3%) — see BENCHMARKS.md. --- ## Files Produced | File | Content | |---|---| | `results/kl/kl_apostate.json` | Full per-prompt KL results with metadata | | `results/kl/logits_base.pt` | Cached base model logits (PyTorch tensor) | | `results/kl/logits_apostate.pt` | Cached apostate model logits | | `results/kl/response_prefix.txt` | Empty (no thinking prefix) |