SelfMorph 让冻结 LLM 的内部计算结构随输入自适应变形
Compute Has Shape: Self-Morphing the Internal Computation of Frozen LLMs
AI 导读
研究者提出 SelfMorph,将计算形状变为依赖输入的推理时决策,统一了原始前向路径(BASE)、层段串行复用(REPEAT)与扰动隐状态的局部分支合并(BRANCH),并用轻量选择器在生成前选择计算形态。在 4B-27B 的三个 LLM 上,SelfMorph 于五个分布内基准平均相对提升 8.06%,四个未见基准提升 4.45%,在 27 个设置中的 24 个取得最强表现。代码已开源。
正文 · 原文
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 this https URL.
| Subjects: | Artificial Intelligence (cs.AI) |
| Cite as: | arXiv:2610.38382 [cs.AI] |
| (or arXiv:2610.38382v1 [cs.AI] for this version) | |
| https://doi.org/10.48550/arXiv.2610.38382 arXiv-issued DOI via DataCite |
Submission history
From: Junxi Wu [view email]
[v1]
Wed, 28 Oct 2026 07:19:28 UTC (5,843 KB)
来源:arXiv cs.AI · arxiv.org