让代码生成模型按需计算,自动决定何时强化推理
When to Ponder: Adaptive Compute Allocation for Code Generation via Test-Time Training
- 用重建损失自适应触发测试时训练,无需额外模型
- 在不同难度输入上实现82%-89%的最优恢复效果
- 无需训练即可动态调整计算量,适合资源受限场景
大型语言模型对所有输入均采用固定计算量,忽视任务难度差异。本文提出 PonderTTT,通过 TTT 层的自监督重建损失构建门控机制,仅在必要时触发测试时训练(TTT)更新。该决策过程完全无需训练——仅需一个初始标量阈值,在无标签数据上校准,并通过指数移动平均(EMA)持续调整以维持目标更新率。在 GPT-2 模型(124M 到 1.5B 参数)上对 The Stack v2 数据集进行代码语言建模(教师强制困惑度)的实验表明,该信号具备推理兼容性,无需真实标签。重建门控在保持全训练自由的前提下,实现了 82%-89% 的理想恢复率,显著优于随机跳过基线(在分布外语言上损失降低最多达 16%)。
原文摘要 · Abstract (English)
Large language models apply uniform computation to all inputs, regardless of difficulty. We propose PonderTTT, a gating strategy using the TTT layer's self-supervised reconstruction loss to selectively trigger Test-Time Training (TTT) updates. The gating decision itself is training-free--requiring no learned classifier or auxiliary networks; only a single scalar threshold is initially calibrated on unlabeled data and continuously adapted via EMA to maintain target update rates. Our experiments with GPT-2 models (124M to 1.5B) on code language modeling (The Stack v2, teacher-forced perplexity) demonstrate that this signal is inference-compatible, requiring no ground-truth labels. Our Reconstruction Gating achieves 82-89% Oracle Recovery while being fully training-free, significantly outperforming Random Skip baselines (up to 16% lower loss on OOD languages).
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。