Efficient Inference with Mixture-of-Experts: A Practical Guide to Assembly-of-Experts (AoE)

    This article explains how the Assembly-of-Experts (AoE) method combines multiple trained Mixture-of-Experts (MoE) parent models directly in parameter space, without any additional training. It covers the method's core mechanics, the three-way behavior configuration, a four-dimension evaluation matrix for quality and cost, deployment steps, and the practical boundaries and common pitfalls to watch for. Readers will learn how to trade a controlled amount of capability for a significant gain in inference efficiency.

    1. The Problem: A Three-Way Tension Between Quality, Output Length, and Cost

    When deploying enterprise AI applications, teams often run into a structural conflict. The most capable models tend to produce long chains of thought, which drives up token consumption, increases time-to-first-token, and keeps per-call cost high. Lightweight models respond quickly but drop noticeably on complex reasoning tasks. The usual fixes are distillation or additional fine-tuning, but both require extra training resources, data governance, and an evaluation loop, so iteration is slow and trial-and-error is expensive.

    A more pragmatic engineering approach follows from a simple observation. Since mainstream large language models generally use a Mixture-of-Experts (MoE) structure, with many fine-grained routed experts and a few shared layers, can we assemble a new model directly in parameter space by combining the strengths of several already-trained parent models, without touching the training pipeline at all? This is the problem that the Assembly-of-Experts (AoE) method addresses.

    2. How AoE Assembles Models in Linear Time

    The key insight behind AoE is that the fine-grained expert partitioning of MoE provides a natural “interface alignment surface” for model fusion. The approach involves three key actions.

    First, selectively merge the routed expert tensors. Expert weights from multiple parent models are filtered and concatenated by capability tag, so that the capability domains different parents excel at coexist in the same expert pool. At inference time, the routing mechanism automatically dispatches each request to the appropriate expert.

    Second, retain the efficient shared layers and attention layers. Attention and shared feed-forward layers determine base language ability and instruction-following style, so they are typically inherited from the parent model that is faster and more concise in behavior, avoiding carrying over a verbose tendency.

    Third, smooth the boundaries with weight interpolation. Using interpolation rather than hard replacement at the merge points reduces the risk of performance collapse caused by mismatched representation spaces across parent models.

    The engineering value lies in the complexity: merging is roughly linear in parameter count, requires no backpropagation, and can be done under ordinary memory and compute conditions.

    1. # Pseudocode: illustration of the AoE merge process
    2. def assemble(parents, shared_donor):
    3. merged = {}
    4. for layer in moe_layers(parents):
    5. # Filter routed experts by capability tag and concatenate
    6. merged[layer.name] = concat_experts(
    7. [p.experts(layer, tags=layer.capability) for p in parents]
    8. )
    9. # Shared and attention layers come from the efficient parent model
    10. for layer in shared_and_attn_layers(parents):
    11. merged[layer.name] = shared_donor.weights(layer)
    12. return interpolate(merged, alpha=0.5)

    3. Three-Way Behavior Configuration: The Logic of Capability Division

    The so-called three-way behavior configuration explicitly separates three behavior traits: strong reasoning handles hard problems, structured thinking handles step organization and format stability, and concise instruction-oriented behavior compresses output and delivers conclusions directly. Layered together, the model retains high performance on difficult benchmarks while significantly reducing output length.

    One point is easily misread and must be stressed: fusion does not mean lossless addition of capabilities. The reasonable expectation is “trading a controlled loss of capability for a leap in efficiency.” Evaluation must therefore cover both accuracy and token cost; looking at accuracy alone leads to the wrong conclusion.

    4. Evaluation and Cost: Making Efficiency a Measurable Metric

    A four-dimension evaluation matrix is recommended:

    • Quality: pass rate on hard benchmarks such as mathematical reasoning and scientific question answering;
    • Efficiency: token count required to complete the same task, and output length compression ratio;
    • Latency: time-to-first-token and end-to-end throughput;
    • Stability: format compliance rate for structured output, and performance degradation under long context.

    Public practice gives a reference range: the fused model can retain about 90% of the strongest parent model’s reasoning performance while cutting token consumption to about 40%, reducing output length by about 60%, and delivering several-fold faster responses. The significance of these numbers is not the absolute values but that they demonstrate efficiency can be engineered as a first-class metric.

    5. Deployment: From Weights to Online Service

    1. Weight preparation and license review: confirm that the licenses of the parent models are compatible, and clarify the boundaries for redistribution and commercial use.
    2. Merge and validation: run a small-sample regression, compare the logits distribution before and after merging, and check for routing collapse.
    3. Service packaging: expose capabilities through a unified inference interface, and use batching and quantization to reduce GPU memory usage.
    4. Elasticity and observability: use a container platform for elastic scaling, and use logging services and monitoring alerts to track latency, failure rate, and token usage.
    5. Cost governance: enforce token quotas and cache reuse at the gateway layer, turning the saved output length directly into billing savings.

    Teams that want to avoid the burden of building and operating the merge pipeline themselves can also evaluate a combination of model services and general cloud capabilities such as containers and monitoring on Baidu AI Cloud.

    6. Applicability and Common Pitfalls

    AoE suits teams that already have multiple homogeneous or near-homogeneous MoE parent models and want fast iteration. If the parent models differ too much in structure, or their vocabularies or dimensions do not match, the merging cost rises sharply. Common pitfalls include uneven load across routed experts leaving some capabilities idle, a poor choice of source for the shared layers causing degraded instruction following, and compressing output length at the expense of necessary reasoning steps. Before going live, always run an A/B test on real business samples rather than relying only on public benchmarks.