Pruning Synthetic Shortcuts with Domain-Cautious Weight Decay

Models trained on synthetic data, such as video-game frames or CAD renderings, often fail on real images. Part of the reason is that they pick up "shortcuts": rendering quirks that predict the label in simulation but are absent in reality. Unsupervised domain adaptation tries to fix this by training on unlabeled real images as well. In practice, these pipelines start from a model already trained on synthetic data, so the shortcut is already stored in the weights. Weight decay, the step that shrinks every parameter slightly toward zero at each update, is the one part of the optimizer that actively removes stored information. Today it does so blindly: at the same rate for every parameter, with no reference to which domain wants that parameter kept.

We propose to make weight decay domain-aware. During adaptation, we track separately the direction the synthetic-data loss wants each parameter to move and the direction the real-data loss wants it to move. We then concentrate decay on parameters where the real-data objective wants the weight to shrink and the synthetic objective wants it to stay large or grow. Those coordinates are the most plausible carriers of synthetic shortcuts. Parameters the two domains agree on are left alone. The change is a few lines of optimizer code, adds no architecture, and plugs into existing adaptation pipelines on VisDA-2017 and GTA5→Cityscapes.

Core Claim

Decoupled weight decay, the AdamW-style update in which shrinkage is applied directly to parameters rather than mixed into the gradient (Decoupled Weight Decay Regularization), gives a clean, unpreconditioned channel for removing parameter mass. Cautious Weight Decay showed that this channel works better when masked: it applies decay only on coordinates where the optimizer's own update already points toward zero. With that mask, a ViT-B/16 on ImageNet improved from 80.15% to 80.71%. That work uses a single, identically distributed data stream.

Our claim is that under synthetic-to-real adaptation, the right mask is a cross-domain one. Decay should fire where the real-domain update moves a weight toward zero while the synthetic-domain update moves it away. Doing so should remove synthetic shortcuts that gradient-level conflict handling can only freeze in place. This is different from cautious decay, which never looks at domains. It is also different from anchoring methods such as RecAdam (Recall and Learn), which pulls weights back toward the source solution and would therefore preserve shortcuts rather than prune them.

Mechanism

For each parameter coordinate $i$ we keep two first-moment buffers. The first, $m^{s}_i$, is the running average of the gradient from the labeled synthetic loss. The second, $m^{t}_i$, is the running average of the gradient from the real-domain adaptation loss, which is a pseudo-label or teacher-consistency loss. The second-moment estimate stays shared, as in AdamW. Writing $\theta_i$ for the parameter value, the decay mask is

$$ M_i = \mathbb{I}\left(m^{t}_i\,\theta_i \ge 0\right)\cdot \mathbb{I}\left(m^{s}_i\,\theta_i < 0\right). $$

The first factor is true when a descent step on the real loss would shrink $|\theta_i|$. The second is true when a descent step on the synthetic loss would enlarge it. The update applies the usual preconditioned step on the combined task gradient, plus decoupled decay $\eta\lambda_c M_i\theta_i$ on flagged coordinates and an ordinary background decay $\eta\lambda_0\theta_i$ elsewhere. Here $\eta$ is the learning rate, $\lambda_c$ is the conflict decay strength, and $\lambda_0 \le \lambda_c$ is the background decay strength.

Because the decay term bypasses the preconditioner, it is not distorted by the large historical gradients that synthetic textures produce. The decoupling literature identifies exactly this failure for coupled penalties (Three Mechanisms of Weight Decay Regularization; Understanding Decoupled and Early Weight Decay).

The method has two costs. The extra moment buffer costs one parameter-sized tensor. Computing source and target gradients separately requires two backward passes. To keep comparisons fair, we will charge both costs to the method in the baselines.

Research Program

The work has three parts.

The first is an instrumented testbed. We take VisDA-2017 source renderings and inject a controlled shortcut, a class-correlated color tint, that is absent from the real target images. With a known shortcut, we can verify directly two things: whether flagged coordinates concentrate in the channels that respond to the tint, and whether the model's reliance on the tint falls during adaptation. We measure reliance as the accuracy drop when the tint is swapped across classes on held-out synthetic images.

The second part is integration into two adaptation pipelines that the file documents on standard benchmarks. One is a mean-teacher self-ensembling pipeline on VisDA-2017 (Self-ensembling for visual domain adaptation). The other is a confidence-thresholded pseudo-label self-training pipeline on GTA5→Cityscapes and SYNTHIA→Cityscapes, in the style of Bidirectional Learning. In both cases only the optimizer changes.

The third part is a robustness read-out. We evaluate the GTA5-adapted Cityscapes model, without further training, on ACDC's fog, night, rain, and snow splits. This tests whether pruning synthetic shortcuts yields features that hold up under physical shifts that neither domain contained. The read-out follows the adverse-condition evaluation that LASA uses for domain generalization.

