Imbalances in Neurosymbolic Learning: Characterization and Mitigating Strategies

Kaifu Wang, Efthymia Tsamoura, Dan Roth · DOI

Abstract

We study one of the most popular problems in neurosymbolic learning (NSL), that of learning neural classifiers given only the result of applying a symbolic component $σ$ to the gold labels of the elements of a vector $\mathbf x$. The gold labels of the elements in $\mathbf x$ are unknown to the learner. We make multiple contributions, theoretical and practical, to address a problem that has not been studied so far in this context, that of characterizing and mitigating learning imbalances, i.e., major differences in the errors that occur when classifying instances of different classes (aka class-specific risks). Our theoretical analysis reveals a unique phenomenon: that $σ$ can greatly impact learning imbalances. This result sharply contrasts with previous research on supervised and weakly supervised learning, which only studies learning imbalances under data imbalances. On the practical side, we introduce a technique for estimating the marginal of the hidden gold labels using weakly supervised data. Then, we introduce algorithms that mitigate imbalances at training and testing time by treating the marginal of the hidden labels as a constraint. We demonstrate the effectiveness of our techniques using strong baselines from NSL and long-tailed learning, suggesting performance improvements of up to 14%.

Introduction: The Learning Imbalance Problem

In Neurosymbolic Learning (NESY), neural networks are often trained using "weak" supervision where the ground truth labels are hidden behind a symbolic function $\sigma$. For instance, a model might be trained to recognize MNIST digits by only seeing the maximum value of a pair of digits.

A critical challenge identified in this work is learning imbalance. Unlike standard machine learning, where performance disparities are typically attributed to "long-tailed" data distributions, this paper identifies a unique "NESY phenomenon": the symbolic function itself creates an inherent imbalance in the supervision signal's strength. For example, knowing the maximum of two digits is 0 uniquely identifies the pair as (0,0), whereas a maximum of 9 allows for many ambiguous combinations. This leads to significant differences in class-specific risks, even when the underlying data is perfectly balanced.

Per-class accuracy disparities in MNIST-based NESY tasks illustrate the learning imbalance phenomenon.

Theoretical Characterization

The authors develop a nonlinear programming framework to compute upper bounds on class-specific risks. Their analysis proves that the symbolic component $\sigma$ can dictate which classes are "hard" or "easy" to learn, independent of their frequency in the training set. This "logic-as-a-filter" effect determines how much information is backpropagated to the neural network, making some classes naturally "foggy" under specific logical constraints.

Proposed Mitigation Strategies

To address these imbalances, the paper introduces three main technical contributions:

  1. Label Ratio Solver (Algorithm 1): A statistically consistent technique to estimate hidden class marginals from weakly supervised data. It solves a system of polynomial equations via cross-entropy optimization to "guess" the true distribution of hidden labels.
  2. Training-Time Mitigation (LP): A Linear Programming formulation for generating pseudolabels during training. These pseudolabels are constrained to satisfy both the symbolic logic (via Tseytin transformation) and the estimated class ratios.
  3. Testing-Time Mitigation (CAROT): Confidence-Adjustment via Robust semi-constrained Optimal Transport. This algorithm adjusts model scores at inference time to align the final prediction distribution with the estimated marginals using a robust Sinkhorn variant.

Experimental Evaluation

The methods were evaluated on benchmarks including MAX-M, SUM-M, Handwritten Formula (HWF-M), and a new hierarchical task called "Smallest Parent." The researchers also tested variants with traditional data imbalance (long-tail) to assess robustness.

Algorithm 1 demonstrates high precision in estimating hidden class ratios across various tasks, even under significant data imbalance.

Key results include:

  • Accuracy Gains: The proposed techniques outperformed strong NSL baselines (e.g., Semantic Loss) and long-tailed learning baselines by up to 14%.
  • Robust Estimation: Algorithm 1 effectively estimated hidden ratios even with extreme imbalance ratios ($\rho=50$).
  • Hierarchical Success: On the "Smallest Parent" benchmark, accuracy improved from ~68% to over 81% using the LP-based training mitigation.

Conclusion

This work highlights that symbolic logic is a primary driver of performance imbalance in NESY systems. By accurately estimating hidden class marginals and using them as constraints during training and testing, researchers can significantly mitigate these disparities. Future work will focus on scaling these methods to larger symbolic pre-images and developing more efficient "plug-and-play" mitigation layers.

Summary updated

Abstract

We study one of the most popular problems in **neurosymbolic learning** (NSL), that of learning neural classifiers given only the result of applying a symbolic component $σ$ to the gold labels of the elements of a vector $\mathbf x$. The gold labels of the elements in $\mathbf x$ are unknown to the learner. We make multiple contributions, theoretical and practical, to address a problem that has not been studied so far in this context, that of characterizing and mitigating *learning imbalances*, i.e., major differences in the errors that occur when classifying instances of different classes (aka **class-specific risks**). Our theoretical analysis reveals a unique phenomenon: that $σ$ can greatly impact learning imbalances. This result sharply contrasts with previous research on supervised and weakly supervised learning, which only studies learning imbalances under data imbalances. On the practical side, we introduce a technique for estimating the marginal of the hidden gold labels using weakly supervised data. Then, we introduce algorithms that mitigate imbalances at training and testing time by treating the marginal of the hidden labels as a constraint. We demonstrate the effectiveness of our techniques using strong baselines from NSL and long-tailed learning, suggesting performance improvements of up to 14%.
BibTeX
@inproceedings{wang2025imbalances,
  author = {Kaifu Wang and Efthymia Tsamoura and Dan Roth},
  title = {{Imbalances in Neurosymbolic Learning: Characterization and Mitigating Strategies}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=nik6BjmLm2},
}
Figure