2026/07/15 38.5k words

Transformer System #numinens#transformer#lora#mixture-of-loras#hydralora#continual-learning#routing#adapter-serving#peft#catastrophic-forgetting

M6.9 - Routed, Shared, and Continual Adapters

M6.9 - Routed, Shared, and Continual Adapters

0x00 Overview: One Adapter Is A Tensor Pair; Many Adapters Are A Control System

M6.3 derived the LoRA operator and its gradients. M6.4 compared changes to rank, scaling, initialization, precision, and weight parameterization. M6.5 treated independently trained adapters as serving objects that must be loaded, batched, pinned, and associated with request K/V state. M6.7 then separated factor rank from objective intrinsic dimension and showed why factor coordinates are not unique.

Those articles intentionally stop before a different family of questions:

If several low-rank updates exist at the same layer, should the model select one, mix several, share one factor, preserve each task as immutable state, or merge the updates into a new checkpoint?

The common shorthand is “LoRA plus MoE.” It is too imprecise. Two systems can compute a weighted sum of adapter outputs and still differ in every important lifecycle decision:

when the specialists were trained
whether specialist tensors remain frozen
whether the router is supervised by task labels
whether one route applies to a task, request, sequence, token, or layer
whether all experts run or only top-k experts run
whether experts share A, share B, or share nothing
whether old task state is preserved, merged, or discarded
whether the serving kernel sees one adapter id or route metadata per row

These choices determine interference, compute, memory growth, mergeability, cache provenance, and rollback. The router equation alone does not define the method.

Task, sequence, token, and soft adapter routing

0x00A The Problem Did Not Begin With A Router Equation

The historical path to routed adapters did not begin by replacing an FFN expert with a LoRA expert. It began with an artifact-management problem. Vanilla LoRA made one task update cheap to train and store, but a useful system soon accumulated several updates for the same frozen base. The first design decision was therefore not which router to use. It was what the adapter collection means.

The design space widened in five steps:

  1. One task, one adapter. Each low-rank delta is trained and evaluated independently. Task identity is external, and serving resolves one adapter ID. This is the baseline owned by M6.3 and M6.5.
  2. Static fusion. Several trained deltas receive manually chosen or learned constants and are added into one effective update. The resulting artifact has no input-conditioned route, even when its coefficients were tuned on data.
  3. Staged or post-hoc composition. Domain specialists are trained first; a later stage learns how to select or mix them. Mixture-of-LoRAs uses explicit domain supervision in a staged multi-task procedure, whereas MoLE treats trained LoRAs as capabilities to be composed by learned layer-local gates.
  4. Joint routed experts and factor sharing. LoRAMoE initializes several adapter experts and a router for one heterogeneous tuning run. HydraLoRA changes the hypothesis class again by sharing one factor while routing several task-sensitive factors.
  5. Continual adapter state. O-LoRA and AM-LoRA assume tasks arrive sequentially. Their central object is not merely a gate vector; it is a growing, versioned history of old and new low-rank state plus a rule for limiting interference or composing prior features.

These families can end with a weighted sum of low-rank outputs, but that algebra does not make their training histories equivalent.

FamilySpecialist originController or constraintState updated in the composition stageRoute lifetimeResulting artifact
independent LoRAone adapter trained per taskexternal adapter IDselected adapter onlyrequestseparate adapter checkpoints
static fusionpreviously trained adaptersfixed coefficientscoefficients and/or merged deltadeployment artifactone fixed effective update
Mixture-of-LoRAsdomain adapters trained firstexplicit domain labels and routingpaper-specific multi-task stagesequence/domainspecialists plus routing state
MoLEpreviously trained LoRAslearned layer-local gatescomposition mechanism; specialist provenance remains distinctinput and layeradapter pool plus gates
LoRAMoEexperts initialized for one joint runlearned soft router plus localized balancingrouter and adapter expertstoken and layerone coupled routed-adapter checkpoint
HydraLoRAasymmetric experts initialized jointlylearned router over multiple headsshared , routed , and routerpaper-specific input scopeshared factor plus specialist heads
O-LoRAone new low-rank subspace per arriving taskorthogonality regularizationnew task factors; prior factors stay frozentask sequenceordered adapter history
AM-LoRAone LoRA per arriving taskattentional selector with pressurecurrent adapter and selector; prior adapters stay frozeninput and task timeadapter history plus feature selector

The table is a lifecycle taxonomy, not a claim that every implementation freezes or updates exactly the same tensors. Loop 2 freezes those identities method by method; Loops 4, 5, and 7 then trace the paper-specific training paths.

The continual branch also changes the geometry of the motivating problem. A parameter region that works for one task may not overlap the low-error region of the next task, so following the new-task gradient can leave the old solution basin. The source-local A22 figure below visualizes that motivation; it does not prove that an orthogonal factor update or an attentional mixture prevents functional forgetting.

Source-local comparison of overlapping and disjoint low-error regions for continual adaptation

0x00B Why Routed Adapters Appeared

A single LoRA trained on heterogeneous data must encode several potentially conflicting update directions through the same rank bottleneck. Increasing rank expands the bottleneck but does not tell the optimizer which task should own which directions. Training one adapter per domain avoids direct parameter overwrite, but it requires task identification and creates a growing collection of artifacts. Arithmetic adapter merging removes the routing decision, but it can destroy specialist behavior because the sum is applied to every input.

Routed-adapter methods explore a middle ground:

specialize:
    preserve separate low-rank updates

share:
    reuse some factors or a common base representation

select:
    choose useful updates from the current input

compose:
    combine capabilities without duplicating the base model

retain:
    keep old task state while learning new tasks sequentially

The original Transformer Series A29 introduces this family through LoRAMoE, HydraLoRA, Mixture-of-LoRAs, MoLE, and continual variants. This article reconstructs that material around the tensor, training, and runtime contracts found in the primary papers.

The source-local LoRAMoE diagram is useful because it exposes the architectural transition directly: the backbone and ordinary Transformer path remain frozen while trainable low-rank branches and a router are inserted beside the frozen FFN path. It is retained as historical evidence, not as a universal diagram for every routed-adapter method.

Source-local LoRAMoE comparison with a frozen Transformer path and trainable routed LoRA experts

0x00C What This Article Owns

task-, sequence-, and token-level adapter routing
soft mixtures, top-k selection, and router-gradient behavior
independent versus shared low-rank factors
LoRAMoE localized expert roles
Mixture-of-LoRAs two-stage specialist training
MoLE post-hoc composition of trained adapters
HydraLoRA shared-A asymmetric experts
static arithmetic merging versus input-conditioned composition
continual adapter sequences, O-LoRA, and AM-LoRA
adapter provenance, storage growth, runtime kernels, and KV compatibility

It does not repeat LoRA fundamentals, variant mechanics, generic MoE balancing, expert-parallel all-to-all, or independent-adapter paging. Those remain in M6.3, M6.4, M6.2/M6.6, and M6.5. M6.7 owns the distinction between factor coordinates, matrix rank, function-space interference, and empirical retention. M6.9 may consume those contracts, but it must not turn a routed-adapter result into a new proof of low-rank theory.

The owner question for this article is therefore:

How should a frozen base model represent, train, select, compose, and preserve several low-rank capabilities when one independent adapter ID is no longer sufficient?

0x00D Evidence And Claim-Status Contract

Four evidence classes remain separate throughout the article:

Evidence classWhat it can establishWhat it cannot establish
source-local A22/A29 materialthe handwritten lineage, terminology, and figure provenanceindependent correctness or benchmark reproduction
primary paperthe method and results reported under that paper’s protocolbehavior outside the stated model, data, objective, and evaluation contract
pinned official codewhat one repository revision stores and executesa universal implementation contract or correspondence to every paper equation
local derivation or oraclealgebraic consequences and tiny deterministic checks under explicit assumptionsreproduction of paper training runs or source-reported quality gains

This distinction matters immediately. The pinned LoRAMoE code computes a dense soft mixture in its traced linear layer; that does not imply every method named “LoRA-MoE” is dense. The pinned MoLE PEFT fork constructs every listed expert result before gate weighting in the traced path; or gate sparsity therefore does not, by itself, prove sparse execution. The HydraLoRA paper is the canonical source for the shared- architecture; a repository path is supporting implementation evidence, not permission to infer untraced tensor sharing. O-LoRA’s orthogonality penalty appears in its trainer path and is not part of ordinary LoRA inference.

A citation proves provenance; it does not reproduce the run. Every benchmark number remains source-reported until a later loop supplies an exact model, data, seed, optimizer, hardware, and evaluation manifest.

0x00E Loop Program And Claim Ceiling

Loop 1 freezes the historical family map, paper and code revisions, source figures, consumed owners, and claims that are still forbidden. It does not certify router gradients, factor-sharing equivalence, continual retention, runtime sparsity, or paper benchmark reproduction.

The remaining loops proceed in dependency order:

Loop 2: immutable experts, factors, routers, route scope, training provenance, versions
Loop 3: common operator, router gradients, collapse telemetry
Loop 4: LoRAMoE, Mixture-of-LoRAs, and MoLE training contracts
Loop 5: HydraLoRA shared-factor derivation and coupled gradients
Loop 6: static/dynamic composition, quantization order, artifact provenance
Loop 7: O-LoRA, AM-LoRA, and continual task-state lifecycle
Loop 8: task/request/sequence/token/layer route lifetimes
Loop 9: independent/shared-factor runtime execution and M6.5 handoff
Loop 10: executable operator, gradient, merge, and resume oracles
Loop 11: complete failure, source, visual, and evaluation closure
Loop 12: final formula, source, render, accessibility, and boundary audit

At this handoff, no model has been trained or served, no paper benchmark has been reproduced, no router is proved collapse-free, and no continual method is proved to preserve every old task.

0x00F Immutable Adapter-State Manifest: Identities Before Operators

The common weighted sum in 0x01 is useful only after its operands have identities. A tensor with shape is not yet “the factor”: it belongs to one base revision, target matrix, adapter artifact, factor convention, training stage, and parent state. The same rule applies to a router. A vector of three coefficients is meaningless until its candidate pool, route scope, activation rule, tie policy, and router revision are known.

Loop 2 therefore freezes a method state before Loop 3 differentiates any operator. The minimum semantic record is:

base execution identity:
    checkpoint revision, config revision, tokenizer revision

target identity:
    module FQN, matrix role, exact input/output dimensions

adapter identity:
    artifact revision, expert-pool revision, factor IDs and convention

route identity:
    router revision, candidate pool, scope, activation, k, tie policy

training provenance:
    ordered stages, parent artifacts, frozen/trainable sets,
    supervision role, task order, source-paper and code revisions

runtime handoff:
    stored artifact IDs and semantic route state, but not a GPU slot,
    page address, kernel choice, or cache-compatibility decision

The manifest deliberately excludes physical residency. expert_2 is a semantic member of a candidate pool; slot 17 is one transient placement chosen by the M6.5 runtime. Replacing one with the other makes checkpoint replay depend on whichever process happened to load the adapter.

Adapter-state manifest separating base and target identity, factor ownership, route state, ordered training provenance, and runtime placement.

0x00F.1 Canonical IDs Are Derived, Not Assigned By Filename

For one low-rank factor, define a canonical semantic digest:

where is the exact module name, is the factor role and multiplication convention, is the scale, and identifies the state against which the factor was trained. For a route:

with route scope , activation rule , selected degree , tie policy , and supervision-role declaration . These are teaching hash projections, not a claim that the cited projects publish this exact serialization. Their purpose is to make silent substitution fail.

Two consequences follow.

  1. Shape equality is necessary for some compositions but never sufficient for artifact compatibility. An adapter trained against base@v1 is not silently re-parented to base@v2 because both expose a matrix.
  2. Factor letters are not stable identities. O-LoRA writes its update as with , while this article usually writes . The manifest stores shape, role, and multiplication order rather than assuming every paper uses the same letters.

0x00F.2 The Same Forward Envelope Contains Different Method States

The six primary families and two controls freeze as follows:

RecordFactor ownershipRoute contractTraining lifecycleSupervision and inference contract
independent LoRA controlone independent pair per artifactfixed adapter ID, no learned routereach specialist trained against an identified parentrequest metadata selects an artifact; M6.5 owns residency
static-fusion controlcompatible trained deltas plus fixed coefficientsno input-conditioned routeadapters exist before coefficient selection or mergeone materialized child revision; dynamic behavior is lost
LoRAMoEindependent experts at traced FFN linear layersdense token-conditioned softmax in the paper and pinned pathbase frozen; experts and router jointly trainedsample/expert type enters the localized balance objective, not the inference router input
Mixture-of-LoRAsseparately initialized domain LoRAs, then a parallel poolsequence-level, layer-specific router with inference voting/selectionStage 1 trains specialists separately; Stage 2 trains routers and LoRA parameters on balanced multi-domain datadomain labels supervise ; they are targets, not proof of a task-ID router input
MoLEpreviously trained adapter outputs remain distinct expertsinput-conditioned hierarchical soft gatebase and trained LoRAs frozen; gate optimized post hocdownstream objective plus gate-balance loss; all candidate outputs are formed in the traced path
HydraLoRAone shared input factor and several output factors input-conditioned soft router over base frozen; shared , , and router trained jointlyclaimed intrinsic components need no task labels; component count still has initialization provenance
O-LoRAone ordered pair per taskno learned mixture in the reported core methodold factors frozen; new factors trained sequentially with orthogonality to prior subspacestask order and cumulative parent state are part of the artifact; no task ID is required in the paper’s comparison table
AM-LoRAone frozen LoRA per completed task, one current LoRA, one zero adapter, and per-adapter selectorsfeature-conditioned softmax over task LoRA outputsbase and prior LoRAs frozen; current LoRA and attentional selector state trained at task pressure acts on selector parameters; it does not certify hard sparse execution

This table prevents three common historical errors. Mixture-of-LoRAs is not post-hoc gate-only composition because its second stage jointly optimizes the routing objective and LoRA parameters. MoLE is not joint routed training because its trained LoRAs are inputs to a new frozen-expert composition stage. HydraLoRA is not merely a smaller independent expert pool because all updates share one learned and therefore one input-side subspace.

0x00F.3 Training Labels, Router Inputs, And Expert Roles Are Different Fields

LoRAMoE defines a training sample type and a predefined expert-group type inside its localized balancing coefficient. The paper then states that inference routes automatically without prespecified data types. The manifest therefore records:

training label role: localized-balance target
router input: current hidden representation
inference task label: absent

Mixture-of-LoRAs uses domain labels to supervise a router-classification loss. That supports domain label -> auxiliary target; it does not support domain ID -> direct router input. HydraLoRA claims automatic discovery of intrinsic components, but the number and initialization of those components still come from a specified initialization procedure. A label, a loss target, a clustering seed, and a runtime route are four separate pieces of state.

0x00F.4 Ordered Continual State Cannot Be Treated As An Unordered Pool

For continual task , let:

be the ordered parent lineage. The next artifact identity is:

O-LoRA’s penalty refers to all previous task subspaces. AM-LoRA’s selector at task sees a zero branch, prior task features, and the current branch. Reordering task IDs after training changes the meaning of those references even if every factor file remains byte-identical. The registry must preserve task position, parent digest, and whether old state was kept separate or merged into a new base revision.

0x00F.5 A Tiny Factor Ledger Exposes The Structural Choices

Use a teaching layer with , , rank , and experts. Three independent adapters contain:

trainable factor scalars. Sharing gives:

whereas the shared- counterfactual gives:

The numbers are not interchangeable savings claims. Shared constrains all experts to one row space; shared constrains them to one output column space. A continual independent pool grows by factor scalars per task before selector, optimizer, registry, or merge-history state.

0x00F.6 Saved Route State Is Not A Runtime Or Cache Proof

A replayable routed forward needs, at minimum, the router revision, candidate-pool revision, scope, selected IDs or full soft weights, normalization state, and the mapping from route slots to semantic experts. Token- or layer-level routes may also need logits or probabilities for backward. This state can reproduce the operator decision under the declared method; it cannot establish that every expert is resident, that unselected branches were skipped, or that K/V and prefix caches are compatible.

The Loop 2 fixture therefore permits runtime fields such as execution_evidence = dense_all_candidates_in_pinned_path or sparse_execution = not_verified, but forbids physical rank, slot, page address, kernel name, latency, and throughput from entering method identity. M6.5 receives semantic artifact and route IDs, then owns placement and cache-safe serving.

Fields not fixed by a paper or inspected code remain the literal value not_verified; they are not filled with an attractive implementation guess. Loop 2 validates identities, shapes, lifecycle order, and source ceilings only. It executes no model, router, GPU kernel, training run, or paper benchmark.

0x01 A Common Operator Before The Variants Diverge

Let one frozen linear layer be:

and let adapter expert own:

with scale . Its output update is:

For adapters and row-dependent gates :

or row by row:

This equation is only a mathematical envelope. It leaves at least five design axes unspecified.

0x01A Routing Scope

ScopeGate is constant overTypical sourceRuntime implication
taskevery request with a known task idmetadata or external classifierordinary adapter selection is possible
request/sequenceall rows in one sequenceprompt representation or domain routercompute route once and persist it
tokenone hidden rowper-layer hidden staterow-to-expert metadata changes at every layer
layerselected target layer or matrixlayer-specific routerroute identity is part of module state

The axes can compose. A sequence-level decision can be different at every layer. A token-level router can select two experts at each target matrix. “Sequence routing” therefore does not imply one global adapter for the whole model unless the method says so.

0x01B Activation Rule

A dense soft mixture uses:

and normally evaluates every expert with nonzero weight. A sparse mixture selects:

then normalizes over the selected set. Sparse routing can reduce adapter-branch work, but only if the implementation avoids evaluating unselected factors. Applying a top-k mask after all low-rank products have already run saves no matmul work.

0x01C Training Provenance

Joint, two-stage, and post-hoc adapter training provenance

Three families must remain separate:

  1. Joint routed training. Router and low-rank experts are initialized for one heterogeneous run and optimized together. LoRAMoE and HydraLoRA fit this broad lifecycle.
  2. Specialists first, routing second. Domain adapters are trained separately, then a router and possibly the specialists receive a balanced multi-domain pass. Mixture-of-LoRAs uses this staged structure.
  3. Post-hoc composition. Existing trained adapters are inputs to a new composition mechanism. MoLE trains gates over those frozen or separately produced capabilities rather than pretending they were one jointly coordinated factorization.

The final forward pass can look similar while the learned coordinate systems and interference history are very different.

0x01D Forward Tensor Trace: Route, Shrink, Expand, Mix

The compact weighted sum hides four distinct tensor operations. Freeze one teaching layer with rows, independent adapter experts, common rank , router matrix , and router bias . The row-batch graph is:

ObjectStorage axesSemantic roleMust be saved for backward?
layer input and router input in this teaching graphyes, unless recomputed
pre-activation router scoreslogits or sufficient activation state
dense probabilities or selected-set probabilitiesyes, with selected IDs for top-
rank- shrink resultsave or recompute from
scaled expert updateneeded by the router VJP; save or recompute
mixed adapter updatenot a substitute for the individual values

For selected-softmax routing with support , the normalization domain is the selected axis:

This is not the same as taking a full softmax and zeroing the losers without renormalization. It is also not yet an execution plan. The Loop 3 oracle distinguishes selected_top2, which logically materializes six selected expert rows for , from selected_top2_postmask, which produces the same numbers after all nine candidate rows have already run.

0x01E Similar Weighted Sums Still Have Different Graphs

The equations above are a local independent-factor teaching envelope, not a claim that every source method has the same router graph.

MethodWhat the envelope capturesWhat it must not replace
LoRAMoEthe paper’s dense weighted low-rank experts and the pinned layer’s hidden-state softmaxlocalized balancing, sample/expert role targets, and the full training contract in Loop 4
Mixture-of-LoRAsa weighted independent-specialist output after a sequence route is broadcastits two-stage lifecycle, domain-classification supervision, voting, and layer-specific route state
MoLEthe final weighted sum of candidate outputsits gate input, which depends on concatenated normalized candidate outputs; the pinned path builds all candidate branches first
HydraLoRAa weighted expert-output envelope after an expert has been definedindependent factors; the paper owns one shared and several , whose coupled gradients belong to Loop 5

This graph firewall matters for both implementation and differentiation. Replacing MoLE’s gate input with changes the model. Applying the independent- gradient below to HydraLoRA duplicates a shared parameter and changes its hypothesis class.

0x02 Router Gradients Explain Collapse Better Than The Word “Balance”

For a soft router:

the Jacobian is:

Let the scaled adapter output for one row be:

and let upstream gradient be . Then:

This form exposes two failure modes.

First, if expert outputs are nearly identical, is small. The router receives little evidence for specialization. Second, if one gate saturates near one, the other values become small and their router gradients shrink. A slightly better early expert can receive more data, improve faster, and reinforce its advantage.

Router collapse is therefore not only a histogram problem. It changes which adapters receive useful task gradients:

A nearly unused expert receives nearly no direct expert update in a dense weighted mixture. Hard top-k adds discontinuous selection and can starve unselected experts completely without auxiliary routing mechanisms.

0x02A Derive Router Credit From The Softmax VJP

The centered form should be derived, not memorized. For the whole row-batch, let

where is the scalar task-loss credit that row would assign to expert . Because

the softmax vector-Jacobian product gives

Define the gate-weighted mean credit

Then the compact VJP is

Only relative expert credit moves the router. Adding the same constant to every changes no router gradient, and every row obeys

This invariance is why equal expert outputs erase the task-loss routing signal. If , then every and , even when the gate distribution itself is highly nonuniform.

0x02B Expert, Factor, Router, And Input Gradients

For expert , gate the upstream rows before differentiating its low-rank path:

Starting from and gives

The router is a second differentiable consumer of . For :

The frozen base still has a mathematical local derivative:

Freezing means that is not retained as trainable optimizer state. It does not remove the base contribution to the input adjoint. The complete input gradient is:

dX = dX_base + dX_experts + dX_router

Dropping dX_router is a common hand-derived-backward bug: it treats route weights as constants even though the router consumed . Detaching the router is a possible training design, but it is a different graph and must be declared explicitly.

Routed adapter forward and backward graph showing router credit, factor gradients, three input-gradient paths, selected execution, post-mask work, and top-one starvation.

0x02C Top-k Has A Piecewise Gradient Contract

Top- contains a discrete support map and a differentiable selected-softmax map. Loop 3 differentiates only the latter while holding

fixed. Away from a selection boundary, the same centered-credit formula applies over the selected set:

At a boundary where the -th and -th logits exchange order, this local derivative is not defined. The executable fixture uses a deterministic tie policy, descending logit followed by semantic candidate order, and verifies that every finite-difference perturbation preserves the selected IDs. That makes the test a local derivative check, not a claim that TopK itself has a conventional derivative.

