Abstract
Conventional supervised learning assumes a stable input-output relationship. However, this assumption fails in open-ended training settings where the input-output relationship depends on hidden contexts. In this work, we formulate a more general supervised learning problem in which training data is drawn from multiple unobservable domains, each potentially exhibiting distinct input-output maps. This inherent conflict in data renders standard empirical risk minimization training ineffective. To address this challenge, we propose a method LEAF that introduces an allocation function, which learns to assign conflicting data to different predictive models. We establish a connection between LEAF and a variant of the Expectation-Maximization algorithm, allowing us to derive an analytical expression for the allocation function. Finally, we provide a theoretical analysis of LEAF and empirically validate its effectiveness on both synthetic and real-world tasks involving conflicting data.
Introduction: The Challenge of Conflicting Data
Standard supervised learning relies on a fundamental assumption: a stable mapping exists between an input $x$ and its corresponding output $y$. In many real-world scenarios, however, this relationship is context-dependent. For instance, an image of a red shoe might be labeled "Red" in a color-focused dataset but "Sneaker" in a category-focused one. When these datasets are combined without explicit context labels, the data becomes "conflicting."
Applying standard Empirical Risk Minimization (ERM) to such data leads to poor performance. The model attempts to minimize the average loss across all contexts, resulting in a "mean" prediction that satisfies no single context well. Traditionally, resolving these conflicts requires manual data cleaning or re-labeling, which is often impractical.
The LEAF Framework
To address this, we introduce LEAF (Learning with an Allocation Function). Instead of training a single global model, LEAF learns a set of $K$ local models, each specializing in a different hidden context.
The Batch Assumption and Allocation
A key insight of LEAF is the Batch Assumption: while the overall dataset is a mixture of domains, individual batches of data are likely to originate from a single hidden context. This allows the system to use the collective signal of a batch to identify the underlying domain.
Unlike Mixture-of-Experts (MoE) architectures that use a separate, trainable gating network, LEAF employs an analytical allocation function. This function is derived from a "Hard" or Viterbi variant of the Expectation-Maximization (EM) algorithm. The training process follows an iterative cycle:
- E-step (Allocation): For each batch, the errors for all $K$ models are calculated. The entire batch is assigned to the model that achieves the lowest error.
- M-step (Optimization): Only the "winning" model is updated using the data from that specific batch.
Over time, this process naturally "unmixes" the data, as models specialize in the contexts they initially fit best.
Theoretical Insights
We introduce the concept of Conflict Rank, defined as the maximum number of distinct outputs for a single input across all domains. Our theoretical analysis proves that for LEAF to successfully recover the underlying mappings, the number of local models $K$ must be at least equal to the Conflict Rank. Furthermore, we demonstrate that identifying hidden contexts is generally impossible when looking at individual data points ($n=1$); a batch size $n > 1$ is necessary to provide a sufficient statistical "fingerprint" of the context.
Empirical Results
We evaluated LEAF across synthetic and real-world benchmarks designed to induce data conflict.
Synthetic Regression
In a task involving three overlapping mathematical functions, standard ERM failed significantly, producing a single curve that averaged the three ground truths. In contrast, LEAF successfully recovered all three distinct functions.
Image Classification and Real-World Tasks
- Colored MNIST: LEAF achieved near-perfect accuracy on both digit (1.70% error) and color (0.03% error) contexts, significantly outperforming Sparse MoE and ERM-based baselines.
- Gas Sensor Array: In a real-world regression task involving different gas mixtures, LEAF achieved a macro-average RMSE of 53.3, nearing the "Oracle" performance (49.4) and vastly outperforming the ERM baseline (83.1).
Conclusion
LEAF provides a robust framework for supervised learning in the presence of hidden contexts. By leveraging batch-level consistency and an analytical allocation function, it effectively resolves data conflicts without requiring manual intervention. Future work will focus on automatically determining the optimal number of models $K$ and distinguishing structured context from random noise.
Summary updated