Manuscript Offprint

arXiv:2610.36994

CaLLM: Continual Adaptation of LLMs via Non-Parametric Adapter Routing

Bilge Celik, Anna Vettoruzzo, Joaquin Vanschoren

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Continual adaptation of large language models (LLMs) to evolving task distributions while mitigating catastrophic forgetting remains an open problem. Existing strategies often struggle to scale or lack a robust mechanism for zero-shot task-to-expert assignment. We introduce CaLLM, a framework that resolves these tensions by combining metric-based meta-learning with modular parameter isolation via lightweight adapters. First, CaLLM projects each input batch into a task-agnostic embedding space to find its nearest prototype. It then routes the batch to the specific adapter specialized for that data distribution. This formulation provides (i) controllable cross-task interference by design, (ii) constant computational complexity regardless of task count, (iii) seamless integration of novel distributions through prototype expansion, and (iv) regime agnosticism as the local routing decision enables a unified approach to both online and offline settings. Our experiments demonstrate that this routing mechanism discovers semantically coherent task groupings while facilitating constructive interference between similar tasks, and keeping overhead at a minimum. Across diverse and fine-grained continual learning benchmarks, CaLLM consistently outperforms traditional isolation and replay methods, establishing prototype-based modular routing as a principled and scalable approach to lifelong adaptation of LLMs.

1 INTRODUCTION

Large language models (LLMs) have become remarkable generalists, but real-world deployment often requires them to acquire task-specific expertise without sacrificing their broader capabilities. The same underlying model needs to be continually adapted to different use cases ranging from closely related to radically different, without retraining from scratch. However, the standard practice of sequential fine-tuning typically triggers catastrophic forgetting (Kirkpatrick et al., 2017), where adaptation to a new domain erodes performance on previously learned ones. A recent survey (Shi et al., 2025) formalizes this challenge along two axes: vertical continuity, moving from broad pretraining to task-specific fine-tuning, and horizontal continuity, adapting to shifting tasks and data distributions over time. Without careful management, adaptation along either of these dimensions typically results in severe performance degradation.

This problem is particularly pronounced for aligned, instruction-tuned LLMs. Wang et al. (2023b) demonstrate that even parameter-efficient methods such as LoRA (Hu et al., 2021) can severely degrade an aligned model's general abilities and instruction-following quality after only a few rounds of sequential adaptation. Classical continual learning (CL) strategies such as regularization, experience replay, and orthogonal subspace isolation address specific aspects of this problem but they entail fundamental trade-offs. Regularization methods collapse when the model must transition between radically different domains (e.g., from natural language to code). Replay requires growing memory buffers that become unscalable as the task stream lengthens. Meanwhile, full retraining after each new task is computationally prohibitive, and real-world data often arrives as a continuous, non-stationary stream rather than the neatly delineated task blocks assumed in most CL benchmarks. Ideally, CL methods should adapt efficiently to new tasks in both online and offline settings.

We present CaLLM (Continual Adaptation of LLMs), a modular CL method that sidesteps these limitations through two interlocking components. First, CaLLM maintains a pool of modular experts (e.g., lightweight adapters implemented as LoRAs), each learning to specialize to a distinct region of the observed input distribution, ensuring that new knowledge is internalized without interfering with prior knowledge. Second, a lightweight non-parametric router, inspired by

Prototypical Networks (Snell et al., 2017), maps each incoming batch to its most relevant adapter by comparing its (frozen-backbone) embeddings against stored prototypes. This mechanism dynamically and efficiently manages the adapter pool: it spawns new adapters when the data is sufficiently novel and re-purposes the least-used modules when the pool reaches full capacity. While Prototypical Networks use class-mean embeddings for few-shot classification, CaLLM uses distributional prototypes for task-level routing. This approach inherits the non-parametric simplicity of metric learning, where no gradient-based router optimization is required, and the model absorbs novel distributions simply by initializing new prototypes. A core architectural advantage of CaLLM is its constant computational overhead: only one adapter is active per forward pass, while the remaining adapters reside on disk.

We evaluate CaLLM on two complementary benchmarks: TRACE-8, which tests robustness to radical cross-domain shifts, and CITB-19 1^{1}, which tests scalability on a long horizon dialogue stream, under offline (task-incremental) and online protocols. CaLLM outperforms CL baselines on the majority of tasks in both benchmarks, with the largest gains observed on specialized domains where the pretrained backbone is weakest. Furthermore, a systematic analysis of pool capacity reveals that moderate pooling outperforms both full isolation and single-adapter training in online settings. In this regime, we observe that interleaved gradients from semantically grouped tasks function as implicit replay, fostering constructive interference that enhances generalization without the overhead of a physical replay buffer.

In summary, our primary contribution is the complete CaLLM system, which unifies non-parametric routing with dynamic adapter isolation. Specifically:

• We design and validate an end-to-end modular framework that achieves robust performance while maintaining a constant computational overhead by activating only one adapter per forward pass.

• We introduce a training-free routing mechanism that scales dynamically to multiple tasks without requiring gradient-based router optimization.

• We provide a comprehensive evaluation under both task-incremental and long-horizon online streaming scenarios, uncovering how constrained pool capacities foster constructive cross-task transfer.

The remainder of this paper is organized as follows. Section §2 contextualizes our work in the CL literature, before section §3 details the CaLLM method. Section §4 presents our empirical analysis, including router representations, task-incremental and online results, and pool capacity effects. Section §5 summarizes our findings and future directions.

References (40)