The case exposes a stronger result. With one selected expert, on that support and , so

for the task loss inside a fixed support region. A hard top-1 router therefore needs some other learning path if the selection operation itself is not relaxed: a straight-through estimator, noisy or differentiable routing during training, an auxiliary router objective, reinforcement-style credit, or soft training followed by hard inference. These are alternative estimators and training contracts, not algebraically equivalent implementations.

0x02D Executable Oracle And Collapse Witnesses

The exact Loop 3 fixture uses

It checks 135 scalar coordinates per policy across . Dense, selected top-2, and selected top-1 therefore contribute 405 centered finite-difference checks.

PolicySelected IDs by rowLossMean gate entropyMaterialized expert rowsMaximum gradient error
dense_softall three1.3193436170.7868319
selected_top21.3079278310.5722456
selected_top2_postmasksame selected weights1.3079278310.5722459same analytic graph; work differs
selected_top11.23250000003
selected_topJall three, score order1.3193436170.7868319exactly matches dense output

The selected top-2 boundary margin is at least in the fixture, so the perturbations do not cross a route boundary. selected_top2 and selected_top2_postmask have identical gates, outputs, losses, and local gradients. Only the declared materialization ledger differs. This is the smallest counterexample to the claim that a top- mask proves sparse execution.

Three additional probes isolate collapse mechanisms:

  1. Identical experts. Copying one expert output into all three slots leaves the maximum router-logit gradient below . The task loss has no routing evidence.
  2. Saturated router. Logits produce probabilities approximately . The weakest coordinate’s absolute gradient falls below in the probe.
  3. Top-1 starvation. A fixed route selecting expert 0 for all three rows gives and exactly zero for experts 1 and 2.

These witnesses do not prove that a paper checkpoint collapses. They prove that the common operator contains mechanisms through which collapse or starvation can occur.

0x02E Mechanism Pseudocode

def routed_adapter_forward(X, W, R, b, factors, policy):
    # X [T, d_in], R [J, d_in], Z/G [T, J]
    Z = X @ R.T + b
    support = route_support(Z, policy, tie_break="semantic_candidate_order")
    G = softmax_over_selected_logits(Z, support)

    Y = X @ W.T
    saved = {"X": X, "Z": Z, "G": G, "support": support, "experts": []}
    for j in materialized_experts_by_row(support, policy):
        A_j, B_j, scale_j = factors[j]
        U_j = X_for_rows(j, support) @ A_j.T
        E_j = scale_j * (U_j @ B_j.T)
        rows = rows_for(j, support)
        scatter_add(Y, rows, G[rows, j, None] * E_j)
        saved["experts"].append((j, U_j, E_j, rows))
    return Y, saved
def routed_adapter_backward(D, W, R, factors, saved):
    X, G, support = saved["X"], saved["G"], saved["support"]
    q = expert_credit(D, saved["experts"])       # q[t,j] = dot(D[t], E_j[t])
    q_bar = (G * q).sum(axis=-1, keepdims=True)
    dZ = where_support(G * (q - q_bar), support, 0)

    dR = dZ.T @ X
    db = dZ.sum(axis=0)
    dX_router = dZ @ R

    dX_experts = zeros_like(X)
    for j, U_j, E_j, rows in saved["experts"]:
        A_j, B_j, scale_j = factors[j]
        D_j = G[rows, j, None] * D[rows]
        dB_j = scale_j * D_j.T @ U_j
        dU_j = scale_j * D_j @ B_j
        dA_j = dU_j.T @ X[rows]
        scatter_add(dX_experts, rows, dU_j @ A_j)

    dX_base = D @ W
    dX = dX_base + dX_experts + dX_router
    return dX, dR, db

For a dense paper path, materialized_experts_by_row returns all candidates. For a selected execution plan it returns only selected row/expert pairs. A framework implementation may recompute during backward instead of saving it, but it must still recover the individual expert credits needed by .

0x02F What To Measure

One utilization chart is insufficient. A routed-adapter training run should record:

mean gate probability per expert
top-k selection frequency per expert
gate entropy by layer and data domain
expert-output norm and pairwise similarity
gradient norm per adapter factor
task-to-expert mutual information
router classification accuracy when labels exist
quality with router frozen, uniform, shuffled, or oracle-routed
minimum top-k boundary margin and route-flip rate
router-logit gradient norm per expert
zero-gradient expert count by layer and step
expert rows materialized before and after selection

Uniform utilization is not automatically desirable. If domains are imbalanced or one shared expert is intentionally general, a uniform target can oppose specialization. Balance losses encode a prior about expert roles and should be evaluated as such.

0x03 Independent Adapter Experts: Similar Shape, Different Objectives

0x03A LoRAMoE: Joint Experts With Localized Roles

LoRAMoE inserts multiple low-rank experts beside frozen FFN linear layers and learns a soft router. In the paper’s notation, the layer is:

where all expert outputs participate in the written formulation. This is adapter conditional composition, but it is not automatically sparse top-k execution.

The paper targets a specific failure: large instruction-tuning mixtures can improve downstream instruction following while damaging performance on tasks that depend on pretrained world knowledge. Freezing the backbone prevents direct overwrite of , but a large learned adapter update can still alter the model’s function enough to hide or disrupt that knowledge. LoRAMoE therefore divides experts into two semantic groups:

knowledge-oriented experts:
    trained to leverage world-knowledge-related data

downstream-task experts:
    trained to specialize on other instruction tasks

For sample with tokens, define router importance for expert :

The method defines a coefficient matrix using known training sample and expert group types:

Then:

and:

The localized balancing constraint is not unsupervised expert discovery: it uses sample-type and expert-group assignments during training. At inference, the learned router operates without those labels. The soft constraint also tries to balance experts within a role while biasing the two role groups differently.

This design should be compared against at least four controls:

one mixed LoRA
multiple experts without localized balancing
ordinary global balance loss
oracle route from known sample type

Without these controls, retention improvements cannot be attributed specifically to localized roles.

0x03B Mixture-of-LoRAs: Specialists Before The Router

Mixture-of-LoRAs starts from task/domain adapters trained separately. The second stage installs those adapters in parallel and learns sequence-level routing using balanced multi-domain data and domain labels. Its training objective combines language modeling and router classification.

Using the factor convention of this series:

where is associated with a sequence or sequence representation rather than independently changing for every token. The paper discusses inference voting or selecting a final expert decision to improve contextual consistency and avoid repeating an unstable token-level decision throughout generation.

The staged training has a useful property: every specialist begins from a competent domain solution instead of waiting for a joint router to give it enough traffic. It also has a cost: the initial specialists were optimized independently, so their scales and functional effects may differ. The second stage must learn both routing and cross-domain compatibility.

0x03C MoLE: Compose Existing LoRAs Without Arithmetic Destruction

MoLE addresses a different problem: several already trained LoRAs must be combined while preserving their characteristics. The paper contrasts this with direct arithmetic merging, which produces one fixed update whether or not every input needs every capability.

At a transformer-block level, MoLE forms trained adapter outputs , concatenates and normalizes them, and trains a gate. The final composition is:

Its gate-balancing term uses average gate probability across the gated blocks:

This objective strongly penalizes an expert whose average probability approaches zero. The overall objective is domain loss plus a weighted balance term.

MoLE’s paper explores hierarchical control at block, layer, or matrix granularity. That flexibility changes cost substantially. Gating complete block-level adapter outputs can require running every candidate path before the gate has the features it consumes. A matrix-level implementation can instead gate low-rank branches inside a shared base forward. The method name alone does not identify the runtime.

0x03D Mechanism Comparison

MethodAdapter originRouter supervisionRoute scope in the paperWhat remains trainable in composition stagePrimary concern
LoRAMoEjoint initializationsample-role signal enters localized balancetoken/layer soft weightsrouter and LoRA expertsworld-knowledge retention under broad SFT
Mixture-of-LoRAsseparately trained domain LoRAsexplicit domain classificationsequence-level, layer-specific routersrouter plus multi-task adaptation stageheterogeneous task interference
MoLEalready trained LoRAsdownstream objective plus gate balancehierarchical, input-conditioned compositioncomposition gates; adapter lifecycle is separatepost-hoc capability composition
HydraLoRAjoint asymmetric factorstask labels not required for claimed intrinsic componentsinput-conditioned soft mixtureshared A, B experts, routerheterogeneous corpus interference with fewer factors

The benchmark numbers in these papers are source-reported under different bases, tasks, budgets, and training procedures. They are not a ranking table.

0x03E One Phrase, Six Training States

“A mixture of LoRAs” is not a sufficient training specification. The three methods above require at least six distinct states once the paper graph, stage order, and pinned implementations are kept separate:

Six routed-adapter training states separating LoRAMoE paper and code objectives, the two Mixture-of-LoRAs stages, and MoLE paper and pinned implementation graphs.
StateParent artifactTrainable statePrivileged training signalResult
LoRAMoE paper graphpretrained baseall routed LoRA experts and routerssample role and predefined expert role inside localized balanceone coupled router-expert checkpoint
LoRAMoE pinned graphpretrained baseall routed LoRA experts and routerstask_types inside each traced balance termcoupled checkpoint under a code-local objective
Mixture Stage 1same base reloaded for each domainone domain LoRA per rundomain-specific language-model dataordered pool of independent specialists
Mixture Stage 2ordered Stage 1 poolevery domain LoRA and every layer routerbalanced domain samples and domain-classification targetsjointly reconciled pool and routers
MoLE paper graphtrained adapter poolcandidate-output gate and paper temperaturedomain loss and gate-balance losscomposition state plus immutable pool identity
MoLE pinned V&L graphtrained adapter poolparameters admitted by the pinned wg name filtertask loss plus an optional recorded statisticimplementation-specific gate state

These states are not interchangeable. Loading the same adapter tensors with a different trainable set changes the optimization problem. Moving a domain label from a loss target into the router input changes the information available at inference. Moving a gate before candidate evaluation changes both the function and the execution ledger. Even two expressions called “balance loss” can produce different gradients.

The immutable transition graph is:

LoRAMoE:
    pretrained base
        -> initialize router + all low-rank experts
        -> one joint optimizer state
        -> coupled routed-adapter checkpoint

Mixture-of-LoRAs:
    pretrained base --domain 0 run--> adapter 0
    pretrained base --domain 1 run--> adapter 1
    ...
    ordered adapter pool
        -> balanced Stage 2, adapters + routers trainable
        -> reconciled adapters + routers

MoLE:
    pretrained base + ordered trained adapter pool
        -> freeze both capability sources
        -> optimize composition state
        -> gate state + exact adapter-pool identity

The arrows transfer parameter values and artifact identities. They do not prove that Adam moments, learning-rate schedules, dataloader cursors, random-number streams, or gradient-scaler state cross a stage boundary. Unless a source explicitly serializes and restores those objects, optimizer continuity must remain unspecified.

0x03F LoRAMoE: Paper Objective Versus Pinned Code

The paper and the pinned repository agree on the main graph: a frozen base linear map, independently parameterized low-rank experts, a hidden-state softmax router, and joint training of experts and router. They do not implement the localized balancing expression identically.

Let a minibatch contain samples, sample contain valid tokens, and let there be experts. For router probability , aggregate each sample’s traffic:

Let be the known training role of sample and the predefined role of expert . The paper constructs:

The printed paper equation is:

Var does not, by itself, specify a population or sample correction. The executable teaching oracle declares population variance so that every denominator is explicit. Flatten into values, define

Since ,

and the quotient rule gives:

The pinned cv_squared path instead evaluates PyTorch’s default sample variance and divides by squared mean plus epsilon:

sample variance / (mean^2 + epsilon)

In symbols,

Therefore:

The two gradients are not generally scalar multiples: one denominator is , the other is , and the variance normalization also differs. In the checked fixture, the same gates produce:

QuantityPaper-form teaching conventionPinned-code convention
0.5178490.517849
variance0.071864 population0.082130 sample
localized objective0.1387740.306265

That is a mechanism discrepancy, not a benchmark accusation. The paper states the intended method; the pinned revision states what that code path computes.

The remaining chain rule is common. Let

Because , every valid token in sample receives the same upstream gate credit . For router logits :

This localized gradient is added to the task-loss router credit derived in 0x02. In the pinned LLaMA path, the local scalar is returned by each routed gate_proj, up_proj, and down_proj, accumulated across layers, and finally added to causal-language-model cross entropy. Consequently, blc_weight is effectively applied many times through local terms; it is not one single model-level statistic formed after pooling every route.

def loramoe_joint_step(batch, model, beta):
    # sample_role is training-only metadata, not a router input.
    token_loss, local_balance_terms = model(
        input_ids=batch.input_ids,
        labels=batch.labels,
        task_types=batch.sample_role,
    )

    # Paper graph: one declared model-level localized objective.
    # Pinned graph: layer/projection-local CV-squared terms are returned.
    loss = token_loss + beta * aggregate_under_declared_contract(local_balance_terms)
    loss.backward()
    optimizer.step()  # router and all A_i/B_i; frozen base has no optimizer update

One final provenance trap matters. The paper’s reported main configuration uses six experts and nonzero localized-balance coefficients. The pinned repository’s inspected shell script defaults to eight experts and sets both balance coefficients to zero. That script is a code example at a pinned revision, not an automatic reproduction command for the paper’s main result.

0x03G Mixture-of-LoRAs: Two Optimizer State Machines

Mixture-of-LoRAs is not “load several adapters and train a router.” Its paper contract has two optimization stages.

Stage 1: independent specialists. For domain , reload the same base checkpoint, attach one LoRA , freeze the base, and optimize only on domain . The parent of adapter is the base checkpoint, not adapter :

specialists = []
for domain in ordered_domains:
    model = load_same_frozen_base(base_checkpoint)
    adapter = initialize_lora()
    optimizer = new_optimizer(adapter.parameters())
    train_language_model(model, adapter, domain.dataset, optimizer)
    specialists.append(save_adapter(adapter, domain_id=domain.id))

This produces an ordered adapter pool. Ordering matters because domain-classification targets and router outputs must refer to the same expert indices.

Stage 2: balanced joint reconciliation. Load all Stage 1 adapters in parallel, add a distinct sequence router to every traced Transformer layer, freeze the base, and optimize both the routers and LoRA parameters. The paper evenly samples domains for this stage. For batch item , layer , and domain label , let router logits be and probabilities .

Using conventional minimized negative log likelihood, the classification term is:

The paper gives no display for ; it describes it in prose as the cross-entropy loss of expert classification. Its one displayed sum of log probabilities is the language-modeling loss, , printed without a minus sign while called a loss. The oracle uses the conventional negative sign required by minimization for the classification term above, writes the language-model term as a negative log likelihood , and records that notation choice rather than silently treating the printed sign as unambiguous. The combined objective is:

The classification gradient is exact:

That is only the classification part of the Stage-2 router gradient. The language-model loss also depends on the router, through the gate-weighted adapter sum of 0x03B, so the full gradient adds the softmax-VJP credit of 0x02A. Because one sequence gate serves every token row of sample at layer , that credit sums over the sample’s rows :

where is expert ‘s scaled adapter output for row at layer and is the gradient of at that layer’s routed output. carries the language-model loss and, wherever a later layer’s router reads a hidden state downstream of layer , that layer’s classification term as well. The checked fixture in 0x03J holds the NLL value fixed, so it finite-differences the classification part alone.

Domain labels are targets, not router inputs. At inference, the model receives the sequence representation available to the router, not . This distinction prevents an evaluation leak in which an oracle domain ID is accidentally supplied to a model advertised as automatic routing.

def mixture_stage2_step(batch, base, adapter_pool, layer_routers):
    assert balanced_domain_histogram(batch.domain_label)
    freeze(base)
    unfreeze(adapter_pool)   # paper Stage 2 updates LoRA parameters too
    unfreeze(layer_routers)

    logits, router_logits = forward_with_sequence_routes(
        base, adapter_pool, layer_routers, batch.tokens
    )
    nll = causal_lm_loss(logits, batch.labels)
    cls = mean_cross_entropy_over_layers(router_logits, batch.domain_label)
    (nll + eta * cls).backward()
    stage2_optimizer.step()

The paper describes layer routers through both a compact weight notation and a later two-layer-MLP description. The invariant is the interface — one sequence-level domain distribution per layer — not an unsupported claim that every implementation must use one exact router architecture.

Generation adds another policy choice. Layer decisions can vote for one adapter, or the last router can provide the final selection. These are not equivalent. In the oracle, layer choices [2, 2, 0] yield expert 2 by majority vote and expert 0 by last-router selection.

def choose_generation_adapter(layer_choices, policy):
    if policy == "router_vote":
        return deterministic_majority_vote(layer_choices)
    if policy == "last_router":
        return layer_choices[-1]
    raise ValueError("policy is part of the deployment contract")

The selection policy, tie break, adapter ordering, and router version must therefore be saved with the Stage 2 artifact. Saving only the LoRA factors loses part of the model.

0x03H MoLE: Paper Gate Graph Versus Pinned V&L Graph

MoLE begins after specialist training. The base and candidate LoRAs are capability inputs to a new composition stage; they are not reinterpreted as jointly initialized experts.

For the paper graph, every candidate first produces . The candidates are concatenated and normalized:

After flattening, a learned map produces candidate logits . With paper temperature :

This dependency fixes the execution order:

all candidate outputs
    -> concatenate and normalize
    -> gate logits and temperature
    -> softmax weights
    -> weighted candidate output

It is impossible to skip an unselected candidate before computing a gate whose input contains that candidate. A different hidden-state router may permit another execution plan, but it is a different graph.

Across gated blocks, define:

The direct probability gradient is:

For total gate-probability credit from the domain objective plus , the logit gradient is again the softmax VJP:

If is trainable in the paper graph, its local derivative is:

The pinned V&L paths inspected for this loop are different in three ways:

  1. Their traced gate is formed from normalized current hidden states rather than concatenated candidate outputs.
  2. The PEFT fork still materializes all listed candidate LoRA outputs before weighting and reduction.
  3. The inspected trainer admits parameters whose names contain wg; the observed temperature state is therefore outside that trainable set even though the paper calls learnable.

The optional entropy path also requires a differentiability audit. In the pinned trace, gate statistics are detached, accessed through .data, converted to Python lists, and reconstructed as a new tensor in the trainer. An arithmetic value can still be added to the scalar loss, but no autograd edge leads from that reconstructed value back to the gate logits. It is a disconnected diagnostic, not a differentiable reproduction of the paper’s gate-balance objective in that path.

def mole_paper_gate_step(x, frozen_base, frozen_candidates, gate, tau):
    candidate_outputs = [candidate(x) for candidate in frozen_candidates]
    gate_input = normalize(concat(candidate_outputs))
    weights = softmax(gate(flatten(gate_input)) / tau)
    output = frozen_base(x) + weighted_sum(weights, candidate_outputs)
    loss = domain_loss(output) + alpha * balance_loss(weights)
    loss.backward()
    gate_optimizer.step()  # gate and paper tau only


def pinned_vl_path(x, frozen_candidates, wg):
    weights = softmax(wg(normalize(x)))
    candidate_outputs = [candidate(x) for candidate in frozen_candidates]
    output = weighted_sum(weights, candidate_outputs)

    recorded = detach(weights)
    entropy = tensor(product(to_python_list(recorded)))
    assert not entropy.requires_grad  # diagnostic cannot train wg in this path
    return output, entropy

This comparison is revision-specific. It does not claim that every MoLE implementation has the same hidden-state gate or detached statistic.

0x03I Objective Gradients And Frozen-State Semantics

“Frozen” constrains parameter updates; it does not erase a module from the computational graph.

Suppose a frozen candidate computes and a trainable gate consumes that output. Setting phi_i.requires_grad = False means:

no dL/dphi_i accumulation
no optimizer slot for phi_i
no optimizer update to phi_i

It does not imply:

detach E_i from x
discard dL/dE_i
remove the candidate from the gate input
skip dL/dx through the frozen function

Those operations would change how earlier trainable composition state receives credit. In a hierarchy with trainable gates at several blocks, later frozen base and adapter maps may still carry gradients to earlier gates.

Method stateParameter gradientsInput-gradient pathOptimizer state
LoRAMoE jointrouter and every base, experts, and router dependenceone coupled optimizer state
Mixture Stage 1one specialist through frozen base and active adapternew independent optimizer per specialist run
Mixture Stage 2all specialists and layer routersthrough weighted multi-adapter graphnew or explicitly restored Stage 2 state; paper weight handoff alone does not prove moment continuity
MoLE paper stagecomposition gate and through frozen candidates where neededgate-only optimizer state
pinned MoLE tracewg-admitted parametershidden-state gate and dense candidate reductionrevision-specific; detached diagnostic has no gate gradient

The training artifact must therefore record at least:

base checkpoint identity
ordered adapter identities and factor shapes
router/gate architecture and scope
trainable parameter-name manifest
frozen parameter-name manifest
objective formula and reduction axes
auxiliary-label schema and availability phase
stage-parent artifact digest
optimizer-state restore policy
inference selection policy

0x03J Executable Stage Oracle

The checked teaching fixture uses small float64 logits, not paper checkpoints. It answers four local questions exactly:

ContractCoordinates finite-differencedMaximum absolute error
LoRAMoE printed-form balance under declared population variance16
LoRAMoE pinned CV-squared form under sample variance16
Mixture domain-classification term27
MoLE linearized domain credit plus balance9

For the Mixture fixture, one sample from each of three domains gives the immutable histogram [1, 1, 1]. The mean layer/domain classification loss is 0.694150; with , it contributes 0.277660 to the teaching total. For MoLE, mean gate probabilities are approximately [0.326606, 0.340376, 0.333018], so the balance term is 3.296264 before weighting.

These checks establish algebra and state ownership only. They do not execute framework autograd, a GPU kernel, a paper checkpoint, an optimizer schedule, or a benchmark. They also do not prove that localized balance prevents forgetting, that balanced routing improves quality, or that dense soft composition skips any physical work.

The replay sequence is:

python3 docs/numinens-evidence/m6-9-routed-shared-continual-adapters/build_loop4_artifacts.py
python3 -m unittest docs/numinens-evidence/m6-9-routed-shared-continual-adapters/test_loop4_method_training_contract.py

0x03K Failure Lab And Measurements

