SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2307.15324 · ICCV · 2023

TaskExpert: Dynamically Assembling Multi-Task Representations with Memorial Mixture-of-Experts

Dan Xu, Hanrong Ye

arXiv · PDF · Open in the Atlas

Code that ran

4 of 8 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 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; 3 failures of our instrument; 4 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; 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/2307.15324.json · badge: /api/ran/2307.15324.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
prismformore/multi-task-transformer marked official in Papers with Code
Papers with Code archive
4 ran · 4 no recorded run
FunctionStatusWhere it lives
Attention Ran
ran on a synthesized input · constructed an object; no result was computed
prismformore/multi-task-transformer/TaskPrompter/models/transformers/taskprompter.py
code served (permissive licence) · get_code("ee6bbe827f8d9472")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, Attention: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type 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 numpy as np

torch.manual_seed(0)

# The Attention module needs:
# - chan_nheads: int (number of channel heads)
# - resolution: tuple (height, width)
# - dim: int (embedding dimension)
# - num_heads: int (number of attention heads)
# - qkv_bias: bool
# - attn_drop: float
# - proj_drop: float

# Looking at the forward pass:
# - x: (B, N, C) tensor where N includes prompt tokens and spatial tokens
# - task_prompts: (B, prompt_tokens, C) tensor
# The resolution must divide evenly by chan_nheads for windowing
# pixel_no = resolution[0] * resolution[1]
# chan_nheads must divide pixel_no evenly
# dim must be divisible by num_heads

# Let's set up parameters that work:
# - resolution: (4, 6) -> 24 pixels
# - chan_nheads: 4 -> each head gets 6 pixels, sqrt(4)=2x2 grid
# - dim: 8 (divisible by num_heads=8? No, let's use num_heads=4)
# Actually dim must be divisible by num_heads
# Let dim=16, num_heads=4, so head_dim=4

dim = 16
num_heads = 4
resolution = (4, 6)  # 24 pixels
chan_nheads = 4  # sqrt(4) = 2, so 2x2 window grid
pixel_no = resolution[0] * resolution[1]  # 24

# Verify chan_nheads divides pixel_no: 24 / 4 = 6 ✓
# Verify sqrt(chan_nheads) is integer: sqrt(4) = 2 ✓
# Verify dim divisible by num_heads: 16 / 4 = 4 ✓

