Mechanistic Circuit Identification for Controllable Data Generation
Organizations: Department of Electrical and Computer Engineering, Seoul National University · Department of Computer Science and Engineering, Konkuk University
Abstract
While recent advances in data synthesis aim to curate high-quality datasets, most generation pipelines still rely on heuristic prompt-based control. This black-box paradigm provides limited insight into how individual samples interact with a model's underlying learning dynamics. To bridge this gap, we propose a circuit-grounded framework that connects training-dynamics-based data valuation with mechanistic interpretability (MI). Specifically, we conceptualize data quality along three complementary utility axes, learnability, challenge, and alignment. First, we uncover specialized model-internal circuits that causally govern these utility signals. Then, moving beyond heuristic prompting toward mechanistic control, we leverage these circuits as controllable interfaces, actively steering generation to produce utility-targeted data. Building on this capability, we introduce SAMS (Stage-Aware Mechanistic Scheduling), which schedules circuit-steered data according to the model's evolving optimization needs. Experiments on multiple-choice QA tasks demonstrate that our approach yields precisely controlled data with greater diversity than prompt-based baselines, consistently improving downstream performance and calibration. Ultimately, this work establishes a principled white-box paradigm for interpretable data generation, pioneering the use of MI not just as an analytical tool, but as a practical, controllable interface.
Figures & tables
| Metric | Circuit | Corr. | GapRed | |
|---|---|---|---|---|
| AUM | High | 7.042 | -0.007 | 99.98% |
| Low | 7.347 | -0.173 | 98.05% | |
| Random | 1.171 | 0.940 | 26.58% | |
| EL2N | High | 0.637 | 0.024 | 99.53% |
| Low | 0.636 | 0.003 | 99.58% | |
| Random | 0.080 | 0.898 | 15.95% |
| Criteria | AUM | EL2N | GradAlign |
|---|---|---|---|
| HighC | 85.8 | 86.7 | 86.6 |
| LowC | 84.8 | 87.0 | 86.4 |
| ContC | 86.3 | 85.8 | 87.7 |
| Rand | 84.0 | 85.2 | 85.8 |
| OriS | 82.3 | 85.1 | 66.2 |
| Full (100%) | 87.4 | 87.6 | 87.4 |
| Category | Config | S&S | Sch. | Accuracy ( ) | ECE ( ) | NLL ( ) | ||||||
| 50% | 60% | 70% | 50% | 60% | 70% | 50% | 60% | 70% | ||||
| In-Domain: SciQ | ||||||||||||
| Baseline | Source Only (Full) | ✗ | ✗ | 83.4 | 0.157 | 1.408 | ||||||
| Prompt Gen. | Uniform-Mix | ✗ | ✗ | 82.9 | 83.7 | 82.8 | 0.070 | 0.078 | 0.093 | 0.541 | 0.551 | 0.588 |
| Stage-Aware Sch. | ✗ | ✓ | 83.4 | 83.1 | 83.2 | 0.074 | 0.079 | 0.090 | 0.525 | 0.568 | 0.594 | |
| Uniform-Mix | ✓ | ✗ | 83.9 | 84.5 | 84.9 | 0.060 | 0.071 | 0.069 | 0.513 | 0.544 | 0.540 | |
| Config (uniform) | SciQ | ECE | NII |
|---|---|---|---|
| Unsteered + Random | |||
| Unsteered + Filter | |||
| Steered + Random | |||
| Steered + Diversity | 0.050 0.020 | 0.477 0.015 | |
| Steered + Filter | 84.77 0.38 |
| Config | SciQ ACC | SciQ ECE | SciQ NII | ARC (OOD) |
|---|---|---|---|---|
| Bengio (logit-margin as the difficulty proxy) | ||||
| Uniform (33:33:34) | ||||
| Linear interpolation (per-batch) | ||||
| Reversed SAMS (reverse phase order) | 0.483 0.076 | |||
| SAMS | 85.20 0.56 | 0.057 0.023 | 76.15 0.30 |
| Model | Config | SciQ ACC | SciQ ECE | SciQ NII | ARC (OOD) |
|---|---|---|---|---|---|
| Gemma | Source-only | 75.74 0.27 | |||
| Prompt-Uniform | |||||
| Prompt-Sched | |||||
| Circuit-Uniform | |||||
| SAMS | 85.75 0.21 | 0.045 0.007 | 0.425 0.007 | ||
| Llama | Source-only | 79.20 0.42 |
Appendix figures & tables15 assets
Supplementary material from the paper’s appendix.
Appendix
| Selected Edges (Top- ) | Proportion of Total Edges (%) |
|---|---|
| 100 | 0.12% |
| 250 | 0.30% |
| 500 | 0.59% |
| 1,000 | 1.18% |
| 2,000 | 2.36% |
| 5,000 | 5.90% |
| Ablated Circuit | Pearson(full, abl) | |||
|---|---|---|---|---|
| AUM-High | ||||
| AUM-Low | ||||
| AUM-Random | ||||
| EL2N-High | ||||
| EL2N-Low | ||||
| EL2N-Random |
| AUM-hi | AUM-lo | EL2N-hi | EL2N-lo | GA-hi | GA-lo | |
|---|---|---|---|---|---|---|
| AUM-hi | 1.000 | 0.355 | 0.374 | 0.553 | 0.319 | 0.458 |
| AUM-lo | 0.355 | 1.000 | 0.323 | 0.370 | 0.282 | 0.441 |
| EL2N-hi | 0.374 | 0.323 | 1.000 | 0.374 | 0.359 | 0.362 |
| EL2N-lo | 0.553 | 0.370 | 0.374 | 1.000 | 0.292 | 0.393 |
| GA-hi | 0.319 | 0.282 | 0.359 | 0.292 | 1.000 | 0.377 |
| GA-lo | 0.458 | 0.441 | 0.362 | 0.393 | 0.377 | 1.000 |
| Circuit Utility Bucket | AUM | EL2N | GradAlign |
|---|---|---|---|
| AUM-high | ( ) | ( ) | ( ) |
| EL2N-high | ( ) | ( ) | ( ) |
| GA-high | ( ) | ( ) | ( ) |
| Circuit | Key Pathways |
|---|---|
| AUM-high | input a0.h6--11 v ; m1,m2 ; m1,m2 a6.h6--11 k ; a14 ; late L12/13/17/18/19; m23 logits |
| AUM-low | m1 a2 q ; m1,m2 a5 k ; m1,m2 m3 (suppr.); m27 logits (suppr.) |
| EL2N-low | input a0.h6--11 v ; m1 m2 m3 ; m1,m2 a6.h6--11 k ; m23 logits |
| EL2N-high | m1 a2 k (suppr.); m1,m2 a5 k ; m4,m6,m13 ; m2 a6,a14 (suppr.) |
| GradAlign-high | m1,m2 m13 ; m1,m2 a14 k (suppr.); m1,m2 a4 k (suppr.); L13–L20 |
| GradAlign-low | input a0.h6--11 v ; m1,m2 ; m1,m2 m3 (suppr.); m23 logits ; m27 logits (suppr.) |
| Hyperparameter | Value |
|---|---|
| Base model | Qwen2.5-1.5B-Instruct |
| Seed examples | 5,000 SciQ training examples |
| Candidates per source example | 4 |
| Selected candidates per source example | 2 |
| Sampling temperature | 0.8 |
| Top- | 0.95 |
| Setting | Prompt Template |
|---|---|
| Shared system instruction | Generate science multiple-choice training data. Keep the sample factually correct, avoid trivia leakage, and return strict JSON. Each choice must be plain text without letter or number prefixes. The answer field must be exactly one uppercase letter among A , B , C , and D . |
| Circuit-steered fixed prompt | Source topic: {topic} Source item: {source question} Source answer: {optional source answer} Create one new science MCQA sample in a similar domain. Keep it self-contained, factually correct, and naturally written. Do not explicitly mention a target difficulty band in the output. Return only JSON with fields question , choices , answer , rationale , difficulty , and helpful . |
| Prompt baseline: learnable-style | Create one new MCQA sample that is easier than the source. Use a single canonical science fact or one direct concept application. Distractors should be plausible but clearly eliminable by the decisive concept. Return only JSON with the same schema. |
| Prompt baseline: challenging-style | Create one new MCQA sample that is harder than the source. Require at least one extra inference step, concept disambiguation, or stronger distractor discrimination. Return only JSON with the same schema. |
| Prompt baseline: aligned-style | Create one new MCQA sample optimized to be instructional and helpful. The rationale must state the decisive evidence and why at least one distractor is wrong. Return only JSON with the same schema. |
| Circuit Preset | Functional Role | Steering Targets |
|---|---|---|
| AUM-High | Canonical anchor | ; ; ; ; ; |
| AUM-Low | Boundary branch | ; ; ; |
| EL2N-Low | Low-pressure anchor | ; ; ; ; ; ; |
| EL2N-High | Informative rerouting | ; ; ; ; ; |
| GradAlign-High | Target-aligned control | ; ; – late-control attention targets |
| GradAlign-Low | Shortcut evidence | ; ; ; ; |
| Activation Scale (Attention Scale) | ||||||
|---|---|---|---|---|---|---|
| Profile | AUM-H | AUM-L | EL2N-H | EL2N-L | GradAlign-H | GradAlign-L |
| ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | |
| ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | |
| ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | |
| Profile | Raw | Selected | JSON | Q. Len. | Rat. Len. | BLEU-1 | Jaccard |
|---|---|---|---|---|---|---|---|
| Circuit-learnable | 20,000 | 10,000 | 98.2 | 9.9 | 20.0 | 0.2752 | 0.1507 |
| Circuit-challenging | 20,000 | 10,000 | 99.5 | 10.8 | 22.6 | 0.2495 | 0.1395 |
| Circuit-aligned | 20,000 | 10,000 | 99.2 | 10.1 | 20.5 | 0.2680 | 0.1468 |
| Prompt-learnable | 20,000 | 10,000 | 99.5 | 9.5 | 20.7 | 0.3150 | 0.1725 |
| Prompt-challenging | 20,000 | 10,000 | 98.7 | 12.9 | 36.6 | 0.2473 | 0.1500 |
| Prompt-aligned | 20,000 | 10,000 | 98.5 | 10.3 | 40.6 | 0.4039 | 0.2497 |
| Hyperparameter | Value |
|---|---|
| Training epochs | 6 |
| Per-device batch size | 12 |
| Gradient accumulation steps | 4 |
| Effective batch size | 48 |
| Evaluation batch size | 8 |
| Learning rate |
| Config | SciQ ACC | SciQ ECE | SciQ NII | ARC (OOD) |
|---|---|---|---|---|
| Prompt-Uniform | ||||
| Prompt + Diversity | ||||
| Prompt + Reject-AUM | ||||
| Prompt + Reject-EL2N | ||||
| Prompt + Reject-GA | ||||
| Random-Circuit steering |
Synthetic Data Generation for Language Models
Synthetic data generation for language models creates artificial text, tasks, and interaction traces to train or evaluate models.
See all 293 papers