Broken contractObservable symptomRoot causeRequired measurement or rejection
paper and code LoRAMoE losses collapsed into one formulareproduced values disagree despite matching gatesvariance correction or mean denominator changedlog , variance convention, denominator, and every local term
LoRAMoE role supplied at inferenceunrealistically clean routesprivileged training metadata leaked into runtimereject any inference schema containing sample role
Mixture Stage 2 freezes specialistsrouter learns around incompatible adapter scales but specialists cannot reconcilewrong trainable setparameter-delta and optimizer-slot audit by adapter
Mixture Stage 2 uses naturally imbalanced datarouter classifier learns corpus frequencybalanced paper contract lostper-domain sample and token histogram per optimizer window
Mixture domain label fed to routerrouting accuracy appears perfecttarget became an input featureablate labels and inspect model input signature
vote and last-router policy treated as identicaladapter changes after deployment despite same weightsunversioned inference policydisagreement rate and deterministic tie-policy test
MoLE paper gate moved before candidate outputslower compute but different functiongate dependency rewrittensource-to-tensor trace and candidate materialization count
frozen MoLE candidates detached wholesaleearlier gates receive incomplete gradientsparameter freezing confused with graph detachmentinput-gradient norm before and after candidate blocks
pinned entropy statistic called a training lossscalar changes but gate gradients do notdetached/reconstructed tensorrequires_grad, grad_fn, and gate-gradient ablation
paper temperature called trainable in pinned run never changesparameter-name filter excludes ittrainable-name manifest and before/after value digest

For real runs, record method-specific telemetry rather than one generic utilization plot:

LoRAMoE:
    per-layer and per-projection LM loss, local balance term, mu, variance,
    sample/expert role traffic, router entropy, role-label ablation,
    every expert A/B gradient norm, and base-weight immutability

Mixture-of-LoRAs:
    Stage 1 parent digest per specialist, domain competence before Stage 2,
    balanced sample/token counts, per-layer classification accuracy,
    adapter and router parameter deltas, vote/last disagreement,
    and cross-domain regression after joint reconciliation

MoLE:
    exact ordered adapter pool, candidate outputs materialized,
    gate input source, tau trainability, q_i and balance gradient,
    gate-only parameter delta, detached-statistic audit,
    and quality against static arithmetic merge and single-adapter controls

The common evaluation rule is causal: compare against a single adapter, an ungated uniform mixture, a router with its auxiliary objective removed, and an oracle route only when the oracle’s privileged information is clearly labeled. Otherwise a gain cannot be attributed to routing, balancing, or composition separately.

0x04 HydraLoRA: Sharing One Factor Changes The Hypothesis Class

HydraLoRA begins from a concrete adaptation problem rather than from the MoE analogy. A heterogeneous corpus can contain tasks or subdomains whose updates interfere, yet allocating one complete LoRA pair to every component multiplies adapter state. The paper asks whether the two LoRA factors play sufficiently different roles that only one of them needs to be replicated.

Its answer is an asymmetric ownership contract: retain one input-side factor , allocate several output-side factors , and learn an input-conditioned router over those factors. This is not ordinary independent-expert LoRA with fewer labels. Sharing one parameter object changes which subspaces can be represented, which gradients are coupled, which optimizer moments exist, and which computations can in principle be reused.

LoRA, symmetric multi-LoRA, and HydraLoRA shared-A factorization

Source: HydraLoRA, Figure 1. The progression is structural: one LoRA pair, several independent pairs under the same parameter budget, then one shared input factor with several output factors. The letters are paper-local; tensor shapes and multiplication order determine what is actually shared.

0x04A From An Empirical Plot To A Sharing Hypothesis

The paper reaches the asymmetric design in two observational steps. First, under its reported setups, splitting a fixed LoRA parameter budget into several smaller task-specific heads can outperform one monolithic head. The paper interprets this as evidence that heterogeneous data can create update interference. Second, it separately trains LoRA heads for Dolly-15K subsets and visualizes flattened , , and module parameters with t-SNE. The plotted points overlap more across tasks while the points are more distinguishable.

HydraLoRA t-SNE comparison of BA, A, and B parameters across task-specific LoRA heads

Source: HydraLoRA, Figure 3, recovered from the official repository at commit afb693b. The reported setup flattens 32 layers times four q/v LoRA submodules for LLaMA2-7B and compares task-specific points. This is empirical motivation for shared , not a gauge-invariant proof that universally stores common knowledge.

That qualification matters because the LoRA factorization is not unique. For any invertible ,

The function is unchanged while the raw coordinates of both factors can move substantially. In the Loop 5 witness, one such transform changes by in Frobenius norm while changing the output by only . A coordinate plot, cosine similarity, or Euclidean distance between unaligned factors is therefore gauge-dependent. A stronger follow-up would compare row- and column-space projectors or principal angles, align factors before comparing them, repeat across seeds and model families, and verify the architectural choice with equal-budget ablations.

The paper itself is appropriately cautious: it attributes part of the observed asymmetry to the usual nonzero-/zero- initialization and notes that behavior can vary across architectures and datasets. Transformer System consequently treats the plot as a design hypothesis with source-reported evidence, not as an algebraic theorem.

0x04B Exact Ownership And Parameter Ledgers

Let the frozen target matrix be , the shared input factor be , and each expert readout be . For one token column , HydraLoRA’s adapter path is

where in the pinned main implementation and . Three superficially similar designs have different trainable object graphs:

DesignFactor objectsFactor parametersStructural assumption
Independent for every experteach expert chooses input and output subspaces
Shared one , distinct all experts share one input row space
Shared distinct , one all experts share one output column space

The shared- saving relative to independent experts follows by cancellation:

The router is a separate ledger. The pinned bias-free projection adds parameters per targeted linear. For the exact teaching dimensions , , , and :

DesignFactorsRouterFactors + routerAdam-like factor state: weight + two moments
Independent421254126 elements
Shared 26123878 elements
Shared 30124290 elements

Those persistent-state counts intentionally omit gradients, mixed-precision master copies, allocator padding, and the frozen base. They isolate the ownership change. They also show why an equal-rank comparison is not an equal-parameter comparison. Under a factor-only budget of 120 elements, the largest integer ranks in this toy geometry are 5 for independent experts, 9 for shared , and 8 for shared . A fair paper comparison must state which budget is held fixed.

Independent, shared-A, and shared-B adapter ownership followed by the shared-A forward and backward tensor trace and a paper-versus-code execution audit.

0x04C Hypothesis-Class Restrictions And Counterexample

Parameter saving is purchased with a precise representational restriction. Each shared- expert update is

For any matrices ,

Therefore

For one token, define the routed readout

Its token-specific effective update is

which still has rank at most and the same row-space ceiling. Increasing adds more possible readouts from the shared latent ; it does not add new rows to the input subspace.

Independent experts do not have that ceiling on a fixed mixture. With , , , and three independent experts, choose updates that sum to

The sum has rank 3, so no shared rank-2 or shared rank-2 can represent it. This is a counterexample to hypothesis-class equivalence, not a claim that the larger class always generalizes better. Sharing encodes an inductive bias that may help when the common-subspace hypothesis is true and bottleneck adaptation when it is false.

There is a second subtlety. If changes with , then changes too. The adapter mapping is generally nonlinear in even though every and is linear. In the exact witness, all three token-specific matrices have rank 2, but the largest pairwise matrix difference is . One static merged update does not represent that route witness. Loop 6 owns the deployment consequences.

0x04D Forward Tensor Trace And Coupled Backward

For a row batch , compute router logits and weights

An optimized shared- schedule computes the common latent once:

The adapter output is

Now let and define the gate-weighted upstream for expert :

Each distinct readout receives

All readout paths accumulate into one latent gradient and one shared factor:

The router receives only relative expert credit. For token , define

Then

The input gradient has three separately auditable paths:

The frozen base receives no optimizer update, but it remains in the input-gradient path. Removing that path because is frozen is a backward bug.

Shared storage also changes optimizer dynamics even when initial values do not. Suppose independent experts begin with value-equal copies . Their forward output exactly matches shared , and at that point

After one SGD step, however,

The independent copies diverge unless every expert gradient is identical. In the exact witness, the initial forward difference is zero and the shared gradient matches the sum to , yet the largest pairwise difference after one step is . A shared parameter is not shorthand for synchronized copies; it is one optimizer state receiving accumulated credit.

0x04E Zero-B Initialization Is A Training Schedule

The standard LoRA initialization sets nonzero and every to zero so that the initial adapter update is exactly zero. HydraLoRA’s paper states this baseline convention, and the pinned main code uses Kaiming-uniform , zero , and a separately initialized router. That creates a specific first-step gradient schedule.

At for all :

Therefore

while

can be nonzero. Under task loss alone, the first update goes into the readouts. Shared and the router begin receiving task gradient only after the paths become nonzero. The pinned main path returns a scalar-zero balance placeholder, so the inspected snapshot does not add a separate gate-balancing gradient at initialization.

The exact fixture makes this visible: the initial and router gradient norms are both zero, while the three gradient norms are , , and . After one teaching update to , the gradient norm becomes and the router gradient norm becomes .

This schedule is not automatically harmful, but it is part of the method. Router symmetry, early expert allocation, warmup, auxiliary objectives, nonzero- initialization, and staged training are alternative design choices, not implementation trivia. If both the router and experts remain symmetry-equivalent, specialization can be delayed or collapse into redundant branches.

0x04F Paper Algebra Versus Pinned Main-Code Schedule

The paper-level workflow is:

HydraLoRA fine-tuning and routed inference workflow

Source: HydraLoRA, Figure 4. The left side separates component-count initialization from joint routed fine-tuning. The right side describes input-conditioned weighted composition of around shared . “Routing LoRA merge” is dynamic composition here, not one permanent weight update shared by every input.

The pinned repository at commit afb693b contains several LoRA/MoE paths that must not be conflated:

Pinned pathObserved ownership and routeWhat it establishes
HydraLoRA/peft/tuners/lora.pyone lora_A object, lora_B0...B{J-1}, bias-free token routermain shared- code path used by fine-tuning.py
HydraLoRA/peft/tuners/mmoelora.pyindependent lists, task-embedding routersymmetric/task-routed baseline, not HydraLoRA sharing evidence
MLLM-HydraLoRA/moe.pyprojection-specific shared- parameters, dense training and sparse inference brancheslater multimodal extension, not reproduction of the main paper experiments

The main path’s forward loop is equivalent to the following source trace:

route_weight = softmax(
    lora_route(x), dim=-1, dtype=float32
).to(result.dtype)

for i in range(J):
    result += (
        route_weight[:, :, i, None]
        * lora_B[i](lora_A(dropout(x)))
        * scaling
    )

return result, scalar_zero_balance_placeholder

This proves shared parameter storage but not optimized shared computation. The A projection is recomputed inside the expert loop, and all branches are evaluated. There is no top-k branch-skipping path in this inspected class. An optimized dense implementation could hoist

Z = lora_A(dropout(x))
expert_outputs = stack([lora_B[i](Z) for i in range(J)], dim=expert)
result += scaling * sum(route_weight[..., i, None] * expert_outputs[..., i, :])

only where every branch sees the same dropout output: at inference, where dropout is the identity, or with dropout probability zero. In training, the pinned loop calls dropout(x) once per expert, so each branch receives its own random mask (the training entrypoint defaults to dropout 0.1, as noted below). Hoisting Z replaces those independent masks with one shared mask and changes the training computation; 0x08C lists the same mask among the reuse preconditions. Even where the hoist is exact, algebraic permission is not evidence that the pinned runtime performs the optimization. In the tiny FLOP ledger, the optimized shared- schedule uses 48 multiply-add FLOPs for , while the pinned loop performs 144 because it recomputes that projection three times. Both then spend 108 on the three readouts and 72 on the router under the stated convention.

The source also exposes a dimensional ambiguity in the paper text. The printed router description gives while saying it consumes intermediate token representation . The pinned code unambiguously maps the target linear’s in_features to logits before applying . This article follows the executable tensor contract and labels the printed shape as unresolved rather than silently repairing it.

The training entrypoint defaults to q_proj,v_proj, rank 8, , dropout 0.1, and two factors. Those are snapshot defaults, not universal HydraLoRA requirements. The paper’s Table 2 separately reports a HydraLoRA rank-8 configuration with one , three average matrices, and the same reported 0.124% parameter fraction as rank-16 LoRA. Those results are source-reported; this loop does not execute the checkpoint or reproduce quality, latency, or energy measurements.

0x04G Independent, Shared-A, And Shared-B Design Choices

Sharing instead gives

Because is common and linear, an optimized schedule may first combine latent rows,

then apply once. This saves output-side readout work but forces

The alternatives therefore encode different beliefs:

ChoiceRepresentationGradient couplingOptimized dense scheduleMain risk
Independent separate input and output subspacesno shared factor; router still couples selection input projections and readoutsparameter and optimizer-state growth
Shared common input row space, distinct output readoutsall experts accumulate into one one projection and readoutsincompatible input subspaces bottleneck
Shared distinct input projections, common output column spaceall experts accumulate into one input projections and one readout after latent mixingincompatible output directions bottleneck
Router/component choiceBenefitCost or caveat
developer-specified componentsreproducible semantic partitionrequires prior structure and may encode wrong boundaries
k-means-selected data-driven component-count heuristicclustering representation and criterion become provenance
dense soft routingdifferentiable weighted compositionevery branch runs unless a specialized kernel changes the schedule
sparse top-k routinglower active branch count in principleselection, capacity, load balance, and dispatch become new contracts

HydraLoRA’s paper uses MoE as a composition mechanism and explicitly notes that other fusion methods are possible. The factor-sharing assumption and the routing mechanism should therefore be evaluated separately: one can test shared with a fixed mixture, or a learned router with independent factors, before attributing a gain to the combined design.

0x04H Executable Shared-Factor Oracle

The Loop 5 evidence package freezes the paper, code, object, tensor, and claim contracts in hydralora_shared_factor_fixture.json. Its pure-Python oracle derives all three variants under one row-batch loss:

shared A:
    X -> one Z = X A^T -> J B_i readouts -> tokenwise soft mixture
    gradients: X, A, every B_i, and router R

independent:
    X -> J Z_i = X A_i^T -> J B_i readouts -> same router mixture
    gradients: X, every A_i/B_i, and R

shared B:
    X -> J Z_i = X A_i^T -> one shared B readout family
    gradients: X, every A_i, shared B, and R

It checks 170 scalar coordinates by centered finite differences in float64. The largest observed absolute error is against an tolerance. It also verifies:

factor parameters:         independent 42 · shared-A 26 · shared-B 30
cloned/shared forward:     max difference 0
shared dA vs sum dA_i:     max difference 5.55e-17
one-step clone divergence: 0.03383
independent rank witness:  3 > shared rank 2
gauge-equivalent output:   max difference 1.11e-16
token effective matrices:  ranks [2,2,2], not one static matrix

The checked report is hydralora_shared_factor_report.json. Eighty-eight one-field negative fixtures reject source substitution, factor alias changes, wrong shapes, changed route or initialization contracts, and any upgrade of an unsupported claim.

0x04I Failure Lab And Measurements

FailureWhy a shape check can miss itRequired detection
duplicated once per expert but called sharedvalues may begin equal and outputs initially matchobject identity, checkpoint-key count, optimizer-slot count
shared gradient not summed across expertsevery local gradient has shape compare against oracle
raw-factor similarity called invariant may be identical after a gauge transformalign factors or compare subspaces/functions
shared treated as same hypothesis class as independent factorsevery individual update still has rank rank-3 sum counterexample under
zero- router expected to specialize on the first task stepsoftmax runs and returns valid probabilitieslog task-loss router gradient norm at initialization
pinned dense loop described as sparse MoEgate values can be near zero while all branches executebranch invocation counts and kernel trace
shared projection assumed reusedone parameter object existscount calls or inspect the compiled graph
mmoelora.py assumed to implement shared filename sounds authoritativetrace allocations: that file owns independent
shared presented as equivalent to shared parameter counts are both smaller than independentrow-space versus column-space containment tests
dynamic token route exported as one permanent mergeeach effective matrix has rank at most compare effective matrices across tokens and requests

For a real training run, record the following before interpreting specialization:

identity and storage:
    exact A/B/router checkpoint keys, aliases, shapes, dtypes,
    parameter count, optimizer slot count, parent/base digest

gradient schedule:
    per-step ||dA||, ||dB_i||, ||dR||,
    expert pairwise gradient cosine after gauge-aware alignment,
    time until router and shared A receive nonzero task credit

route behavior:
    entropy, per-expert probability mass, branch invocation count,
    input scope, layer/projection scope, component-count provenance

hypothesis diagnostics:
    row-space projector drift for A, column-space drift for B_i,
    effective-matrix rank, independent-versus-shared equal-budget controls

runtime:
    actual A-projection call count, B_i readout count,
    materialized temporary bytes, launch count, and latency by phase

The minimum causal comparison is independent factors versus shared versus shared under both equal rank and equal parameter budget, each with fixed and learned routing controls. Without that matrix, a quality or efficiency change cannot be attributed specifically to asymmetry, routing, budget, or implementation reuse.

Loop 5 closes factor ownership and training algebra only. Static merge, dynamic composition packaging, quantized state, and provenance move to Loop 6; continual adapter state remains Loop 7; sparse runtime execution remains Loop 9.

0x05 Static Merge, Dynamic Composition, Quantization, And Provenance

The word merge is overloaded. It can mean adding full update matrices, constructing a higher-rank LoRA whose product equals that sum, approximating the sum at a smaller rank, combining the two factor coordinates separately, resolving conflicts between full task vectors, or evaluating an input-conditioned mixture at runtime. Those operations do not share one algebra or one artifact contract.

A22’s source-local fusion survey already separates manually chosen weights, learned blending, and LoRA-expert hybrids. Loop 6 turns that taxonomy into an executable boundary: first name the coordinate space, then state whether the result is exact, approximate, stochastic, or input-dependent, and only then decide whether it can be packaged as one static artifact.

Exact block-concatenated adapter composition, rank-constrained SVD, factor-coordinate cross terms, dynamic non-mergeability, quantization order, and immutable release provenance.

0x05A Composition Starts With The Coordinate Space

For adapter , define the deployed update matrix rather than only its stored factors:

For request-static coefficients , the intended update is

That equation is in delta-matrix coordinates. It is gauge-invariant: replacing by and by leaves unchanged. A method that instead averages tensors and tensors separately is operating in factor coordinates. The factorization is non-identifiable, so equality in one coordinate system does not imply equality in the other.

OperationInput coordinatesOutputExactness contract
direct dense sumone dense or exact before finite-precision rounding
block-concatenated LoRA with weights absorbed into one sideone rank- factor pairexactly reconstructs
delta then truncated SVDfull one rank- factor pairexact only when
factor-linear or factor-wise TIES/DARE and separatelyone rank-compatible factor pairgenerally differs from delta arithmetic
input-conditioned composition plus runtime function not one global static matrix in general

The first compatibility check is therefore not “do these files have the same rank?” It is:

same parent base and target tensor?
same factor convention and scale interpretation?
same intended coordinate space?
same static coefficients for every request and token?
same dtype and rounding boundary?
same stochastic mask, seed, and reduction policy if used?

Matching shapes are not a compatibility proof.

0x05B Exact Static Sum By Block Concatenation

Assume each adapter targets the same , but allow heterogeneous ranks . Stack the weighted input factors by rows and the output factors by columns:

Block multiplication contains only matching block products:

There are no cross terms because the blocks meet along disjoint latent coordinates. The rank bound follows from the inner dimension:

The pinned PEFT v0.19.1 implementation uses this construction for combination_type="cat": it multiplies each by the requested weight and adapter scaling, concatenates those rows, concatenates columns, and allocates output rank . That code path supports different input ranks, but the resulting adapter can become large enough to erase the storage and runtime benefit of low rank.

The Loop 6 rank-one witness is deliberately small:

with and . Therefore

Each input adapter has rank 1, while the composed update has rank 2. The block factors have shapes and and reconstruct with maximum error exactly zero in the float64 teaching oracle.

def exact_cat(adapters, coefficients):
    A_cat = concat_rows([
        coefficient * adapter.scale * adapter.A
        for adapter, coefficient in zip(adapters, coefficients)
    ])
    B_cat = concat_columns([adapter.B for adapter in adapters])
    return A_cat, B_cat  # B_cat @ A_cat is the exact weighted delta sum

This is a representation of the composed adapter update. Folding it into the base as is a separate lifecycle step owned at the single-adapter level by M6.3 and at deployment-package level by M8.

0x05C Rank-Constrained Delta SVD And Its Error

If rank is too expensive, one can first construct in delta coordinates and then refactor it. Let

The rank- truncation is

A LoRA-compatible factorization can place the singular values on either side. PEFT’s pinned delta-SVD path returns

so . Under the Frobenius norm, the discarded error is

For the diagonal witness, . Keeping rank 1 gives

That is the best rank-1 Frobenius approximation, but it is still not the requested exact sum. The deployment decision has traded one capability direction for a smaller adapter. The artifact must record requested rank, actual retained rank, SVD driver, clamping, working dtype, and output digest. A rank choice without an error ledger hides the decision.

The pinned PEFT _svd_generalized_task_arithmetic_weighted_adapter path makes the coordinate distinction executable. It first calls get_delta_weight(adapter), applies task arithmetic, TIES, DARE, or magnitude pruning to those full delta matrices, and only then computes the SVD. Its non-SVD sibling follows a different path.

0x05D Factor-Linear Composition Creates Cross Terms

For same-rank adapters, PEFT’s non-SVD linear path assigns the sign to the weight and splits coefficient magnitude across both factors. With :

Multiplying the combined factors gives

The diagonal terms are correct. The off-diagonal terms are generally nonzero. Therefore factor-coordinate linear combination is not delta arithmetic.

For the exact witness:

and

The desired has zero off-diagonal entries, so the cross-term matrix has Frobenius norm . The distinction is not rounding noise.

It is also gauge-sensitive. Replace only adapter 2 with the functionally identical factors

The exact delta sum remains unchanged, while the factor-linear output changes by in maximum absolute value. Any factor-wise TIES, DARE, magnitude pruning, averaging, or interpolation inherits this coordinate question unless it first canonicalizes the gauge or reconstructs full deltas.

This does not make factor-space composition useless. It makes it a different hypothesis class with a smaller fixed rank and different interactions. It should be evaluated against exact cat and delta-SVD baselines, not labeled an exact merge by default.

0x05E TIES: Paper Task Vectors Versus PEFT LoRA Paths

TIES begins with full fine-tuned model task vectors, not LoRA factors:

Its paper algorithm has three ordered steps.

  1. Trim: retain the top- percent of each by magnitude and set the rest to zero, producing .
  2. Elect: choose a sign at every parameter coordinate from the aggregate signed movement.
  3. Disjoint merge: average only nonzero task-vector values aligned with the elected sign.

TIES trim, elect-sign, and disjoint-merge procedure

Source: TIES-Merging, Figure 1, cropped from the official NeurIPS proceedings PDF. The figure establishes the paper’s full task-vector procedure. It does not establish that applying TIES independently to LoRA and factors is equivalent to applying it to .

