Circuit-HyperNet: Guiding parameter generation and compositional reasoning with internal computation
Abstract
Using one neural network to generate or modify another model's parameters is becoming a new route to model adaptation and error correction (Ha et al., 2017; Charakorn et al., 2025; Takehi et al., 2026). Hypernetworks can generate adaptation parameters directly from task descriptions (Ivison et al., 2023; Charakorn et al., 2025), while closed-weight language models can analyze a target model and edit its weights to repair specific failures (Takehi et al., 2026). Yet each approach leaves a gap: parameter generation based only on task descriptions cannot observe the target model's internal computation on the current problem, and weight repair for specific failures often requires a clearly identified symptom before the relevant weights can be located and modified. We introduce Circuit-HyperNet (C-HyperNet). With the base model frozen, we first extract a local attribution graph, or circuit (Ameisen et al., 2025), from its initial attempt at the current problem. This graph describes internal features and their influence relationships. We summarize it as a fixed-length vector (Zhao et al., 2025; He et al., 2026) and feed it, together with the original problem (query), into a small hypernetwork (HyperNet). HyperNet generates a problem-specific low-rank parameter update (LoRA) (Hu et al., 2022), which the base model uses for a second attempt. Our central intuition is that problems with different wording but shared logical structure often exhibit similar internal representation dynamics (Zhou et al., 2026). These shared computational patterns may provide a basis for learning general rules for parameter correction and help connect compositional out-of-distribution (OOD) tasks—novel combinations of familiar atomic operations not encountered during training (Press et al., 2023; Dziri et al., 2023; Yuan et al., 2025)—to familiar atomic capabilities. Training uses the adapted model's prediction loss on the correct answer as supervision, without manual error-cause annotations or example-specific instructions about which parameters to modify. Conceptually, C-HyperNet offers a middle ground between static supervised fine-tuning (SFT) and gradient-based test-time fine-tuning (TTFT) by amortizing test-time adaptation into a single forward pass of an offline-trained hypernetwork, while linking mechanistic interpretability with capability improvement. On Lean logical proof tasks (Sheng & Fu, 2026), C-HyperNet raises mean atomic-task accuracy from 43.98% for the supervised fine-tuned base model to 71.00%. On unseen composition families held out during training, it achieves a five-fold mean OOD accuracy of 13.14%, substantially above a query-only hypernetwork (Query-only, 4.60%) and direct supervised fine-tuning (Direct SFT, 6.34%), and ahead of a hypernetwork that additionally reads static base-model weights (Raw-weight, 10.58%), with gains concentrated in specific composition families. On ARC-AGI-1 grid reasoning tasks (Chollet, 2019), directly applying the generated LoRA achieves performance close to supervised fine-tuning. For test-time fine-tuning (TTFT) (Sun et al., 2020; Akyürek et al., 2025) on the same supervised fine-tuned base model, replacing standard initialization with the generated LoRA further raises accuracy from 45.875% to 47.875%. Learning to read circuits also brings an unexpected analytical benefit: task-related responses to circuits inside HyperNet can serve as an additional signal for locating functional nodes in the base model. Combining these responses with conventional attribution and ablation evidence yields higher functional selectivity in preliminary experiments on all four atomic tasks: the selected nodes' effects are more concentrated on the target task. A model that learns to use circuits may, in turn, help us understand them.