wikillm

Paper · 2024-12-07 · cs.CV, cs.AI, cs.CL, cs.LG, cs.RO

SAME: Learning Generic Language-Guided Visual Navigation with State-Adaptive Mixture of Experts

Puts a mixture-of-experts layer in the cross-attention query of the DUET navigation agent and routes each step by the pooled visual views plus the instruction [CLS] token, so one model handles seven vision-language navigation tasks. Trained with DAgger and a load-balance loss (weight 0.8). Author-reported: SR 76 on R2R val unseen, 46.4 on REVERIE val unseen, 76.3 on ObjectNav MP3D val.

Mixture of experts (MoE)Imitation learningTopological map navigationvision-language-navigationembodied-agentsmixture-of-expertsmulti-task-learningimitation-learningdagger

arXivPDFCodeMarkdown14 min read

AI-compiled by claude-haiku-5-5 on 2026-10-25, not yet reviewed by a human. Every claim cites its source; check it when a detail matters.

In plain words

A navigation agent gets a sentence such as "walk to the kitchen" or "find a chair", then moves through a building by looking around at each step. Earlier work built a separate agent for each kind of instruction. The authors show that one agent trained on all of them at once often does worse on the harder ones, because the kinds of instruction pull the agent in different directions.

Their fix is a set of small specialist sub-networks, called experts, inside the agent. At each step a small router looks at what the agent currently sees and what it was told, then picks a couple of experts to use for that step. Easy exploration and careful instruction-following can then use different specialists, while the shared parts of the agent keep the common knowledge.

The result is a single model that handles seven navigation benchmarks. The authors report that it matches or beats models built for one task, though not on every metric.

TL;DR

  • SAME is a mixture-of-experts layer on the visual query of the cross-attention in the DUET navigation agent §3.2 §4 app., DUET revisit.
  • A router picks the top experts per navigation step from the mean of the panorama views and the instruction [CLS] token §3.2.
  • Trained with DAgger on seven VLN datasets in the discrete Matterport graph, with a load-balancing loss weighted 0.8 §4.
  • Author-reported: best unified-model results on several splits, but separate single-task models still lead on REVERIE tab. 4.
  • Code is MIT-licensed and mostly matches the paper, with three notable differences in routing softmax, balance-loss scaling and the data mix (see Paper vs code).

Problem

Language-guided navigation tasks differ in how detailed their instructions are. Fine-grained tasks (R2R) describe every step, coarse-grained tasks (REVERIE) name a target object and a room, and ObjectNav gives only a category §2 fig. 1. Training one model on a mix of these datasets gives inconsistent results: the authors report that mixing data cuts success rate on R2R by 2-3 points and on REVERIE by 6-7 points in their held-out tests §2.1.

The paper also finds that common mixture-of-experts routing does not fit this setting. Routing by token [shazeer2017outrageously] or by task identity gave lower REVERIE success than the state-adaptive routing in single-run tests tab. 2, so the authors design routing from the agent's current state §3.2.

Method

The base model is DUET, a dual-scale graph transformer. It builds a local branch on the current panorama and a global branch on the topological map of visited and candidate nodes, and both branches use cross-attention over the instruction app., DUET revisit. SAME does not change the graph or the action head. It changes the cross-attention layers.