For coordinate , a total-magnitude sign election can be written as

With aligned set

the disjoint mean is

with an explicit empty-coordinate policy. For the Loop 6 vectors and density , trimming leaves two coordinates per vector, elects signs , and returns .

The TIES paper contract and PEFT LoRA paths are different objects:

SurfaceCoordinates receiving trim/sign/mergeFinal factorization
TIES paperfull task vectors merged full parameter vector
PEFT ties and independentlymultiply merged ; cross terms and gauge dependence can remain
PEFT ties_svdfull LoRA delta matrices SVD refactor at requested rank; may truncate

The pinned code also exposes implementation choices absent from the one-word method name: density, total-versus-frequency sign election, disjoint mean versus sum, target compatibility, rank policy, SVD driver, and optional clamp. These belong in the artifact record.

TIES reports empirical gains under its evaluation protocol. Loop 6 externally verifies the method and executes a small algebraic procedure; it does not reproduce the paper’s benchmark or claim that trimming and sign election universally improve merged quality.

0x05F DARE: An Unbiased Stochastic Preprocessor, Not An Identity

DARE operates on delta parameters. Write retain probability and a coordinatewise mask

The dropped-and-rescaled delta is

The inverse-density scale gives a coordinatewise expectation identity:

That derivation explains the scale. It does not say one sampled tensor equals the original delta. For

the sampled result is

whose maximum coordinate difference from is . Averaging over the mask distribution recovers the original coordinates; one release artifact does not.

DARE is a stochastic preprocessor before a subsequent linear or TIES merge. Reproducibility requires retain density plus either the exact mask digest or a fully specified random generator, seed, traversal order, device, and library contract. PEFT’s pinned dare_linear and dare_ties paths apply random pruning to factors separately; their _svd variants apply it to full deltas before refactoring. Those paths should not share one unlabeled “DARE merged” artifact name.

0x05G Dynamic Gates Fail The Static-Matrix Contract

For a learned input-conditioned router:

At any one , one can define a token-specific effective matrix

That does not imply one offline matrix works for every input. Any fixed matrix map is additive:

Therefore one counterexample with

is sufficient to reject a global static merge for that routed function.

The Loop 6 witness uses

with and . The router gives approximately on , reverses those weights on , and gives on . The additivity residual is

with norm . The largest difference among the three effective matrices is .

The phrase “dynamic merge” must therefore be read as runtime composition. Its state includes the router, candidate pool, route scope, and selected coefficients. Request-level routing may resolve one static adapter for the whole request. Sequence-, token-, layer-, or matrix-level routing may change the effective operator within the same request. Loop 8 owns those granularities; M6.5 owns loading and residency; Loop 9 owns the physical routed execution.

0x05H Quantization Makes Operation Order Observable

Exact (real-number) addition is commutative and associative:

The lifecycle ceases to share that equality when a nonlinear representation change is inserted. To expose the issue without reopening M8, define one teaching quantizer:

with and integer range . This is only an operation-order witness, not a recommended deployment format.

Using the frozen fixture matrices, the three paths produce:

and

The first and second paths differ by in maximum absolute value; sequential requantization differs from one-shot quantization by . Likewise,

with maximum recovery error . Subtracting the float delta cannot undo information lost to rounding or clipping.

def publish_composed_artifact(base, deltas, quantizer):
    assert all(delta.parent_base_digest == base.digest for delta in deltas)
    composed = exact_delta_compose(base.float_weight, deltas)
    released = quantizer.quantize_once(composed)
    return released, digest(released), quantizer.calibration_digest

def unsafe_sequential_publish(base, delta1, delta2, quantizer):
    interim = quantizer.quantize(base + delta1)
    return quantizer.quantize(interim + delta2)  # a different artifact

Other order changes matter for the same reason:

train D2 against W + D1       != train D2 against W
TIES then SVD                 != SVD each adapter then TIES factors
DARE mask then gauge change   != gauge change then factor-wise DARE mask
merge, round, then unmerge    != restore immutable W and original deltas

M8 owns quantizer families, calibration, kernels, deployment evaluation, release, and rollback. M6.9 owns recording where composition sits in that lifecycle.

0x05I Composition Artifact And Provenance DAG

A released composition is a directed acyclic graph of parent artifacts and transformations, not merely a filename. The minimum record is:

parents:
    base digest, revision, config, tokenizer
    every adapter digest and its own parent-base digest

target ABI:
    module path, semantic role, exact shape
    factor convention, rank, scale, dtype, orientation

composition:
    method and coordinate space
    adapter order, coefficients, normalization
    cat rank or SVD rank/driver/clamp
    TIES density/sign/reduction policy
    DARE density and seed or exact mask digest

dynamic state, if any:
    router digest, input scope, layer/matrix scope, top-k policy
    component-count and candidate-pool revisions

representation transition:
    merge dtype, quantizer family, scale/zero-point/clipping/rounding
    calibration digest and exact operation order

release:
    library release and commit
    output tensor and package digests
    evaluation-record digest and compatibility decision

The immutable Loop 6 record binds 23 top-level fields. Its static cat artifact rejects a mismatched parent base, wrong target shape, omitted coordinate space, changed coefficient order, missing stochastic identity, changed quantization order, or output digest drift.

def admit_composition(record, base, adapters):
    require(record.base_digest == base.digest)
    require(all(a.parent_base_digest == base.digest for a in adapters))
    require(record.target_shape == base.target_shape)
    require(record.coordinate_space in APPROVED_COORDINATE_SPACES)

    if record.dare.used:
        require(record.dare.seed is not None or record.dare.mask_digest is not None)
    if record.router.mode != "none_static_coefficients":
        reject("dynamic route cannot be labeled one static merged artifact")

    require(record.quantization.operation_order == APPROVED_ORDER)
    require(hash_bytes(load_output(record)) == record.output_digest)
    require(evaluation_passed(record.evaluation_record_digest))

Restoring the base plus original adapters is the reversible rollback path. Subtracting factors from rounded merged weights is not.

0x05J Executable Oracle, Alternatives, And Failure Lab

The Loop 6 fixture is composition_merge_fixture.json. Its pure-Python oracle performs the matrix algebra, two-dimensional SVD, TIES trim/elect/disjoint merge, DARE expectation and sample, dynamic additivity witness, teaching quantizer, and provenance validation without NumPy or a framework runtime.

The checked composition_merge_report.json establishes:

exact cat reconstruction error:         0
composed delta rank:                    2 from two rank-1 adapters
factor-linear cross-term norm:          1.0
gauge-equivalent factor-merge change:   0.7071
rank-1 SVD Frobenius error:             0.5
TIES retained coordinates per vector:  [2,2,2]
DARE expectation error:                 0
DARE sample max difference:             3.0
dynamic additivity residual norm:       0.3268
sequential quantization order change:   0.25
rounded unmerge base error:             0.10

It rejects 128 one-field mutations spanning source revision, method coordinates, dimensions, factors, dynamic route, TIES/DARE policy, quantizer, parent lineage, composition method, stochastic identity, output digest, and unsupported claim promotion.

NeedConservative choiceMore compressed or adaptive choiceNew evidence required
exact fixed coefficientsblock-cat adapter or dense delta sumnonerank/storage/runtime ledger
smaller fixed-rank artifactexact cat at rank sumdelta-SVD at discarded singular energy plus quality evaluation
same-rank factor artifactdelta-SVD at requested rankfactor-linear or factor-wise TIES/DAREcross-term and gauge sensitivity controls
conflict resolutionexplicit weighted delta baselineTIESdensity, sign election, reduction, benchmark protocol
stochastic redundancy removaldeterministic baselineDARE before linear/TIES mergeseed/mask digest and variance over masks
input-specific specializationone approved request-static compositionlearned runtime gaterouter, route scope, candidate residency, cache provenance
low-precision releasecompose in approved working dtype, quantize oncesequential merge/requantizeorder, calibration, byte digest, rollback proof
FailureShape-correct symptomRoot causeRequired detection or repair
factor merge labeled exact delta sumoutput factor shapes match rank cross terms were introducedcompare against materialized
gauge-equivalent adapters merge differentlyevery adapter still computes the same aloneoperation acted on non-identifiable factorscanonicalize or compose in delta coordinates
truncated SVD called losslessoutput rank is accepted by runtimecomposed delta rank exceeds retained ranksingular spectrum and reconstruction error ledger
TIES paper and PEFT factor path conflatedboth use the string tiestrim/elect/merge happened in different coordinatespin implementation path and test delta output
DARE release cannot be reproduceddensity matchesrandom mask or generator state is absentseed plus RNG contract or exact mask digest
dynamic route exported as one mergeone token test passes changes with inputadditivity test and effective-matrix trace across inputs
quantization order silently changesshapes and nominal bit width matchrounding/clipping occurred between additionsoperation DAG and output digest comparison
unmerge corrupts basesubtraction executes without errormerged state had already roundedrestore immutable parent artifact
same-shape incompatible adapters acceptedtensor load succeedsparent bases, targets, scales, or conventions differprovenance admission before arithmetic

Loop 6 closes multi-adapter composition algebra and artifact identity. It does not close generic quantization, runtime residency, paper benchmark reproduction, or continual-learning state. Loop 7 consumes this immutable parent/provenance contract before adding sequential task state.

0x06 Continual Adapters: Ordered State Without A No-Forgetting Myth

Continual learning is not ordinary multi-task training with the dataset rows sorted by task. It is an ordered state transition. Task arrives after , earlier examples may be unavailable, and the training artifact at step becomes the parent of step . The learner must therefore answer three different questions:

parameter retention:
    which old tensors are frozen or consolidated?

functional retention:
    how does old-task behavior change after the new transition?

operational retention:
    which parent, selector, task order, evaluation, and rollback state survive?

Freezing one LoRA per completed task answers only the first question. A newly summed delta changes every input that reaches it. A newly trained selector changes how old frozen deltas are combined. A merged checkpoint can preserve the current function while destroying the factor basis required by the next regularizer. Continual state is consequently larger than “the adapters currently loaded on the GPU.”

Incremental LoRA, O-LoRA, and AM-LoRA continual state

0x06A Continual Learning Is An Ordered State Transition

Represent the state after task as:

where is selector or consolidation state, is the ordered task sequence, is the parent/provenance record, and is the evaluation matrix. Training is a transition:

under an explicit constraint contract . O-LoRA places an overlap penalty on the new factor subspace. AM-LoRA freezes old task factors and changes an attentional selector while learning the current adapter. A replay method would put old examples or old gradients into . These are different state machines, even if all eventually evaluate .

A release must be able to reconstruct or reject this transition:

base revision and digest
ordered task IDs and task-data manifest hashes
parent state digest for every task transition
adapter factor convention, targets, ranks, scales, and dtypes
which old factors, current factors, and selectors were trainable
regularizer definition and coefficients
merge or consolidation history
training-code revision
evaluation-matrix digest and task baselines

In this contract, task order is part of artifact identity. Reversing sentiment topic QA is not a metadata-only edit; it defines a different chain of optimization problems and therefore needs a new state digest and evaluation.

0x06B Three Lifecycles: Sum, Select, Or Consolidate

One new adapter per task does not determine how inference uses the history.

LifecycleEffective updatePreserved stateBenefitCost or failure mode
cumulative sum for every inputall deltas or one exact merged parentno task ID and simple forwardevery new delta perturbs old inputs
task-ID selectionone adapter per task plus task resolverisolates task factors and active computerequires reliable task identity; limited cross-task reuse
learned feature selectionadapters plus selector stateinput-conditioned reuseselector drift, dense branch work, provenance growth
consolidationreplace history by or compressed factorsconsolidated parent plus rollback sourcebounded active artifactapproximation, irreversible rounding, future-basis loss

For target matrices , retaining all task factors costs:

before selector, optimizer, registry, and rollback state. A rank-efficient transition is not a bounded-state continual learner. M6.5 owns residency and paging; this section owns what must exist semantically even when only a subset is resident.

0x06C O-LoRA Paper Geometry

O-LoRA approximates earlier task-gradient subspaces with learned LoRA factors, freezes the prior factors, and learns a new low-rank update under an orthogonality regularizer. Its Figure 2 makes that lifecycle visible: the pretrained model and prior task factors are locked while the current pair remains trainable.

O-LoRA paper Figure 2 showing frozen prior task factors, trainable current factors, and orthogonal regularization

Source: O-LoRA official ACL Anthology paper, Figure 2. It establishes the paper architecture and freeze/train lifecycle, not numerical identity with the repository trainer or guaranteed retention.

The paper uses the convention:

so:

first projects into coordinates through , then maps those coordinates into the column space of . O-LoRA therefore uses as a tractable proxy for the current task’s update directions. If the prior bases are concatenated as:

exact subspace orthogonality would require:

The method enforces a finite penalty instead. It does not project every optimizer step onto the exact null space, and it does not retain old examples to check old functions directly.

0x06D O-LoRA Paper Loss And Gradient

The paper’s pairwise overlap loss can be written:

The final form follows from the trace identity:

Because is symmetric, differentiating gives:

This gradient removes the component of the current basis that overlaps directions represented by the old factors. It is not automatically scale-normalized. Multiplying one old basis by a constant changes the penalty unless the bases are orthonormalized first.

The Loop 7 witness uses:

Then:

and:

The third coordinate receives no penalty because the old proxy basis contains no component there. This explains the geometry of the regularizer; it does not establish that a finite optimizer step preserves every old network output.

0x06E The Official O-LoRA Code Is A Different Numerical Contract

The official repository is pinned at 07117e1. The paper and pinned code must remain separate rows. In the traced PEFT fork, old and current down-projection factors use the implementation orientation:

old lora_A:      [r_sum, d_in]
current loranew_A: [r, d_in]
old lora_B:      [d_out, r_sum]
current loranew_B: [d_out, r]

The trainer computes:

not the squared Frobenius expression above. It then adds unsquared Euclidean norms for every current loranew_A and loranew_B tensor:

Away from zero overlap entries, an subgradient is:

For the same numerical overlap , the code loss is , and the overlap subgradient in code coordinates is . This is not a harmless notation transpose: squared overlap and entrywise overlap produce different magnitudes, smoothness, and rank/task-count sensitivity. The code also matches old and current factors by a parameter-name prefix, making naming part of the implementation contract.

The initialization creates another training-state detail. Current loranew_A is Kaiming-initialized, while current loranew_B is zero. For a row batch:

and upstream gradient :

At , the task-loss gradient into is exactly zero, while the task-loss gradient into can be nonzero. The regularizers can nevertheless move on the first step. In the executable witness, the maximum task-gradient magnitude is for and for , while the regularizer produces a nonzero gradient. Training therefore begins with two distinct forces: task loss opens the zero branch, and regularization can rotate or shrink immediately.

def pinned_olora_loss(task_loss, named_parameters, lambda1, lambda2):
    overlap_l1 = 0.0
    factor_l2 = 0.0

    for module_prefix in target_module_prefixes(named_parameters):
        old_A = named_parameters[module_prefix + "lora_A"]
        new_A = named_parameters[module_prefix + "loranew_A"]
        overlap_l1 += abs(old_A @ new_A.T).sum()

    for name, factor in named_parameters.items():
        if "loranew_" in name:
            factor_l2 += norm(factor, p=2)  # unsquared in the pin

    return task_loss + lambda1 * overlap_l1 + lambda2 * factor_l2

This pseudocode describes the pinned revision only. It is not a replacement definition for the O-LoRA paper.

0x06F Cumulative Rank, Checkpoint Concatenation, And Scaling

The pinned save path accumulates completed and current ranks by concatenating along rank rows and along rank columns:

Multiplication proves the exact sum:

No cross term appears because the factors are block-concatenated, as in Loop 6’s exact cat composition. The cumulative rank becomes:

Exactness requires the scale contract to survive. If old and new deltas use and but the cumulative forward applies one scale , naive concatenation computes:

which equals the intended only when scales are compatible or encoded into one factor before concatenation. The oracle’s homogeneous-scale concatenation has zero error. Changing only the new-task scale from to yields maximum error under naive concatenation; multiplying the new block by its scale repairs the witness exactly.

Merging the cumulative delta into may reduce inference bookkeeping, but it does not make the continual state disappear. Future O-LoRA training still needs a representation of prior basis directions; rollback still needs the immutable parent or exact deltas; and a merged parent gets a new base digest. Inference state, future-training state, and rollback state are three separate ledgers.

0x06G Orthogonality Capacity And Function-Space Limits

If every task contributes a full-rank subspace and all task subspaces must be mutually orthogonal in an ambient dimension , then necessarily:

In the paper’s convention, . In the implementation’s row-space convention, the corresponding ceiling is . The Loop 7 witness sets and accepts ranks ; a fourth rank-one task cannot be exactly orthogonal to all three independent directions.

Before that hard ceiling, finite regularization can still leave overlap. After it, one of rank, exact orthogonality, or prior-subspace independence must give way. Practical alternatives include:

normalize or orthonormalize the stored bases before measuring overlap
penalize projector overlap ||Q_old^T Q_new||_F^2
inspect principal angles rather than raw factor magnitudes
allocate rank adaptively and stop when the null-space budget is exhausted
retain replay examples or distillation targets for function-space constraints
consolidate old tasks and accept an explicit approximation contract

M6.7 owns the general geometry of projectors, principal angles, factor gauge, and functional diagnostics. Loop 7 consumes that theory to set the claim ceiling: orthogonal proxy factors do not prove unchanged hidden states, logits, or old-task accuracy in a nonlinear network.

0x06H AM-LoRA Feature Selector Tensor Trace

AM-LoRA addresses a different failure. It keeps one task-specific LoRA per task, freezes completed adapter factors, and learns how to combine branch features. The paper’s Figure 2 separates the frozen old LoRAs from the current LoRA and the trainable feature editor/raters.

AM-LoRA paper Figure 2 showing task-specific LoRAs and the trainable attentional feature selector

Source: AM-LoRA arXiv v1 paper, Figure 2. It establishes the paper architecture and trainability legend. No official AM-LoRA code revision is claimed here.

For a row batch , define branch ‘s feature:

Let one rater vector score that branch:

The logits must be stacked before normalization:

The softmax is over the adapter-branch axis. Applying a softmax independently to each scalar would return one for every branch and would not define a selector. The mixed output is:

where is broadcast over . This dimensionally explicit equation also restores the base input multiplication that can be obscured by compact paper notation.

AM-LoRA includes a zero branch . Therefore . If its rater has no bias, supplies a fixed reference logit. The zero branch can absorb probability mass and reduce the adapter correction, but it does not save a matmul that was already executed for the nonzero branches.

The oracle uses two rows and four branches [zero, task-1, task-2, task-3]:

RowStacked logits Branch gates
1
2

Every row sums to one over branches. The zero branch receives positive mass, and no gate is exactly zero.

0x06I AM-LoRA Trainability And Sparsity Contract

At task , the base and prior task LoRA factors are frozen, and the current task LoRA is trainable. Selector trainability needs a more careful statement. The paper’s ablation reports that freezing previous rater dense layers performs worse than the stronger configuration that continues to train the selector raters. Consequently:

old LoRA factors fixed
does not imply
old branch contribution fixed

Changing changes and therefore changes the composed function even when every is byte-identical. In the oracle, changing only the task-1 rater from to changes output by maximum absolute value while all adapter deltas remain fixed.

The paper adds an penalty to rater weights:

This encourages parameter shrinkage. It is not an penalty on gate probabilities, not a top- operator, and not a certificate that a branch can be skipped. Softmax assigns strictly positive probability to every finite logit. Sparse execution needs a separate threshold/top- policy, a route plan, and a kernel that does not materialize rejected branch features.

def am_lora_forward(X, W0, task_deltas, rater_vectors):
    # X: [N, d_in]; every F_i: [N, d_out]
    features = [X @ delta.T for delta in task_deltas]
    features = [zeros_like(features[0])] + features

    # Each branch produces one scalar per row. Stack first.
    logits = stack([
        features[i] @ rater_vectors[i]
        for i in range(len(features))
    ], axis=1)                              # [N, T+1]

    gates = softmax(logits, axis=1)         # adapter-branch axis
    mixed = sum(
        gates[:, i, None] * features[i]
        for i in range(len(features))
    )
    return X @ W0.T + mixed, gates

The pseudocode is a dimensionally valid reconstruction of the paper equations, not a traced official implementation.

0x06J State, Training, And Runtime Growth

For task adapters with common rank at one target, factor state is:

One bias-free rater vector per task branch plus the zero branch adds:

Across target modules :

Storage, trainable state, and active runtime state differ:

Ledger at task O-LoRA-style cumulative factorsAM-LoRA stronger selector configuration
stored factorsall previous and current ranks, or exact merged delta plus retained basis provenanceall task LoRAs plus all raters
trainable factorscurrent loranew_A/Bcurrent LoRA plus trainable raters
optimizer statecurrent factors and regularizer pathcurrent LoRA and every trainable rater
inference branchescumulative merged branch or accumulated factorsevery materialized task branch unless execution prunes
rollbackimmutable parent or exact task deltasparent adapters plus selector revision

For the oracle’s , , layer, task adapters contain parameters and four raters contain , for continual parameters. At task 3, two old adapters contribute frozen parameters. Training the current adapter and all raters exposes trainable parameters. A dense forward materializes three nonzero adapter branches and four selector logits per row.

These toy counts prove the ledger algebra, not the paper’s total model memory. Real releases must add every target layer, dtype, optimizer tensor, distributed replica/shard, selector bias if present, registry object, and parent artifact.

0x06K Continual Evaluation Matrix

The GEM evaluation protocol defines as performance on test task after learning through task . For tasks:

Final average accuracy does not identify whether earlier tasks improved or degraded. Backward transfer compares each old task’s final score with its score immediately after learning it:

Forward transfer needs a pretraining or random-initialization baseline for the future task:

A taskwise forgetting measure records the fall from the best score observed after learning that task:

For the immutable teaching matrix:

the derived ledger is:

final ACC:          (0.68 + 0.78 + 0.85) / 3 = 0.770
BWT terms:          [0.68 - 0.80, 0.78 - 0.82] = [-0.12, -0.04]
mean BWT:           -0.080
FWT terms:          [0.25 - 0.20, 0.25 - 0.15] = [0.05, 0.10]
mean FWT:           +0.075
per-task forgetting:[0.12, 0.04]
maximum forgetting: 0.120

The final mean looks strong while backward transfer is negative. A release protocol should additionally record base-capability retention, task-order permutations, task-ID oracle versus task-ID-free inference, state bytes, training work, active branch count, and rollback success. The O-LoRA paper’s reported final average accuracy is a source result under its protocol, not a substitute for this complete matrix.

