arXiv Science⌕ Search

arXiv subjects

Maciej Stefaniak

Publications and source records attributed to Maciej Stefaniak.

5 recordsLinked to original sources

Scaling Laws for LLM Memory Sparsity

Sparse memory architectures offer a route to expanding language-model capacity while accessing only a small fraction of parameters per token. Their finer access granularity promises greater sparsity than conventional mixture-of-experts (MoE), but how memory capacity should scale with active computation and training data remains insufficiently understood. We study how architecture and sparsity should vary with parameter and training-compute budgets. We introduce scaling laws for Product Key Memory (PKM) that capture how active parameters, memory capacity, and training tokens jointly determine loss, using 421 measured training endpoints from 44 configurations spanning dense Transformers, PKM, token-indexed memory (STEM), and MoE, with total parameter capacities reaching 21.9B and training budgets reaching 128B tokens. The fitted laws reveal distinct regions of architectural advantage: PKM achieves the lowest predicted loss when capacity is abundant relative to compute, MoE is preferred in an intermediate regime, and dense Transformers become preferable when compute is abundant relative to capacity. Within PKM, increasing capacity at fixed compute favors greater sparsity, whereas increasing compute at fixed capacity favors more active parameters. Along a hardware-calibrated scaling path, PKM maintains lower predicted loss at higher optimal sparsity than MoE, permitting more training tokens and fewer operational FLOPs per token. A complementary roofline analysis estimates a 7.6x PKM token-throughput advantage over MoE in the modeled mobile inference setting. Together, these findings characterize when sparse memory offers advantages in predicted loss and execution efficiency.

cs.LG↗

$μ$-Parametrization for Mixture of Experts

Recent years have seen a growing interest and adoption of LLMs, with Mixture-of-Experts (MoE) emerging as a leading architecture in extremely large models. Currently, the largest open-source models reach over $1$T parameters. At such scales, hyperparameter tuning becomes prohibitively expensive. Precisely for this reason, the $μ$Transfer is becoming a key technique. It allows for seamless transfer of optimal hyperparameters across model scales, resulting in a huge reduction in tuning costs. However, existing work has primarily focused on dense LLMs, leaving MoE architectures unexplored. In this work, we derive a $μ$-Parameterization for MoE, providing theoretical guarantees for feature learning across model widths. Our experiments demonstrate that the optimal learning rate reliably transfers across model sizes, establishing a foundation for efficient hyperparameter tuning in large-scale MoE models.

cs.LG↗

Decoupled Relative Learning Rate Schedules

In this work, we introduce a novel approach for optimizing LLM training by adjusting learning rates across weights of different components in Transformer models. Traditional methods often apply a uniform learning rate across all network layers, potentially overlooking the unique dynamics of each part. Remarkably, our introduced relative learning rates, RLRS, method accelerates the training process by up to $23\%$, particularly in complex models such as Mixture of Experts (MoE). Hyperparameters of RLRS can be efficiently tuned on smaller models and then effectively reused on models up to $27\times$ larger. This simple and effective method results in a substantial reduction in training time and computational resources, offering a practical and scalable solution for optimizing large-scale neural networks.

cs.LG↗

Projected Compression: Trainable Projection for Efficient Transformer Compression

Large language models have steadily increased in size to achieve improved performance; however, this growth has also led to greater inference time and computational demands. Consequently, there is rising interest in model size reduction methods. To address this issue, we propose Projected Compression, a novel model compression technique, that reduces model weights by utilizing projection modules. Specifically, we first train additional trainable projections weights and preserve access to all the original model parameters. Subsequently, these projections are merged into a lower-dimensional product matrix, resulting in a reduced-size standard Transformer-based model. Unlike alternative approaches that require additional computational overhead, our method matches the base model's per-token computation step in FLOPs. Experimental results show that Projected Compression outperforms the comparable hard pruning and retraining approach on higher quality models. Moreover, the performance margin scales well with the number of tokens.

cs.LG↗

Joint MoE Scaling Laws: Mixture of Experts Can Be Memory Efficient

Mixture of Experts (MoE) architectures have significantly increased computational efficiency in both research and real-world applications of large-scale machine learning models. However, their scalability and efficiency under memory constraints remain relatively underexplored. In this work, we present joint scaling laws for dense and MoE models, incorporating key factors such as the number of active parameters, dataset size, and the number of experts. Our findings provide a principled framework for selecting the optimal MoE configuration under fixed memory and compute budgets. Surprisingly, we show that MoE models can be more memory-efficient than dense models, contradicting conventional wisdom. To derive and validate the theoretical predictions of our scaling laws, we conduct over 280 experiments with up to 2.7B active parameters and up to 5B total parameters. These results offer actionable insights for designing and deploying MoE models in practical large-scale training scenarios.

cs.LG↗