1. Experts in a sparse MoE layer §3.1. A layer holds N experts and a linear router. The router turns a routing feature into one score per expert, a softmax gives probabilities, and the output is the probability-weighted sum over the top-k experts §3.1, MoE formulation. The paper gives the formula but does not state N or k; the code uses N = 8 and k = 2 [code: src/configs/default.yaml#L60-L61].

2. Routing feature (SAME routing) §3.2. The routing feature merges the mean of the visual features over all views with the instruction [CLS] token, through one linear layer W_m that maps 2h to h. A variant adds a task embedding. In the single-run ablations this variant has lower SPL than the plain routing on all three tasks §3.3 tab. 2.

3. Where the experts sit §3.4 fig. 2. The experts replace the query projection of the visual cross-attention in every cross-attention layer of DUET's local and global branches vilmodel.py. The paper compares this with experts on the key and value projections, and with experts in the feed-forward network. Experts on the visual query gave the best SPL on all three ablation tasks tab. 3.

4. Training objective §4. DAgger, not plain imitation: at each step the agent samples its action from its own predicted distribution, and the teacher's action supervises that choice §4 §4.2, training schema. The loss is the DAgger navigation loss plus lambda times the MoE load-balancing loss, with lambda = 0.8 §4 tab. 7. The load-balancing loss follows the Switch Transformer form [fedus2022switch] §3.1.

5. Data mix §4. The training sets are ScaleVLN, R2R, RxR-EN, CVDN, REVERIE, SOON and Habitat-Web (ObjectNav demonstrations), sampled in the ratio 10:1:1:1:1:1:2. A batch never mixes datasets §4. The model starts from ScaleVLN pre-trained weights §3.3 §4.

Pseudocode
# SAME routing for one navigation step  [§3.2]
# Input:  views (B, V, h), instruction_cls (B, h)
# Output: weights (B, k), experts (B, k), logits (B, N)

def route_step(views, instruction_cls):
    # Average the view features into one state vector  [§3.2]
    visual_mean = mean(views, over=V)                     # (B, h)
    # Merge the visual state with the instruction token  [§3.2]
    routing_feature = W_m(concat(visual_mean, instruction_cls))
    # Score every expert for each sample  [§3.1]
    logits = W(routing_feature)                           # (B, N)
    # Turn scores into probabilities over the experts  [§3.1]
    probs = softmax(logits, over=N)
    # Keep the k most likely experts and their weights  [§3.1]
    weights, experts = top_k(probs, k)
    return weights, experts, logits
Pseudocode
# Visual query with MoE  [§3.1] [§3.4]
# Input:  x (B, L, h), weights (B, k), experts (B, k)
# Output: query (B, L, h)

def moe_query(x, weights, experts, expert_linears):
    # Sum the weighted outputs of the selected experts  [§3.1]
    query = zeros_like(x)
    for i in range(N):
        # Samples that routed to expert i, with that sample's weight  [§3.1]
        rows, slots = where(experts == i)
        query[rows] += weights[rows, slots] * expert_linears[i](x[rows])
    return query
Pseudocode
# Training loss for one batch of episodes  [§4] [§3.1]
# Input:  dagger_losses (T,), balance_terms (T, N), lam = 0.8
# Output: scalar

def batch_loss(dagger_losses, balance_terms, lam):
    # Navigation loss summed over steps, as the paper's objective  [§4]
    nav_loss = sum(dagger_losses)
    # Load-balance term from the routing decisions  [§3.1]
    balance = sum(balance_terms)
    return nav_loss + lam * balance

Balance loss, as the paper defines it §3.1. For each routing batch of K inputs with N experts, F is the fraction of inputs whose top-1 expert is i, and D is the mean router probability of expert i. The loss is N times the sum over experts of F_i times D_i. With uniform routing it equals 1. The code uses a different count, see Paper vs code.

Pseudocode
# MoE load-balance term for one routing batch  [§3.1] [eq. balance]
# Input:  probs (K, N) router probabilities
# Output: scalar

def balance_term(probs, num_experts):
    # Fraction of inputs whose top-1 expert is each expert  [§3.1]
    top1 = argmax(probs, over=N)
    fraction = mean(one_hot(top1, num_experts), over=K)   # (N,)
    # Mean router probability given to each expert  [§3.1]
    mean_prob = mean(probs, over=K)                       # (N,)
    return num_experts * sum(fraction * mean_prob)

The paper's loss equation is labelled equ:balance_loss in the LaTeX source; the equation numbers in the PDF were not checked, so the card cites the section.

Hyperparameters

NameValueWhereNotes
Base modelDUET (dual-scale graph transformer)§2 app., DUET revisitLocal and global branches with cross-attention
InitialisationScaleVLN pre-trained weights§3.3 §4Pre-training on MoE position: code loads a checkpoint per position README.md; how it was made is not stated
Visual encoderCLIP ViT-B/16§4Feature database name in code default.yaml
Experts Nnot stated§3.1Code: 8 default.yaml
Experts per token knot stated§3.1Code: 2 default.yaml; the paper calls k the top-k of routing scores
Balance coefficient lambda0.8§4 tab. 7Code: router_aux_loss_coef 0.8 default.yaml
Training algorithmDAgger§4Student sampling with teacher labels base_trainer.py
Data mixScaleVLN, R2R, RxR-EN, CVDN, REVERIE, SOON, Habitat-Web at 10:1:1:1:1:1:2§4Code main config has 9 sources, see Paper vs code
Batch size16§4Code default 8, main configs 16 default.yaml main_multi_q.yaml
Batch mixingnone (one dataset per batch)§4Ablation shows mixing hurts DAgger tab. 6
OptimiserAdamW§4Code: torch AdamW, constant schedule with warm-up optims.py
Learning rate1e-5§4Code default 1e-5 default.yaml
Training length20k iterations§4Code default 500000 iterations; main configs do not override it default.yaml
Hardware1 × 80 GB NVIDIA A100§4
Gradient clippingnot statedCode: 0.5 default.yaml
Teacher-forcing termnot stated in paperCode: IL_loss_coef 0.2 added to the DAgger loss default.yaml base_trainer.py
Dropoutnot statedCode: hidden 0.1, attention 0.1, feature 0.3 default.yaml
SimulatorsMatterport discrete graph for training and eval; zero-shot Habitat with waypoint predictor for continuous eval§4 tab. 5
Max action lengthnot statedCode (train): 15 for R2R, 20 for RxR and ObjectNav default.yaml

Results

Author-reported. Setup: discrete Matterport3D graph, DUET backbone initialised from ScaleVLN, multi-task training on seven datasets §4.

Main results (discrete environment) tab. 4. SAME row against the unified baselines and the best single-task model, val unseen unless marked.

Benchmark, splitMetricSAMEScaleVLN† (unified)NaviLLM (unified)ScaleVLN (single task)Source
CVDN, valGP ↑6.945.936.166.12tab. 4
CVDN, testGP ↑7.07not stated7.906.97tab. 4
RxR-EN, valSR / nDTW ↑50.5 / 51.246.7 / 49.7not statednot statedtab. 4
R2R, valSR / SPL ↑76 / 6676 / 6767 / 5979 / 70tab. 4
R2R, testSR / SPL ↑74 / 64not stated68 / 6077 / 68tab. 4
SOON, valSR / SPL ↑36.1 / 25.433.2 / 25.438.3 / 29.2not statedtab. 4
SOON, testSR / SPL ↑38.2 / 27.1not stated35.0 / 26.3not statedtab. 4
REVERIE, valSR / SPL ↑46.4 / 36.141.9 / 34.442.2 / 35.757.0 / 41.8tab. 4
REVERIE, testSR / SPL ↑48.6 / 37.1not stated39.8 / 32.356.1 / 39.5tab. 4
ObjectNav MP3D, valSR / SPL ↑76.3 / 42.772.3 / 43.4not statednot statedtab. 4

† the authors' multi-task run of ScaleVLN. The full-results table in the appendix gives SAME's TL and NE for each benchmark app., full-results table.

Zero-shot on continuous Habitat tab. 5. The same checkpoint, evaluated with a waypoint predictor and no training in the continuous environment §4.

Environment, splitNE ↓SR ↑SPL ↑Source
R2R-CE, val unseen5.314738tab. 5
MP3D ObjectNav, valnot stated4321tab. 5

For context, the paper lists ScaleVLN trained on R2R-CE at SR 55 and SPL 51, and Habitat-Web at MP3D SR 35 and SPL 10 tab. 5.

Routing comparison, single runs tab. 2. Setup: the Section 3 experiments, experts on visual query, pre-trained from ScaleVLN. Columns: TL, NE, SR, SPL.

Routing conditionR2R TLR2R NER2R SRR2R SPLREVERIE TLREVERIE NEREVERIE SRREVERIE SPLObjectNav TLObjectNav NEObjectNav SRObjectNav SPL
w/o MoE11.762.9873.0965.7913.175.9040.3935.4016.133.1672.3142.72
Token embedding13.282.9873.9964.8116.785.6043.4535.4015.693.0474.3844.97
Task embedding12.983.1372.8464.8114.905.7143.7136.5814.963.1771.1343.88
Text [CLS]14.452.9274.6764.1219.225.4645.5036.5615.633.1171.3242.75
Text [CLS] + task embedding15.802.9573.6162.8021.505.4443.8534.1018.263.0072.4039.98
SAME (state-adaptive)13.512.9073.6964.9216.325.3845.6737.9515.603.1071.4343.39
SAME + task embedding14.002.8974.5064.6617.655.6642.3233.6117.202.8673.3942.07
SAME without VLN pre-training14.714.6659.0549.0214.196.2638.4332.4019.933.0870.9438.48

Expert position, single runs tab. 3.

Experts placed onR2R TLR2R NER2R SRR2R SPLREVERIE TLREVERIE NEREVERIE SRREVERIE SPLObjectNav TLObjectNav NEObjectNav SRObjectNav SPL
Feed-forward13.183.0873.4464.8616.025.6242.7735.2816.023.0971.3742.24
Visual query13.512.9073.6964.9216.325.3845.6737.9515.603.1071.4343.39
Textual key and value15.582.8275.3563.8520.305.3645.6134.7517.573.1072.1742.67

Training schema, single runs tab. 6.

AlgorithmBatchR2R TLR2R NER2R SRR2R SPLREVERIE TLREVERIE NEREVERIE SRREVERIE SPLObjectNav TLObjectNav NEObjectNav SRObjectNav SPL
ImitationMix13.773.8265.5156.5719.025.7935.6428.1531.312.6475.8326.77
ImitationSequential9.354.2361.0958.889.247.3728.3726.4226.573.5171.7024.06
DAggerMix16.094.0762.3652.1825.055.8930.4521.9127.572.8174.8531.70
DAggerSequential13.512.9073.6964.9216.325.3845.6737.9515.603.1071.4343.39

Balance coefficient, single runs tab. 7.

lambdaR2R TLR2R NER2R SRR2R SPLREVERIE TLREVERIE NEREVERIE SRREVERIE SPLObjectNav TLObjectNav NEObjectNav SRObjectNav SPL
0.212.632.9173.6165.7315.475.5542.8635.2215.253.1371.7943.51
0.513.772.8974.2965.0019.455.5644.7034.8918.103.0572.2640.50
0.813.512.9073.6964.9216.325.3845.6737.9515.603.1071.4343.39
1.013.563.0273.5664.5216.195.2445.8137.8918.112.6774.6644.81

Data mixture for DUET, held-out results tab. 1. SR (SPL in brackets) on R2R, REVERIE and ObjectNav MP3D when DUET is trained on the listed sets. Entries marked (zs) are zero-shot, meaning the dataset was not in training. Habitat-rendered images are used for this experiment.

Training dataR2R SR (SPL)REVERIE SR (SPL)ObjectNav SR (SPL)
R2R67 (55)39 (28) zs55 (24) zs
REVERIE42 (32) zs41 (32)43 (23) zs
ObjectNav16 (9) zs13 (9) zs68 (29)
R2R + ObjectNav64 (55)38 (31) zs72 (28)
REVERIE + ObjectNav34 (26) zs35 (26)70 (33)
R2R + REVERIE + ObjectNav65 (54)34 (27)68 (27)

The single-run ablations (tables 2, 3, 6, 7) use the Section 3 setup and are not directly comparable with the main results in table 4.

Paper vs code

Repository: https://github.com/GengzeZhou/SAME, MIT, at commit b74c57bbb189a0ed8c908e90b53d02dfbe417528. The authors are listed in the paper's author block, so this is their repository.

  • Routing softmax runs over the batch, not the experts. Paper: softmax over the N experts for each sample §3.1. Code: the task router applies softmax along dimension 0, which is the batch dimension, and then takes the top-k vilmodel.py. Per-sample ranking can change because the normaliser differs per expert.
  • Top-k weights are renormalised. Paper: the output uses the unnormalised router probabilities of the top-k experts §3.1. Code: the top-k weights are divided by their sum, so they add to 1 vilmodel.py.
  • Balance loss scale. Paper: F uses the top-1 expert, and the loss is 1 at uniform routing §3.1. Code: the one-hot mask covers all k selected slots, and the sum runs over those slots, so the loss is k at uniform routing (2 with k = 2) duet_agent.py [code: src/tasks/agents/duet_agent.py#L323-L324]. The code's default balance weight of 0.8 therefore has an effective scale about twice the paper formula.
  • Balance term is summed over navigation steps. Paper: one loss over the routing batch §3.1. Code: a balance term is added at every step of every episode, then multiplied by 0.8 and divided by the batch size, the same way as the navigation loss duet_agent.py duet_agent.py.
  • Extra teacher-forcing term. Paper: DAgger loss plus lambda times the balance loss §4. Code: a teacher-forcing (imitation) loss with coefficient 0.2 is added to the DAgger loss in each step default.yaml base_trainer.py.
  • Data mix. Paper: seven sets at 10:1:1:1:1:1:2 §4. Code main config: nine sources at 10:1:1:1:1:1:1:1:2, adding R2R_PREVALENT and REVERIE_SCALEVLN main_multi_q.yaml. The default config uses 20:1:1:10:1:1:1:1:2 default.yaml.
  • Training length and batch. Paper: 20k iterations at batch 16 §4. Code default: 500000 iterations at batch 8 default.yaml. The main multi-task configs set batch 16 and do not override the iteration count.
  • Experts N and k. Not stated in paper; code uses 8 and 2 [code: src/configs/default.yaml#L60-L61].
  • Pre-trained checkpoints. Paper: initialised from ScaleVLN §3.3. Code: each MoE position loads its own pre-trained checkpoint, for example Attnq_pretrained_ckpt.pt for the visual-query variant [code: src/configs/main_multi_q.yaml#L17]. The README says these are released on HuggingFace README.md. The paper does not describe how they were produced.
  • Paper claims against its own tables. The text says lambda = 0.2 "performs worse than all other variants" §4.2 tab. 7. On R2R SPL and ObjectNav SPL, lambda = 0.2 is the best row or close to it (65.73 and 43.51); on REVERIE SR it is the lowest (42.86) tab. 7. The claim holds only for some metrics.
  • Average SPL. The text reports an average SPL of 48.31% §3.3. The mean of the three SPL values in the routing-comparison table for SAME is 48.75 tab. 2. The paper does not say how the average was taken.

No discrepancies were found for the navigation policy structure, the cross-attention placement, or the routing feature merge (mean views plus instruction [CLS] through a linear layer) vilmodel.py.

Pitfalls

  • Routing details. The softmax axis and the top-k renormalisation matter for reproduction. Follow the code if you want to match the reported numbers, and the paper if you want the stated formulation. Report which one you used.
  • Balance coefficient scale. Because the code's balance term is k times the paper formula, lambda = 0.8 in code is not the same number as lambda = 0.8 in the paper formula. Matching the paper's ablations needs the paper's form.
  • N and k are unstated. The paper gives no number of experts and no k. The code's values (8 and 2) are the only source default.yaml.
  • Pre-training is a prerequisite. Table 2 shows that without VLN pre-training the SR drops to 59.05 on R2R, from 73.69 with it tab. 2. The paper's pre-training is ScaleVLN, and the MoE-position checkpoints in the code are not described in the paper.
  • Ablations are single runs. Tables 2, 3, 6 and 7 are single runs of the Section 3 setup. Differences of about one point are within noise. The paper does not report seeds or variance.
  • Mixing data hurts DAgger. Table 6 shows that batch mixing reduces DAgger results sharply (R2R SR 62.36 against 73.69 sequential) tab. 6. Keep datasets in separate batches, as the paper does §4.
  • Continuous results are zero-shot. The continuous Habitat numbers come from a discrete-trained model with a waypoint predictor §4 tab. 5. They are not a continuous-environment training result.
  • Missing details for a faithful rebuild. Not stated in the paper: hidden sizes, the exact teacher labels for DAgger, gradient clipping, the teacher-forcing weight, dropout, max action length, and the scheduler. The code has values for all of these (see Hyperparameters), but the paper does not say they were used.
  • Compute. Single 80 GB A100 for training §4. The paper does not report training time, memory or inference cost for SAME against DUET.
  • Visual data. The ablations use Matterport3D-rendered images for R2R and REVERIE §3.3, while the Table 1 study uses Habitat-rendered images tab. 1. Keep the rendering source in mind when comparing numbers.

Lineage

  • Builds on: DUET (Chen et al., CVPR 2022, "Think Global, Act Local"), the base navigation model, extended with MoE on its cross-attention app., DUET revisit.
  • Builds on: ScaleVLN, used for pre-training and data §3.3 §4.
  • Builds on: mixture-of-experts routing from Shazeer et al. (2017) and Switch Transformers (Fedus et al.), used for the balance loss §3.1.
  • Compared against: MT-RCM, NaviLLM, ScaleVLN† (multi-task), and separate single-task models such as ScaleVLN, BEVBert, VER and GOAT tab. 4.
  • Superseded by: not known from content already in this wiki.

Source and license

Adapted from “SAME: Learning Generic Language-Guided Visual Navigation with State-Adaptive Mixture of Experts” by Gengze Zhou, Yicong Hong, Zun Wang, Chongyang Zhao, Mohit Bansal, Qi Wu (arXiv:2412.05552), used under CC BY-SA 4.0. Changes: condensed and restructured for implementation, with tables, equations and algorithms taken from the paper and its code, each cited to its source. Not affiliated with or endorsed by the authors. This page is licensed under CC BY-SA 4.0. Code citations refer to https://github.com/GengzeZhou/SAME at commit b74c57bbb189 (MIT). Any quoted code is shown under that license.