Compress Where Labels Are Scarce: Autoencoder Bottlenecks for Unevenly Labeled Multi-Task Learning

Multi-task learning trains one network to solve several prediction problems at once, for example segmenting an indoor scene, estimating its depth, and estimating surface orientation from the same photo. In practice the tasks rarely have equal amounts of labeled data. Depth may come free from a sensor, while pixel-accurate segmentation masks are expensive. The field's standard account of why a task gets worse when trained jointly, called "negative transfer," blames conflicting gradients, meaning cases where tasks push the shared weights in opposite directions. It answers with optimizers that reshape those gradients. We propose a different account for the uneven-label regime. A data-starved task is hurt mainly by estimation variance: it has too few labels to fit a head on a large shared representation. The fix is to give that task a smaller representation, not a better gradient.

Concretely, we insert an autoencoder bottleneck between the shared backbone and the task heads. An autoencoder is a network trained to compress its input into a small code and rebuild the input from that code. Ours reconstructs the image, so it can be trained on every image, including those that lack labels for a given task. Each task then reads a nested slice of the bottleneck whose size is matched to that task's label budget. The prediction is sharp and falsifiable. A single-task result, Does the Data Processing Inequality Reflect Practice?, proves that dimensionality reduction cuts classification error with finite samples, and that the gain peaks at moderate sample sizes and vanishes with abundant data. If that account carries over to multi-task learning, the benefit of compression should rise and then fall as a task's label count grows. It should shrink for data-rich tasks. Gradient-reshaping optimizers should not reproduce it.

Core Claim

In multi-task dense prediction with unequal per-task label budgets, a shared, reconstruction-trained bottleneck improves the scarce tasks because it reduces variance, not because it removes gradient conflict. The benefit depends on each task's label count in the non-monotonic way the finite-sample theory predicts. The best bottleneck size for a task should grow with its number of labels.

This claim takes a side in an open disagreement. CAGrad and RotoGrad treat conflicting gradient directions and mismatched gradient magnitudes as the cause of negative transfer. ForkMerge argues that conflicts can be harmless and that the real driver is drift away from what generalizes on the target task. Its example is weight decay, which conflicts with task gradients yet helps. Our account is a specific, mechanistic version of the second view: the drift that matters is variance from too few labels, and capacity control addresses it directly. We will measure gradient conflict throughout. If our method helps without lowering conflict, or while raising it, that is evidence against the conflict account in this regime.

Research Program

The model has four parts: a pretrained convolutional or Swin backbone, a spatial autoencoder bottleneck $z \in \mathbb{R}^{H \times W \times C}$, a light image decoder, and one head per task. Training minimizes

$$\mathcal{L} = \sum_{k=1}^{K} w_k\, \mathcal{L}_k\big(h_k(P_{c_k} z)\big)\, m_k \;+\; \beta\, \|x - g(z)\|_2^2 ,$$

where the symbols are as follows. $\mathcal{L}_k$ is task $k$'s loss and $h_k$ its head. $P_{c_k}$ keeps the first $c_k$ channels of $z$. $m_k$ is 1 when the image carries a task-$k$ label and 0 otherwise. $g$ is the reconstruction decoder, $x$ the input image, $\beta$ the reconstruction weight, and $w_k$ the task weights.

During training we randomly truncate $z$ to shorter channel prefixes when reconstructing. This makes the prefixes nested, so a narrower slice is a coarser but still usable summary. Because the reconstruction term runs on every image, a task with 5% of its labels still shapes, and benefits from, a code fitted on all of the data.

Two design choices come from prior work that constrains us. First, Walking the Tightrope studied single-task convolutional autoencoders. It found that spatial resolution matters far more than channel depth, and that bottlenecks with the same spatial size learn nearly the same representations regardless of channels. This is a warning that channel prefixes may be a weak control. So we search each task's slice over a small grid covering both channel prefix and spatial pooling level. We report which axis actually carries the effect. Second, the finite-sample theory is proven only for linear projections and Gaussian mixtures. We therefore include a linear projection baseline, which is principal component analysis (PCA) of the backbone features. If the effect is purely about compression and not about nonlinear autoencoding, that baseline will reveal it.

