Optimal Sample Complexity of Contrastive Learning
Noga Alon, Dmitrii Avdiukhin, Dor Elboim, Orr Fischer, Grigory Yaroslavtsev
Abstract
Contrastive learning is a highly successful technique for learning representations of data from labeled tuples, specifying the distance relations within the tuple. We study the sample complexity of contrastive learning, i.e. the minimum number of labeled tuples sufficient for getting high generalization accuracy. We give tight bounds on the sample complexity in a variety of settings, focusing on arbitrary distance functions, both general -distances, and tree metrics. Our main result is an (almost) optimal bound on the sample complexity of learning -distances for integer . For any we show that labeled tuples are necessary and sufficient for learning -dimensional representations of -point datasets. Our results hold for an arbitrary distribution of the input samples and are based on giving the corresponding bounds on the Vapnik-Chervonenkis/Natarajan dimension of the associated problems. We further show that the theoretical bounds on sample complexity obtained via VC/Natarajan dimension can have strong predictive power for experimental results, in contrast with the folklore belief about a substantial gap between the statistical learning theory and the practice of deep learning.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext a9ee206d-cf5b-4e32-8c4f-2848e1c992d2Cited by top-tier papers10
- Self-Supervised Contrastive Learning is Approximately Supervised Contrastive LearningAchleshwar Luthra, Tianbao Yang, Tomer GalantiNeurIPS 2025 · 7 citations
- Embedding Dimension of Contrastive Learning and k-Nearest NeighborsDmitrii Avdiukhin, Vaggos Chatziafratis, Orr Fischer, Grigory YaroslavtsevNeurIPS 2024 · 5 citations
- On the Alignment Between Supervised and Self-Supervised Contrastive LearningAchleshwar Luthra, Priyadarsi Mishra, Tomer GalantiICLR 2026 · 4 citations
- Formal Models of Active Learning from Contrastive ExamplesFarnam Mansouri, Hans Simon, Adish Singla, Yuxin Chen et al.NeurIPS 2025 · 2 citations
- The Complexity of Finding Local Optima in Contrastive LearningJingming Yan, Yiyuan Luo, Vaggos Chatziafratis, Ioannis Panageas et al.NeurIPS 2025 · 2 citations
Builds on19
- A Simple Framework for Contrastive Learning of Visual RepresentationsTing Chen, Simon Kornblith, Mohammad Norouzi, Geoffrey E. HintonICML 2020 · 24,064 citations
- SimCSE: Simple Contrastive Learning of Sentence EmbeddingsTianyu Gao, Xingcheng Yao, Danqi ChenEMNLP 2021 · 2,496 citations
- Understanding Contrastive Representation Learning through Alignment and Uniformity on the HypersphereTongzhou Wang, Phillip IsolaICML 2020 · 2,360 citations
- Debiased Contrastive LearningChing-Yao Chuang, Joshua Robinson, Yen-Chen Lin, Antonio Torralba et al.NeurIPS 2020 · 761 citations
- Fantastic Generalization Measures and Where to Find ThemYiding Jiang, Behnam Neyshabur, Hossein Mobahi, Dilip Krishnan et al.ICLR 2020 · 705 citations
Related papers
- Tree Learning: Optimal Sample Complexity and AlgorithmsDmitrii Avdiukhin, Grigory Yaroslavtsev, Danny Vainstein, Orr Fischer et al.AAAI 2023 · 1 citation
- Generalization Analysis for Supervised Contrastive Representation Learning under Non-IID SettingsNong Minh Hieu, Antoine LedentICML 2025
- Provable Accuracy Collapse of Embedding-Based Representations under Dimensionality MismatchDionysis Arvanitakis, Vaggos Chatziafratis, Yiyuan LuoICML 2026
- VC dimension and distribution-free sample-based testingEric Blais, Renato Ferreira Pinto Jr., Nathaniel HarmsSTOC 2021
- Generalization Analysis for Contrastive Representation LearningYunwen Lei, Tianbao Yang, Yiming Ying, Ding-Xuan ZhouICML 2023 · 28 citations
