SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2509.07945 · ICLR · 2025

One Model for All Tasks: Leveraging Efficient World Models in Multi-Task Planning

Hongsheng Li, Yazhe Niu, Yuan Pu, Shuai Hu, Jia Tang, Junyu Xiong, Kong Mmlab

arXiv · PDF · Open in the Atlas

Code that ran

1 of 1 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 0 failures of our instrument; 0 no recorded run), measured 2026-11-23; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2509.07945.json · badge: /api/ran/2509.07945.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
opendilab/LightZero community
Papers with Code archive
1 ran · 0 no recorded run
FunctionStatusWhere it lives
MoELayer Ran
ran on a synthesized input
opendilab/LightZero/lzero/model/unizero_world_models/moe.py
code served (permissive licence) · get_code("485e2019a2bf217a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 3, dtype family float, shape (2, 3, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import torch.nn.functional as F
from typing import List, Any

class SimpleConfig:
    def __init__(self, embed_dim: int, n_shared_experts: int = 0):
        self.embed_dim = embed_dim
        self.n_shared_experts = n_shared_experts

class SimpleExpert(nn.Module):
    def __init__(self, dim: int):
        super().__init__()
        self.linear = nn.Linear(dim, dim)
    
    def forward(self, x: torch.Tensor) -> torch.Tensor:
        return self.linear(x)

class SimpleGate(nn.Module):
    def __init__(self, dim: int, num_experts: int):
        super().__init__()
        self.linear = nn.Linear(dim, num_experts)
    
    def forward(self, x: torch.Tensor) -> torch.Tensor:
        return self.linear(x)

# Configuration
embed_dim = 4
num_experts = 3
num_experts_per_tok = 2
batch_size = 2
seq_len = 3

# Create config
config = SimpleConfig(embed_dim=embed_dim, n_shared_experts=0)

# Create experts
experts = [SimpleExpert(embed_dim) for _ in range(num_experts)]

# Create gate
gate = SimpleGate(embed_dim, num_experts)

INIT_ARGS = {
    'config': config,
    'experts': experts,
    'gate': gate,
    'num_experts_per_tok': num_experts_per_tok,
}

ARGS = {
    'x': torch.randn(batch_size, seq_len, embed_dim),
}

if __name__ == '__main__':
    from typing import List, Any
    import torch
    import torch.nn.functional as F
    from torch import nn

    class MoELayer(nn.Module):
        def __init__(self, config: Any, experts: List[nn.Module], gate: nn.Module, num_experts_per_tok: int=1) -> None:
            super().__init__()
            self.dim = config.embed_dim
            self.num_experts = len(experts)
            self.num_experts_per_tok = num_experts_per_tok
            self.gate = gate
            self.experts = nn.ModuleList(experts)
            if hasattr(config, 'n_shared_experts') and config.n_shared_experts > 0:
                self.shared_expert = nn.Sequential(nn.Linear(self.dim, config.n_shared_experts * (4 * self.dim)), nn.GELU(), nn.Linear(config.n_shared_experts * (4 * self.dim), self.dim))
            else:
                self.shared_expert = None

        def forward(self, x: torch.Tensor) -> torch.Tensor:
            original_shape = x.size()
            x = x.view(-1, self.dim)
            gate_logits = self.gate(x)
            weights, indices = torch.topk(gate_logits, self.num_experts_per_tok, dim=1)
            weights = F.softmax(weights, dim=1).to(x.dtype)
            expert_output = torch.zeros_like(x)
            for expert_id in range(self.num_experts):
                batch_idx, expert_tok_idx = torch.where(indices == expert_id)
                if batch_idx.numel() == 0:
                    continue
                token_subset = x[batch_idx]
                output_expert = self.experts[expert_id](token_subset)
                token_weights = weights[batch_idx, expert_tok_idx].unsqueeze(-1)
                expert_output[batch_idx] += output_expert * token_weights
            if self.shared_expert is not None:
                shared_output = self.shared_expert(x)
                output = expert_output + shared_output
            else:
                output = expert_output
            return output.view(original_shape)

    moe_layer = MoELayer(**INIT_ARGS)
    result = moe_layer(**ARGS)
    print(f"Output shape: {result.shape}")
    print(f"Expected shape: {ARGS['x'].shape}")
    assert result.shape == ARGS['x'].shape, f"Shape mismatch: {result.shape} vs {ARGS['x'].shape}"
    print("Test passed!")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (2, 3, 4) — shape (2, 3, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)

Also present in other papers' code

Of 1 samples lifted from this paper's linked repositories, 1 carry a function identity and 0 do not. Of the 1 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 1 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

In heterogeneous multitask decision-making, tasks not only exhibit diverse observation and action spaces but also vary substantially in their underlying complexities. While conventional multitask world models like UniZero excel in single-task settings, we find that when handling a broad and diverse suite of tasks, gradient conflicts and the loss of model plasticity often constrain their sample efficiency. In this work, we address these challenges from two complementary perspectives: the single learning iteration and the overall learning process. First, to mitigate the gradient conflicts, we systematically investigate key architectural designs for extending UniZero. Our investigation identifies a Mixture-of-Experts (MoE) architecture as the most effective approach. We demonstrate, both theoretically and empirically, that this architecture alleviates gradient conflicts by routing task-specific representations to specialized sub-networks. This finding leads to our proposed model, ScaleZero. Second, to dynamically allocate model capacity throughout the learning process, we introduce an online Dynamic Parameter Scaling (DPS) strategy. This strategy progressively integrates LoRA adapters in response to taskspecific progress, enabling adaptive knowledge retention and parameter expansion. Evaluations on a diverse set of standard benchmarks (Atari, DMC, Jericho) demonstrate that ScaleZero, utilizing solely online reinforcement learning with one model, performs on par with specialized single-task agents. With the DPS strategy, it remains competitive while using just 71.5% of the environment interactions. These findings underscore the potential of ScaleZero for effective multitask planning. Our code is available at https://github.com/opendilab/LightZero.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2509.07945")
get_code_for_paper("2509.07945")
have("2509.07945")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2509.07945.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2509.07945.svg)](https://syntology.ai/paper/2509.07945)

Connect an agent — have() is free.