When to Ponder: Adaptive Compute Allocation for Code Generation via Test-Time Training
Gihyeon Sim
cs.LG, cs.CL
Submitted: 2026-08-20
Updated: 2026-08-24
Comments: 14 pages, 1 figure, 14 tables, code available at https://github.com/deveworld/ponderTTT
License: http://creativecommons.org/licenses/by/4.0/
The gist: Large language models apply uniform computation to all inputs, regardless of difficulty.
Terminology
Abstract
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).
Sources
- PonderNet: Learning to Ponder
- Gemma 3 Technical Report
- StarCoder 2 and The Stack v2: The Next Generation
Related papers
- Polynomial-Augmented Neural Networks (PANNs) with Weak Orthogonality Constraints for Enhanced Function and PDE Approximation
- AIRL-S: Unifying Reinforcement Learning and Search-Based Test-Time Scaling via Adversarial Inverse Reinforcement Learning
- Transformers as Bayesian In-Context Experimenters: Smoothness-Adaptive Efficient ATE Estimation
- Convergence issues in Relational Concept Analysis based on AOC-posets
- Beliefs Beyond Posteriors: The Predictive Cost of ELBO Binding
- Understanding Diffusion Models via Ratio-Based Function Approximation with SignReLU Networks