Four-panel continual adapter contract separating O-LoRA paper and code losses, cumulative checkpoint rank and scale, AM-LoRA branch-axis selection, and the evaluation and provenance matrix.

0x06L Alternatives And Paper-By-Contract Comparison

DesignTask boundary requiredOld dataState growthHow interference is constrainedInference contract
immutable adapter + oracle task IDyesnoone adapter per taskisolate factors and select exactly onetask resolver chooses one artifact
cumulative adapter sumtask order onlynocumulative rank or merged parentno explicit functional constraintall updates always active
O-LoRA papersequential tasksno replay in reported methodcumulative task factors/basis statesquared factor-subspace overlapcumulative adapted model; paper reports task-ID-free comparison
O-LoRA pinned codesequential tasks and cumulative checkpointno replay in traced trainerr_sum plus current factorsentrywise overlap plus unsquared factor normsold and current branches share one scale before save concatenation
AM-LoRA papersequential tasksno replay in core methodone LoRA and rater state per taskfeature selector with rater-weight soft mixture over zero, old, and current branches
replay or distillationtask/stream protocol dependentexamples, logits, or teacher statereplay buffer or teacher artifactsdirectly checks old examples/targetsmethod-specific
Online-LoRAno explicit task ID in its task-free settingmethod-specific online buffers/stateonline regularization stateimportance-weight regularization and loss-dynamics shift detectiontask-free online boundary, not O-LoRA equivalence
consolidation/distillationchosen release boundaryoptionalbounded release, retained rollback parentapproximate function transferone consolidated artifact after evaluation

Online-LoRA is included to expose a missing axis: O-LoRA and AM-LoRA assume a task sequence, while a production stream may not provide clean boundaries. Loop 7 does not derive or reproduce Online-LoRA, replay, or consolidation methods. They are alternatives that require their own source, state, and evaluation contracts.

0x06M Executable Oracle And Failure Closure

The checked-in continual_adapter_state_fixture.json and continual_adapter_state_oracle.py produce continual_adapter_state_report.json. The deterministic report checks:

O-LoRA paper squared-overlap loss:             0.3125
pinned-code entrywise overlap loss:            0.75
task gradient into new A at zero new B:        0
maximum task gradient into new B:              0.875
homogeneous checkpoint-cat error:              0
heterogeneous naive-cat error:                 1.0
remaining exact orthogonal dimensions:         0
minimum AM-LoRA softmax gate:                  0.13447
AM output drift after old-rater-only mutation: 0.17426
continual parameters in the AM toy layer:      20
ACC / BWT / FWT:                               0.770 / -0.080 / +0.075
maximum forgetting:                            0.120

It also binds task order, parent chain, adapter and selector digests, targets, ranks, scales, training code, merge history, and evaluation identity. Two hundred four one-field mutations are rejected across sources, method contracts, numerical policy, O-LoRA factors, AM-LoRA branches, evaluation values, provenance, and forbidden claims.

FailureShape-correct symptomRoot causeRequired repair
paper/code loss collapseboth losses mention orthogonalitysquared Frobenius was substituted for entrywise , or vice versapin equation and code revision as separate contracts
old/new factors fail to matchtraining continues with some modules unregularizedname-prefix pairing differs between checkpoint and trainervalidate complete target-module pair map
regularizer dominates over timenew task underfits as task count growsoverlap penalty is not normalized by accumulated old rank/taskslog task loss, overlap loss, factor loss, and gradient norms separately
zero- schedule misunderstood moves before task gradient can reach itregularizer updates while task path is blockedtrace task and regularizer gradients independently
heterogeneous scale driftconcatenated shapes load successfullyone forward scale was applied to factors trained under different scalesencode scales into blocks or preserve separate metadata/branches
orthogonal capacity exhaustedoverlap cannot approach zero at retained rankcumulative rank exceeds ambient dimensionreduce rank, share/project, replay, or consolidate under an explicit loss contract
frozen adapter still forgetsold factor files are unchangedselector raters or newly summed deltas changed the functionevaluate old functions and version selector state
fake AM sparsityrater weights are small but latency grows with softmax stayed dense and every branch feature was computedadd executable pruning policy and kernel trace
zero branch misread as free abstentiongate assigns mass to zero but work is unchangednonzero branches were materialized before selectionmeasure branch matmuls, not only gate values
final mean hides damageACC stays highearly-task loss is averaged with strong recent tasksreport , BWT, per-task forgetting, and critical-task floors
task reorder treated as same releasetensor filenames and shapes matchordered parent transition was omitted from identityhash task order and rerun the full evaluation matrix
merged parent cannot resumeinference works, next task cannot reconstruct constraintold basis/provenance was discardedretain immutable factors/basis state or declare a new continual method

Loop 7 closes sequential adapter state. It does not close task/request/token routing granularity, sparse kernels, replay, task-free online continual learning, or paper benchmark reproduction. Loop 8 consumes this immutable state before changing route lifetime and scope.

0x07 Routing Granularity: Lifetime Is Not Placement

The owner question for this section is narrower than “which adapter wins?”:

At what lifetime is a routing decision made, at which layers and matrices does it apply, which information is legally available when it is made, and does the execution path actually skip unselected adapter work?

Those are four different questions. A route can be fixed for an entire task but still carry a different coefficient for every target matrix. A request-level route can be fixed throughout generation but differ at every layer. A token route can change at every row while still being shared across all adapted projections. Finally, a top- tensor is not evidence of sparse execution unless the runtime omits the other adapter matmuls.

Loop 8 therefore treats granularity as a product of decision lifetime, placement scope, feature availability, training lifecycle, and execution operator. It consumes the immutable adapter identities and sequential state from Loops 2—7. It does not redo generic MoE capacity from M6.1/M6.2, adapter residency from M6.5, multimodal architecture from M6.8, or grouped low-rank kernels from Loop 9.

0x07A Route Lifetime And Placement Are Different Axes

Let be requests, token positions, routed layers, adapted target matrices, and adapter choices. A useful logical route tensor is:

The route extents , , and are policy choices. They need not equal the model extents:

AxisExtent 1 meansFull extent meansIndependent question
route persists across positionsroute can change at every tokenwhen does the decision change?
one route is shared across layersevery layer has its own routewhere in depth does it apply?
one route is shared across target matricesevery adapted matrix has its own routewhich projection does it modify?
one adapter candidatean ordered adapter registrywhich artifact/version is selected?

Define index maps , , and that either preserve an index or map it to zero when that axis is shared. For input row and adapter with scale , the common routed-adapter envelope is:

This equation derives the broadcast rules. A task route sets and reuses one coefficient vector everywhere its artifact says to apply. A sequence-by-layer route uses but , so one request keeps one distribution per layer. A token-by-layer route uses and . Adding matrix-local routing makes .

The number of logical gate entries follows immediately from the Cartesian product:

For the Loop 8 toy with , , , , and :

task:                       3 entries
request:                    2 * 3 = 6
sequence by layer:          2 * 2 * 3 = 12
token by layer:             2 * 3 * 2 * 3 = 36
token by layer and matrix:  2 * 3 * 2 * 2 * 3 = 72

This is a semantic count, not a command to materialize a dense five-dimensional tensor. A static route may be one artifact digest. A sparse route may be IDs and gates with logical shape:

where stores adapter IDs and stores selected-axis weights. Loop 9 will derive the packed execution plan. Loop 8 only establishes what those records mean.

Four-panel routing contract separating task, request, sequence, and token lifetimes from layer and target-module placement, then mapping paper methods, prompt persistence, K/V identity, and dense versus sparse execution.

0x07B Task-Level Composition: LoRAHub

LoRAHub is a task-level composition method, not an online request router. For a new task with a few-shot set , it searches one coefficient vector over an existing adapter pool. Its paper objective is:

The cost is paid while constructing the task artifact. Once is chosen, ordinary examples from task do not rerun CMA-ES or another gradient-free search. The deployed state is one fixed composition and therefore has task lifetime even when many requests use it.

The paper’s Figure 1 says this directly: composition is conducted per task rather than per example.

LoRAHub Figure 1 showing few-shot task examples used to compose a reusable task module rather than routing every test example.

Primary-source figure. LoRAHub Figure 1, arXiv v3/COLM 2024. The diagram supports task-level timing. Its benchmark bars are source-reported and are not reproduced by this article.

The paper and pinned official repository must still remain separate numerical contracts:

ContractPaperPinned code
candidate admissionequal-rank factor discussionchecks matching state-dict tensor shapes
regularizer$\alpha\sum_jw_j
searchgradient-free, primarily CMA-ES in reported setupsbounded Nevergrad NGOpt budget
outputone task-adapted modulecoordinate-wise state-dict sum, then merge_and_unload

Loop 6 already showed that the paper’s factor-wise expression and a coordinate-wise state-dict sum are not universally interchangeable because factor products can introduce cross terms. Loop 8 uses only the timing invariant: one search result becomes one reusable task artifact.

def build_task_adapter(few_shot_task_set, ordered_adapter_pool, budget):
    assert all_compatible_with_same_base_and_targets(ordered_adapter_pool)

    def objective(weights):
        candidate = compose_under_pinned_coordinate_contract(
            ordered_adapter_pool, weights
        )
        return task_loss(candidate, few_shot_task_set) + regularizer(weights)

    weights = gradient_free_search(objective, budget=budget)
    return materialize_versioned_task_artifact(weights, ordered_adapter_pool)

def serve_task_request(request, task_artifact):
    # No gradient-free search in the request path.
    return generate(request, adapter=task_artifact)

0x07C Prompt-Persisted Request Routing: MiLoRA

MiLoRA occupies a different coordinate. It computes routes from a request’s prompt hidden states immediately before generation, then persists those decisions for subsequent tokens. Its route lifetime is therefore prompt/request, while its placement is layer specific and module specific.

For layer , let be the prompt representation and its attention mask. A pooler produces one request feature:

The paper sends that feature through a layer-specific activation and router, then applies top- over LoRA module choices:

For a LLaMA-style block, the candidates in the paper are module placements such as Q, K, V, O, gate, up, and down. A request can therefore select one module at layer 3 and another at layer 20. Calling this simply “sequence routing” would hide the layer and module axes.

MiLoRA Figure 1 showing a prompt pooler and per-layer router selecting LoRA placements whose decisions persist during generation.

Primary-source figure. MiLoRA Figure 1, Findings of EMNLP 2024. It supports prompt-conditioned, per-layer module selection and route reuse. It is not official-code evidence and does not reproduce the paper’s latency results.

The paper considers last-token, average, max, and self-attention pooling. It also uses learnable rational activation functions and describes bi-level optimization for activation parameters versus remaining router/expert parameters . Its load term follows a Switch-style prompt assignment ledger. For layer and module expert :

where is the fraction of prompts assigned to module and is its mean router probability. The final training objective and the activation-search procedure are paper-specific; neither follows from prompt persistence alone.

The serving state must include more than selected integers:

def prepare_prompt_route(prompt, model, routers, adapter_registry):
    hidden_by_layer = prefill_and_capture_router_inputs(prompt, model)
    layer_routes = []

    for layer, hidden in enumerate(hidden_by_layer):
        pooled = routers[layer].pool(hidden, mask=prompt.attention_mask)
        logits = routers[layer].activation(pooled) @ routers[layer].weight
        ids, gates = selected_axis_topk(logits, k=routers[layer].k)
        layer_routes.append({
            "ids": adapter_registry.resolve_versions(ids),
            "gates": gates,
            "router_revision": routers[layer].revision,
            "pooling_policy": routers[layer].pooling_policy,
        })

    return persist_request_route(layer_routes)

def decode_with_prompt_route(request, token_row):
    assert request.route_state.is_pinned_and_resident()
    return model_decode(token_row, layer_routes=request.route_state)

Recomputing this route after preemption, or silently substituting a newly deployed router, changes the model. The route is request state and must be checkpointed with scheduler state.

0x07D Sequence- And Instance-Level Routing

Two methods can both emit one route per example and still have different contracts.

0x07D.1 Mixture-of-LoRAs: Sequence By Layer

The Mixture-of-LoRAs lifecycle was derived in 0x03G. It separately trains domain specialists, then performs a balanced Stage 2 in which one router at each layer predicts a sequence-level domain distribution. Its logical route is:

Domain labels supervise during Stage 2. They are targets, not proof that an oracle domain ID is supplied at inference. The sequence representation, router architecture, layer voting policy, and final selection policy remain part of the artifact.

0x07D.2 Conditional MixLoRA: Instance-Local Factor Construction

Conditional MixLoRA routes rank-one factors, not complete pre-trained LoRA modules. At one target layer, the paper starts from preceding-layer hidden states and forms one instance feature:

An independent factor selector chooses entries from an expanded pool of input factors:

If and , selected factors construct:

The conditional factor selector for additionally depends on selected factors. The resulting is one instance-local low-rank update at that wrapped layer and is broadcast across the sequence rows for request .

Conditional MixLoRA Figure 3 showing independent A and B factor selectors plus conditional B-factor selection.

Primary-source figure. Conditional MixLoRA Figure 3, ACL 2024. This section uses the figure only to establish instance-level A/B factor selection. The paper’s multimodal architecture and training context are outside this article’s scope.

The pinned official code makes the shapes concrete:

selector input:               [batch, sequence, hidden]
input_x.mean(dim=1):          [batch, hidden]
selected A factor IDs:        [batch, rank]
gathered A factors:           [batch, rank, d_in]
gathered B factors:           [batch, rank, d_out]
constructed A after rearrange:[batch, d_in, rank]
constructed B:                [batch, rank, d_out]
x @ (A @ B):                  [batch, sequence, d_out]

That code trace also exposes a batching defect that a shape table alone misses: the inspected selector uses input_x.mean(dim=1) without an attention mask. In a padded batch, zero or nonzero pad rows participate in the route feature unless an outer caller has removed them.

The paper is multimodal and does not establish a general autoregressive decode policy for repeatedly averaging an evolving text sequence. A text-serving implementation must choose explicitly between prompt-only pooling, a running causal pool, or rerouting. It cannot average future tokens that do not yet exist.

0x07E Token Routing: SiRA

SiRA supplies the sparse token-level counterpoint. For token row :

and the adapter output is:

Here changes with . The paper also adds expert dropout, a balancing term, and a capacity limit. If all selected experts are full, the overflow token uses only the frozen base path in the reported design. Capacity therefore changes the executed function: “selected by score” and “admitted to an expert buffer” are distinct states.

SiRA Figure 1 showing token gating, expert dropout, top-k, expert capacity, weighted LoRA outputs, and the frozen base path.

Primary-source figure. SiRA Figure 1, arXiv v1. It supports the paper’s token top-, dropout, capacity, and base fallback. It is not an official code or GPU-kernel trace.

M6.1 and M6.2 own the generic capacity formula, load balance, token dropping, and distributed dispatch. The M6.9-specific consequence is that adapter route metadata now has at least one record per token, layer, target scope, and selected slot:

(request_id, token_position, layer_id, target_id,
 route_slot, adapter_id, gate, local_row, adapter_version)

Without that mapping, inverse scatter can be shape-correct while assigning an expert output to the wrong token.

0x07F Token-By-Layer Dense Routing: X-LoRA

X-LoRA makes both token and layer axes explicit. Adding batch to the paper’s notation gives:

The default route is dense. At wrapped layer :

The paper and pinned code use a two-pass schedule:

  1. Scaling pass. Run the base with adapters inhibited or fixed, collect hidden states, and predict .
  2. Forward pass. Run the adapter-wrapped model using the predicted token-by-layer scalings.

X-LoRA Figure 19 showing a scaling pass, scaling head, wrapped X-LoRA layers, and dense additive adapter combination.

Primary-source figure. X-LoRA Figure 19, arXiv v2. It supports the two-pass graph and adapter scaling. It does not establish sparse default execution or validate every optional code path.

The pinned official implementation exposes four consequential details:

classifier output: [batch, sequence, wrapped_layers, adapters]
layerwise_scalings=False:
    predict [batch, sequence, adapters]
    repeat the route across wrapped layers
Python integration:
    assert model.config.use_cache is False
default wrapped linear:
    loop over every active adapter and add every branch

The paper warns that the same K/V cache cannot simply be reused between the scaling and forward passes because hidden state and cache accumulation belong to different effective executions. It describes a separate mistral.rs path and a non-granular scaling option that caches scalings after a configured number of completion runs. That option is a different route-lifetime policy, not merely a kernel optimization.

0x07F.1 Pinned Optional Top-K Normalization Counterexample

The pinned optional top- helper masks selected entries, then applies:

softmax(xlora_scalings[nonzero_mask], dim=-1)

Boolean indexing flattens all selected values from all token rows. The correct selected-axis normalization for row is:

The pinned operation instead has one denominator across every selected pair:

For dense inputs [.70,.20,.10] and [.10,.60,.30] with :

correct row-wise top-k:
    [.77778, .22222, 0]
    [0, .66667, .33333]
    row sums = [1.0, 1.0]

pinned flattened selected-value softmax:
    [.31430, .19063, 0]
    [0, .28439, .21068]
    row sums = [.50493, .49507]

The global selected sum is one, but neither token row is normalized. This is a pinned-code caveat, not a claim that the X-LoRA paper defines top- this way.

0x07G Causality, Pooling, And Feature Availability

Routing granularity is only meaningful if the route feature exists when the decision is needed.

LifetimeLegal feature examplesIllegal shortcutState consequence
task searchfew-shot task inputs and targets in the declared search settest labelsone task artifact and search provenance
prompt/requestprompt tokens, prompt mask, prompt hidden statesfuture generated tokenspersisted per-request route
sequenceencoder/full-sequence state when the task contract permits ithidden rows outside the declared inputone route per sample, possibly per layer
tokencurrent layer input and causal prefixfuture tokens or same-layer output that depends on the route being chosenroute metadata per token/layer

The same-layer circularity is easy to miss. If needs route but is predicted from the post-adapter output , then:

which is an implicit equation, not the advertised one-pass router. A conventional routed layer predicts from , metadata, or a prior pass.

0x07G.1 Masked Pooling Derivation

For variable prompt lengths, average pooling must exclude padding:

The denominator is the count of valid positions, so identical content has the same pooled representation regardless of batch padding. The padding-blind mean uses instead and therefore scales or contaminates the feature.

The oracle’s first request has valid rows [2,0], [0,2] and a padded sentinel [100,100]:

mask:                 [1, 1, 0]
masked mean:          [1, 1]
padding-blind mean:   [34, 34]
maximum difference:  33

The second request has no padding and both means equal [2/3, 2/3]. This paired witness proves that the discrepancy comes from padding, not from the pooling implementation in general.

Last-token pooling has a parallel constraint: in a left- or right-padded batch, “last array row” is not necessarily “last valid prompt token.” Self-attention pooling must mask keys and normalize only over valid rows. Pooling policy, mask convention, and tokenizer padding side are model state.

0x07H Route Persistence, Decode, And K/V Provenance

Prompt routing trades adaptation frequency for persistent state. Suppose MiLoRA-style prefill chooses IDs and gates once. The request state is:

It must survive scheduler preemption, migration, beam expansion, and restore. Reconstructing it from a mutable registry is not equivalent to restoring it.

The conservative prefix/KV identity is:

Why include the route when LoRA does not directly target K or V? Because an adapter applied to Q, O, or an MLP changes residual states; later layers project those states into K/V. A route change invalidates K/V provenance even if the changed matrix is not named k_proj or v_proj.

def restore_request(snapshot, registry):
    route = snapshot.route_state
    assert registry.has_exact_versions(route.adapter_versions)
    assert route.router_revision == snapshot.router_revision
    assert kv_cache.key == hash_execution_config(snapshot, route)
    pin(route.adapter_versions)
    return RequestState(route=route, kv=kv_cache)

def change_route_after_kv_exists(request, new_route):
    if new_route.signature != request.route.signature:
        invalidate_or_rebuild_affected_kv(request)
    request.route = new_route

For X-LoRA’s two-pass graph, the issue is stricter: the scaling pass and adapter-weighted forward are different executions. The pinned Python path asserts use_cache=False; a runtime claiming cache reuse must document how it separates, repairs, or recomputes cache state.

0x07I Routing Scope Does Not Determine Training Lifecycle

The same route shape can be produced by incompatible training processes:

MethodAdapter originRouter/scaler trainingRoute lifetimeRuntime artifact
LoRAHubpre-trained task adaptersgradient-free task searchtaskstatic composed adapter
MiLoRAjointly initialized module-level LoRA expertsrouters, experts, and learnable activations under paper scheduleprompt/requestpersisted per-layer module route
Mixture-of-LoRAsindependently trained domain adaptersbalanced Stage 2 updates routers and LoRAssequence by layerrouters, adapter pool, ordering, voting policy
Conditional MixLoRAexpanded rank-one factor poolsIFS/CFS selectors and factors in multimodal tuninginstance by layer/targetselectors plus factor pools
SiRALoRA experts initialized for sparse adaptationtoken gate, experts, dropout, capacity/balance objectivetokensparse route plus capacity policy
X-LoRAseparately trained adaptersfrozen base/adapters, train scaling head in reported coretoken by layerscaling head plus full adapter pool

Consequently:

route shape != training provenance
route shape != expert coordinate compatibility
route shape != sparsity
route shape != mergeability

A design review must record all four independently.

0x07J Dense Weights Versus Sparse Execution

For dense softmax routing, every finite logit has a positive gate:

If the implementation loops over all adapters, routing changes arithmetic weights but saves no adapter branch matmul. That is the pinned X-LoRA default path and the dense envelope used by several methods earlier in this article.

For sparse top- routing, the mathematical output has at most nonzero branches:

Actual compute is sparse only if the execution trace satisfies:

unselected adapter IDs absent from packed segments
unselected A/B tensors not read for that row
no dense all-adapter output tensor formed before masking
selected rows mapped back through route-slot metadata
capacity or residency fallback recorded explicitly

Top- after all expert outputs have already been formed is sparse weighting, not sparse computation. Soft gates with small values are not zero. An penalty on router parameters is not an execution plan. Loop 9 will convert these conditions into traffic, launch, and grouped-GEMM contracts.

0x07K Paper-By-Contract Comparison

ContractLoRAHubMiLoRAMixture-of-LoRAsConditional MixLoRASiRAX-LoRA
decision sourcefew-shot task setpooled prompt hiddensequence representationpreceding-layer sequence meantoken hidden rowscaling-pass hidden row
lifetimetaskrequest/promptsequenceinstance at each wrapped layertokentoken
layer axisartifact-definedlayer-specificlayer-specifictarget-layer-localtarget-layer-localexplicit layer axis
selected unitadapter compositionmodule-level LoRA placementdomain adapterrank-one A/B factorsLoRA expertcomplete adapter output
dense/sparsestatic coefficientspaper top-distribution then selection/votetop- factorstop- + capacitydense default
decode statestatic artifactpersist routeselection policynot closed for general text decoderoute each tokentwo-pass/cache-specific
privileged signaltask examples during searchnone required at inferencedomain label is training targetmultimodal conditioning fields are method-specificno task ID required in paper settingnone required beyond hidden states