The scientific product is a set of gain-versus-label-fraction curves, one per task. We also fit a simple rule that predicts the chosen $c_k$ from label count, so a practitioner can set bottleneck sizes without a validation search.

Baselines

The naive reference points are independent single-task models and uniform-weight hard parameter sharing, where all heads read the full backbone features. Every relative metric is computed against the single-task models. The uniform-sharing model shows how much joint training alone helps or hurts at each label budget.

The strongest gradient-based competitor is CAGrad, which picks the update that most improves the worst-off task within a ball around the average gradient. CAGrad reports a per-task average drop Δm of 0.20% on NYUv2, compared with 3.97% for PCGrad and 5.59% for MTAN. The strongest competitor that explicitly targets negative transfer is ForkMerge. It periodically trains a target-only copy and a target-plus-auxiliary copy, then blends their weights using validation performance. ForkMerge reports a +4.03% relative gain over single-task learning on NYUv2, and says it beats NashMTL and CAGrad. We also run RotoGrad, which rotates the shared features per task. As an architectural reference we include DeMT, which reports Δm = +3.36% on NYUD-v2 with Swin-T at 100.7 GFLOPs.

All of these published numbers use full labels and differing setups. We therefore rerun every method on the same backbone, the same label subsets, the same number of training steps, and the same hyperparameter search budget per method. ForkMerge gets the same validation split that our method uses to choose slice sizes.

Two ablations isolate the key ingredient. The first keeps the reconstruction loss but gives every task the full-width code, which tests whether compression matters beyond the auxiliary objective. The second keeps the narrow per-task slices but drops reconstruction, which tests whether the unlabeled images matter. A third ablation trains reconstruction only on labeled images.

Our method beats a baseline if two things hold. It must improve the scarce task at moderate label fractions (roughly 5–25%) by more than seed-to-seed variation over five seeds. It must also not lower average Δm at full labels. We additionally test whether combining our bottleneck with CAGrad beats each alone, since the two target different causes.

Why not just…?

Why not just add a reconstruction loss to an ordinary multi-task network? This is the most direct threat, and the first ablation above is exactly this model. If full-width reconstruction matches label-matched slices, then our claim about compression is wrong. The contribution would reduce to "use unlabeled images through reconstruction." We would report that outcome as such.

Why not just use gradient surgery such as CAGrad or ForkMerge? Both are strong at full labels. Neither changes how many parameters a 5%-labeled head must estimate. If the harm is variance, their gains should be roughly flat across label fractions, while ours should peak at moderate fractions. The gain curves test this directly. ForkMerge's validation-guided merge could partly act as variance control, and we will say so if its curve tracks ours.

Why not just freeze a strong pretrained encoder, or project it with PCA? The finite-sample paper itself obtained 30–40% error reductions on low-data Mini-ImageNet by mapping into a pretrained DINOv2 embedding space. Much of the benefit may therefore already live in the pretrained backbone. The PCA baseline and a frozen-encoder sequential baseline test this. If PCA on backbone features matches the autoencoder, the right conclusion is "reduce dimensionality in proportion to labels," and the autoencoder is unnecessary.

Proposed Experiments

We use four benchmarks. The first is NYUv2 with segmentation, depth, and normals. Here we subsample segmentation labels to 5, 10, 25, 50, and 100% while keeping depth and normals full, then rotate which task is scarce. The second is PASCAL-Context with its five dense tasks, in which many of the 520 classes score below 2% IoU, making it a natural rare-label stress test. The third is CelebA's 40 attributes with per-attribute label subsampling. The fourth is Multi-MNIST, where the tasks are the left and right digits, for controlled sweeps with synthetic noise. Varying the noise tests the theory's prediction that gains grow with class separation.

Metrics are Δm, per-task metrics, the cosine between task gradients at the bottleneck, and the variance of predictions across seeds.

Three decisive checks settle the claim. First, the scarce task's gain over uniform sharing must be non-monotonic in label fraction and near zero at 100%. Second, the chosen slice size must increase with label count. Third, this label-dependent pattern must be absent for CAGrad and ForkMerge, and must not coincide with reduced gradient conflict. Failing the first two falsifies the variance account. Failing the third, with a variance reduction explained entirely by lower conflict, would support the gradient-conflict view instead.