Baselines

The naive reference is the unchanged adaptation pipeline trained with AdamW at its published or default decay. It is rerun by us at the same number of steps, batch composition, and seeds. Every gain is reported relative to this rerun, not to a published number.

The strongest tuned version of the naive reference is AdamW with a grid search over a single decay value. We give it a tuning budget equal to the combined budget we spend on $\lambda_0$ and $\lambda_c$, and the same doubled backward-pass compute, used as extra steps. If domain-cautious decay cannot beat a well-tuned scalar decay given the same compute, the idea fails.

Cautious Weight Decay (Cautious Weight Decay) is the closest existing method. It applies its single-stream mask to the summed source-plus-target update. It is the most direct competitor because it already beats tuned AdamW on in-distribution data, so any gain we show must come from the domain-specific part of the mask. We run it in the same pipelines with the same tuning budget.

An anchor baseline applies RecAdam-style decoupled decay toward the synthetic-trained weights (Recall and Learn). It represents the opposite hypothesis, that adaptation fails by forgetting useful source knowledge. Comparing the two tells us which failure dominates.

The key ablation replaces our mask with a random mask of matched per-layer sparsity. A second variant keeps our mask but decays toward the source weights instead of toward zero. Together these isolate whether the gain comes from where decay is applied and from removing mass, rather than from simply having more decay.

For the strongest published reference points, the file reports the following. On VisDA-2017, CDTrans reached 88.4% accuracy (CDTrans) and ICON reached 87.4% mean-class accuracy (ICON). On GTA5→Cityscapes, unsupervised contrastive adaptation reached 60.2% mIoU (Unsupervised Contrastive Domain Adaptation), against a real-label oracle of about 65.1% reported in BDL. The self-ensembling 92.8% VisDA figure is a challenge-test ensemble result and is not comparable to single-model runs.

Beating a baseline means a gain over its rerun counterpart that exceeds the seed standard deviation across at least three seeds. On the strongest pipeline we can rerun, we also want the gain to persist when the method is added on top. For segmentation, the gain should also be visible on the hard classes the contrastive paper identifies, such as poles, signs, and riders, and not only in the average.

Why not just…?

Why not just tune AdamW's decay coefficient? A single scalar shrinks shortcut and causal coordinates alike. Adaptive Weight Decay reports that fixed decay is brittle under label noise; with 20% flipped labels, adaptive balancing improved CIFAR-100 accuracy by roughly 4%. Pseudo-labels on real images are exactly such a noisy regime. Still, this alternative is a real threat on benchmarks where the shortcut is weak. The equal-budget tuned-AdamW baseline settles it directly.

Why not just mask or project away conflicting gradients instead of changing decay? This is the most serious alternative. Dropping update components where source and target disagree is simpler, and it does stop the shortcut from growing. But adaptation starts from a model that has already learned the shortcut on synthetic data. Gradient masking leaves those weights in place, whereas decay removes them. We add a gradient-masking baseline with the same conflict criterion. The injected-tint testbed then distinguishes the two cleanly: if masking matches our method on tint reliance and accuracy, the decay framing adds nothing and we will say so.

Why not just use stronger augmentation or domain randomization? LASA reports that aggressive style randomization distorts class boundaries, for example confusing roads with sidewalks. Anchored methods move GTAV→Cityscapes domain-generalization performance to 55.93% mIoU (LASA). Augmentation also only addresses shortcuts the designer anticipates. Our method is complementary: we keep each pipeline's own augmentation fixed, and we test whether the gain survives adding a stronger style augmentation.

Why not just raise the pseudo-label confidence threshold? Stricter filtering starves hard classes of signal, as the contrastive adaptation work argues (Unsupervised Contrastive Domain Adaptation). It also weakens the target gradient that our mask depends on. We will sweep the threshold jointly with our method to show whether the two interact or substitute for each other.

Decisive Checks

Three outcomes would make or break the claim.

First, on the tint testbed, flagged coordinates should be enriched in tint-responsive channels relative to random coordinates. Tint reliance should fall faster than under Cautious Weight Decay or gradient masking.

Second, on VisDA-2017 and GTA5→Cityscapes, domain-cautious decay should beat equal-budget tuned AdamW and Cautious Weight Decay within the same pipeline. Decaying toward zero should beat decaying toward the source anchor.

Third, the gain should transfer to ACDC adverse conditions without further training.

There is also a known failure mode. Pseudo-labels inherit the source model's shortcuts, so the target gradient may rarely conflict with the source gradient. We will report the fraction of flagged coordinates over training. If that fraction is negligible, we conclude that the signal is too weak in pseudo-label regimes and that teacher-consistency losses are the necessary target signal.