This table is not a leaderboard. It prevents one method’s route semantics from being used to explain another method’s latency or training claims.

0x07L Executable Oracle And Failure Closure

The checked-in routing_granularity_fixture.json and routing_granularity_oracle.py produce routing_granularity_report.json. The exact report checks:

logical entries, task/request/sequence-layer/token-layer/full: 3/6/12/36/72
masked request-0 mean:                                        [1, 1]
padding-blind request-0 mean:                                 [34, 34]
prompt route reused over decode steps:                        4
route change changes K/V provenance digest:                   true
correct top-k row sums:                                       [1.0, 1.0]
pinned X-LoRA optional top-k row sums:                         [.50493, .49507]
dense materialized branches / sparse selected branches:       3 / 2
LoRAHub search evaluations per task / request:                 12 / 0

Every scalar in the fixture receives a one-field mutation. The test suite rejects changes to sources, method contracts, route axes, route values, pooling masks, persistence state, causality, the pinned X-LoRA witness, execution counts, and forbidden claims.

FailureShape-correct symptomRoot causeRequired repair
lifetime/placement collapseone route tensor broadcasts”layer routing” was treated as a lifetimerecord , , and separately
task search in request pathoutputs look valid but latency explodestask artifact construction confused with online routingmaterialize and version task result once
prompt route silently changesdecode remains numerically finiterouter/registry changed after prefillpersist exact IDs, gates, revisions, and policy
padding changes adapterbatch shape is validsequence mean ignored maskmasked pool with valid-token denominator
oracle label leakevaluation accuracy risesdomain/task label used as inference input though only trained as targetenumerate legal runtime features
same-layer circular routergraph appears to have one route and one adapterroute predicted from output that already depends on routeuse layer input, metadata, or explicit prior pass
fake sparse token routetop- IDs are loggedall adapter outputs computed before masktrace packed rows and omitted tensor reads
selected-axis bugglobal selected gates sum to oneBoolean indexing flattened rows before softmaxnormalize independently per logical route row
stale K/V acceptedcache dimensions matchroute state omitted from cache identityinvalidate/rebuild or prove unaffected dependency cone
MixLoRA called token routingper-token outputs differ after base attentionone instance matrix was broadcast across rowstrace selector input and selected-ID shapes
MiLoRA called global routingone request has one route objectobject contains different layer/module choicesinspect internal route axes, not container count
dense X-LoRA called sparsemany gates are smallevery adapter remains in the forward loopcount branch matmuls and tensor reads

Loop 8 closes routing semantics and persistent state. It does not claim to execute a GPU kernel, reproduce paper benchmarks, or close Loop 9 runtime packing.

0x07M Loop 9 Handoff Sketches

The following sketches are deliberately incomplete. They show the data that Loop 9 must consume; they are not yet a launch, traffic, occupancy, or scheduler proof.

0x07M.1 Independent Factors

def routed_lora_independent(x, route_ids, route_gates, adapters):
    # x: [T, d_in], route_ids/gates: [T, k]
    plan = build_route_plan(route_ids)
    # Every entry binds (token_row, route_slot, expert_id, local_row).
    packed_x = gather_rows(x, plan.token_rows)

    packed_dy = empty_output(plan.num_routes, adapters.d_out)
    for expert_id, segment in plan.expert_segments:
        adapter = adapters.pin(expert_id)
        z = segment.rows @ adapter.A.T
        segment.output = adapter.scale * (z @ adapter.B.T)

    packed_dy *= route_gates[plan.token_rows, plan.route_slots, None]
    return scatter_add(packed_dy, plan.token_rows, output_rows=x.shape[0])

0x07M.2 Shared A

def routed_lora_shared_a(x, route_ids, route_gates, shared_A, B_experts):
    z = x @ shared_A.T                     # [T, r], once per row
    plan = build_route_plan(route_ids)
    packed_z = gather_rows(z, plan.token_rows)
    packed_dy = grouped_expert_linear(
        packed_z,
        expert_ids=plan.expert_ids,
        local_offsets=plan.local_offsets,
        expert_weights=B_experts,
    )
    packed_dy *= route_gates[plan.token_rows, plan.route_slots, None]
    return scatter_add(packed_dy, plan.token_rows, output_rows=x.shape[0])

Shared A removes repeated input projections. It does not remove row packing, expert-specific B reads, gate weighting, inverse scatter, residency, or version checks.

0x07M.3 Persisted Prompt Route

def decode_step(request, x_t):
    route = request.persisted_route
    assert route.signature == request.kv.execution_signature.route
    assert all_exact_adapter_versions_resident(route)
    return base_linear(x_t) + apply_layer_local_adapter_route(x_t, route)

0x08 Runtime Execution: From Logical Routes To Versioned Work

Loop 8 ended with logical route IDs, gates, decision lifetime, and K/V provenance. Those records still do not execute a low-rank branch. Loop 9 owns the missing transformation:

logical route rows
    -> route occurrences
    -> stable physical plan
    -> grouped low-rank work
    -> gate and scatter
    -> versioned completion under an M6.5 lease

The owner boundary matters. M6.5 owns adapter admission, paging, resident slots, request scheduling, hotswap publication, K/V compatibility, and reclamation. This section consumes those services. It owns only the additional work created when one row can select several adapters, when factors may be shared, and when route metadata changes by token or layer.

Four-panel runtime contract tracing route occurrences into stable expert segments, comparing independent and shared-A execution, binding launches to generations and leases, and separating six physical execution alternatives.

0x08A Runtime ABI: A Row Can Produce Several Occurrences

Let the layer input be . For row , the router supplies a selected support , adapter IDs , and selected-axis gates . The number of physical route occurrences is

Only under fixed top- without capacity rejection is . An overflow or base-only row can make ; an all-expert soft mixture makes . The physical ABI therefore flattens selected pairs rather than pretending that every batch has the same work:

token_row   [R] int32
route_slot  [R] int32
expert_id   [R] int32
local_row   [R] int32, assigned after packing
gate        [R] compute or accumulation dtype
scale       [R] or one scale per expert

For the teaching route

t0 -> (e0, .75), (e2, .25)
t1 -> (e1, .60), (e0, .40)
t2 -> (e2, .50), (e1, .50)
t3 -> (e0, .80), (e1, .20)

the row-major occurrence IDs are . A stable sort by (expert_id, token_row, route_slot) gives

permutation:       [0, 3, 6, 2, 5, 7, 1, 4]
segment experts:   [0, 1, 2]
segment offsets:   [0, 3, 6, 8]

The first segment contains three copies of input rows for expert 0. The second contains for expert 1. The final segment contains for expert 2. This is not a token permutation alone: one token can occur in two segments.

One exact pack plan is:

def build_route_plan(route_ids, route_gates, expert_count):
    occurrences = []
    for token_row, (ids, gates) in enumerate(zip(route_ids, route_gates)):
        for route_slot, (expert_id, gate) in enumerate(zip(ids, gates)):
            occurrences.append({
                "token_row": token_row,
                "route_slot": route_slot,
                "expert_id": expert_id,
                "gate": gate,
            })

    perm = stable_argsort(
        occurrences,
        key=lambda r: (r["expert_id"], r["token_row"], r["route_slot"]),
    )
    offsets = histogram_prefix_sum(
        [occurrences[p]["expert_id"] for p in perm],
        expert_count,
    )

    for local_row, occurrence_id in enumerate(perm):
        occurrences[occurrence_id]["local_row"] = local_row

    return occurrences, perm, offsets

Sorting is one implementation, not a mathematical requirement. A bounded expert pool can use histogram counts, prefix sums, and a stable scatter. A direct-indexed kernel can retain row-major occurrences and fetch factors by expert_id. Whichever plan is chosen, (token_row, route_slot) -> (expert_id, local_row, gate) must remain invertible until scatter-add completes. Indexing an expert-major output buffer by original token ID is wrong.

0x08B Independent-Factor Forward: Pack, Shrink, Expand, Scatter

For independent factors

one occurrence computes

and the adapter output is

scale here is the LoRA scale , not the router gate. Folding into or can remove one runtime multiply, but it changes artifact and pointer-table identity. The plan must say where scale lives.

The grouped schedule is:

def independent_route_forward(X, plan, factors):
    delta = zeros([X.rows, factors.d_out])

    for expert_id, begin, end in plan.segments:
        occurrence_ids = plan.permutation[begin:end]
        token_rows = [plan.occurrence[q].token_row for q in occurrence_ids]
        X_j = gather_rows(X, token_rows)                 # [R_j, d_in]
        Z_j = X_j @ factors[expert_id].A.T              # [R_j, r]
        D_j = Z_j @ factors[expert_id].B.T              # [R_j, d_out]

        for local, occurrence_id in enumerate(occurrence_ids):
            row = plan.occurrence[occurrence_id]
            coefficient = row.gate * factors[expert_id].scale
            delta[row.token_row] += coefficient * D_j[local]

    return delta

The scalar coefficient may be applied to before the linear expansion or to afterward because

That algebra does not authorize moving token-dependent dropout, nonlinear normalization, or a vector-valued gate across . It also does not eliminate the need to retain the coefficient for router and factor gradients during training.

0x08C Shared A: Reuse Proof And Its Exact Preconditions

HydraLoRA-style ownership changes the operator to

Because every selected branch consumes the same and the same row , compute

once per token, gather by route occurrence, and group only the expansions. This is exact because substitution gives

It is not valid merely because several independently owned tensors happen to start with equal values. After one optimizer step, separate moment state or gradients can make them diverge. Reuse requires all of the following at the launch boundary:

the same A storage/version and multiplication orientation
the same input row before A
the same dropout mask or inference-time identity dropout
compatible logical and physical rank
compatible placement of LoRA scale
no branch-local nonlinear operation between A and B

With route occurrences, the arithmetic ledgers are

so the saved shrink work is

For fixed top-, this reduces to . In the exact fixture, , , , , and :

independent factors:  2 * 8 * 2 * (3 + 2) = 160 FLOPs
shared A:             2 * 4 * 2 * 3 + 2 * 8 * 2 * 2 = 112 FLOPs
saved shrink work:    48 FLOPs

These are arithmetic counts under the article’s multiply-add convention, not latency predictions.

0x08D Packed Backward: Segment Reductions And Shared Ownership

Let . For occurrence , define

For independent factors, and the local derivatives are

The selected gate derivative before the selected-axis softmax is assembled from

Loop 3 owns the softmax Jacobian and centered router credit. This packed backward holds the discrete top- support fixed. It does not claim a derivative through support changes at a tie or selection boundary.

For shared , compute all branch-local as above, then reduce by source token:

Only after that reduction are the shared-factor gradients valid:

Computing one dA per expert and applying the optimizer three times would violate shared ownership even if all three arrays alias the same storage. A kernel may use segmented reductions, block-local accumulation, atomics, or a second reduction pass; the mathematical owner remains one shared gradient tensor.

def shared_A_backward(X, G, plan, A, B, scales, saved_Z):
    dB = zeros_like(B)
    dZ = zeros([X.rows, A.rank])
    dgate = zeros([plan.route_count])

    for q in plan.occurrences:
        t, j = q.token_row, q.expert_id
        z = saved_Z[t]                         # or recompute A @ X[t]
        u = q.gate * scales[j] * G[t]
        dB[j] += outer(u, z)
        dZ[t] += B[j].T @ u
        dgate[q.id] = scales[j] * dot(G[t], B[j] @ z)

    dA = dZ.T @ X
    dX_adapter = dZ @ A
    return dX_adapter, dA, dB, dgate

The Loop 9 oracle checks this backward against three independently represented clones of the same , sums the three clone gradients, and then checks , shared , selected , and gate coordinates by centered finite differences. The maximum teaching error is below .

0x08E Workspace, Traffic, And Liveness

The FLOP count hides several physically different schedules. If route occurrences are packed explicitly, a conservative workspace ledger contains

for token row, route slot, expert ID, local row, and one gate. Materializing packed inputs and both low-rank intermediates adds

An indexed batched-matrix implementation that copies every selected factor pair adds

A direct-indexed kernel can make this particular copy term zero by loading the selected factors through expert_id. It still reads those factors from memory, still needs route indices, and can suffer irregular access or poor small-matrix utilization. “No selected-factor copy” is not “no factor traffic.”

The fixture uses four 32-bit indices and one FP64 gate per occurrence, so requires 192 bytes of metadata. FP64 occurrence intermediates require 128 bytes each for and . Copying eight selected FP16 factor pairs at , , and requires another 160 bytes. The numbers are tiny because the fixture is tiny; the formulas, not the byte magnitudes, are the reusable contract.

Training introduces a liveness decision:

PolicySaved forward stateBackward workRisk
save independent bytesreuse each occurrence projectionactivation growth with
recompute independent route plan and repeat about FLOPsfactors and dropout state must match
save shared bytesreuse once-per-token projectionexact only under shared-A contract
recompute shared route plan and repeat about FLOPssame deterministic-state requirement

If dropout was active before , recomputation must reproduce its mask or checkpoint the post-dropout input. If an adapter or router generation changes between forward and backward, recomputation is invalid even when shapes still match.

0x08F Prefill And Decode Are Different Regimes

For prefill, is often the sum of prompt rows admitted to the target layer. Larger segments can make grouped matrix work efficient, but selected-factor copies and -scaled intermediates grow with prompt length. For one-token decode, is approximately the number of active requests. Segments can be very short, so host dispatch, sorting, pointer assembly, and launches can dominate the low-rank arithmetic.

prefill teaching regime:
    T=128, k=2 -> R=256 route occurrences
    many rows can amortize one grouped launch

decode teaching regime:
    T=16, k=2 -> R=32 route occurrences
    one row per active request; route skew can create tiny segments

Sequence routing can group requests by a route signature

but exact floating-point gates can create many unique signatures. Rounding or quantizing gates to improve batching changes the function and needs its own quality evaluation. Token routing cannot assume one signature persists across rows unless Loop 8’s route policy proves it.

Measurements must separate at least:

router time
route expansion and plan construction
residency/admission wait
pack or factor-index preparation
shrink and expand kernels
gate and scatter/reduction
prefill versus decode
cold versus warm adapter state

0x08G Residency, Generations, Leases, And K/V Handoff

A physical plan is valid only for the M6.5 state snapshot from which it was built. Bind the request to semantic revisions first, acquire resident slots and leases second, then record a launch snapshot:

base revision
router revision
selected adapter artifact versions
catalog generation
slot generation for every selected adapter
pointer-table generation for every selected adapter
route-plan generation
route/KV execution signature
def execute_routed_layer(request, X, route_state, runtime):
    assert route_state.digest == request.kv.execution_signature.route_digest
    assert route_state.router_revision == request.router_revision

    lease = runtime.acquire_exact_adapter_set(
        versions=route_state.selected_adapter_versions,
        deadline=request.deadline,
    )
    try:
        plan = build_route_plan(route_state.ids, route_state.gates, lease.pool_size)
        launch = runtime.snapshot(lease, plan.generation)

        assert launch.catalog_generation == request.catalog_generation
        assert launch.slot_generations == lease.slot_generations
        assert launch.pointer_generations == lease.pointer_generations

        delta = routed_low_rank_kernel(X, plan, launch.pointer_table)
        event = runtime.record_last_use(lease)
        return base_linear(X) + delta, event
    finally:
        runtime.release_after_last_use_event(lease)

The lease must cover plan construction through the final kernel use. Otherwise an adapter can be evicted or a slot can be republished after its pointer enters the plan but before the GPU consumes it. Comparing only adapter names is insufficient because one alias can resolve to a new artifact generation.

Even when adapters do not target K or V directly, their residual updates can change later hidden states that produce K/V. A cached prefix therefore belongs to

Deterministic token routing may reconstruct historical routes from the same inputs and exact revisions rather than serializing every row. The cache still needs a digest proving that reconstruction contract. Sequence/prompt routing should persist the resolved route explicitly. Never continue an in-flight request with a newly published adapter generation and old K/V.

A miss on one selected adapter has only three honest outcomes: wait/admit it, reject/defer the request, or enter an explicitly evaluated degraded mode. Silently replacing it with a default adapter changes the function.

0x08H MeteoRA: Indexed BMM Versus Direct Factor Indexing

MeteoRA Figure 2 showing a token router, frozen base layer, top-k selected LoRA branches, and weighted output.

Primary-source figure. MeteoRA Figure 2, arXiv:2405.13053/ICLR 2025. It supports the routed LoRA architecture and top- branch combination. It does not reproduce the paper’s latency, memory, or task-quality measurements.

MeteoRA exposes three implementation contracts for the same logical token-routed operator.

  1. Loop over adapters. Select each expert’s rows and run small matrix multiplications. The paper argues that this underutilizes hardware when each expert receives few rows, especially in decode when .
  2. Indexed batched matrices. Flatten selections, index the corresponding factor pairs, and execute two BMMs. This parallelizes the arithmetic but materializes selected-factor copies.
  3. Direct-indexed Triton kernel. Load the selected factor pair through the route ID inside the kernel, block the vector-by-low-rank products, and avoid the explicit factor-pair allocation.

The distinction is visible in the pinned official repository at revision 2d192ad. The traced Torch path performs

selected_loras = selected_loras.view(-1)
blora_A = lora_A_weights[selected_loras].contiguous()
blora_B = lora_B_weights[selected_loras].contiguous()
torch.bmm(torch.bmm(X_occurrence, blora_A), blora_B)

whereas the traced Triton v4 path passes the factor pools and flattened selected IDs to a kernel that indexes each selected factor. The repository also contains distinct backward kernels. That is useful implementation evidence, but this article did not compile or run those GPU paths.

MeteoRA’s paper reports an average speedup of roughly for its indexed Torch BMM over its original loop in its experiments, while its Triton path retains much of that time improvement with lower selected-factor-copy memory. Those are source-reported results under the paper’s shapes and hardware. They are not a universal ranking against M6.5’s Punica/S-LoRA paths, and they are not reproduced here.

0x08I LoRA-Switch: Change The Route Contract To Change The Kernel

LoRA-Switch Figure 2 contrasting routed adapter training with token-by-token fused backbone switching during decoding.

Primary-source figure. LoRA-Switch Figure 2, arXiv:2405.17741. It supports the paper’s pre-gated architecture, fused weight-switching path, and different training/decode graphs. It is not evidence that arbitrary layer-local routed adapters can use the same kernel.

LoRA-Switch changes the model before it changes the kernel. It places a top-2 router at the first expanded linear layer and reuses that token route for all later expanded layers. If is adapter ‘s update for layer , the fused weight for token is

Because the current fused weights already contain the previous token’s route, the next state can be written

The paper concatenates the negative previous and positive current factors, then applies the updates for many layer matrices through one segmented gather matrix multiplication (SGMM) launch. Pointer and shape arrays describe heterogeneous layer segments; tiled work and double buffering address launch and loading overhead.

That schedule is not a drop-in optimization for arbitrary M6.9 routes:

required by LoRA-Switch:
    route known before all expanded layers
    same token route reused across those layers
    mutable fused weight state carried between decode steps
    explicit previous-route state for subtraction

not provided by a generic layer-local router:
    future layer routes before those layers execute
    one shared route across target matrices
    permission to mutate a multitenant shared base in place

In a batched server, requests can choose different routes. One globally mutated fused backbone cannot represent all request-specific weights simultaneously. A production integration would need route-homogeneous batching, isolated weight replicas, another indirection, or a different kernel. M6.5’s immutable-generation and lease rules still apply to whichever physical state is chosen.

0x08J Paper-By-Contract Runtime Comparison

PathLogical route preserved?Selected factor handlingIntermediate/workspaceTraining support in this auditMain regime/risk
Python expert loopyesone expert at a timerow-index lists and many launchesreference onlytiny segments and launch overhead
M6.5 sort/segmentyespointer per expert segmentpermutation, offsets, packed rowsexact CPU oracle; GPU wrapper owned by M6.5route planning and segment skew
MeteoRA indexed BMMyescopies selected pairs factor-copy bytespinned forward/backward source inspectedmemory grows with route occurrences
MeteoRA direct Tritonyesindexes pools in kernelmasks, blocked temporaries, route IDspinned code inspected, not executedlayout constraints and irregular loads
exactly shared yes under stated object graphone projection, routed plus B segmentsexact forward/backward oraclerepresentational and optimizer coupling
LoRA-Switch SGMMpaper’s pre-gated routeupdates many layer weights before forwardprevious/current route and fused weightspaper algorithm audited, kernel not runarchitecture change and mutable weight state
dense all-expertyes for dense gatematerializes all branchesall expert outputs or streaming sumlogical referencetop- name does not prove this work vanished

No row in this table is universally best. The decision depends on route lifetime, factor sharing, rank, segment size, prefill/decode mix, resident pool, training needs, and whether changing the architecture is allowed.

0x08K Executable Oracle And Failure Closure

The checked-in runtime_execution_fixture.json and runtime_execution_oracle.py produce runtime_execution_report.json and make the section executable without claiming a GPU benchmark. The oracle proves:

R=8 route occurrences and segment offsets [0,3,6,8]
dense row-major reference == stable grouped pack/scatter
output is invariant to within-segment occurrence order
shared-A schedule == independent clones only when every A is identical
replacing unequal A_j with one shared A changes the output
shared dA == sum of cloned independent dA_j
shared dB and dX match the cloned independent graph
selected X, A, B, and gate gradients match centered finite differences
all selected adapters are resident under valid generation-bound leases
route state matches the K/V execution signature

Its work report records 160 independent-factor FLOPs, 112 shared- FLOPs, 192 bytes of route metadata, 160 bytes of teaching FP16 selected-factor copies for indexed BMM, and zero copy bytes for direct indexing while retaining factor reads. All GPU, latency, throughput, production-scheduler, and paper-benchmark claims remain false.

The generated one-field mutation corpus rejects changes to dimensions, route IDs or gates, factors, sharing preconditions, source digests, residency, slot or pointer generations, leases, K/V identity, execution alternatives, regimes, and claim ceilings. Loop 10 will consume this exact report rather than reconstructing the runtime graph from prose.

0x09 Cross-Contract Oracle: Compose State Without Collapsing Methods

Loops 2-9 each close one local question. That is necessary but not sufficient for a runnable system. A route can be numerically correct while naming the wrong adapter generation. A valid shared factor can be paired with a training history that produced independent factors. A correct continual checkpoint can be reopened under a reordered task lineage. An exact static merge can be attached to a live router even though those two composition contracts are mutually exclusive.

