---
title: 'Task Mode: Mixture of Dyadic Experts'
url: https://www.emergentmind.com/topics/task-mode
type: topic
---

# Task Mode: Mixture of Dyadic Experts

Searching arXiv for the specified paper and closely related PEFT/MoE work to ground the article.
MoDE, short for **Mixture of Dyadic Experts**, is a multi-task parameter-efficient fine-tuning architecture for large language models that reformulates LoRA adaptation at the granularity of rank-one dyadic components and combines this with shared down-projections and per-rank routing [2408.01505]. It is motivated by an empirical observation about multi-task LoRA-style mixtures: when independently trained LoRA modules are compared across tasks, the down-projection matrices appear highly similar while the up-projection matrices differ, suggesting that existing LoRA-MoE designs repeatedly learn redundant structure [2408.01505]. On the Supernatural Instructions benchmark using 756 English tasks and a frozen Gemma-2B backbone, MoDE improves over single multitask LoRA and over prior LoRA-mixture baselines while preserving a parameter-efficient adaptation regime [2408.01505].

## 1. Redundancy in multi-task LoRA mixtures

Standard LoRA augments a base weight matrix \(W_0\) with a low-rank update
\[
\Delta W = A B^T,\quad A\in\mathbb{R}^{P\times r},\ B\in\mathbb{R}^{Q\times r},
\]
so that a linear layer computes
\[
y = x W_0 + x A B^T.
\]
In multi-task and MoE-style parameter-efficient fine-tuning methods, multiple LoRA experts are typically instantiated,
\[
E^i = A^i {B^i}^T,\quad i=1,\dots,m,
\]
and mixed by a router \(\mathcal{R}\),
\[
y = x W_0 + \sum_{i=1}^m \mathcal{R}^i(x)\, x A^i {B^i}^T.
\]
The central empirical result motivating MoDE is that the down-projection matrices \(A^i\) learned across tasks are highly similar, whereas the up-projection matrices \(B^i\) are task-specific [2408.01505].

This result was established by training 15 single-task LoRAs from a shared initialization on 15 diverse Supernatural Instructions tasks, slicing \(A\) and \(B\) along the rank dimension into column vectors, and applying PCA to those vectors. The down vectors clustered tightly by rank index across tasks, while the up vectors did not cluster. The authors interpret this as evidence that multi-task LoRA-MoE architectures redundantly relearn similar down-projection structure while the useful specialization resides primarily in the up-projection side [2408.01505].

A plausible implication is that the low-dimensional adapter subspace defined by \(A\) is largely task-agnostic, while task variability is better modeled as different ways of decoding or routing within that subspace. MoDE is built directly around that interpretation.

## 2. Dyadic decomposition and the MoDE architecture

A LoRA update can be written as a sum of dyadic rank-one terms,
\[
\Delta W = A B^T = [a_1,\dots,a_r][b_1,\dots,b_r]^T = \sum_{j=1}^r (a_j \otimes b_j),
\]
where \(a_j\in\mathbb{R}^P\) and \(b_j\in\mathbb{R}^Q\) are the \(j\)-th columns of \(A\) and \(B\). MoDE treats each dyadic product \(a_j \otimes b_j\) as an atomic expert [2408.01505].

The design has three defining elements. First, the down-projection matrix \(A\) is shared across all experts. Second, specialization is shifted to the up-projection vectors \(b_j^i\), with \(m\) candidate vectors per rank slot \(j\). Third, routing is performed independently for each rank slot rather than over the full rank-\(r\) adapter as a block [2408.01505].

