# Sparse Weight Decomposition for Efficient Circuit Extraction

- **ID:** 667
- **Kind:** code
- **URL:** https://github.com/Veri-Safe/SWD
- **Authors:** Veri Safe
- **Venue:** Veri Safe (GitHub)
- **Published:** 2026
- **Source:** github
- **Language:** en
- **Access:** free
- **License:** Apache-2.0
- **License family:** Permissive (auto-classified)
- **Tags:** swd, sparse-weight-decomposition, interpretability, circuits, veri-safe, blog
- **Topics:** mechanistic interpretability, sparse factorization, circuit analysis
- **Added:** 2026-08-14
- **Verified:** 2026-08-14
- **Research status:** done
- **Needs deep evaluation:** no
- **Page:** https://papers.projxon.ai/entries/667

## Summary

Veri-Safe SWD reference implementation. Factorizes pretrained dense linear maps (GPT-2 Small mlp.c_proj, Qwen2.5 0.5B/1.5B/3B down_proj, Qwen3.5-27B, full GPT-2 MLP and all 48 body projections) via Double Sparse Factorization so replacement CE stays near dense (e.g. GPT-2 L8 c_proj s=0.5: CE delta 0.000889 on 16,384 tokens; Qwen3.5-27B s=0.5: −0.000427). Pipeline: activation-Gram → DSF → fixed-support recovery → CE/KL/recon, task-margin attribution, mean ablation, sufficiency/necessity frontiers vs Transcoder/VPD baselines. Factor-only checkpoints on HF veri-safe/SWD (~1.16 GB usedStorage) plus SWD-Qwen2.5-3B (Qwen Research License). Discord posted the HF Spaces blog veri-safe/SWD-Blog. Apache-2.0. No FineWeb text redistributed.

## Attributes

- **Purpose:** Rewrite a dense projection as two sparse factors whose bottleneck coordinates are directly intervenable circuit units
- **Scale:** GitHub 12 stars / 0 forks at check. HF veri-safe/SWD usedStorage ~1.16 GB; 4 likes / 0 downloads at check. Space 5 likes.
- **Time period:** Repo created 2026-08-03; pushed 2026-08-04. HF created 2026-08-04. Discord posted 2026-08-08.
- **Author type:** human

## From the source (fetched 2026-10-03)

- **Repository:** Veri-Safe/SWD (GitHub)
- **Created:** Aug 3, 2026 (GitHub)
- **Last push:** Aug 4, 2026 (GitHub)
- **Stars:** 15 (GitHub)
- **Forks:** 0 (GitHub)
- **Main language:** Python (GitHub)

## Research notes

- Primary: GitHub README (Apache-2.0). Discord posted https://huggingface.co/spaces/veri-safe/SWD-Blog (Space was a loading stub at fetch). Checkpoints https://huggingface.co/veri-safe/SWD and veri-safe/SWD-Qwen2.5-3B. Calibration uses FineWeb-Edu locally; not a new hosted corpus, so no datasets_local row. Individual author names not on the README; org Veri Safe used rather than guess.

## Similar entries

- [Natural Language Autoencoders Produce Unsupervised Explanations of LLM Activations](https://papers.projxon.ai/entries/615) (paper, #615)
- [Verbalizable Representations Form a Global Workspace in Language Models](https://papers.projxon.ai/entries/1093) (paper, #1093)
- [Thought Branches: Interpreting LLM Reasoning Requires Resampling](https://papers.projxon.ai/entries/750) (paper, #750)
- [Shared Circuits for Shared Grammar: Tracing Subject-Verb Agreement Across Languages](https://papers.projxon.ai/entries/1247) (paper, #1247)
- [The Spike, the Sparse and the Sink: Anatomy of Massive Activations and Attention Sinks](https://papers.projxon.ai/entries/1263) (paper, #1263)
- [Flash-MSA: Accelerating Million-Token Training With Sparse Attention Kernels](https://papers.projxon.ai/entries/627) (other, #627)
