Skip to main content
Back

Rel-MOSS Fixes the Silent Failure Killing AI on Skewed Database Data

Rel-MOSS is the first GNN method to tackle class imbalance in relational databases, beating SOTA by up to 4% on 12 real-world benchmarks

Pro

  • First paper to formally address class imbalance in relational database entity classification with GNNs.
  • Rel-MOSS introduces two modules: Rel-Gate (relation-aware gating to amplify minority signals) and Rel-Syn (structure-preserving over-sampling).
  • Vanilla RDL models score G-Mean = 0.0 on severely imbalanced tasks; Rel-MOSS raises this to 0.80 on f1-driver-top3.
  • Average gains of +2.46% Balanced Accuracy and +4.00% G-Mean across 12 RelBench datasets vs. SOTA.
  • Works as a plug-and-play module across GNN backbones (GraphSAGE, HGT, RelGNN) with ~1s overhead per epoch.
  • Code is open-source at github.com/Esperanto-mega/RelMOSS; accepted at ICML 2026.

Most enterprise data lives in relational databases, and a growing body of work called Relational Deep Learning (RDL) is trying to make GNNs work directly on that data, without the usual grind of manual feature engineering. The idea is elegant: turn your tables and foreign-key links into a heterogeneous graph, then run a GNN over it end-to-end. But there is a blind spot that the entire field has been ignoring, and it is one that makes these models nearly useless in the most commercially important scenarios.

A new paper accepted at ICML 2026 called Rel-MOSS is the first to formally address class imbalance in RDB entity classification. The authors show that existing RDL methods, when applied to skewed datasets, simply give up on the minority class entirely, producing Balanced Accuracy scores of 0.5 and G-Mean scores of 0.0 -- the statistical equivalent of a model that never predicts the rare class at all.

The blind spot hiding in plain sight

Class imbalance is not a new problem. In fraud detection, the vast majority of accounts are legitimate. In ad-click prediction, most users never click. In clinical trial outcome prediction, failures outnumber successes. These are exactly the cases where getting the minority class right matters most, and they are exactly the cases where RDL models fail silently.

Diagram showing how majority class information overwhelms minority signals during GNN message aggregation

The problem is structural. In a standard heterogeneous GNN, neighborhood messages from all relation types are aggregated with equal weight. Because majority-class entities vastly outnumber minority ones, their signals dominate every message-passing step. The authors prove this formally: the minority discriminative signal decays exponentially across GNN layers, with a contraction factor proportional to how rare the minority class is in each entity's neighborhood. By the time you reach the classifier head, minority and majority representations are nearly indistinguishable.

A second, subtler problem compounds this. In regular graphs, node features carry rich semantic meaning. In relational databases, entity features are mostly IDs, timestamps, and categorical codes -- they identify an entity but say little about its class. The real signal lives in the relational structure: who a customer bought from, how often, through which channels. Existing over-sampling methods like SMOTE and GraphSMOTE interpolate in feature space, completely ignoring this structural context, and end up generating synthetic minority samples that look structurally nothing like real minority entities.

Two modules, one coherent fix

Rel-MOSS introduces two components that work together to fix both problems.

Rel-Gate (Relation-wise Gating Controller) addresses the signal collapse. For each relation type, it estimates the likelihood that the neighborhood messages from that relation lean toward the minority class, using a cross-attention mechanism:

# Simplified Rel-Gate logic
for each relation r:
    H_e_r = aggregate_neighbors(entity_e, relation_r)
    # Cross-attention between entity and its neighborhood
    gate = sigmoid(R_r + softmax(Q(X_e) @ K(H_e_r).T / sqrt(d)) @ V(H_e_r))
    # Amplify minority-relevant signals, suppress majority noise
    X_e += gate * H_e_r

The learnable embedding R_r per relation type lets the model develop a per-relation prior about minority relevance. Relations that consistently carry minority signal get amplified; relations dominated by majority noise get suppressed.