Loop 10 therefore asks a different owner question:

Can one request be traced from immutable model identity through training provenance, factor ownership, composition, continual state, route state, physical execution, K/V provenance, and rollback without silently substituting one method’s contract for another?

The answer is not one universal routed-adapter schema. The answer is a typed compatibility graph whose legal paths remain distinct.

Four-panel cross-contract oracle replaying Loops 2 through 9, separating four legal adapter lifecycle lanes, tracing one shared-A request identity, and distinguishing artifact rollback from publication-generation and K/V identity.

0x09A A Contract Is A Typed Product, Not A Bag Of Fields

Represent one deployable adapter state as

where

I_B  base model, config, tokenizer, and target-module identity
I_M  method family and paper/code contract
I_T  training lifecycle, trainable set, frozen set, and optimizer provenance
I_F  factor topology, rank, orientation, scale, storage owner, and versions
I_C  static or dynamic composition contract and artifact lineage
I_S  ordered continual state, task lineage, selector, and parent chain
I_R  route scope, support, gates, persistence, and causal feature provenance
I_E  physical plan, residency, slots, pointers, generations, and leases
I_K  K/V and prefix provenance affected by the routed model state

The tuple is typed. none is a valid value only when the selected lane does not own that state. Static fusion has no online router; a HydraLoRA-style shared-factor transaction has no O-LoRA task chain; O-LoRA has no attentional selector; AM-LoRA’s softmax selector does not imply a sparse physical plan.

Separate semantic and execution identities:

H is SHA-256 over canonical, typed, length-preserving serialization in the teaching oracle. A production system may use another collision-resistant content-addressing scheme. It must not hash an ambiguous concatenated string, omit field names, or treat two equal-shaped tensors as one object.

Runtime generations do not change the abstract function by themselves. They still belong to because they decide which concrete slots and pointer-table rows the launch may dereference. This is why a rollback can restore the old function while producing a new execution identity.

0x09B Replay Before Composition

The Loop 10 oracle imports every prior fixture and oracle, rebuilds every report, compares the result with the checked-in report, and validates four immutable file digests per loop:

Loop 2: adapter-family identity
Loop 3: common routed operator and fixed-support gradients
Loop 4: method-specific training states
Loop 5: independent/shared-A/shared-B ownership and hypothesis class
Loop 6: static/dynamic composition, quantization order, and artifact identity
Loop 7: ordered continual state and evaluation matrix
Loop 8: route lifetime, causality, persistence, and K/V provenance
Loop 9: route occurrences, physical execution, backward, and leases

For loop , let , , , and denote the fixture, oracle, report, and contract bytes. Admission requires

and

The semantic digest stored inside is checked separately from the JSON file digest. The first identifies the report’s canonical meaning; the second catches serialization or checked-in byte drift. Loop 10 refuses to compose stale prose with current fixtures or current prose with stale reports.

The exact fixture admits four lanes. They share the frozen-base deployment envelope, not a training algorithm or runtime graph.

LaneTraining provenanceFactor topologyCompositionRoute and materializationRelease state
shared-A selectedjoint asymmetric trainingone owned , several dynamic input-conditionedselected top-2 route occurrences; pack routed base + router + shared + pool
static fusionpost-training fixed coefficientsindependent exact delta-space block concatenationno online route; one fixed child deltaversioned merged or unmerged child
O-LoRA orderedsequential tasksordered task-factor pairsscale-aware cumulative concatenationglobal cumulative update; no selectorordered parents or exact deltas required for rollback
AM-LoRA selectorsequential tasks plus selectortask pairs plus zero branchdynamic attentional mixturedense softmax; all nonzero task branches in the teaching pathordered history plus selector state

A compact legality predicate is

This notation does not reduce compatibility to nine undocumented booleans. Each predicate has concrete checks:

P_B: exact parent base/config/tokenizer/target identity
P_M: method key resolves to one frozen paper/code contract
P_T: trainable and frozen sets match that method and stage
P_F: ranks, orientations, scales, ownership, and versions are compatible
P_C: dynamic routes are not packaged as static deltas; static coefficients are fixed
P_S: task order, parents, selector, and continual state identity agree
P_R: route features are causal and route lifetime/persistence is explicit
P_E: selected artifacts are resident under generation-bound leases
P_K: route/model state matches the cache and prefix execution signature

The predicate is intentionally stricter than shape checking. Every lane uses low-rank matrices, but that common shape does not make its factor owners, route scopes, update histories, or release artifacts interchangeable.

0x09D End-To-End Shared-A Request Transaction

The executable path uses the Loop 9 teaching tensors and the local shared_a_selected lane. It is not a reproduction of HydraLoRA training or a MeteoRA benchmark. It composes the already proved shared-A topology with the already proved selected-route runtime.

The request binds:

request                         request-loop10-0001
base                            teaching-base-r17
router                          teaching-router-r9
route-plan/catalog generations 41 / 31
selected adapter versions       adapter-0-r5, adapter-1-r3, adapter-2-r8
slot generations                11, 12, 13
pointer-table generations       21, 22, 23
shared-A storage/generation     shared-A-storage-r17 / 17
route/KV state digest           3d37e7...44c721
route occurrences               8 in three expert segments

The transaction identity is

The exact teaching digest is:

a3593145c02635cf0b76d2035453c0ee8fdd3d2655567bd38a517ebb08f3604a

It identifies the whole request binding, not the adapter checkpoint alone.

One transaction trace is:

def execute_bound_shared_a_request(request, registry, cache):
    lane = resolve_exact_lane("shared_a_selected")
    assert lane.training_lifecycle == "joint_asymmetric_training"
    assert lane.factor_topology == "shared_A_multiple_B"
    assert not lane.static_merge_legal

    model_state = bind_model_identity(
        base=request.base_revision,
        router=request.router_revision,
        factor_pool=request.selected_adapter_versions,
        shared_A=(request.shared_A_storage_id, request.shared_A_generation),
    )
    assert model_state.semantic_id == request.expected_model_id

    route = bind_route(
        ids=request.route_ids,
        gates=request.route_gates,
        generation=request.route_plan_generation,
    )
    assert route.digest == cache.execution_signature.route_state_digest

    leases = registry.acquire_exact_versions(
        request.selected_adapter_versions,
        slot_generations=request.slot_generations,
        pointer_generations=request.pointer_table_generations,
    )
    try:
        assert all(lease.valid for lease in leases)
        assert one_exact_shared_A_owner(leases)
        plan = stable_route_occurrence_plan(route)
        delta = execute_shared_A_pack_segment_scatter(request.X, plan, leases)
        record_last_use_event(leases, delta)
        return request.base_output + delta
    finally:
        release_only_after_last_use(leases)

The report reproduces the Loop 9 shared-A output:

[[-0.1875,  0.0000],
 [-2.6000,  2.1000],
 [-0.3750,  2.2500],
 [-2.4000,  1.5000]]

Its output digest is:

1f5e91f4aab7bea475dd00644f4bf0f9588cab039c28204f9a21325743618f45

The plan retains eight occurrences, the shared-A schedule saves 48 arithmetic FLOPs in the tiny fixture, and the maximum finite-difference error is approximately . None of those facts measures production latency.

0x09E Backward And Optimizer Ownership Survive Composition

An integrated forward does not authorize mixing training objectives. The shared-A lane consumes:

Loop 3: selected-axis gate derivative on fixed support
Loop 5: one shared A owner and coupled branch gradients
Loop 9: per-occurrence dB, token-reduced dZ, one dA, and one dX

It does not automatically consume LoRAMoE’s localized balance objective, Mixture-of-LoRAs domain supervision, MoLE’s candidate-output gate, O-LoRA’s orthogonality penalty, or AM-LoRA’s selector penalty. Those losses belong to different method states from Loops 4 and 7.

For a legal shared-A step, the ownership graph is

The optimizer receives one parameter identity, one gradient, and one set of moments. Replacing that state with three equal-valued independent tensors is illegal even when the current forward is equal: the optimizer objects and future trajectories differ.

The route derivative still holds support fixed. A full training transaction must additionally record the top- support, tie policy, gate dtype, balance objective, and whether the router’s input path itself depends on routed outputs. Loop 3 remains the diagnostic owner when that gradient fails.

0x09F Composition And Continual State Are Lane-Specific

The static lane may materialize

by exact block concatenation before later rounding. Its router is none, its route lifetime is artifact_global, and its runtime can use an ordinary fixed child weight. Retaining an online router in that release would make the artifact description internally contradictory.

The shared-A and AM-LoRA lanes are input-conditioned. Loop 6’s additivity witness has residual norm , so one global static matrix does not represent that dynamic witness. Factor-coordinate linear averaging is not a repair: its cross-term norm is in the exact fixture and changes under a gauge transform.

O-LoRA and AM-LoRA both carry ordered state, but they still do not share a runtime:

O-LoRA:
    cumulative update, no selector
    exact homogeneous block concatenation
    scale-aware blocks required when scales differ

AM-LoRA:
    task adapters plus zero branch and mutable raters
    adapter-axis softmax
    three nonzero task branches per row in the teaching state
    zero hard-zero gates, despite L1 pressure

The continual state identity is

For the exact fixture, the original state digest begins 87c42c59...; reordering the same task records produces 2b55c98b.... Same members plus a different order is a different continual state. A resume path must reject the reordered state before loading optimizer moments or selector parameters.

0x09G Publication, Drain, And Rollback

The local transition has three monotonically increasing plan generations:

generation 41: adapter-0-r5, adapter-1-r3, adapter-2-r8
generation 42: adapter-0-r5, adapter-1-r4, adapter-2-r8
generation 43: adapter-0-r5, adapter-1-r3, adapter-2-r8  # rollback publication

Generation 42 accepts new requests only after publication. Requests already bound to generation 41 retain their old leases until their last-use events complete. Rollback does not mutate generation 42 in place; it publishes the old artifact set as generation 43.

Let be the ordered artifact-version tuple and the publication identity. Then

but

because the publication generation and lifecycle history differ. Functional rollback is not temporal erasure.

The conservative cache rule is correspondingly strict:

generation-42 K/V is not reusable after rollback
generation-41 K/V is not silently relabeled generation 43
reuse requires an explicit semantic compatibility proof
old in-flight generation-41 requests may finish under their original leases

Some architectures may prove that an adapter change does not affect a specific cache dependency cone. That narrower proof can relax the rule. Shape equality or restored adapter filenames cannot.

0x09H Same-Shape Counterfactuals

The integrated oracle carries eight substitutions that remain shape-correct but violate ownership or lifecycle semantics.

SubstitutionWhy tensors still fitWhy the transaction rejects it
package dynamic route as static mergeevery delta has the same matrix shapeinput-conditioned operator fails the fixed-matrix/additivity contract
use factor-linear average as delta sum and shapes remain legalcross terms appear and result is gauge-sensitive
reuse shared-A schedule for unequal each is one projection no longer equals branch-local projections
call AM-LoRA softmax sparse executiongates are finite and normalizedall three task branches remain nonzero/materialized
naively concatenate heterogeneous O-LoRA scalesblock dimensions matcheffective delta differs by in the witness
reorder continual tasks under old state IDall parent records remain presenttask order changes state identity and selector history
reuse K/V after route changecache tensor shapes matchroute provenance digest changes
infer skipped work from top- gatessupport contains two IDsno physical plan or tensor-read trace proves omission

This is the main value of the cross-contract oracle: local equations can all be right while the assembled system is wrong.

0x09I Selection Logic After Contract Closure

NeedConservative designMore adaptive designAdded contract
known disjoint tasksexternal task ID + one adapterlearned request routerrouter identity and route persistence
heterogeneous corpusone larger LoRAjoint routed expertscoupled expert/router training state
reduce routed parametersindependent small expertsexactly shared A or Bshared storage and optimizer ownership
combine trained adaptersevaluated static delta compositioninput-conditioned gatedynamic artifact and runtime route state
continual retentionimmutable adapter per taskorthogonal or attentional stateordered parent chain and selector provenance
simple servingone approved merged childlive token routingoccurrences, kernels, generations, leases, and K/V identity

The correct baseline is often not another router. Reliable external task identity can make explicit request-level selection easier to evaluate and serve. A single higher-rank adapter can avoid router and packing overhead. A routed training system can also be distilled into one approved static artifact, but M6.10 owns that model-transfer objective and its quality contract.

0x09J Executable Oracle And Mutation Closure

The checked-in cross_contract_fixture.json and cross_contract_oracle.py produce cross_contract_report.json. The report:

replays exact upstream reports:             8 / 8
legal lifecycle lanes reconciled:           4 / 4
integrated checks passing:                 16 / 16
same-shape counterfactuals rejected:        8 / 8
route occurrences / expert segments:       8 / 3
shared-A arithmetic saved in fixture:      48 FLOPs
shared-A finite-difference maximum error:   7.11e-10
publication generations:                   41 -> 42 -> 43
one-field negative fixtures rejected:      222 / 222

Every scalar in the Loop 10 fixture receives a one-field mutation. The suite separately classifies source, identity, lane, route/factor/runtime, continual, composition, publication/rollback, and claim-ceiling drift. Prior-loop numerical fixtures remain owned and diagnosed by their original tests; Loop 10 proves composition rather than replacing them with one opaque test.

The claim ceiling remains narrow. No paper training run, checkpoint, framework autograd path, GPU kernel, production scheduler, latency, throughput, quality result, or benchmark is reproduced. Loop 11 still owns broad evaluation and injected-failure closure; Loop 12 owns final publication reconciliation.

0x0A Evaluation, Failure Recovery, And Static Publication Closure

Loops 2-10 answered whether a declared routed-adapter state is internally coherent. They did not answer whether one state is better than another. That second question needs a different contract. A quality score without the candidate’s parent checkpoint, training history, route scope, active budget, evaluation split, nuisance coordinates, and runtime state is not an evaluation record. It is a number detached from the system that produced it.

Loop 11 therefore owns three publication-facing surfaces and no new mechanism:

evaluation design:       which typed states may be compared, under which estimand
failure closure:         which invariant failed, who repairs it, and what proves recovery
static evidence surface: which sources, links, figures, and assets support the article

It consumes the exact Loop 10 transaction rather than constructing a new method state. It does not execute paper training, a framework model, a GPU kernel, a production scheduler, or a benchmark. The checked numbers below are synthetic teaching records used to test the evaluation algebra and publication schema.

0x0AA Candidate Lanes Are Not Automatically Comparable

The candidate identifier must include the complete parent state:

Two candidates with the same rank and tensor shapes can still have different frozen specialists, supervision, task order, route lifetime, selected-branch materialization, or publication generation. A comparison table must not erase those coordinates.

The Loop 11 design freezes six inference candidates:

CandidateQuestion it can answerRequired matchingInterpretation limit
one mixed rank-16 adapteris routing worth its extra state?trainable budget, targets, data, optimizerdifferent hypothesis class from specialists
oracle task-ID specialistswhat if reliable task identity were available?exact specialist artifactsupper-bound control, not task-ID-free routing
uniform shared- mixturedoes the learned router add value over fixed mixing?same shared , , materializationdense fixed control, not sparse execution
learned shared- top-2does input-conditioned selection help?same parent factors and route budgetdynamic route cannot become one fixed matrix
exact static fusion childwhat does a fixed release artifact trade away?same parent deltas and conversion policydeployment alternative, not the same function
AM-LoRA dense selectorhow does continual attentional composition behave?ordered task state and selector lineageall nonzero branches remain physical work

No single ordering of these six rows is scientifically meaningful. The oracle-task control uses information the learned route may not have. The static child removes route overhead by changing the function class. AM-LoRA consumes an ordered continual state. The one-adapter control changes capacity allocation. The valid output is a set of predeclared contrasts, not a universal adapter leaderboard.

Evaluation transaction separating typed candidate lanes, paired nuisance coordinates, validation-only selection, candidate freeze, and independent quality, routing, runtime, and continual reports.

0x0AB Freeze Unit, Workload, Nuisance, Split, And Attempt Identity

One cross-sectional evaluation cell is

where is a candidate identity, is a workload, is a paired nuisance tuple, is a split identity, and is an attempt identity. The nuisance tuple is itself structured:

The same must be used on both sides of a paired contrast. “Four seeds” is too weak if candidate A sees initialization/data-order pairs while candidate B sees a different pairing. Route tie-breaking and request order also matter because a numerically tied top-k route or a different cold-adapter arrival sequence can change physical execution without changing tensor shapes.

The design contains four fixed workloads:

domain_alpha:    target capability A
domain_beta:     target capability B
base_retention:  capability inherited from the frozen base
unseen_transfer: held-out domain not used to train the router or factors

It crosses six candidates, four workloads, and four nuisance tuples, producing synthetic quality cells. The split manifest keeps training, route-validation, candidate-selection, and held-out test identities disjoint. Missing paired cells are not replaced with a convenient new seed; the contrast remains incomplete. An infrastructure retry retains the failed attempt and may rerun only the same semantic unit. A numerical failure is an outcome, not permission to search for a better seed.

0x0AC Derive The Paired Estimand Before Looking At Scores

Let be a metric for candidate , workload , and paired nuisance tuple . Against a declared baseline , the paired difference is

Pairing removes the nuisance contribution only to the extent that the same nuisance realization affects both candidates. It does not make the result causal when training histories, information sets, or budgets differ.

For complete pairs, the mean difference is

with sample variance

and standard error

This formula does not automatically create a valid confidence interval. Workloads may not be exchangeable, repeated examples may be dependent, and four hand-picked nuisance tuples do not define a population of all training runs. The report must name the sampling unit and dependence assumptions before attaching inferential language. Otherwise it should publish the paired values, mean, dispersion, and missingness without calling the interval a confidence statement.

The teaching matrix deliberately uses a common nuisance offset, so the paired difference is easy to audit:

CandidateMean synthetic qualityPaired difference from one mixed adapterWhat the number proves
one mixed adapter0.71750.0000arithmetic baseline only
oracle specialists0.7725+0.0550paired-summary implementation
uniform shared-0.7150-0.0025paired-summary implementation
learned shared- top-20.7575+0.0400paired-summary implementation
exact static child0.7375+0.0200paired-summary implementation
AM-LoRA dense selector0.7450+0.0275paired-summary implementation

These values are generated fixtures, not observations about LoRAMoE, HydraLoRA, O-LoRA, AM-LoRA, or any cited implementation. Their only purpose is to make incorrect grouping, unpaired subtraction, workload pooling, test reselection, and hidden missing-cell substitution executable failures.

0x0AD Quality Is A Vector, Not One Average

For candidate , the minimum publication unit is a quality vector

Target quality can rise while base retention falls. Oracle routing can improve a known-domain score while being unusable when the task ID is absent. A static fusion child can reduce runtime state while losing input-conditioned specialization. For that reason, Loop 11 forbids “best average quality” from silently compensating a retention or safety regression.

An actual run must predeclare:

primary target estimand and direction
non-inferiority margins for base retention and safety
unseen-domain transfer metric
calibration and decoding policy
validation-only selection rule and deterministic tie-break
one held-out opening after candidate identity is frozen
release or no-release outcome; no runner-up reselection

Parameter matching also needs two ledgers. Matched total trainable parameters controls optimizer state and artifact growth. Matched active parameters per token controls routed low-rank arithmetic. A shared- top-2 candidate and an independent-factor top-2 candidate can match active rank while differing in stored parameters and hypothesis class. Both ledgers must be visible.

0x0AE Routing Diagnostics Must Join Logical And Physical State

Let be the fraction of eligible route mass assigned to adapter . Route entropy is

indicates one selected branch in the teaching oracle, while a uniform three-branch route has . Entropy alone is insufficient: a high-entropy soft gate can still materialize every branch, and balanced route counts can still assign poor experts.

For selected occurrence counts , define

The coefficient of variation exposes load skew, but it must be reported beside domain-conditioned quality. Driving to zero can destroy specialization.

Route stability between two selected sets and can be summarized by Jaccard overlap:

The report must say what changed between and : adjacent token, layer, nuisance seed, prompt paraphrase, or publication generation. Those are different stability questions.

Finally, logical sparsity must reconcile with physical materialization:

For a correct selected top-k schedule, both counts describe the same admitted occurrences and . If all branches run before a top-k mask, the denominator must not be falsified to ; the physical ledger is . AM-LoRA’s softmax selector has no hard-zero execution claim in the teaching state, so its materialized branch count remains dense.

Required routing evidence is therefore:

gate probabilities and selected IDs by domain, token, layer, and nuisance tuple
entropy, top-k frequency, count CV, and task/domain confusion
selected versus evaluated versus materialized branch occurrences
route stability under named perturbations
expert output similarity and gradient utilization during training
quality under forced oracle, uniform, balanced, and sparse controls

0x0AF Runtime Evaluation Is Phase-Specific Measurement

A routed-adapter request decomposes into

This is an accounting identity, not permission to add overlapping GPU intervals. Events must be recorded on the owning streams, synchronized at declared boundaries, and reconciled with one end-to-end wall-clock interval. CPU queueing, adapter admission, cold copy, and GPU execution need different clocks.

Prefill and one-token decode must remain separate. Prefill has many rows and can amortize route and packing work; decode exposes launch, pointer, and selected-factor overhead at small row counts. The same candidate can win one phase and lose the other. Actual measurement must freeze:

hardware, driver, framework, kernel revision, clocks, and power policy
batch and sequence-length distribution, prompt/decode split, and request popularity
warmup count, measured repetitions, synchronization, and percentile estimator
resident versus cold-adapter state and copy overlap policy
route-signature distribution and prefix/KV compatibility policy
raw attempt records, failures, retries, and censoring

Cold-start cost is

but it is meaningful only when both terms use the same request and route state. Resident bytes, selected bytes, copied bytes, workspace bytes, and K/V bytes are separate ledgers.

The executable fixture contains twelve synthetic phase ledgers, two phases for each candidate. For example, the shared- top-2 row totals 132 synthetic prefill work units and 22 decode units, while the static child totals 112 and 12. Those numbers test phase aggregation only. They are explicitly not latency measurements, because no kernel, overlap schedule, hardware, or scheduler ran.

0x0AG Continual Evaluation Consumes The Full Task-Time Matrix

Loop 7 already derived the task-by-time matrix contract. Loop 11 consumes that exact report rather than recomputing a convenient final average. For task evaluated after learning task , retain every . Then final average accuracy, backward transfer, forward transfer, and forgetting remain different estimands:

where is the declared pre-training baseline for task . The Loop 7 teaching witness remains ACC , BWT , and FWT : the same final average coexists with negative backward transfer.

State growth is part of the result:

