Search arXiv⌕ Search

arXiv subjects

Urs Spiegelhalter

Publications and source records attributed to Urs Spiegelhalter.

3 recordsLinked to original sources

When Does Fine-Tuning Overtake Prompting? An Accuracy and Cost Analysis of Small Language Models on Narrow Tasks

When small language models (SLMs) are deployed for narrow tasks, adapting them with a small number of labeled samples can substantially improve performance. Three adaptation families compete in this regime: in-context learning (ICL), parameter-efficient fine-tuning, and automatic prompt optimization (APO), yet no prior study compares all three at matched conditions. We compare three ICL selection strategies, fine-tuning using LoRA with per-task hyperparameter optimization, and the APO method GEPA across 17 narrow tasks, three Qwen3 model sizes, and data budgets up to 200 labeled samples. ICL sample efficiency largely saturates by 25-50 examples regardless of selection strategy, while fine-tuning keeps improving across the full budget range. Averaged over our task suite, approximately 50~labeled samples suffice for fine-tuning to overtake all ICL strategies, with the crossover occurring earlier on 0.6B and 1.7B than on 4B, although task category can shift or reverse this ordering. GEPA, in our configuration, is not competitive. A throughput-calibrated two-component cost analysis shows that, under single-task serving with merged adapters, data availability rather than deployment volume is the main driver of the cost-optimal method.

cs.LG↗

Learning in Compact Spaces with Approximately Normalized Transformer

The successful training of deep neural networks requires addressing challenges such as overfitting, numerical instabilities leading to divergence, and increasing variance in the residual stream. A common solution is to apply regularization and normalization techniques that usually require tuning additional hyperparameters. An alternative is to force all parameters and representations to lie on a hypersphere. This removes the need for regularization and increases convergence speed, but comes with additional costs. In this work, we propose a more holistic, approximate normalization via simple scalar multiplications motivated by the tight concentration of the norms of high-dimensional random vectors. Additionally, instead of applying strict normalization for the parameters, we constrain their norms. These modifications remove the need for weight decay and learning rate warm-up as well, but do not increase the total number of normalization layers. Our experiments with transformer architectures show up to 40% faster convergence compared to GPT models with QK normalization, with only 3% additional runtime cost. When deriving scaling laws, we found that our method enables training with larger batch sizes while preserving the favorable scaling characteristics of classic GPT architectures.

cs.LG↗

Balancing Synthetic Data and Replay for Enhancing Task-Specific Capabilities

Adapting language models to new tasks through continued pretraining faces a fundamental trade-off: models must learn new capabilities while avoiding catastrophic forgetting of existing knowledge. While prior work has studied synthetic data generation techniques, the optimal replay ratios for balancing task performance and knowledge retention under computational constraints remain poorly understood. We present a comprehensive empirical study investigating the interplay between replay ratio configuration and computational budget when adapting language models to new tasks. Using the bAbI reasoning tasks as our target objective, we apply synthetic data generation and systematically evaluate different total token budgets and replay ratio configurations. We analyze their effects on both task mastery and general knowledge retention. Our experiments reveal an optimal configuration that balances task-specific performance with general knowledge retention. Based on our findings, we provide empirically-grounded guidelines for selecting replay ratios based on computational budget, enabling practitioners to achieve strong task adaptation with significantly reduced training costs.

cs.LG↗