{"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/constrained-sampling-with-primal-dual","title":"Constrained Sampling with Primal-Dual Langevin Monte Carlo","arxiv_id":"2411.00568","date":"2024-11-01","proceeding":null,"authors":["Luiz F. O. Chamon","Mohammad Reza Karimi","Anna Korba"],"abstract":"This work considers the problem of sampling from a probability distribution known up to a normalization constant while satisfying a set of statistical constraints specified by the expected values of general nonlinear functions. This problem finds applications in, e.g., Bayesian inference, where it can constrain moments to evaluate counterfactual scenarios or enforce desiderata such as prediction fairness. Methods developed to handle support constraints, such as those based on mirror maps, barriers, and penalties, are not suited for this task. This work therefore relies on gradient descent-ascent dynamics in Wasserstein space to put forward a discrete-time primal-dual Langevin Monte Carlo algorithm (PD-LMC) that simultaneously constrains the target distribution and samples from it. We analyze the convergence of PD-LMC under standard assumptions on the target distribution and constraints, namely (strong) convexity and log-Sobolev inequalities. To do so, we bring classical optimization arguments for saddle-point algorithms to the geometry of Wasserstein space. We illustrate the relevance and effectiveness of PD-LMC in several applications.","url_abs":"https://arxiv.org/abs/2411.00568v2","url_pdf":"https://arxiv.org/pdf/2411.00568v2.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":"constrained-sampling-with-primal-dual","repo_url":"https://github.com/lfochamon/pdlmc","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"jax","reach":null}],"tasks":[{"task_slug":"bayesian-inference","task_name":"Bayesian Inference"},{"task_slug":"fairness","task_name":"Fairness"},{"task_slug":null,"task_name":"counterfactual"}],"methods":[{"method_slug":"set","method_name":"SET"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2411.00568","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2411.00568"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+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":"deterministic:regex_extraction","url":"https://github.com/lfochamon/pdlmc","reach":null}],"summary":{"ran_violates":1,"unverified":2},"by_repo_kind":{"official":{"samples":3,"ran":1,"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":3,"samples":[{"code_sha256_prefix":"7293963838a3aa35","entry":"logprior","repo":"lfochamon/pdlmc","repo_kind":"official","path":"fairness/fairness.py","file_url":"https://github.com/lfochamon/pdlmc/blob/HEAD/fairness/fairness.py","link_basis":"first_harvest_node","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7293963838a3aa35"}},{"code_sha256_prefix":"1ea8544e135a9bf7","entry":"loglikelihood","repo":"lfochamon/pdlmc","repo_kind":"official","path":"fairness/fairness.py","file_url":"https://github.com/lfochamon/pdlmc/blob/HEAD/fairness/fairness.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1ea8544e135a9bf7"}},{"code_sha256_prefix":"c5ea099e967ddcfa","entry":"neglogposterior","repo":"lfochamon/pdlmc","repo_kind":"official","path":"fairness/fairness.py","file_url":"https://github.com/lfochamon/pdlmc/blob/HEAD/fairness/fairness.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c5ea099e967ddcfa"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}