For each rank index \(j\in\{1,\dots,r\}\), MoDE defines \(m\) rank-one experts
\[
a_j \otimes {b_j^i}^T,\quad i=1,\dots,m.
\]
The router has separate parameters for each rank slot,
\[
\mathbf{W}_{\mathcal{R}}\in\mathbb{R}^{r\times P\times m},\qquad
\mathbf{W}_{\mathcal{R};j}\in\mathbb{R}^{P\times m},
\]
and for token hidden state \(x\in\mathbb{R}^{1\times P}\),
\[
\mathcal{R}_j(x)=\text{softmax}(x\,\mathbf{W}_{\mathcal{R};j})\in\mathbb{R}^{1\times m}.
\]
The resulting layer output is
\[
y = x W_0 + \sum_{i=1}^m \sum_{j=1}^r \mathcal{R}_j^i(x)\,\big(x(a_j \otimes {b_j^i}^T)\big).
\]
Operationally, each rank slot first projects the token onto the shared input direction \(a_j\), then forms multiple candidate output directions via the expert-specific \(b_j^i\), and finally mixes them with token-dependent router weights [2408.01505].

This factorization gives MoDE a much finer routing granularity than standard LoRA-MoE. The paper argues that with \(m\) expert choices for each of \(r\) rank slots, the number of effective compositions grows roughly as \(m^r\), whereas conventional LoRA-MoE exposes only \(m\) full-matrix choices at a layer [2408.01505]. This suggests substantially higher combinatorial expressivity for comparable parameter budgets.

## 3. Generalized formulation and structural comparison

MoDE is embedded in a broader family parameterized as **MoDE \(m\times r\times p\)**, where \(m\) is the number of expert choices per group, \(r\) is the total LoRA rank, and \(p\) is the rank per expert group [2408.01505]. Assuming \(r\) is divisible by \(p\), the \(r\) dyadic terms are grouped into \(r/p\) groups:
\[
\mathbf{A}_k \mathbf{B}_k^{iT} = \sum_{j=1}^p \big(a_{j + p(k-1)}\otimes b_{j + p(k-1)}^{iT}\big),
\]
and the generalized output becomes
\[
y = x W_0 + \sum_{i=1}^m \sum_{k=1}^{r/p} \mathcal{R}_k^i(x)\, x \mathbf{A}_k \mathbf{B}_k^{iT}.
\]
Rank-one experts correspond to the default form of MoDE; higher \(p\) recovers coarser expert groupings [2408.01505].

Two special cases connect MoDE to earlier PEFT formulations. MoDE \(1\times r\times r\) is equivalent to a single rank-\(r\) LoRA, while MoDE \(m\times r\times r\) is equivalent to a LoRA-MoE with shared down-projection, termed LoRA-MoE-SD in the paper [2408.01505]. This places MoDE on a continuum between standard LoRA and blockwise shared-\(A\) expert mixtures.

The structural distinction from standard LoRA, LoRA-MoE, and LoRA-MoE-SD is summarized below.

| Method | Core structure | Parameters per layer |
|---|---|---|
| LoRA | One rank-\(r\) adapter, no routing | \(Pr + Qr\) |
| LoRA-MoE | \(m\) experts, each with its own \(A^i,B^i\), single router | \(m(Pr + Qr) + Pm\) |
| LoRA-MoE-SD | Shared \(A\), expert-specific \(B^i\), single router | \(Pr + mQr + Pm\) |
| MoDE | Shared \(A\), per-rank expert-specific \(b_j^i\), per-rank routers | \(Pr + mQr + rPm\) |

The main architectural reallocation is therefore from redundant down-projection matrices into additional router capacity and finer expert specialization [2408.01505].

## 4. Training procedure and inference behavior

The experimental training setup uses a frozen **Gemma-2B** backbone and a single multitask corpus formed by mixing examples from the 756 English tasks in Supernatural Instructions [2408.01505]. Tasks are not represented by explicit task IDs or task embeddings; instead, routing is conditioned only on token hidden states derived from the concatenated instruction and input. This means task-specific behavior is implicit, arising from how different instructions and inputs induce different router activations [2408.01505].

