arXiv:2610.29571cs.LGOct 2026

Manuscript Offprint

arXiv:2610.29571

Implicit Feature Reweighting for Label-Free Graph Generalization

Tianjun Yao, Chen Xi, Xinyang Li, Lixian Zhong

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Graph-level out-of-distribution (OOD) generalization is critical for deploying graph neural networks in real-world applications where distribution shifts are inevitable. Existing approaches typically require class labels during representation learning to decide which substructures are predictive, limiting their applicability. We propose SCARCE, a label-free representation-learning framework that yields distribution-shift-robust graph representations from an environment partition of the training graphs alone, whether that partition comes from dataset metadata or, when none is available, from clustering a self-supervised embedding. Our method operates in two stages: (1) a variational graph autoencoder is warm-started for graph reconstruction; and (2) an adversarial confusion mechanism forces the encoder to produce representations from which a discriminator cannot distinguish environments, while preserving graph-reconstruction fidelity. We provide theoretical analysis showing that environment confusion contracts environment-discriminative directions in the representation space, which, under regularized downstream classifiers, is equivalent to imposing a stronger directional penalty on environment-associated features. This feature-reweighting mechanism reduces reliance on spurious correlations without erasing information, offering a label-free, continuous relaxation of last-layer reweighting methods. Experiments on a controlled synthetic model, the GOOD-Motif benchmark, and molecular property prediction under assay, scaffold, and size shifts show that SCARCE achieves state-of-the-art OOD generalization among label-free methods, using no class labels during representation learning.

1 INTRODUCTION

Machine learning models are routinely deployed on data whose distribution differs from that of their training set, and their tendency to latch onto features that are predictive only in training makes such shifts a primary cause of failure (Geirhos et al., 2020; Gulrajani & Lopez-Paz, 2021). Graph data sharpens the problem: molecules are tested on scaffolds absent from training, and graph size or base-graph structure drifts between collections (Gui et al., 2022; Ji et al., 2023; Li et al., 2025b). A substantial body of work now targets out-of-distribution (OOD) generalization on graphs, typically by extracting an invariant subgraph or enforcing invariance across environments (Wu et al., 2022b; Chen et al., 2022; Miao et al., 2022; Yang et al., 2022a; Wu et al., 2022a; Gui et al., 2023). These methods share a prerequisite that is easy to overlook: they need class labels to decide which substructures are predictive, environment labels to decide which correlations are unstable, or both.

Class labels are the expensive part. In drug discovery a single assay label is the outcome of a wet-lab experiment, and many DrugOOD assays contain only tens of labeled molecules, whereas unlabeled molecular graphs are available by the tens of millions (Ji et al., 2023; Hu et al., 2020; Rong et al., 2020). Environment information, by contrast, is cheap but rough: a benchmark may ship a domain index, a scaffold can be computed although which scaffolds form an environment is a modeling decision, and for proteins or social networks the partition has to be inferred from the data itself (Lin et al., 2022; Yao et al., 2024). A method that learns shift-robust representations from

Figure

Figure 1: Overview of the SCARCE framework. Given an environment partition of the training graphs (dataset metadata or, when unavailable, clusters of a frozen self-supervised embedding), (1) a VGAE is warm-started for graph reconstruction and (2) an adversarial confusion mechanism forces the encoder to produce representations indistinguishable across environments while preserving reconstruction fidelity.

an environment partition alone, with no class labels, and that tolerates a coarse or inferred partition, would therefore cover the common case. This setting remains largely unexplored on graphs: the few existing label-free methods add invariance-inspired augmentations to a contrastive objective (Li et al., 2022b; 2024), and none establishes what the learned representation actually retains.

Removing class supervision raises two obstacles, and each points to one of our contributions. The first concerns what the representation contains. Without labels one can neither tell the encoder which features to keep nor check afterwards which it kept, and a contrastive objective offers no guarantee: it is minimized by whichever features most easily discriminate instances and suppresses the rest (Robinson et al., 2021), and a representation that has discarded the core features cannot be repaired downstream. Likelihood objectives behave differently: because the latent must explain the whole input, they keep core features alongside shortcuts (Yang et al., 2022b; Li et al., 2025a; Müller et al., 2024; Qiang et al., 2025). We show that this holds for graph reconstruction without any auxiliary variable: for a variational graph autoencoder (Kipf & Welling, 2016), reconstruction alone forces the latent to retain both environment-specific and core factors (Theorem 4.1), and both remain linearly accessible. The second obstacle concerns what to do with them. No class label says which factor is spurious, and erasing environment information outright discards useful signal along with the shortcut (Belrose et al., 2023; Lin et al., 2024). We show that neither selection nor erasure is needed: it suffices to shrink the environment-associated directions, because any ℓ2\ell_{2}-regularized downstream classifier then finds them expensive to use and shifts its weight onto the core features. We realize this shrinkage with an adversarial confusion loss against the training environments, which asks nothing of the partition beyond that it separate the spurious factor, and call the framework SCARCE (Shortcut Contraction via Adversarial Representation Compression for Environments).

Our contributions are as follows.

① Retention by reconstruction. We prove that VGAE reconstruction alone forces the latent to retain both environment-specific and core features (Theorem 4.1), and verify that both are linearly accessible.

② Contraction as a ridge penalty. We propose a confusion loss that scales down environment-discriminative directions rather than erasing them, prove that this contraction (Lemma 4.2) is exactly equivalent to an anisotropic ridge penalty on the downstream probe (Proposition 4.3), and characterize exactly when it helps.

③ Empirical validation. Empirically, SCARCE attains state-of-the-art label-free OOD accuracy on GOOD-Motif and is best in 17 of 18 DrugOOD settings, where no environment annotation exists and clustered pseudo-environments suffice; a controlled synthetic study confirms the two preconditions identified by the theory.

Section 2 positions SCARCE against supervised and contrastive alternatives, Section 3 and Section 4 state the setting and the two guarantees, and Section 5 tests the mechanism from a synthetic model up to DrugOOD.

References (45)