circuit_sparsity  by openai

Sparse circuit analysis and visualization tools

Created 2 months ago
486 stars

Top 63.3% on SourcePulse

GitHubView on GitHub
1 Expert Loves This Project
Project Summary

This project provides tools for inspecting and understanding sparse circuit models, specifically those developed in the Gao et al. 2025 research. It targets researchers and engineers interested in model interpretability and the behavior of pruned neural networks, offering a Streamlit-based visualizer and inference code to facilitate analysis and exploration of these specialized models.

How It Works

The project utilizes a lightweight GPT implementation for efficient CPU/GPU inference and a Streamlit dashboard for interactive visualization. The dashboard connects to cached data from openaipublic, allowing users to select models, datasets, pruning sweeps, and node budgets. It renders interactive plots using Plotly to display circuit masks, activations, and importances, enabling detailed exploration of pruned model components. The inference module supports capturing intermediate activations via hook_recorder.

Quick Start & Requirements

  • Install: pip install -e .
  • Launch Visualizer: streamlit run circuit_sparsity/viz.py
  • Prerequisites: Streamlit, Plotly, matplotlib, seaborn, torch. Specific hardware requirements are not detailed, but GPU inference is supported.
  • Data: Visualizer loads data from https://openaipublic.blob.core.windows.net/circuit-sparsity.

Highlighted Details

  • Features a Streamlit dashboard for interactive exploration of task-specific circuits derived from pruning.
  • Includes a lightweight GPT implementation for running model forward passes and capturing activations.
  • Releases multiple pre-trained models, including sizes like 118M and 475M parameters, and configurations for various experiments.
  • Supports analysis across different pruning algorithms and configurations (e.g., prune_v4, prune_v5_logitscaling).

Maintenance & Community

The project is an open-source release accompanying research from "Gao et al. 2025." No specific community channels (e.g., Discord, Slack) or detailed roadmap are provided in the README.

Licensing & Compatibility

The license type is not specified in the provided README. This omission requires further investigation to determine compatibility for commercial use or integration into closed-source projects.

Limitations & Caveats

The README states it was AI-generated and lightly edited, potentially indicating areas needing verification. Exact training hyperparameters for some models are marked as [todo]. The absence of explicit licensing information is a significant caveat for adoption assessment.

Health Check
Last Commit

1 month ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
2
Star History
339 stars in the last 30 days

Explore Similar Projects

Starred by Yaowei Zheng Yaowei Zheng(Author of LLaMA-Factory), Yineng Zhang Yineng Zhang(Inference Lead at SGLang; Research Scientist at Together AI), and
1 more.

VeOmni by ByteDance-Seed

1.8%
2k
Framework for scaling multimodal model training across accelerators
Created 9 months ago
Updated 1 day ago
Starred by David Cournapeau David Cournapeau(Author of scikit-learn), Stas Bekman Stas Bekman(Author of "Machine Learning Engineering Open Book"; Research Engineer at Snowflake), and
5 more.

lectures by gpu-mode

0.8%
6k
Lecture series for GPU-accelerated computing
Created 2 years ago
Updated 1 month ago
Starred by George Hotz George Hotz(Author of tinygrad; Founder of the tiny corp, comma.ai), Andrej Karpathy Andrej Karpathy(Founder of Eureka Labs; Formerly at Tesla, OpenAI; Author of CS 231n), and
41 more.

mlx by ml-explore

0.3%
23k
Array framework for machine learning on Apple silicon
Created 2 years ago
Updated 1 day ago
Feedback? Help us improve.