Only adapter and router parameters are optimized: the shared \(A\), the expert-specific up-vectors \(\{b_j^i\}\), and the router parameters \(\mathbf{W}_{\mathcal{R};j}\). Optimization uses Adafactor with learning rate \(1\times 10^{-3}\), sequence length 1024, batch size 128, and 20k training steps [2408.01505]. The objective is standard next-token cross-entropy over the mixed multitask corpus,
\[
\mathcal{L}(\theta) = - \mathbb{E}_{(x, y) \sim \text{SNI}} \sum_t \log p_\theta(y_t \mid y_{<t}, x),
\]
with no auxiliary routing loss, no load-balancing term, and no explicit sparsity penalty [2408.01505].

At inference time, MoDE uses dense soft routing. For each token and each MoDE-enabled layer, it computes \(r\) router projections \(x\mathbf{W}_{\mathcal{R};j}\), applies softmax over the \(m\) experts per rank slot, and forms a weighted mixture over all \(mr\) rank-one experts. There is no sampling: routing is continuous and deterministic given the hidden state [2408.01505].

The paper notes that MoDE introduces more router computations than standard LoRA because it performs \(r\) router matmuls rather than one. However, it also notes that exact FLOP formulas are not derived and qualitatively argues that the dominant costs remain the linear projections for large \(P\) and \(Q\), with router overhead relatively small [2408.01505]. This suggests that MoDE’s main trade-off is architectural rather than one of dramatically increased compute.

## 5. Experimental setting and quantitative results

All reported main experiments use Supernatural Instructions. The full benchmark contains 1,616 instruction-following tasks over 76 task types, but the multitask experiments use the 756 English-only tasks from the default train split, with each task split into 90% training and 10% evaluation [2408.01505]. The principal metric is **ROUGE-L**, which is the benchmark default [2408.01505].

The study compares MoDE against a single multitask LoRA, a LoRA-MoE baseline denoted MoLORA, and a shared-down-projection variant MoLORA-SD. The main 756-task results are:

| Model | ROUGE-L | Added params (% of Gemma-2B) |
|---|---:|---:|
| LoRA rank 64 | 56.11 | 6.31% |
| MoLORA 16×4 | 57.77 | 7.62% |
| MoLORA-SD 16×4 | 58.28 | 2.71% |
| MoDE 16×4 | 60.00 | 6.64% |
| MoDE 8×4 | 59.00 | 3.48% |
| MoDE 6×4 | 60.91 | 2.69% |
| MoDE 4×4 | 60.18 | 1.90% |
| MoDE 4×6 | 60.53 | 2.86% |
| MoDE 4×8 | 58.92 | 3.81% |
| MoDE 4×16 | 60.04 | 7.62% |

Several comparisons are especially central to the paper’s argument. Sharing the down-projection in MoLORA-SD reduces added parameters from 7.62% to 2.71% while improving ROUGE-L from 57.77 to 58.28, which supports the redundancy hypothesis directly [2408.01505]. Relative to the single multitask LoRA baseline, MoDE 16×4 improves from 56.11 to 60.00 at a similar parameter budget, a gain of +3.89 ROUGE-L [2408.01505]. Relative to MoLORA 16×4, MoDE 16×4 improves by +2.23 ROUGE-L at essentially the same effective expert-rank setting [2408.01505].

The paper also reports broad task-level advantages. Across the 756 tasks, MoDE wins on 78% of tasks versus single LoRA, 73% versus MoLORA, and 68% versus MoLORA-SD, with all win rates statistically significant versus 50% at 0.99 confidence [2408.01505]. This is presented as evidence that MoDE’s gains are not confined to a narrow subset of tasks.

## 6. Ablations, generalized MoDE, and interpretation

Ablations over the number of experts \(m\) at fixed rank \(r=4\) show a non-monotonic trend. MoDE 4×4 achieves 60.18 ROUGE-L, 6×4 achieves 60.91, 8×4 drops to 59.00, and 16×4 yields 60.00 [2408.01505]. The paper interprets this as diminishing returns from adding too many experts, plausibly because router capacity and dataset size limit useful specialization.