Report artifact, CPU, GPU, optimizer, and temporary bytes separately, together with branch materialization at inference. Evaluate oracle task-ID and task-ID-free inference as distinct protocols. A rollback test must load each immutable parent state, reproduce its declared evaluation digest, and create a new publication generation rather than rewriting history.

0x0AH Failure Injection Needs A Recovery Owner

A red flag in prose is not a closed failure. Each Loop 11 record binds ten coordinates:

loop and category
invariant
controlled fault injection
detector
consequence
recovery owner
mechanism-local executable test
release gate after repair
evidence limit that remains in force

The manifest contains four failures for every mechanism loop from 2 through 10: 36 typed failures total. It reconciles nine prior invalid-fixture families and all 1,296 one-field negatives without replacing the original tests. Loop 3 still diagnoses a wrong selected-axis softmax; Loop 6 still diagnoses a gauge-sensitive factor merge; Loop 9 still diagnoses a stale lease. Loop 11 only proves that publication cannot call the problem recovered until the named owner restores the invariant and the named local test passes.

Failure closure mapping nine mechanism loops to 36 typed failures, ten-coordinate failure records, named recovery owners, executable tests, and a static release state awaiting Loop 12.

Detection and recovery remain separate predicates:

A detected failure with no repair blocks release. A repair with no replayable test also blocks release. Passing one synthetic oracle cannot widen the claim to a paper training run, GPU implementation, or production scheduler.

The publication audit separates frozen evidence identities from routes visible to the reader:

19 Loop 1 source identities:      7 local/consumed owners + 12 primary/code records
29 exact external URLs:           every paper, official implementation, and handoff link
7 normalized local article links: all resolved to source Markdown
91 source-figure dispositions:    53 from A22 + 38 from A29
2 retained source-local figures:  A22 Figure 51 + A29 Figure 33
29 rendered visual elements:      Markdown images plus responsive picture contracts
40 desktop/mobile asset routes:   every route exists, has alt text, digest, and provenance

The 29-URL publication registry is intentionally broader than the 12-source Loop 1 core. Later loops added LoRAHub, MiLoRA, Conditional MixLoRA, SiRA, X-LoRA, GEM, Online-LoRA, TIES, DARE, MeteoRA, LoRA-Switch, PEFT, and pinned code evidence. Loop 11 does not retroactively pretend those sources were in the Loop 1 manifest; it records when and why they entered the article.

Every A22/A29 figure has a final owner and disposition. Rejection is useful evidence: a figure can be technically related yet belong to M6.3, M6.4, M6.5, M6.8, or another mechanism loop. Reusing all source images would blur article ownership instead of adding depth.

Static SVG checks verify file existence, digest, viewBox, role, title, description, and responsive-pair semantics. They do not verify browser selection, clipping, MathJax interaction, dark-theme contrast, or mobile overflow. Loop 12 owns that normalized browser evidence.

0x0AJ Executable Loop 11 Oracle And Release State

The checked-in evaluation_publication_fixture.json and evaluation_publication_oracle.py produce evaluation_publication_report.json. The exact report closes:

Loop 10 contract/report digest chain:          exact
candidate / workload / nuisance cross-product: 6 / 4 / 4
synthetic quality cells:                       96
routing profiles:                              16
synthetic prefill/decode phase ledgers:         12
typed failures:                                36
prior mechanism negatives:                  1,296
published external/local routes:              29 / 7
A22/A29 figure dispositions:                  53 / 38
responsive Loop 11 visual routes:              4
new one-field publication mutations:          30

The static release predicate is

Its state is awaiting_loop12. Browser rendering, live external availability, empirical quality, GPU runtime, production scheduling, deployment, publication acceptance, and rollback-artifact execution all remain false. Loop 12 must independently reconcile the final formula registry, source surface, responsive rendering, accessibility, and cross-article boundaries before the article is publishable.

0x0B Failure Lab

The table below remains the reader-facing symptom index. The executable failure_closure_manifest.json is stricter: it records 36 failures, four for each mechanism loop from 2 through 10, and binds every row to an injected fault, detector, recovery owner, mechanism-local test, release gate, and evidence limit. A symptom can appear in several rows when it violates different invariants. Recovery is accepted only by the original mechanism owner; Loop 11 does not replace 1,296 earlier one-field negatives with a single publication test.

FailureSymptomRoot causeRequired evidence/fix
router collapseone adapter receives almost all massearly advantage and softmax saturationgate, gradient, and output-similarity traces; balance or routing redesign
fake sparse routinglatency scales with all experts despite top-kexperts evaluated before maskingkernel trace proving unselected matmuls are absent
shared-factor bottleneckmore B experts stop improving qualitycommon A cannot represent needed input subspacescompare independent experts at matched active/total parameters
specialist overwritedomain adapter loses its original behavior during router stage”composition” stage also updated specialist factorsfreeze ablation and per-specialist regression tests
task-label leakagerouter looks excellent only with labels unavailable at inferencetraining route consumes privileged metadatatask-id-free evaluation and explicit inference contract
unsafe mergecomposed artifact silently changes after quantization/roundinglifecycle operation is order-sensitivepreserve base/deltas and test conversion order
stale route stateresumed request uses new adapter version with old K/Vhotswap ignored request provenanceversion pinning or full state invalidation
continual state explosiontask count increases latency and memory linearlyevery old adapter and selector remains activegrowth ledger, sparse execution, consolidation/distillation policy
orthogonality overclaimlow factor overlap but old-task quality fallsfactor subspace is only a proxy for functional interferencefull task-time matrix and function-space diagnostics
balance harms specializationuniform routes reduce domain qualityauxiliary objective encodes wrong utilization priordomain-conditioned utilization and quality ablation
scatter uses token ID as expert-local rowoutputs are attached to the wrong tokens after groupingroute occurrence metadata was discarded during packpreserve occurrence ID, token row, route slot, expert ID, local row, and inverse scatter
fake shared- reusepacked shared schedule disagrees with independent referencevalue-equal but independently owned , different dropout, rank, or scale policyrequire one exact shared object/version and run the unequal- counterexample
shared gradient applied once per expertshared update depends on segment order or optimizer call countbranch-local dA_j was not reduced into one shared gradientreduce all token/branch first and step one shared parameter state
selected-factor copy explosionmemory rises with prompt length, batch size, or indexed BMM materializes copies of both factorsrecord and compare direct indexing or segmentation
stale route planshape-correct launch reads a republished slotplan retained an old slot or pointer-table generationgeneration-bound lease from plan construction through the last-use event
route/KV mismatchresumed generation changes after hotswap or rerouteK/V signature omitted router, adapter, or resolved-route statereject reuse or rebuild all dependent cache state
LoRA-Switch treated as a kernel swaplayer-local model changes function or cannot know later routespre-gated cross-layer route assumption was omittedpreserve the paper architecture or choose a generic routed execution path
dynamic route packaged as a static childone artifact passes shape checks but disagrees across inputsinput-conditioned coefficients were erased during releaseretain a live route contract or distill into a separately evaluated static student
shared-A lane reopened with independent factorscurrent values agree but resumed optimizer trajectories divergestorage and optimizer ownership were inferred from tensor equalitybind one shared storage/version and one optimizer state in the model identity
continual task order changes under the old state IDall task adapters load, but selector behavior and replay history changean ordered parent chain was treated as an unordered adapter setderive a new continual-state identity and reject old optimizer/selector state
AM-LoRA soft gates called sparse executionevery branch is still materialized despite small coefficientsnumerical pressure was confused with a physical omission planreport materialized branches and require an explicit sparse execution trace
rollback relabels old K/V as the new generationshapes match after artifact restoration, but request provenance does notfunctional artifact equality was confused with publication identitypublish a new generation and require an explicit cache-compatibility proof
stale upstream evidence composed with current statelocal equations pass while the assembled transaction uses mixed revisionsfixture, oracle, report, or contract digests were not replayed before compositionrebuild all eight upstream reports and reject any file or semantic digest drift

0x0C Claim Status

ClaimStatusBoundary
LoRAMoE freezes the base, routes several low-rank experts, and uses a localized balancing constraint tied to expert/sample rolesexternally verifiedmechanism from the ACL 2024 paper; benchmark gains are source-reported
Mixture-of-LoRAs separately trains domain adapters and then learns sequence-level routing with domain supervisionexternally verifiedpaper-specific lifecycle; not universal to all “mixture of LoRA” methods
MoLE composes trained LoRA outputs with hierarchical learned gates and a gate-balancing lossexternally verifiedexact runtime cost depends on gating hierarchy and implementation
HydraLoRA shares A and routes multiple B matricesexternally verifiedthe claim that A captures universal commonality is an empirical interpretation, not a theorem
shared A reduces parameter count and permits one A projection per rowderived herefollows from tensor shapes and assumes compatible ranks/targets
an input-dependent adapter mixture cannot generally become one fixed merged matrixderived herestatic coefficients remain mergeable
block-concatenated LoRA factors exactly reconstruct a compatible weighted delta sum at rank at most the sum of input ranksderived here and checked against pinned PEFT codeexact before later rounding; output rank can become expensive
PEFT factor-wise linear/TIES/DARE paths are not generally equivalent to delta-space compositionpinned-code trace plus local derivationfactor cross terms and gauge dependence are explicit; _svd paths instead operate on delta matrices before refactoring
TIES trims task vectors, elects aggregate signs, and disjointly merges aligned coordinatesexternally verifiedpaper task-vector contract; quality gains remain source-reported
DARE’s inverse-density rescale is coordinatewise unbiasedexternally verified and derived hereone stochastic sample is not the original delta and needs reproducible randomness
quantization can make merge order and rounded unmerge observablederived teaching witnessM8 owns generic quantizer methods, calibration, and release policy
the O-LoRA paper penalizes squared Frobenius overlap between new and old low-rank factor subspacesexternally verifiedorthogonality is a proxy, not guaranteed functional retention
the pinned O-LoRA trainer uses entrywise absolute overlap plus unsquared current-factor normspinned-code tracethis numerical objective differs from the paper equation and is revision-specific
block concatenation exactly accumulates compatible O-LoRA factors while cumulative rank grows additivelypinned-code trace plus local derivationheterogeneous scales need scale-aware blocks or preserved branch metadata
exact mutually orthogonal full-rank task subspaces consume a finite ambient-dimension budgetderived herea finite penalty can leave overlap before the hard dimension ceiling
AM-LoRA freezes prior task adapters and learns a sparse-pressured attentional selectorexternally verifiedthe stronger paper ablation can continue updating prior raters; pressure does not guarantee sparse execution
ACC, BWT, and FWT require a task-by-time evaluation matrix and FWT baselinesexternally verified and derived herethe teaching matrix is not an O-LoRA or AM-LoRA benchmark reproduction
routed adapter identity belongs in KV/prefix provenanceruntime inferencefollows from M5/M6.5 state dependence; exact safe reuse can be proven for narrower architectures
a token top- route expands to $R=\sum_t\mathcal S_t$ route occurrences before grouped execution
stable pack/segment/scatter preserves the independent routed-adapter outputderived here and checked by exact oraclerequires complete route-occurrence metadata and scalar gate/scale semantics
exactly shared saves arithmetic FLOPs relative to independent factorsderived here and checked by exact oracleexcludes routing, pack, scatter, traffic, and launch overhead; requires one compatible shared object
shared- backward reduces all branch-local by token before producing one and derived here and checked by finite differencesthe discrete top- support is held fixed; Loop 3 owns router-softmax credit
MeteoRA compares adapter loops, indexed selected-factor BMM, and a direct-indexed Triton pathexternally verified plus pinned-code traceits performance numbers remain source-reported and no GPU path was executed here
LoRA-Switch uses one token pre-route across expanded layers and applies previous-negative/current-positive low-rank weight updates through SGMMexternally verifiedthis changes the model/runtime contract and is not a drop-in kernel for arbitrary layer-local routes
routed execution must bind adapter residency, slot/pointer generations, leases, and K/V route provenanceruntime integration derived from M6.5exact engine APIs vary; this article validates a teaching state machine rather than a production scheduler
all eight Loop 2-9 fixtures rebuild their checked-in semantic reports before cross-contract compositionlocal executable evidenceproves revision consistency of the teaching evidence only; it does not reproduce the cited training runs or runtime systems
shared-A selected execution, static fusion, O-LoRA ordered state, and AM-LoRA selection are four non-interchangeable lifecycle laneslocal derivation checked by the cross-contract oraclethe lanes share a frozen-base envelope, not training, routing, composition, or release semantics
the teaching transaction ID binds model, route, factor, slot, pointer, lease, and K/V statelocal executable evidencethe SHA-256 identity is a canonical teaching contract, not a prescribed production wire format
rollback can restore the generation-41 artifact tuple while still requiring a new generation-43 publication identitylocal derivation checked by the publication oraclefunctional restoration does not prove K/V compatibility or erase lifecycle history
222 one-field mutations and eight same-shape cross-lane substitutions are rejectedlocal executable evidencethe mutation corpus covers the declared fixture schema; it is not an exhaustive proof over every framework or deployment
the Loop 11 paired evaluation oracle computes 96 quality cells, 16 route profiles, and 12 phase ledgerslocal synthetic teaching evidencevalidates grouping, pairing, aggregation, and evidence firewalls only; no model, paper protocol, or GPU measurement ran
36 typed failures preserve four recovery records for every mechanism loop from 2 through 10local executable evidencecloses the declared failure inventory, not the universe of possible implementation faults
29 external URLs, seven local routes, 91 source-figure dispositions, and 40 image routes form a complete static surfacelocal static publication evidencelive availability, browser rendering, theme contrast, and final publication acceptance remain Loop 12
the Loop 11 release state is awaiting_loop12local release-state contractstatic inventory closure is not publication acceptance

0x0D Publish Gate

[x] route scope is explicit at task, sequence, token, layer, and matrix levels
[x] soft routing is not described as sparse compute
[x] factor-sharing parameter counts and subspace restrictions are derived
[x] joint, staged, and post-hoc training histories remain separate
[x] static merging is separated from input-conditioned composition
[x] plain delta addition is not incorrectly called non-commutative
[x] exact cat, delta-SVD, and factor-coordinate composition are separated
[x] TIES and DARE paper contracts are separated from PEFT factor-wise paths
[x] quantization order and stochastic identity are preserved in provenance
[x] O-LoRA paper and pinned-code losses, shapes, gradients, and initialization remain separate
[x] cumulative checkpoint concatenation includes rank, scale, resume, and rollback contracts
[x] AM-LoRA softmax axis, selector trainability, state growth, and runtime density are explicit
[x] continual retention is evaluated with ACC, BWT, FWT, forgetting, task order, and state growth
[x] route rows are expanded into invertible route-occurrence metadata before grouped execution
[x] independent and shared-A forward schedules, FLOPs, and exact sharing preconditions are derived
[x] packed independent and shared-A backward ownership is derived and finite-difference checked
[x] workspace separates metadata, packed activations, saved intermediates, and selected-factor copies
[x] prefill and decode ledgers remain separate from measured latency claims
[x] runtime plan includes residency, route metadata, slot/pointer generations, leases, batching, and KV provenance
[x] MeteoRA indexed-BMM and direct-indexed paths remain separate from M6.5 segmented serving
[x] LoRA-Switch is presented as an architecture/runtime co-design, not a generic kernel substitution
[x] Loop 9 oracle and one-field mutation corpus are checked in and GPU/benchmark claims remain false
[x] all Loop 2-9 fixtures, oracles, reports, and contracts replay exactly before composition
[x] shared-A selected, static fusion, O-LoRA ordered, and AM-LoRA selector lanes remain typed and non-interchangeable
[x] one request transaction binds exact model, route, factor, residency, generation, lease, and K/V identity
[x] static and dynamic composition, continual task order, and optimizer ownership survive end-to-end composition
[x] rollback restores artifacts under a new publication identity and never silently relabels prior K/V
[x] eight same-shape substitutions and all 222 one-field Loop 10 mutations are rejected
[x] Loop 10 cross-contract fixture, oracle, source trace, visual provenance, and report are checked in
[x] the responsive Loop 10 contract graph passes desktop/mobile and light/dark browser validation
[x] six typed evaluation candidates remain separate across training, factor, route, composition, continual, and runtime identities
[x] four workloads and four complete nuisance tuples produce 96 paired synthetic teaching cells with no replacement seeds
[x] quality, routing, prefill/decode runtime, and continual estimands are reported separately
[x] validation-only selection freezes one candidate before a held-out split is opened
[x] route entropy, load CV, stability, selected occurrences, and physical materialization remain distinct
[x] runtime phase ledgers are labeled synthetic and are not called latency or throughput measurements
[x] the exact Loop 7 task-time matrix and ACC/BWT/FWT/forgetting report are consumed by digest
[x] four typed failures cover each mechanism loop from 2 through 10 with named recovery owner and test surface
[x] all 1,296 prior mechanism-local one-field negatives remain reconciled under their original owners
[x] all 29 external URLs, seven local routes, 53 A22 figures, and 38 A29 figures have a static publication disposition
[x] all 29 rendered visual elements and 40 asset routes have nonempty alternatives, local assets, digests, and provenance
[x] the two Loop 11 responsive visual pairs pass static SVG role, title, description, and semantic-pair checks
[x] the Loop 11 oracle rejects all 30 one-field evaluation/publication mutations
[x] the historical Loop 11 release state remains recorded as `awaiting_loop12`; static closure is not retroactively called browser, deployment, rollback, or publication evidence
[x] Loop 12 independently closes formula/source identity, normalized browser rendering, accessibility, concrete owner boundaries, local-route acceptance, and article-source rollback as `publishable_with_declared_scope`
[x] paper benchmark claims remain source-reported

0x0E Final Formula, Source, Rendering, Accessibility, Boundary, And Rollback Closure

Loop 12 is not a twelfth routed-adapter mechanism. It is a transaction over the article that already exists. The transaction asks whether the explanatory surface, executable evidence, local assets, owner boundaries, and release state all describe the same candidate. A passing mechanism test cannot answer that question by itself: a page can preserve the right tensor algebra while shipping a missing mobile figure, a stale source identity, a broken owner route, or a release state that cannot return to its parent.

The parent is the exact Loop 11 article digest. The final candidate adds this closure section and replaces only the final publication-gate state. The rollback oracle removes that exact span in memory, restores the exact Loop 11 gate row, and requires the reconstructed bytes to hash to the Loop 11 digest. It never edits the working article.

0x0EA One Candidate, Several Independent Surfaces

The final audit does not accept one aggregate “documentation score.” It reconciles these surfaces independently and then joins them by the final article digest:

SurfaceFinal identityAcceptance condition
formulas255 source-ordered display blocksexact LaTeX text, order, section, line span, and digest
sources and claims19 frozen source records, 12 claim records, and 29 published external URLslocal digests exact; external URL set exact; no new Loop 12 scientific claim
figures and visualsall 53 A22 and 38 A29 dispositions; 40 asset routes yielding 29 rendered image elementsevery asset local and digest-bound; every alternative nonempty; every SVG has role, title, description, and view box
executable evidenceeleven historical loop contracts, 36 typed failures, 1,296 mechanism mutations, and 30 Loop 11 publication mutationseach historical diagnostic owner remains intact; Loop 12 does not collapse them into one final test
browser surfacedesktop/mobile crossed with light/darkMathJax parity, responsive source selection, local route and image responses, headings, anchors, language, theme, and article-local overflow all pass
release and rollbackone final article digest and one Loop 11 parent digestpublication is allowed only after browser and local-route acceptance; rollback reconstructs the exact parent bytes

The source and visual registries used here are final-candidate registries, not mutations of the historical Loop 11 files. That distinction keeps the evidence chain honest: Loop 11 remains replayable against its own article digest, while Loop 12 can bind the final article without rewriting history.

0x0EB Normalized Browser And Accessibility Contract

Four profiles cover desktop light, desktop dark, mobile light, and mobile dark. Each profile loads the built local route, waits until every MathJax source has a rendered peer, eagerly resolves article images, and then inspects the complete article DOM rather than only the screenshot viewport. The audit requires:

math sources == rendered MathJax nodes
display-math sources == 255
rendered image elements == 29
responsive picture elements == 11
broken images == 0
empty image alternatives == 0
duplicate heading IDs == 0
broken internal anchors == 0
article-owned horizontal overflow == 0
article-owned console/page errors == 0
all image and local owner routes return the expected content type
mobile profiles select mobile sources; desktop profiles select desktop sources

The four screenshots are normalized top-of-article evidence; the DOM checks cover the full article. Fixed menu or theme controls are site-shell state and are reported separately if they intersect the long title. Browser acceptance does not claim every browser, assistive technology, zoom policy, live external URL, or production deployment.

0x0EC Concrete Owner Boundaries And Program Handoff

The final boundary audit resolves owners to actual local files and rejects long exact prose duplication. It preserves the following non-transferable contracts:

RelationOwnerContract preserved here
consumesM6.2generic router, selection, weighting, and balance vocabulary
consumesM6.3vanilla LoRA operator, gradients, checkpoint, and merge baseline
consumesM6.4changed-object variant axes and quantized-base boundaries
consumesM6.5independent-adapter residency, scheduling, K/V compatibility, and lifecycle
consumesM6.7factor geometry, non-identifiability, and function-space diagnostic limits
defersM6.6generic expert-parallel placement, all-to-all, grouped GEMM, and topology
defersM7.8speculative proposal, verification, branch state, and release evaluation
defersM8.10compression-specific deployment evaluation, packaging, release, and rollback
next program ownerM6.10teacher-student objectives, supervision artifacts, architecture alignment, and transfer runtime

M6.9 therefore closes routed, shared-factor, composed, and continual adapter state without reopening generic MoE execution, ordinary adapter serving, speculative verification, quantized packaging, or teacher-student transfer.

0x0ED Release Verdict And Narrow Rollback

The final state is publication_closed with the verdict publishable_with_declared_scope. Browser acceptance and local-route acceptance are true. Live external availability remains unclaimed. The rollback artifact is executable only at article-source scope: it proves that the Loop 12 closure can return to the exact Loop 11 Markdown bytes. It does not roll back a model, adapter pool, optimizer, router, K/V cache, service, deployment, or infrastructure generation.

The evidence ceiling remains unchanged. No paper training run, checkpoint, framework model, GPU kernel, production scheduler, latency, throughput, quality benchmark, live-link availability, or deployment was reproduced by Loop 12. The final audit proves publication consistency for this repository snapshot, not empirical superiority of any routed-adapter method.

0xFF References

Transformer System and source-local material

Primary papers

Pinned official implementations

Runtime handoff

M6 now has the adapter lifecycle end to end: operator and optimization, method variants, serving, low-rank geometry, routed composition, and continual state. M6.10 applies the same discipline to teacher-student distillation and model transfer.