[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-detail-84278-en":3,"doc-seo-84278-105":29,"detail-sidebar-cat-0-en-105":90},{"code":4,"msg":5,"data":6},0,"success",{"doc_id":7,"user_id":8,"nickname":9,"user_avatar":10,"doc_module":4,"category_id":11,"category_name":12,"doc_title":13,"doc_description":14,"doc_content":15,"file_id":16,"file_url":17,"file_type":18,"file_size":19,"view_count":4,"is_deleted":4,"is_public":20,"is_downloadable":20,"audit_status":20,"page_count":21,"language":22,"language_code":23,"site_id":24,"html_lang":23,"table_of_contents":25,"faqs":26,"seo_title":13,"seo_description":14,"update_tm":27,"read_time":28},84278,1374391974564,"Clementine","https://ap-avatar.wpscdn.com/avatar/14000253aa45c000a9e?x-image-process=image/resize,m_fixed,w_180,h_180&k=1779874745381141002",8,"Research & Report","GradInf Gradient Estimation as Probabilistic Inference","Gradient estimation—the task of computing gradients of expectations of probabilistic programs—supports broad scientific and ML applications but is difficult due to high-dimensional integration, discrete random choices, and intricate stochastic dependencies. GradInf introduces gradient inference: a formal reduction from gradient estimation to a related probabilistic inference problem. Coupling and factorization transform the probabilistic program into an inference target whose solution can be differentiated to yield sound, efficient gradient estimators. GradInf provides automated source-to-source transformations with soundness proven by denotational semantics.","arXiv :2607 .07840v 1 [ cs .PL] 8 Jul 2026  \nGradInf: Gradient Estimation as Probabilistic Inference  \nGAURAV ARYA, Carnegie Mellon University, USA  \nMATHIEU HUOT, Massachusetts Institute of Technology, USA  \nMORITZ SCHAUER, Chalmers University of Technology & University of Gothenburg, Sweden ALEXANDER K. LEW, Yale University, USA  \nFERAS A. SAAD, Carnegie Mellon University, USA  \nGradient estimation—the task of computing the gradient of the expected value of a probabilistic program—has diverse applications in scientific computing, but is notoriously difficult because of issues such as highdimensional integration, discrete random choices, and complex stochastic dependencies. This article introduces gradient inference, a new approach to developing sound and efficient gradient estimators for probabilistic programs. Gradient inference rests on a formal reduction from a gradient estimation problem to a closely related probabilistic inference problem, whose solution can be differentiated to obtain a gradient estimator. This inference problem is obtained by applying two powerful statistical operations—coupling and factorization—to the input probabilistic program. Our reduction lets us leverage the rich toolkit of probabilistic inference algorithms to design novel gradient estimators that extend and improve upon existing methods.  \nWe introduce GradInf, a probabilistic programming system that facilitates the sound and automated implementation of gradient inference. GradInf is centered around programmable source-to-source transformations for coupling and factorizing higher-order probabilistic programs, whose soundness is proven in terms of a denotational semantics. Key to our development is the use of information-flow typing to allow random choices in a probabilistic program to be factored out and partially evaluated, which improves our ability to deploy sophisticated probabilistic inference algorithms. The resulting system offers practitioners a principled framework for designing gradient estimators. We apply GradInf to several challenging case studies, showing that it can express prominent gradient estimators from the literature and enables the construction of new state-of-the-art estimators that outperform the best existing baselines.  \nCCS Concepts: • Mathematics of computing → Probabilistic algorithms; Probabilistic inference problems;  \nStatistical software; Automatic differentiation; • Theory of computation → Probabilistic computation. Additional Key Words and Phrases: probabilistic programming, gradient estimation, couplings ACM Reference Format:  \nGaurav Arya, Mathieu Huot, Moritz Schauer, Alexander K. Lew, and Feras A. Saad. 2026. GradInf: Gradient Estimation as Probabilistic Inference. Proc. ACM Program. Lang. 10, PLDI, Article 243 (June 2026), 27 pages.  \n[https://doi.org/10.1145/3808321](https://doi.org/10.1145/3808321)  \n1 Introduction  \nSuppose we are given a function 􀁠 : R􀀽 → 􀀥 (R) that maps a parameter vector 􀁜 := (􀁜1, . . . , 􀁜 􀀽) toa probability distribution 􀁠 􀁜 over the reals. The expectation of 􀁠 􀁜 is given by  \nE􀁇∼􀁠 􀁜 [􀁇 ] = ∫R 􀁇 􀁠 􀁜 (d􀁇 ) ≕ ℓ (􀁜 ) . (1.1)  \nAuthors’ Contact Information: Gaurav Arya, Carnegie Mellon University, Pittsburgh, USA, [gauravar@cmu.edu](gauravar@cmu.edu); Mathieu Huot, Massachusetts Institute of Technology, Cambridge, USA, [mhuot@mit.edu](mhuot@mit.edu); Moritz Schauer, Chalmers University of Technology & University of Gothenburg, Gothenburg, Sweden, [smoritz@chalmers.se](smoritz@chalmers.se); Alexander K. Lew, Yale University,  \nNew Haven, USA, [alexander.lew@yale.edu](alexander.lew@yale.edu); Feras A. Saad, Carnegie Mellon University, Pittsburgh, USA, [fsaad@cmu.edu](fsaad@cmu.edu).  \nThis work is licensed under a Creative Commons Attribution 4 .0 International License.  \n© 2026 Copyright held by the owner/author(s) .  \nACM 2475-1421/2026/6-ART243  \n[https://doi.org/10.1145/3808321](https://doi.org/10.1145/3808321)  \nProc. ACM Program. Lang., Vol. 10, No. PLDI, Article 243 . Publicati","cbCaicgRq1mLp4Cy","https://ap.wps.com/l/cbCaicgRq1mLp4Cy","pdf",2485291,1,57,"English","en",105,"# Introduction\n## Gradient inference overview\n## GradInf system and implementation\n# Gradient estimation and expected values\n## Coupling\n## Factorization\n## Probabilistic inference and automatic differentiation","[{\"question\":\"What problem does GradInf target?\",\"answer\":\"GradInf targets gradient estimation for probabilistic programs, specifically computing the gradient of the expected value produced by a probabilistic program.\"},{\"question\":\"How does gradient inference convert gradient estimation into inference?\",\"answer\":\"It reduces gradient estimation to a closely related probabilistic inference problem, then differentiates the solution of that inference target to obtain a gradient estimator.\"},{\"question\":\"What key operations does GradInf use to build the inference target?\",\"answer\":\"GradInf applies coupling and factorization to the input probabilistic program to construct an inference target that supports differentiation for gradient estimation.\"}]",1784194550,144,{"code":4,"msg":30,"data":31},"ok",{"site_id":24,"language":23,"slug":32,"title":13,"keywords":33,"description":14,"schema_data":34,"social_meta":85,"head_meta":87,"extra_data":89,"updated_unix":27},"gradinf-gradient-estimation-as-probabilistic-inference","",{"@graph":35,"@context":84},[36,53,67],{"@type":37,"itemListElement":38},"BreadcrumbList",[39,43,47,50],{"item":40,"name":41,"@type":42,"position":20},"https://docshare.wps.com","Home","ListItem",{"item":44,"name":45,"@type":42,"position":46},"https://docshare.wps.com/document/","Document",2,{"item":48,"name":12,"@type":42,"position":49},"https://docshare.wps.com/document/research-report/",3,{"item":51,"name":13,"@type":42,"position":52},"https://docshare.wps.com/document/gradinf-gradient-estimation-as-probabilistic-inference/84278/",4,{"url":51,"name":13,"@type":54,"author":55,"headline":13,"publisher":57,"fileFormat":60,"inLanguage":23,"description":14,"dateModified":61,"datePublished":61,"encodingFormat":60,"isAccessibleForFree":62,"interactionStatistic":63},"DigitalDocument",{"name":9,"@type":56},"Person",{"url":40,"name":58,"@type":59},"DocShare","Organization","application/pdf","2026-07-16",true,{"@type":64,"interactionType":65,"userInteractionCount":4},"InteractionCounter",{"@type":66},"ViewAction",{"@type":68,"mainEntity":69},"FAQPage",[70,76,80],{"name":71,"@type":72,"acceptedAnswer":73},"What problem does GradInf target?","Question",{"text":74,"@type":75},"GradInf targets gradient estimation for probabilistic programs, specifically computing the gradient of the expected value produced by a probabilistic program.","Answer",{"name":77,"@type":72,"acceptedAnswer":78},"How does gradient inference convert gradient estimation into inference?",{"text":79,"@type":75},"It reduces gradient estimation to a closely related probabilistic inference problem, then differentiates the solution of that inference target to obtain a gradient estimator.",{"name":81,"@type":72,"acceptedAnswer":82},"What key operations does GradInf use to build the inference target?",{"text":83,"@type":75},"GradInf applies coupling and factorization to the input probabilistic program to construct an inference target that supports differentiation for gradient estimation.","https://schema.org",{"og:url":51,"og:type":86,"og:title":13,"og:site_name":58,"og:description":14},"article",{"robots":88,"canonical":51},"index,follow",{"doc_id":7,"site_id":24},{"code":4,"msg":5,"data":91},[92,96,100,104,109,114,119,122,127,130,134],{"id":20,"doc_module":4,"doc_module_name":45,"category_name":93,"show_sort_weight":94,"slug":95},"Story & Novel",90,"story-novel",{"id":46,"doc_module":4,"doc_module_name":45,"category_name":97,"show_sort_weight":98,"slug":99},"Literature",80,"literature",{"id":52,"doc_module":4,"doc_module_name":45,"category_name":101,"show_sort_weight":102,"slug":103},"Exam",70,"exam",{"id":105,"doc_module":4,"doc_module_name":45,"category_name":106,"show_sort_weight":107,"slug":108},5,"Comic",60,"comic",{"id":110,"doc_module":4,"doc_module_name":45,"category_name":111,"show_sort_weight":112,"slug":113},6,"Technology",50,"technology",{"id":115,"doc_module":4,"doc_module_name":45,"category_name":116,"show_sort_weight":117,"slug":118},7,"Healthcare",40,"healthcare",{"id":11,"doc_module":4,"doc_module_name":45,"category_name":12,"show_sort_weight":120,"slug":121},30,"research-report",{"id":123,"doc_module":4,"doc_module_name":45,"category_name":124,"show_sort_weight":125,"slug":126},9,"Religion & Spirituality",20,"religion-spirituality",{"id":125,"doc_module":4,"doc_module_name":45,"category_name":128,"show_sort_weight":125,"slug":129},"World Cup","world-cup",{"id":131,"doc_module":4,"doc_module_name":45,"category_name":132,"show_sort_weight":131,"slug":133},10,"Lifestyle","lifestyle",{"id":135,"doc_module":4,"doc_module_name":45,"category_name":136,"show_sort_weight":105,"slug":137},19,"General","general"]