Manuscript Offprint

arXiv:2611.08741

AlterNet: Adaptive-Depth Mixture-of-Experts with Learned Halting for Elastic Inference

Alexander Kastius

Abstract

Most LLM architectures have fixed compute demands determined at training time. We propose a novel architecture that combines the Mixture-of-Experts architecture with shallow experts and a novel dynamic-depth system to make the extent of a forward pass dynamically adjustable. Our approach lets the model automatically determine the compute needed for a given task, paired with a system to scale it down after training without retraining when the execution environment demands faster or cheaper inference. To achieve this, we introduce an iterative computation mechanism, sequence-level depth-based routing steered by a halting mechanism within the experts, a depth encoding that lets the model track its progress in the chain, and a regularization mechanism that incentivizes the model to use allocated compute efficiently. We present initial benchmarks and discuss future research directions.

1 Introduction

Adapting the computational demands of large models to resource-constrained environments is a heavily studied research area, cf. Menghani [2023]. Proposed solutions include quantization [Dettmers et al., 2022], distillation [Hinton et al., 2015], and others. In many cases, for example, in the Qwen model line [Yang et al., 2024], scaled-down versions of the models with either lower precision or fewer parameters are presented. In those cases, it is still necessary to retrain or at least partially reparametrize a model. In many cases, the model's capacity is also reduced across all domains, unless it is specially retrained.

One architecture option in particular supports those efforts further: By now, Mixture-of-Experts (MoE) models are commonly observed among releases, cf. Fedus et al. [2022], Jiang et al. [2024]. MoE distinguishes between active and passive parameters, contained in active and passive experts, with the latter remaining unused. A central router model decides which experts stay active. This allows using only a fraction of the model, at the cost of slightly lower performance. MoE models have their own disadvantages, most importantly that experts are usually disconnected to some extent; i.e., the knowledge of one expert does not become available as input to other experts.

We propose a design concept to overcome these limitations. If the intuition about the underlying mechanism of large experts holds, knowledge is distributed topic-wise among them. If so, interchanging information between them to allow further specialization can be beneficial. We propose a mechanism in which information flows between alternating experts across iterations, which we call Alternet. Combined with an explicit depth signal, this allows experts to specialize for distinct positions within the loop. Furthermore, not all problems require the same computational depth. Following from this, we propose a mechanism to express an expert's belief in the quality of its output, allowing early stopping when sufficient confidence is observed. The per-expert halt heads and the sinusoidal depth encoding are our two most relevant additions to previous iterations on the matter.

Preprint.

Figure

Figure 1: AlterNet forward pass. Input tokens are embedded and passed through a depth loop with a maximum of DD iterations. At each step, a depth-aware router selects kk of EE shallow experts; a PonderNet halt gate accumulates per-step probabilities against a Gaussian prior.

References (28)