Manuscript Offprint

arXiv:2608.28078

Task-State Adaptation with Prototype Memory for Multi-Task Dense Prediction

Yangyang Xu, Haobo Yuan, Yuzhu Wang, Duo Su, Xi Ye, Yibo Yang, Jun Zhu

Abstract

Vision foundation backbones provide strong representations for dense prediction, yet a single shared feature still needs to support tasks with different, image-dependent adaptation requirements. We propose MemMTL, a multi-task dense prediction framework that estimates a compact task state from global visual context and refines it through a learnable task-state prototype memory. The refined state is converted into task-conditioned expert logits and combined with token-level logits before sparse top-k selection over a local expert bank shared by all tasks. A separate task-agnostic residual bank provides a common adaptation path, and both paths are added once to the backbone feature before task-specific prediction. We specify a matched evaluation protocol on NYUD-v2 and PASCAL-Context with SAM 3 and ViT-L backbones to measure predictive quality, computational cost, and the contributions of task-state conditioning, prototype retrieval, and sparse routing. The numerical record in the present working draft pre-dates this canonical implementation and must be regenerated before it can support empirical claims.

Introduction

Multi-task dense prediction learns semantic segmentation, depth estimation, surface normal prediction, boundary detection, and related pixel-level tasks in a unified model (Vandenhende et al. 2022). Recent vision backbones, including ViT (Dosovitskiy et al. 2021) and SAM 3 (Carion et al. 2026), provide strong shared features for these tasks (Ye and Xu 2022; Yang et al. 2025; Lu, Cao, and Wang 2025). A remaining design question is how to adapt the same dense feature to different tasks and images without replicating a large decoder for every output.

Existing methods approach this question from complementary directions. Optimization methods balance task losses or modify task gradients (Kendall, Gal, and Cipolla 2018; Chen et al. 2018; Yu et al. 2020; Liu et al. 2021a). Architectural methods introduce task interaction modules (Bruggermann et al. 2021; Ye and Xu 2022; Xu, Yang, and Zhang 2023a; Huang et al. 2024a), prompts (Ye and Xu 2023b), adapters (Jiang, Wang, and Gong 2024), or mixture-of-experts (MoE) layers (liang et al. 2022; Ye and Xu 2023a; Yang et al. 2024). MoE designs are particularly attractive because they can separate reusable expert transformations from input-dependent routing. Their behavior, however, depends on how image-level task requirements and token-level evidence are combined when selecting experts.

We propose MemMTL, a task-state-conditioned sparse adaptation framework for multi-task dense prediction. MemMTL first pools the fused backbone feature and maps it to a coarse state for each image–task pair through a sparse mixture of global state experts. A learnable task-state prototype memory then retrieves a small set of normalized prototypes by cosine similarity and refines the coarse state through a residual connection and layer normalization. The refined state produces image-level expert logits. Rather than applying these logits after expert selection, MemMTL adds them to token-level logits before top-k routing. Consequently, both global task context and local token evidence determine the experts that are dispatched.

All tasks use the same routed local expert bank, so an expert index has a consistent meaning across tasks. In parallel, a separate task-agnostic expert bank produces a shared residual from the dense feature. Both expert modules return residuals only, and the final task feature is the backbone feature plus one routed task residual and one task-agnostic residual. This construction makes the sharing pattern and residual path explicit while keeping the task losses and their balancing coefficients independent of the routing design.

We target matched evaluation with SAM 3 (Carion et al. 2026) and ViT-L (Dosovitskiy et al. 2021) on NYUD-v2 (Silberman et al. 2012) and PASCAL-Context (Chen et al. 2014). The required experiments measure the overall multi-task tradeoff, routing sparsity, expert count, and the contributions of task-state conditioning and prototype retrieval. The numerical tables currently retained in the manuscript were generated before the canonical implementation and serve only as a rerun manifest, not as evidence for these claims.

Our main contributions are:

• We formulate a hierarchical sparse router in which a prototype-refined, image-level task state and token-level visual evidence jointly determine top-k expert selection.

