{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/the-optimal-noise-in-noise-contrastive","title":"The Optimal Noise in Noise-Contrastive Learning Is Not What You Think","arxiv_id":"2203.01110","date":"2022-03-02","proceeding":null,"authors":["Omar Chehab","Alexandre Gramfort","Aapo Hyvarinen"],"abstract":"Learning a parametric model of a data distribution is a well-known statistical problem that has seen renewed interest as it is brought to scale in deep learning. Framing the problem as a self-supervised task, where data samples are discriminated from noise samples, is at the core of state-of-the-art methods, beginning with Noise-Contrastive Estimation (NCE). Yet, such contrastive learning requires a good noise distribution, which is hard to specify; domain-specific heuristics are therefore widely used. While a comprehensive theory is missing, it is widely assumed that the optimal noise should in practice be made equal to the data, both in distribution and proportion. This setting underlies Generative Adversarial Networks (GANs) in particular. Here, we empirically and theoretically challenge this assumption on the optimal noise. We show that deviating from this assumption can actually lead to better statistical estimators, in terms of asymptotic variance. In particular, the optimal noise distribution is different from the data's and even from a different family.","url_abs":"https://arxiv.org/abs/2203.01110v2","url_pdf":"https://arxiv.org/pdf/2203.01110v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"the-optimal-noise-in-noise-contrastive","repo_url":"https://github.com/l-omar-chehab/nce-noise-var","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"contrastive-learning","task_name":"Contrastive Learning"}],"methods":[{"method_slug":"contrastive-learning","method_name":"Contrastive Learning"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2203.01110","atlas_url":"https://app.syntology.ai/?focus=2203.01110","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2203.01110"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/l-omar-chehab/nce-noise-var","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":9,"unverified":1},"by_repo_kind":{"listed":{"samples":10,"ran":9,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"f4fcab6207da1213","entry":"data_logpdf","repo":"l-omar-chehab/nce-noise-var","repo_kind":"listed","path":"nlica/quadrature/singleparam/gaussian_var.py","file_url":"https://github.com/l-omar-chehab/nce-noise-var/blob/HEAD/nlica/quadrature/singleparam/gaussian_var.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f4fcab6207da1213"}},{"code_sha256_prefix":"42fb58d11674bed8","entry":"data_score","repo":"l-omar-chehab/nce-noise-var","repo_kind":"listed","path":"nlica/quadrature/singleparam/gaussian_var.py","file_url":"https://github.com/l-omar-chehab/nce-noise-var/blob/HEAD/nlica/quadrature/singleparam/gaussian_var.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"42fb58d11674bed8"}},{"code_sha256_prefix":"8aedce51bf88e5c1","entry":"hasmeth","repo":"l-omar-chehab/nce-noise-var","repo_kind":"listed","path":"nlica/utils.py","file_url":"https://github.com/l-omar-chehab/nce-noise-var/blob/HEAD/nlica/utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8aedce51bf88e5c1"}},{"code_sha256_prefix":"3de39a8e2a49e338","entry":"hsic","repo":"l-omar-chehab/nce-noise-var","repo_kind":"listed","path":"archive/loss.py","file_url":"https://github.com/l-omar-chehab/nce-noise-var/blob/HEAD/archive/loss.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"3de39a8e2a49e338"}},{"code_sha256_prefix":"ce51b72db205a595","entry":"is_numpy","repo":"l-omar-chehab/nce-noise-var","repo_kind":"listed","path":"nlica/utils.py","file_url":"https://github.com/l-omar-chehab/nce-noise-var/blob/HEAD/nlica/utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ce51b72db205a595"}},{"code_sha256_prefix":"2533365186ad3aa7","entry":"minimize","repo":"l-omar-chehab/nce-noise-var","repo_kind":"listed","path":"nlica/autoptim.py","file_url":"https://github.com/l-omar-chehab/nce-noise-var/blob/HEAD/nlica/autoptim.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2533365186ad3aa7"}},{"code_sha256_prefix":"5d753a903c8639e9","entry":"noise_pihlaja_mean","repo":"l-omar-chehab/nce-noise-var","repo_kind":"listed","path":"experiments/plot_optimal_noise.py","file_url":"https://github.com/l-omar-chehab/nce-noise-var/blob/HEAD/experiments/plot_optimal_noise.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5d753a903c8639e9"}},{"code_sha256_prefix":"4ba37ef8879d8a2e","entry":"noise_pihlaja_var","repo":"l-omar-chehab/nce-noise-var","repo_kind":"listed","path":"experiments/plot_optimal_noise.py","file_url":"https://github.com/l-omar-chehab/nce-noise-var/blob/HEAD/experiments/plot_optimal_noise.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4ba37ef8879d8a2e"}},{"code_sha256_prefix":"d3a157623cdc357b","entry":"trunc","repo":"l-omar-chehab/nce-noise-var","repo_kind":"listed","path":"experiments/plot_optimal_noise.py","file_url":"https://github.com/l-omar-chehab/nce-noise-var/blob/HEAD/experiments/plot_optimal_noise.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"d3a157623cdc357b"}},{"code_sha256_prefix":"3353d0643b18daad","entry":"noise_logpdf","repo":"l-omar-chehab/nce-noise-var","repo_kind":"listed","path":"nlica/quadrature/singleparam/gaussian_var.py","file_url":"https://github.com/l-omar-chehab/nce-noise-var/blob/HEAD/nlica/quadrature/singleparam/gaussian_var.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"3353d0643b18daad"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}