English

The Complexity of Finding Local Optima in Contrastive Learning

Machine Learning 2025-09-23 v1 Computational Complexity Optimization and Control

Abstract

Contrastive learning is a powerful technique for discovering meaningful data representations by optimizing objectives based on contrastive information\textit{contrastive information}, often given as a set of weighted triplets {(xi,yi+,zi)}i=1m\{(x_i, y_i^+, z_{i}^-)\}_{i = 1}^m indicating that an "anchor" xix_i is more similar to a "positive" example yiy_i than to a "negative" example ziz_i. The goal is to find representations (e.g., embeddings in Rd\mathbb{R}^d or a tree metric) where anchors are placed closer to positive than to negative examples. While finding global\textit{global} optima of contrastive objectives is NP\mathsf{NP}-hard, the complexity of finding local\textit{local} optima -- representations that do not improve by local search algorithms such as gradient-based methods -- remains open. Our work settles the complexity of finding local optima in various contrastive learning problems by proving PLS\mathsf{PLS}-hardness in discrete settings (e.g., maximize satisfied triplets) and CLS\mathsf{CLS}-hardness in continuous settings (e.g., minimize Triplet Loss), where PLS\mathsf{PLS} (Polynomial Local Search) and CLS\mathsf{CLS} (Continuous Local Search) are well-studied complexity classes capturing local search dynamics in discrete and continuous optimization, respectively. Our results imply that no polynomial time algorithm (local search or otherwise) can find a local optimum for various contrastive learning problems, unless PLSP\mathsf{PLS}\subseteq\mathsf{P} (or CLSP\mathsf{CLS}\subseteq \mathsf{P} for continuous problems). Even in the unlikely scenario that PLSP\mathsf{PLS}\subseteq\mathsf{P} (or CLSP\mathsf{CLS}\subseteq \mathsf{P}), our reductions imply that there exist instances where local search algorithms need exponential time to reach a local optimum, even for d=1d=1 (embeddings on a line).

Keywords

Cite

@article{arxiv.2509.16898,
  title  = {The Complexity of Finding Local Optima in Contrastive Learning},
  author = {Jingming Yan and Yiyuan Luo and Vaggos Chatziafratis and Ioannis Panageas and Parnian Shahkar and Stelios Stavroulakis},
  journal= {arXiv preprint arXiv:2509.16898},
  year   = {2025}
}

Comments

To appear as a conference paper in NeurIPS 2025

R2 v1 2026-07-01T05:47:56.149Z