Learning Half-Spaces from Perturbed Contrastive Examples

Aryan Alavi Razavi Ravari, Farnam Mansouri, Yuxin Chen, Valentio Iverson, Adish Singla, Sandra Zilles · DOI

Abstract

We study learning under a two-step contrastive example oracle, as introduced by Mansouri et. al. (2025), where each queried (or sampled) labeled example is paired with an additional contrastive example of opposite label. While Mansouri et al. assume an idealized setting, where the contrastive example is at minimum distance of the originally queried/sampled point, we introduce and analyze a mechanism, parameterized by a non-decreasing noise function $f$, under which this ideal contrastive example is perturbed. The amount of perturbation is controlled by $f(d)$, where $d$ is the distance of the queried/sampled point to the decision boundary. Intuitively, this results in higher-quality contrastive examples for points closer to the decision boundary. We study this model in two settings: (i) when the maximum perturbation magnitude is fixed, and (ii) when it is stochastic. For one-dimensional thresholds and for half-spaces under the uniform distribution on a bounded domain, we characterize active and passive contrastive sample complexity in dependence on the function $f$. We show that, under certain conditions on $f$, the presence of contrastive examples speeds up learning in terms of asymptotic query complexity and asymptotic expected query complexity.

Introduction

Contrastive learning—using pairs of similar data points with opposite labels—is a powerful tool for identifying decision boundaries in machine learning. While recent theoretical work has explored an idealized "contrastive oracle" that provides the exact closest point on the other side of a boundary, such perfect information is rarely available in practice. This paper bridges the gap between theory and reality by introducing "perturbed" contrastive examples. The authors demonstrate that even when contrastive information is noisy, learning efficiency can still achieve massive exponential speedups, provided the noise precision improves as one approaches the decision boundary.

Problem Formulation

The core challenge addressed is the unrealistic nature of perfect contrastive examples. In real-world scenarios, like generating counterfactual explanations, it is naturally easier to find a contrasting neighbor when a point is already near the "fence" or decision boundary. The authors formalize this by assuming the perturbation magnitude is controlled by a non-decreasing noise function $f(d)$, where $d$ is the distance of the queried point to the boundary.

Methods: Approximate Minimum Distance Oracles

The paper introduces two new mathematical models for "Approximate Minimum Distance" oracles (AMDM) to represent noisy contrastive feedback:

  1. Deterministic AMDM: The oracle returns a contrastive example within a fixed "noise budget" $f(d)$, where $d$ is the distance from the original point to the boundary.
  2. Probabilistic AMDM: The oracle returns a contrastive example where the expected distance to the ideal point is bounded by $f(d)$.

The geometry of these perturbations is illustrated in the figure below, showing how the contrastive example $x'$ relates to the original point $x$ and its ideal projection $x^{proj}$ on the boundary of the target concept $C^*$.

Geometric representation of perturbed contrastive examples in maximum angle and general cases.

The authors analyze these models across three hypothesis classes: 1D Thresholds, Homogeneous Half-spaces (linear separators through the origin), and General Half-spaces. They evaluate both Active Learning (where the learner chooses queries) and Passive Learning (random sampling) to determine the sample complexity required to reach a target error rate $\epsilon$.

Key Insights

  • The Proximity Virtuous Cycle: In active learning, queries that land near the boundary yield higher-quality (less noisy) contrastive examples because $f(d)$ is non-decreasing. This creates a feedback loop that rapidly homes in on the true boundary.
  • Dimension-Free Learning: For homogeneous half-spaces, the learning complexity is essentially independent of the number of dimensions ($k$). This is a significant result, as standard learning methods often scale poorly with dimensionality.
  • The "Skewed Error" Phenomenon: In stochastic noise models, a small probability of receiving a "very bad" contrastive example can make the expected error appear much worse than the typical error, highlighting a critical nuance in learning performance.
  • Exponential Speedups: Contrastive queries can reduce sample complexity from $\Theta(\log 1/\epsilon)$ (standard binary search) to $\Theta(\log \log 1/\epsilon)$ or even $\Theta(\log^* 1/\epsilon)$ (the iterated logarithm), depending on the specific noise function.

Key Results

The paper provides a comprehensive taxonomy of complexity bounds across different noise regimes. As shown in the table below, active contrastive queries provide significant improvements over standard membership queries. For instance, with polynomial noise, 1D threshold complexity drops to $\Theta(\log \log 1/\epsilon)$. For general half-spaces, the complexity $O(\log \log 1/\epsilon + \log k)$ significantly outperforms standard active learning bounds.

Summary of query complexity for different hypothesis classes and noise functions.

Limitations and Future Work

The current proofs rely on the assumption that data is distributed uniformly over a bounded domain and that a perfect linear separator exists (the realizable setting). Future research could extend these findings to non-uniform distributions and more complex, non-linear hypothesis classes, such as neural networks or decision trees, to determine if the "contrastive speedup" remains robust in more general settings.

Summary updated

BibTeX
@misc{ravari2026learning,
  author = {Aryan Alavi Razavi Ravari and Farnam Mansouri and Yuxin Chen and Valentio Iverson and Adish Singla and Sandra Zilles},
  title = {{Learning Half-Spaces from Perturbed Contrastive Examples}},
  year = {2026},
  eprint = {2602.02080},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2602.02080},
}

Loading related content...

Figure