When one neural network is trained on several tasks at once, every task reads from the same fixed-width feature vector. That width suits no task well. A simple task, such as a binary face attribute, needs a handful of directions in feature space. A complex task, such as predicting surface orientation at every pixel, needs many more. Because all tasks write gradients into all directions, they also interfere with each other. This proposal lets each task decide, for each input, which dimensions of a shared stochastic feature vector it actually reads. It does this with the variance-gating trick from VAEase, a recent sparse variational autoencoder, adapted so that every task gets its own gate. A task that closes a dimension for an input sends no gradient through it, so tasks fight only over the dimensions they genuinely share. The count of open dimensions per task becomes a measured estimate of how much latent capacity that task needs.
The opportunity exists because two literatures have reached complementary results without meeting. Representation-learning theory now shows that a properly gated stochastic latent recovers the true intrinsic dimension of data, meaning the number of independent factors the data actually varies along, and that it avoids the many bad local minima of standard sparse autoencoders (Sparse Autoencoders, Again?; Learning Manifold Dimensions with Conditional Variational Autoencoders). Multi-task methods, meanwhile, either rotate a fixed-width shared space (RotoGrad) or carve it into hand-sized slices (Latent Multi-Task Architecture Learning.). None of them lets the effective width differ per task and per input.
Core Claim
A shared encoder produces a mean vector $\mu(x)\in\mathbb{R}^d$. Each task $k$ has a small head that predicts its own per-dimension noise level $\sigma_k(x)\in(0,1)^d$. Task $k$ then reads a gated, noisy copy of the shared mean:
$$\bar z_k = (1-\sigma_k(x)) \odot \big(\mu(x) + \sigma_k(x)\odot\epsilon\big), \quad \epsilon\sim\mathcal{N}(0,I).$$
Training minimizes the sum of task losses plus a KL-style information penalty on each task's channel, which pushes $\sigma_k$ toward 1 unless the task benefits from a dimension:
$$\mathcal{L} = \sum_k \mathbb{E}_\epsilon\, \ell_k\big(h_k(\bar z_k), y_k\big) + \lambda \sum_k \sum_{j=1}^d \tfrac12\big(\mu_j^2 + \sigma_{kj}^2 - \log\sigma_{kj}^2 - 1\big).$$
Here $h_k$ is task $k$'s prediction head, $\ell_k$ its loss, $y_k$ its label, and $\lambda$ sets the information budget.
When $\sigma_{kj}\to 1$, dimension $j$ is closed for task $k$ on that input. The task receives only scaled-away noise there, and its gradient into $\mu_j$ vanishes. Because the gate is per-sample rather than a weight permanently zeroed in the head, a dimension closed for one input stays available for another. This is exactly the dead-dimension pathology VAEase avoids in the single-task case.
We make three claims. First, the number of open dimensions per task, $AD_k$, tracks that task's intrinsic dimension. Second, destructive gradient conflict concentrates on dimensions open for several tasks at once, so gating reduces negative transfer without discarding gradient signal the way projection methods do. Third, the result costs one backbone plus $O(Kd)$ gate outputs, unlike multi-expert designs such as BrainMoE, which reports roughly 4× inference latency.
Relation to Prior Work
The method is borrowed from two sources. VAEase introduced the gate $\bar z=(1-\sigma)\odot z$ and proved a unique global minimum where deterministic sparse autoencoders have $2^d$ local minima. It also recovered exactly 5 and 10 active dimensions on synthetic manifolds where standard sparse autoencoders overestimated by 2–3× (Sparse Autoencoders, Again?). Its evaluation is single-objective and unsupervised. We add separate gates for competing supervised objectives over one shared mean.
The conditional-VAE result that conditioning on a variable of effective dimension $t$ cuts active dimensions from $r$ to $r-t$ (Learning Manifold Dimensions with Conditional Variational Autoencoders) motivates our prediction about overlap. Factors used by several tasks should appear as dimensions jointly open across those tasks. The same paper also constrains the design. It found that sharing weights between encoder and prior raised reconstruction error from $1.81\times10^{-5}$ to $0.374$. We therefore keep the per-task variance heads separate from the shared mean network rather than tying them. We also caution that those guarantees are asymptotic and stated for reconstruction likelihoods, not supervised losses. Whether the dimension-recovery behavior survives is an empirical question here, not something we inherit.
Several multi-task methods share our goal but fix the dimensionality. RotoGrad gives each task a rotation of a $d$-dimensional shared vector to align gradient directions, but every task still sees all $d$ dimensions (RotoGrad). Sluice networks learn how much predefined subspaces mix, not how large they are (Latent Multi-Task Architecture Learning.). AutoMTL searches discrete share, copy, or skip choices over CNN operators rather than continuous latent width (AutoMTL). DeMT uses task-specific queries over a shared pool at a fixed token width (DeMT). Choi and Bajić's split of a latent tensor into 128 base and 192 total channels is the closest in spirit, but the split is hand-set for two tasks (Latent-Space Scalability for Multi-Task Collaborative Intelligence).
Two theory papers motivate the work and also pull against it. Zakerinia et al. show that multi-task networks need far fewer weight-space parameters per task: about 32 versus 400 on MNIST with 30 tasks (Deep Multi-Task Learning Has Low Amortized Intrinsic Dimensionality). They measure this in weights through static random projections, not in activations. Our $AD_k$ is an activation-space analogue we can compare against. The disentanglement theorem of Disentangling Representations through Multi-task Learning argues that multi-task training alone yields orthogonal latent axes once the number of tasks reaches the latent dimension. If that held generally, gating would be unnecessary. We treat this as a hypothesis the experiments test directly, by checking whether ungated training already produces task-separated dimensions.
Research Program
The first stage is a controlled synthetic benchmark in the style of the VAEase and conditional-VAE manifold experiments. Inputs are random nonlinear embeddings of $m$ latent factors. Each task depends on a known subset of factors, so each task has a known intrinsic dimension $r_k$ and each pair of tasks has a known number of shared factors. A variant makes the active factor set depend on the input, so per-sample gating has something to find. This gives ground truth for all three claims: whether $AD_k$ matches $r_k$, whether jointly open dimensions match shared factors, and whether gradient conflict concentrates on them.
The second stage moves to standard multi-task benchmarks with the gate inserted after the shared backbone. We use NYUv2 (segmentation, depth, surface normals), CelebA as 40 binary tasks, and Multi-MNIST. We measure task accuracy, $AD_k$, the overlap of open sets between task pairs, and gradient cosine similarity split by overlapping versus exclusive dimensions.
The third stage tests composition. Rotation and gating act on different things, so we apply a RotoGrad-style rotation only within the jointly open dimensions. This checks whether the two are complementary or redundant.
Baselines
The naive reference points are hard parameter sharing, meaning one backbone with linear task heads, and independent single-task models. Both use the same backbone, epochs, and augmentation. Our method should beat hard sharing on average per-task improvement over the single-task models, written $\Delta_m$. It should also not fall below the single-task models on any task.
The strongest gradient-side competitor is RotoGrad, because it attacks the same negative transfer while keeping a uniform width. On NYUv2 surface normals, RotoGrad reports a median angle error of 20.80, against 26.16 for vanilla multi-task training. We will rerun it with its published settings on our backbone, giving it the same number of hyperparameter trials as our method. Beating it means lower median angle error with no loss on segmentation or depth. For CelebA, RotoGrad reports the best average F1, but no reported result was found on Lacuna for the exact value, so we compare against our own rerun.
The strongest architecture-side reference is DeMT, which reports $\Delta_m$ = 3.36% and 46.36 IoU on NYUv2 with a Swin-T backbone at 100.7 GFLOPs (DeMT). We add our gate to a Swin-T backbone at matched FLOPs, within about 2%, and compare $\Delta_m$. For AutoMTL on NYUv2, no reported result was found on Lacuna, so we include it only as a rerun if compute allows.
Three ablations isolate the key ingredient. The first replaces the variance gate with a deterministic sigmoid mask trained with an $\ell_1$ penalty and tuned over the same budget. It tests whether the noise-plus-gate coupling matters, as VAEase's local-minima result predicts. The second makes the gate depend only on the task, not the input, which tests whether per-sample adaptivity matters. The third removes the noise term while keeping the gate, which tests whether the information penalty alone does the work.
Why not just…?
Why not just tune a separate bottleneck width for each task? This is the most serious threat. A per-task linear projection of tuned width, followed by its head, could capture most of the benefit if task complexity is constant across inputs. We include it as a baseline and give it a grid search over widths with a budget equal to ours. If it matches our method on NYUv2 and CelebA, the contribution shrinks to "choosing widths automatically, at a cost of $O(K)$ instead of an exponential search." We will say so plainly. The input-dependent synthetic variant is where per-sample gating should clearly win. If it does not, we will drop the per-sample claim.
Why not just learn per-task channel masks with an $\ell_1$ penalty or Gumbel-softmax? That is our first ablation. Sparse Autoencoders, Again? reports that deterministic $\ell_1$-sparse models need heavy penalty tuning and overestimate dimension 2–3× on synthetic manifolds. We expect the same overestimate and higher seed variance in $AD_k$ under multi-task losses. If deterministic masks match us across seeds, the stochastic gate is unnecessary.
Why not just use RotoGrad on a wider shared vector? Rotation fixes gradient direction but gives every task every dimension. A wider vector therefore adds over-capacity for simple tasks rather than removing it. We run RotoGrad at both the default width $d$ and $2d$. If the wider version matches our method, capacity rather than allocation was the bottleneck, and our story is wrong.
Why not just rely on multi-task training to disentangle by itself? The disentanglement theorem predicts that axes become orthogonal without help. We test this directly by measuring, in the ungated hard-sharing baseline, how well task-relevant subspaces separate on the synthetic benchmark. If they already separate cleanly and gradient conflict is low, gating has nothing to fix, and that is itself a useful negative result about the claim's limits.
Decisive Checks
The idea survives only if four checks hold. On the synthetic benchmark, $AD_k$ should fall within ±1 of each task's true $r_k$, and jointly open dimensions should match shared factors, both across five seeds. Gradient cosine similarity between tasks should be negative mainly on jointly open dimensions, and the share of conflicting gradient mass should drop relative to hard sharing. On NYUv2, the method should beat the tuned per-task-width baseline and the deterministic-mask ablation in $\Delta_m$ at matched FLOPs. It should also reach a surface-normal error at or below RotoGrad's reported 20.80 under our rerun. Finally, inference cost should stay within 10% of hard sharing.
If the per-task-width baseline ties our method on real benchmarks, we would still report the measured $AD_k$ values against Zakerinia et al.'s weight-space numbers. That comparison is a diagnostic of activation-space versus weight-space task complexity that no current method provides.
References
- Sparse Autoencoders, Again?
- Learning Manifold Dimensions with Conditional Variational Autoencoders
- RotoGrad: Gradient Homogenization in Multitask Learning
- Latent Multi-Task Architecture Learning.
- BrainMoE: Cognition Joint Embedding via Mixture-of-Expert Towards Robust Brain Foundation Model
- AutoMTL: A Programming Framework for Automating Efficient Multi-Task Learning
- DeMT: Deformable Mixer Transformer for Multi-Task Learning of Dense Prediction
- Latent-Space Scalability for Multi-Task Collaborative Intelligence
- From Low Intrinsic Dimensionality to Non-Vacuous Generalization Bounds in Deep Multi-Task Learning
- Disentangling Representations through Multi-task Learning