Modular AI Architecture for LLM Scaling: Overcoming Catastrophic Forgetting with Frozen MoE-LoRA Stacks

    This article explains why monolithic large language models are expensive and fragile, and how a modular architecture built on frozen MoE-LoRA expert stacks addresses scaling costs, per-capability maintenance, over-activation, and catastrophic forgetting. It walks through the core components—an expert router, a residual-boosting inner loop, a curriculum-style outer loop, null-space projection, and a memory-and-scheduling layer—then examines a counterintuitive finding that cross-domain expert collaboration can outperform single-domain specialists, along with the engineering trade-offs and limitations to keep in mind.

    1. Background: Why Monolithic LLMs Are “Expensive and Fragile”

    Today’s mainstream large language models are essentially baked in a single pass, with massive amounts of text fused into one enormous parameter space. Knowledge, language patterns, and reasoning styles are deeply entangled, with no clear boundaries between them. This monolithic design is highly efficient during pre-training, but problems surface the moment you need the model to pick up a new capability.

    The traditional approach is to mix new data with the original training data and retrain from scratch or from an intermediate checkpoint. This path has three structural flaws:

    1. High incremental cost: Every new skill requires reprocessing the entire dataset, so compute and time costs grow linearly—or even superlinearly—with the number of capabilities.
    2. No independent maintenance: Skills are “welded” into the same set of weights. You cannot update a single capability the way you would swap a plugin, nor can you take one outdated or defective capability offline on its own.
    3. Over-activation: The model may draw on its entire “knowledge base” for every input, like treating a common cold with a cardiac care protocol. This not only wastes compute but can also introduce irrelevant interference.

    Alongside these issues lies a long-standing challenge in continual learning—catastrophic forgetting: when the model learns new tasks, gradient updates overwrite the parameters that carry important old tasks, silently degrading existing capabilities.

    Modular architecture is a systematic solution designed specifically to address these pain points.

    2. Core Idea: From “Monolithic Behemoth” to “Composable Building Blocks”

    The modular approach breaks a large model’s capabilities into individual independent, composable, freezable expert modules. A fitting analogy is a professional kitchen: instead of one chef trying to cook everything (and doing all of it mediocrely), you have chefs who specialize in different cuisines, then assemble them flexibly into teams based on each order.

    In engineering terms, the core of this architecture is a “frozen MoE-LoRA stack.” Let’s unpack the two key terms:

    • LoRA (Low-Rank Adaptation): An efficient fine-tuning method. Rather than modifying the original model weights, it injects a pair of low-rank matrices into linear layers as a “patch.” Each domain’s capability can be packaged as a set of LoRA parameters, far smaller than the full weights.
    • MoE (Mixture of Experts): A gating and routing mechanism that activates only the few most relevant experts for each token, keeping actual compute under control even as the parameter count grows.
    • Frozen: Once a domain’s LoRA is trained, it is frozen—its parameters are never updated in any subsequent stage. This is the key to resisting catastrophic forgetting: because old skills are “sealed,” they never degrade.

    Under this system, adding a new skill means training and freezing a new expert module rather than retraining the whole model. This is the fundamental difference from a monolithic model: capabilities go from a “coupled whole” to “pluggable building blocks.”

    3. Breaking Down the Key Components

    A complete modular system typically relies on five parts working together. Below is each one’s design motivation and implementation.

    3.1 MoE-LoRA Construction: The Intelligent Expert Router

    This is the system’s “dispatch center.” For each input, the router computes how well each expert matches that input, then selects the few most relevant experts (for example, 2 out of 4) to handle it collaboratively.

    1. def route(hidden, experts, top_k=2):
    2. # Compute the gating score for each expert
    3. scores = [gate(hidden, e) for e in experts]
    4. # Select the top_k experts with the highest scores
    5. top_idx = argsort(scores)[-top_k:]
    6. return [experts[i] for i in top_idx]

    For memory optimization, these systems typically store frozen expert weights in 4-bit quantization. Quantization compresses each parameter from 16 bits to 4, theoretically yielding around a 4x reduction in GPU memory and making it possible to keep “more experts resident in memory.” Because experts are frozen and only read during inference, the precision loss from quantization is relatively manageable—a pragmatic choice that balances capacity against precision.

    3.2 Inner Loop: Residual Boosting

    Once the experts are selected, the system doesn’t have each expert write its own answer to be concatenated afterward. Instead, it uses a round-by-round refinement strategy of residual boosting: the first expert produces the main answer, and subsequent experts specifically address the “residual” left behind by the previous stage (the parts not yet well resolved), stacking improvements round by round until the output converges.

    1. def inner_loop(x, active_experts, n_rounds=2, conf_threshold=0.9):
    2. output, residual = 0.0, x
    3. for _ in range(n_rounds):
    4. delta, confidence = active_experts.forward(residual)
    5. output += delta
    6. residual = residual - delta # Update the unresolved residual
    7. if confidence >= conf_threshold:
    8. break # Exit early if confidence is high enough
    9. return output

    This design echoes the thinking behind gradient boosting trees: rather than getting everything right in one shot, it gradually approaches the target through multiple rounds of “gap filling.” It also naturally supports early exit—when an expert is already confident enough, later experts aren’t invoked, saving compute.

    3.3 Outer Loop: Curriculum-Style Training Order

    Experts are not trained in a randomly shuffled order. Instead, they follow a easy-to-hard curriculum, similar to how a language is learned: master basic grammar first, then specialized vocabulary and expression. A sensible training order lets each expert build on a well-represented foundation, improving overall convergence quality and stability.

    3.4 Null-Space Projection: A Guardrail for Preserving Base Capabilities

    This is another line of defense against catastrophic forgetting. When the model trains a new expert, the update direction may overlap with directions that matter to existing capabilities, “collateral-damaging” old knowledge. The idea behind null-space projection is to first identify the important subspace that needs protection, then project the new task’s gradient onto the orthogonal complement of that subspace (the null space), stripping out the components that would harm old capabilities.

    1. def null_space_project(grad, protect_basis):
    2. # protect_basis: orthonormal basis spanned by the important directions holding existing capabilities
    3. projection = protect_basis @ (protect_basis.T @ grad)
    4. return grad - projection # Keep only the update directions that do not disturb old capabilities

    Combined with the expert-freezing mechanism, null-space projection further ensures that as new capabilities are added, the base model’s general capabilities are not eroded.

    3.5 Memory and Scheduling: The Organizational Layer

    On top of the mechanisms above, the system needs a scheduling layer to manage expert registration, route caching, and lifecycle (adding, replacing, taking offline). This layer typically relies on general-purpose infrastructure—for example, using object storage to persist expert weights, message queues to decouple training from inference tasks, and monitoring and alerting to track the routing distribution and each expert’s activation frequency—thereby ensuring observability and scalability at the engineering level.

    4. A Counterintuitive Finding: Cross-Domain Collaboration Beats Single-Domain Experts

    The most intriguing conclusion from this line of research is this: when handling medical questions, the best-performing combination may not be a “medical expert” itself, but a collaboration between a “dialogue expert” and a “math expert.” The study observed that such cross-domain pairings achieved a notably higher success rate on certain benchmarks than a single-domain expert.

    There’s clear logic behind this phenomenon. The bottleneck in many “knowledge-type” problems isn’t the knowledge itself, but the ability to decompose problems, reason in a structured way, and perform symbolic computation. A dialogue expert excels at clarifying vague natural-language requirements and breaking them into clear sub-problems, while a math expert excels at rigorous logical deduction and calculation. The two work in relay, and together often go further than an expert that “knows the medical conclusion but follows a single reasoning path.”

    This suggests that the value of a modular architecture is not just “divide and conquer,” but more importantly that capabilities can be freely combined to produce a 1+1>2 emergent effect. What the model learns is arguably not specific knowledge, but “reasoning operators” that transfer across domains. This is a deeper scalability advantage of modularity over monolithic training—monolithic models can hardly arrange such cross-domain collaboration deliberately, whereas a modular architecture can.

    5. Engineering Considerations

    Putting a modular architecture into production requires attention to several practical issues:

    • Routing quality is the ceiling: If the gating network selects the wrong expert, even the strongest residual boosting afterward can’t compensate. Techniques such as load-balancing loss are needed to avoid “expert collapse” (all inputs flooding toward a few experts).
    • The trade-off between expert count and memory: More experts mean more capacity, but also higher memory and scheduling overhead. 4-bit quantization is an effective mitigation, but its impact on precision must be evaluated.
    • Versioning and rollback: Because experts are independently frozen, updating one capability means replacing only the corresponding module while keeping the old version for fast rollback—something nearly impossible in a monolithic model.
    • Observability: You should monitor each expert’s call frequency, the distribution of residual-boosting rounds, and routing confidence. These are key signals for diagnosing whether capabilities are being invoked correctly.

    6. Limitations and Outlook

    A modular architecture is no silver bullet. The combinatorial explosion among experts makes routing and scheduling complex; the gains from cross-expert collaboration depend heavily on gating quality; and quantized compression also requires careful trade-offs. On top of that, “which capabilities should be packaged as a single expert” remains a design question that requires domain judgment.

    Even so, the direction it points to is clear: turning the large model from a “one-time cast whole” into a “incrementally assembled collection of capabilities.” When capabilities can be added, replaced, combined, and frozen like building blocks, the cost structure, maintenance model, and collaborative potential of model iteration are all redefined. For teams that need to keep expanding capabilities under limited compute, this approach offers an appealing engineering paradigm.