ARGS = {
    'chan_nheads': chan_nheads,
    'resolution': resolution,
    'dim': dim,
    'num_heads': num_heads,
    'qkv_bias': False,
    'attn_drop': 0.0,
    'proj_drop': 0.0,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Attention — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Attention output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
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: none by the harness; any seed is in the setup block
rearrange Ran
ran; our contract draft was wrong, not the code
prismformore/multi-task-transformer/TaskPrompter/models/transformers/taskprompter.py
code served (permissive licence) · get_code("2e10210303b061a9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 12) 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 numpy as np
from einops import rearrange as o_rearrange

torch.manual_seed(0)

# The rearrange function from einops takes:
# - tensor: the input tensor to rearrange
# - pattern: a string describing the rearrangement pattern
# - **axes_lengths: optional keyword arguments for dimension names

# Create a small test tensor
tensor = torch.randn(2, 4, 3)  # batch=2, height=4, width=3

# Define a rearrangement pattern
pattern = "b h w -> b (h w)"

# axes_lengths can be empty dict for simple patterns
axes_lengths = {}

ARGS = {
    "tensor": tensor,
    "pattern": pattern,
    **axes_lengths
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 12) — shape (2, 12) 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: none by the harness; any seed is in the setup block
resize_pos_embed Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
prismformore/multi-task-transformer/TaskPrompter/models/transformers/taskprompter.py
code served (permissive licence) · get_code("191b2735955d18f4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 3, dtype family float, shape (1, 17, 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 math

torch.manual_seed(0)

# The function resizes positional embeddings from one shape to another
# posemb: original position embeddings tensor (batch_size, num_tokens, embedding_dim)
# posemb_new: target position embeddings tensor with desired shape
# num_tokens: number of special tokens (like cls token) to preserve
# gs_new: target grid size (height, width) for the spatial part

# Create small test tensors
embedding_dim = 4
num_special_tokens = 1
old_grid_size = 3  # 3x3 = 9 spatial tokens
old_total_tokens = num_special_tokens + (old_grid_size * old_grid_size)  # 1 + 9 = 10

# Original position embedding: (batch=1, num_tokens=10, embedding_dim=4)
posemb = torch.randn(1, old_total_tokens, embedding_dim)

# New position embedding target shape
new_grid_size = 4  # 4x4 = 16 spatial tokens
new_total_tokens = num_special_tokens + (new_grid_size * new_grid_size)  # 1 + 16 = 17
posemb_new = torch.randn(1, new_total_tokens, embedding_dim)

# Grid size for new embedding (4x4 spatial grid)
gs_new = [4, 4]

ARGS = {
    'posemb': posemb,
    'posemb_new': posemb_new,
    'num_tokens': num_special_tokens,
    'gs_new': gs_new,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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 (1, 17, 4) — shape (1, 17, 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: none by the harness; any seed is in the setup block
sep_prompt Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
prismformore/multi-task-transformer/TaskPrompter/models/transformers/taskprompter.py
code served (permissive licence) · get_code("84cbc8dde894bd57")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type 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

torch.manual_seed(0)

# Create a small 3D tensor: (batch=2, sequence_length=10, embedding_dim=4)
x = torch.randn(2, 10, 4)

# Define prompt_length
prompt_length = 3

ARGS = {
    "x": x,
    "prompt_length": prompt_length,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
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: none by the harness; any seed is in the setup block
Block Not yet run
unverified (harvested, no recorded run)
prismformore/multi-task-transformer/TaskPrompter/models/transformers/taskprompter.py
code served (permissive licence) · get_code("786d3dd6c884f03f")
How it ran

no invocation recorded.

TaskPrompter Not yet run
unverified (harvested, no recorded run)
prismformore/multi-task-transformer/TaskPrompter/models/transformers/taskprompter.py
code served (permissive licence) · get_code("f433e5e5bd35351b")
How it ran

no invocation recorded.

_init_vit_weights Not yet run
unverified (harvested, no recorded run)
prismformore/multi-task-transformer/TaskPrompter/models/transformers/taskprompter.py
code served (permissive licence) · get_code("fe1af6a5e64c4760")
How it ran

no invocation recorded.

_load_weights Not yet run
unverified (harvested, no recorded run)
prismformore/multi-task-transformer/TaskPrompter/models/transformers/taskprompter.py
code served (permissive licence) · get_code("930478a0420de5ff")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 5 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 5 later) and 3 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.

FunctionAlso present inEarliest-datedOthers named
resize_pos_embed
brick of this paper's assembly: helper
20 other papers
7 dated earlier, 12 later, 1 same year, order not determinable · 1 only as an assembly brick
2105.12723 (2021-05)
Nested Hierarchical Transformer: Towards Accurate, Data-Efficient and Interpretable Visual Understanding
2202.07800 (2022-02)
Not All Patches are What You Need: Expediting Vision Transformers via Token Reorganizations
and 17 more not named here
_init_vit_weights
brick of this paper's assembly: helper
3 other papers
2 dated earlier, 1 later · 1 only as an assembly brick
2204.03645 (2022-04)
DaViT: Dual Attention Vision Transformers
2204.07683 (2022-04)
Safe Self-Refinement for Transformer-based Domain Adaptation
2403.17749 (2024-03)
Multi-Task Dense Prediction via Mixture of Low-Rank Experts
_load_weights
brick of this paper's assembly: helper
1 other paper
1 later · 1 only as an assembly brick
2403.17749 (2024-03)
Multi-Task Dense Prediction via Mixture of Low-Rank Experts
rearrange
brick of this paper's assembly: helper
1 other paper
1 later · 1 only as an assembly brick
2403.17749 (2024-03)
Multi-Task Dense Prediction via Mixture of Low-Rank Experts
sep_prompt
brick of this paper's assembly: helper
1 other paper
1 later
2403.17749 (2024-03)
Multi-Task Dense Prediction via Mixture of Low-Rank Experts

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-22.

Repositories linked to this paper

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

Abstract

Learning discriminative task-specific features simultaneously for multiple distinct tasks is a fundamental problem in multi-task learning. Recent state-of-the-art models consider directly decoding task-specific features from one shared task-generic feature (e.g., feature from a backbone layer), and utilize carefully designed decoders to produce multi-task features. However, as the input feature is fully shared and each task decoder also shares decoding parameters for different input samples, it leads to a static feature decoding process, producing less discriminative task-specific representations. To tackle this limitation, we propose TaskExpert, a novel multi-task mixtureof-experts model that enables learning multiple representative task-generic feature spaces and decoding task-specific features in a dynamic manner. Specifically, TaskExpert introduces a set of expert networks to decompose the backbone feature into several representative task-generic features. Then, the task-specific features are decoded by using dynamic task-specific gating networks operating on the decomposed task-generic features. Furthermore, to establish long-range modeling of the task-specific representations from different layers of TaskExpert, we design a multitask feature memory that updates at each layer and acts as an additional feature expert for dynamic task-specific feature decoding. Extensive experiments demonstrate that our TaskExpert clearly outperforms previous best-performing methods on all 9 metrics of two competitive multi-task learning benchmarks for visual scene understanding (i.e., PASCAL-Context and NYUD-v2). Codes and models will be made publicly available.

For agents

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

get_harvested_code_for_paper("2307.15324")
get_code_for_paper("2307.15324")
have("2307.15324")

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

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

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

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

Connect an agent — have() is free.