Varying rank at fixed \(m=4\) also yields non-monotonic behavior: 4×4 gives 60.18, 4×6 gives 60.53, 4×8 drops to 58.92, and 4×16 gives 60.04 [2408.01505]. This suggests that modest rank increases can help, but larger ranks may introduce overparameterization or optimization difficulty when not matched by corresponding expert diversity.

The generalized rank-\(p\) formulation further clarifies the trade-off between fine-grained routing and parameter cost. At fixed \(m,r\), decreasing \(p\) toward rank-one experts improves performance but also increases parameters. For \(m=4,r=16\), performance rises from 58.51 at \(p=16\) to 59.93 at \(p=1\); for \(m=16,r=4\), it rises from 58.97 at \(p=4\) to 59.91 at \(p=1\) [2408.01505]. The paper interprets this as evidence that finer decomposition increases expressivity.

Under an iso-parametric budget of roughly 6.5% added parameters, the best generalized configuration reported is **12×16×8**, reaching 60.94 ROUGE-L [2408.01505]. This indicates that the most parameter-efficient design within a fixed budget is not always the finest rank-one decomposition. A plausible implication is that MoDE defines a three-way trade-off among total LoRA rank, number of expert choices, and expert granularity, rather than a universally dominant operating point.

A separate 15-task fixed-budget study reinforces the multitask advantage. Under roughly 6M adapter parameters, a single multitask MoDE model achieves around 63.37–63.39 ROUGE-L, outperforming 15 separate single-task LoRAs, a single multitask LoRA, MoLORA, and MoLORA-SD [2408.01505]. This result suggests that MoDE’s shared representation and routing scheme can outperform even an oracle-like collection of small task-specific adapters under a matched budget.

## 7. Conceptual significance, limitations, and position in the literature

MoDE’s main conceptual contribution is to recast LoRA as a sum of rank-one dyadic updates and to treat those atomic terms as the natural granularity for mixture-of-experts routing [2408.01505]. This yields a separation between a shared adapter feature space, represented by the common down-projection \(A\), and task-dependent decoding behavior, represented by routed up-projection vectors \(b_j^i\). The design is tightly aligned with the empirical structure observed in independently trained single-task LoRAs.

The paper is primarily empirical and does not present formal theorems. Its expressivity claims are therefore conceptual rather than deductive: standard LoRA-MoE offers \(m\) alternative low-rank updates, whereas MoDE offers roughly \(m^r\) possible compositions from \(m\) choices per rank slot [2408.01505]. This suggests a large increase in representable effective updates for similar parameter counts, though the paper does not formalize this as a complexity theorem.

Several limitations are explicit. The routing strategy is simple: token-level softmax over a linear transformation of the hidden state, with no load balancing, no sparsity, and no top-\(k\) selection [2408.01505]. Hyperparameter sensitivity remains only partially mapped, especially over the joint space of \(m\), \(r\), and \(p\) [2408.01505]. The evaluation focuses on Supernatural Instructions, so broader claims about multilingual, code, or other multi-domain settings remain open [2408.01505]. The added per-rank router computation may also matter in low-latency deployments, although the paper does not quantify this precisely [2408.01505].

Within the broader PEFT landscape, MoDE is positioned as a mixture-of-adapters method rather than a prompt-based or prefix-based scheme. It is directly descended from LoRA and most closely related to LoRA-MoE variants such as MoLORA, MixLoRA, SiRA, and related multi-task adapter-composition approaches listed in the paper’s positioning discussion [2408.01505]. Its distinguishing features are the empirical identification of down-projection redundancy, shared \(A\), and dyadic-level routing. In that sense, MoDE proposes not merely a more compact mixture, but a different view of where multitask specialization should reside in low-rank adaptation.

Source: https://www.emergentmind.com/topics/task-mode