Symbolic Circuit Distillation: prove program to LLM circuit equivalence
Details
- External ID
- 46518608
- Source
- HN
- Company
- —
- Product
- Symbolic Circuit Distillation: prove program to LLM circuit equivalence
- Website domain
- github.com
- Launched
- Jan. 6, 2026
- Cohort
- —
- Upvotes
- 16
- Upvotes percentile
- 0.6212121212121212
- Tags
- —
- Fetched at
- Sept. 7, 2026, 9:25 p.m.
- Updated at
- Sept. 7, 2026, 9:25 p.m.
Description
Hi HN, I've been exploring various applications of formal methods to ML/interpretability and I've been hoping to get more eyes on the approach.I have been working on a small interpretability project I call Symbolic Circuit Distillation. The goal is to take a tiny neuron-level circuit (like the ones in OpenAI's "Sparse Circuits" work) and automatically recover a concise Python program that implements the same algorithm, along with a bounded formal proof that the two are equivalent on a finite token domain.Roughly, the pipeline is:1. Start from a pruned circuit graph for a specific behavior (e.g. quote closing or bracket depth) extracted from a transformer. 2. Treat the circuit as an executable function and train a tiny ReLU network ("surrogate") that exactly matches the circuit on all inputs in a bounded domain (typically sequences of length 5–10 over a small token alphabet). 3. Search over a constrained DSL of common transformer motifs (counters, toggles, threshold detectors, small state machines) to synthesize candidate Python programs. 4. Use SMT-based bounded equivalence checking to either: - Prove that a candidate program and the surrogate agree on all inputs in the domain, or - Produce a counterexample input that rules the program out.If the solver finds a proof, you get a small, human-readable Python function plus a machine-checkable guarantee that it matches the original circuit on that bounded domain.Why I built thisMechanistic interpretability has gotten pretty good at extracting "small crisp circuits" from large models, but turning those graphs into clean, human-readable algorithms is still very manual. My goal here is to automate that last step: go from "here is a sparse circuit" to "here is a verified algorithm that explains what it does", without hand-holding.What works today- Tasks: quote closing and bracket-depth detection from the OpenAI circuit_sparsity repo. - Exact surrogate fitting on a finite token domain. - DSL templates for simple counters, toggles, and small state machines. - SMT-based bounded equivalence between: sparse circuit -> ReLU surrogate -> Python program in the DSL.Limitations and open questions- The guarantees are bounded: equivalence is only proven on a finite token domain (short sequences and a small vocabulary). - Currently focused on very small circuits. Scaling to larger circuits and longer contexts is open engineering and research work. - The DSL is hand-designed around a few motifs. I am not yet learning the DSL itself or doing anything very clever in the search.What I would love feedback on- Are the problem framing and guarantees interesting to people working on mechanistic interpretability or formal methods? - Suggestions for next benchmarks: which circuits or behaviors would you want to see distilled next? - Feedback on the DSL design, search strategy, and SMT setup.Happy to answer questions about implementation details, the SMT encoding, integration with OpenAI's Sparse Circuits repo, or anything else.
Enrichment
- Theme
- scientific computing and deep tech tools
- Vertical
- Horizontal
- Function
- Dev tools
- Audience
- Developer
- AI stance
- AI-native
- Project type
- Hobby / open-source project
- Normalized one-liner
- prove program equivalence to llm circuits
- Manually corrected
- False
Could you build this?
No Proving program equivalence to neural network circuits requires advanced formal methods, SMT solvers, and deep mechanistic interpretability research expertise.
What it would actually take: A working system requires integrating mechanistic interpretability tooling (such as TransformerLens) to identify and isolate sub-circuits, translation of neural weight activations into formal logic constraints, and symbolic SMT/SAT verification engines (like Z3 or CVC5) to prove functional equivalence against programmatic specifications. It requires deep research expertise in both formal verification and transformer interpretability theory.
Discussion
2 comments analyzed.
Concerns raised: Lack of examples in readme documentation
Competitors
Other products that read as similar to this one — 99 launches clear the similarity bar, closest 8 shown.
Attention rank: #37 of 100 (itself plus its competitors, highest first — normalized so YC and Product Hunt are compared fairly).
Launched 64 days after the earliest competitor.
- zkGolf · hn · 2026-07-02 · 69 upvotes · similarity 0.52
- Duplicate 3 layers in a 24B LLM, logical deduction .22→.76. No training · hn · 2026-03-18 · 265 upvotes · similarity 0.50
- SHDL · hn · 2026-01-28 · 48 upvotes · similarity 0.44
- The Thiele Machine · hn · 2026-01-12 · 9 upvotes · similarity 0.42
- SymDerive · hn · 2026-02-01 · 26 upvotes · similarity 0.42
- I built a lite LPU that can do inference on Karpathy's MicroGPT · hn · 2026-08-24 · 18 upvotes · similarity 0.41
- The Hessian of tall-skinny networks is easy to invert · hn · 2026-01-15 · 31 upvotes · similarity 0.40
- Operon · hn · 2025-12-29 · 6 upvotes · similarity 0.40
Other launches for this product
- No other launches for this product.
Same idea, different domain
Nobody's really built a dev tools tool for Sales yet.