Rel-Syn (Relation-guided Minority Synthesizer) fixes the over-sampling problem. Instead of finding the nearest neighbor in raw feature space, it computes distance using both the gated representation and a relational signature -- a structural fingerprint of each entity that captures things like the type histogram of 1-hop and 2-hop neighbors, and the fan-in/fan-out distribution of each relation type. Synthetic samples are then generated by interpolating both the representation and the relational signature between a minority entity and its structurally similar neighbor.

Architecture diagram of Rel-MOSS showing modality encoders, Rel-Gate, Rel-Syn memory bank, and classifier

A memory bank stores minority representations and their relational signatures, refreshed with a FIFO strategy during training. The final loss combines binary cross-entropy for classification with an MSE reconstruction loss on the relational signatures, forcing the model to generate structurally faithful synthetic minorities.

Benchmarks: the numbers that matter

The team evaluated Rel-MOSS on all 12 entity classification datasets from RelBench, the standard benchmark for RDL covering e-commerce, social networks, sports, and Q&A platforms. Imbalance ratios range from mild (1.04x on event-user-repeat) to severe (24.83x on avito-user-clicks).

The results are stark. On the most imbalanced datasets, vanilla RDL models score G-Mean = 0.0 -- they never predict the positive class. Rel-MOSS fixes this completely:

  • f1-driver-top3 (imbalance ratio 4.86): G-Mean jumps from 0.09 (RelGNN) to 0.80 -- a 7.9% improvement over the best baseline
  • avito-user-clicks (imbalance ratio 24.83): G-Mean goes from 0.0 to 0.59
  • stack-user-engagement (imbalance ratio 19.01): B-Acc improves to 0.81, a 2.54% gain over the best baseline
  • Average improvement: +2.46% Balanced Accuracy and +4.00% G-Mean over SOTA RDL and classic imbalance methods
  • PR-AUC improvements are even more pronounced -- the metric most sensitive to class imbalance

Critically, Rel-MOSS does not degrade performance on balanced datasets. On tasks where vanilla RDL already works well (like amazon-user-churn), Rel-MOSS matches or beats the baseline, while methods like GraphSMOTE actually hurt performance by disrupting relational structure during synthesis.

t-SNE visualization comparing synthetic minority samples from SMOTE, GraphSMOTE, and Rel-MOSS showing Rel-MOSS samples align with true minority distribution

The real breakthrough

The headline numbers are solid, but the deeper contribution is the formalization of two phenomena that were previously unacknowledged in the RDL literature: minority information collapse during heterogeneous message passing, and relational consistency violation during over-sampling. Both are proven mathematically, not just observed empirically. This gives practitioners a principled framework for diagnosing why their RDL models fail on imbalanced data, not just a recipe for fixing it.

Rel-MOSS is also designed as a plug-and-play module. The authors test it on three different GNN backbones -- heterogeneous GraphSAGE, HGT, and RelGNN -- and it improves all of them consistently. On the highly imbalanced f1-driver-top3 task, HGT's G-Mean jumps from 0.12 to 0.75 when Rel-MOSS is applied. The computational overhead is minimal: on a dataset with 19,000 samples, the additional runtime is roughly 1 second per epoch.

Where it applies and where it falls short

Rel-MOSS is most valuable when:

  • You are doing entity classification on a relational database (fraud detection, churn prediction, ad-click prediction, clinical trial outcome prediction)
  • Your positive class is rare -- imbalance ratios above ~4x are where the gains are most dramatic
  • You are already using or considering an RDL pipeline with a GNN backbone

The authors are candid about limitations. Rel-MOSS only addresses classification imbalance, not regression tasks where numerical distribution skew is the problem. The synthetic over-sampling approach also relies on interpolation, which is a relatively simple generative strategy -- the authors flag diffusion models and flow-based models as promising future directions for higher-quality minority synthesis. The method also currently focuses on binary classification; multi-class imbalance in RDBs remains open.

Code is available at github.com/Esperanto-mega/RelMOSS. Given that virtually every production database has some form of class skew in its most important prediction tasks, this is a gap that needed closing.