• We introduce a learnable task-state prototype memory and an explicit two-residual design consisting of one

∗^{*}Corresponding Author.

Copyright © 2027, Association for the Advancement of Artificial Intelligence (www.aaai.org). All rights reserved.

task-routed expert bank shared across tasks and one task-agnostic expert bank.

• We define a matched, multi-seed evaluation protocol for two vision backbones on NYUD-v2 and PASCAL-Context, including component, routing, expert-count, efficiency, and intervention studies.

References (48)

  • MTLoRA: A Low-Rank Adaptation Approach for Efficient Multi-Task Learning
  • Vision transformer adapters for generalizable multitask learning
  • Exploring relational context for multi-task dense prediction
  • SAM 3: Segment Anything with Concepts
  • Adamv-moe: Adaptive multi-task vision mixture-of-experts
  • Detect what you can: Detecting and representing objects using holistic models and body parts
  • Gradnorm: Gradient normalization for adaptive loss balancing in deep multitask networks
  • Mod-squad: Designing mixtures of experts as modular multi-task learners
  • DeepSeekMoE: Towards Ultimate Expert Specialization in Mixture-of-Experts Language Models
  • An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale
  • Glam: Efficient scaling of language models with mixture-of-experts
  • Switch transformers: Scaling to trillion parameter models with simple and efficient sparsity
  • Going Beyond Multi-Task Dense Prediction with Synergy Embedding Models
  • FaPN: Feature-aligned pyramid network for dense image prediction
  • Learning piecewise control strategies in a modular neural network architecture
  • Adaptive mixtures of local experts
  • Task-Conditional Adapter for Multi-Task Dense Prediction
  • Multi-task learning using uncertainty to weigh losses for scene geometry and semantics
  • Segment anything
  • GShard: Scaling Giant Models with Conditional Computation and Automatic Sharding
  • PiKE: Adaptive Data Mixing for Large-Scale Multi-Task Learning Under Low Gradient Conflicts
  • M $^{3}$ViT: Mixture-of-Experts Vision Transformer for Efficient Multi-task Learning with Model-Accelerator Co-design
  • Conflict-averse gradient descent for multi-task learning
  • Towards impartial multi-task learning
  • Polyhistor: Parameter-Efficient Multi-Task Adaptation for Dense Vision Tasks
  • Prompt guided transformer for multi-task dense prediction
  • A comprehensive survey of mixture-of-experts: Algorithms, theory, and applications (opens arXiv in a new tab)
  • NTKMTL: Mitigating Task Imbalance in Multi-Task Learning from Neural Tangent Kernel Perspective
  • SAM 2: Segment Anything in Images and Videos
  • Scaling vision with sparse mixture of experts
  • Multi-task learning as multi-objective optimization
  • Channel-Wise Knowledge Distillation for Dense Prediction
  • Indoor segmentation and support inference from rgbd images
  • Merging Multi-Task Models via Weight-Ensembling Mixture of Experts
  • Multi-Task Learning for Dense Prediction Tasks: A Survey
  • Mti-net: Multi-scale task interaction networks for multi-task learning
  • MTSAM: Multi-task fine-tuning for segment anything model
  • Vmtadapter: Parameter-efficient transfer learning for multi-task dense scene understanding
  • PADNet: Multi-tasks guided prediction-and-distillation network for simultaneous depth estimation and scene parsing
  • DeMT: Deformable Mixer Transformer for Multi-Task Learning of Dense Prediction
  • Multi-task learning with knowledge distillation for dense prediction
  • Multi-task dense prediction via mixture of low-rank experts
  • Multi-Task Dense Predictions via Unleashing the Power of Diffusion
  • Inverted Pyramid Multi-task Transformer for Dense Scene Understanding
  • Taskexpert: Dynamically assembling multi-task representations with memorial mixture-of-experts
  • TaskPrompter: Spatial-Channel Multi-Task Prompting for Dense Scene Understanding
  • Gradient surgery for multi-task learning
  • Exploring Tradeoffs through Mode Connectivity for Multi-Task Learning