Compute Has Shape: Self-Morphing the Internal Computation of Frozen LLMs
Abstract
Test-time scaling improves large language models through additional computation, but how to adapt the topology of internal computation to individual inputs remains underexplored. Existing approaches largely fix recurrent or parallel architectures during training, or reconfigure frozen models along a single structural axis. We introduce SelfMorph, which makes computational shape an input-dependent inference-time decision. It unifies the original forward path (BASE), serial reuse of a layer span (REPEAT), and local branching and merging of perturbed hidden states (BRANCH) in a unified space parameterized by type, location, and intensity. Since they offer complementary benefits rather than uniform dominance, we use a lightweight selector that reads the backbone's depth-wise hidden state trajectory on the prompt to choose a morphology before response generation. We train the selector by distilling utility-based distribution from offline morphing that jointly account for task performance and computational cost. Evaluated on three LLMs spanning 4B-27B, SelfMorph achieves a 8.06% mean relative improvement on five in-distribution benchmarks and 4.45% on four unseen benchmarks. It achieves the strongest performance in 24 of 27 settings. These findings identify input-adaptive computational topology as a complementary axis of test-time scaling beyond generating more tokens. Our code is available at https://github.com/creator-xi/SelfMorph.
Create a lesson
Related papers
Internalized Experience: How Training Data Shapes Memory Formation in LLMs
Shared title terminologycs.AIXianxuan Long, Xinnan Dai, Kai Guo et al.
Demystifying the Autoresearch Harness: How Context and Skills Shape Self-Evolving Agents
Shared title terminologycs.AIKelvin Kiu-Wai Tam, Newt Hue-Nam K. Nguyen, Tianshi Zheng et al.
Confident Fools or Careful Searchers? A Behavioural Study of When LLMs Search Beyond Their Static Internal Memory
Shared title terminologycs.AINipun D. Pathirage, Kwan Srijomkwan
Uncovering Why LLMs Fail: From Internal Mechanisms to Adversarial Reasoning Trajectories
Shared title terminologycs.AIZirui Ding, Xinxin Fan, Hao Yuan et al.
Fin-RSI: A Unified Library of Financial Skills, Checks, and Self-Improvement for LLM Agents
Shared title terminologycs.AIWanghao Ye, Shwai He, Sihan Chen et al.
Wactorz: Self-Writing LLM Agents That Discover, Repair, and Migrate at the Edge
Shared title terminologycs.AIPanagiotis Kasnesis, Lazaros Toumanidis, Amalia Contiero Syropoulou et al.