Papers › Stable Training of Normalizing Flows for High-dimensional Variational Inference

Stable Training of Normalizing Flows for High-dimensional Variational Inference

26 Feb 2024arXiv:2402.16408archive 2025-07-28

Daniel Andrade

Variational inference with normalizing flows (NFs) is an increasingly popular alternative to MCMC methods. In particular, NFs based on coupling layers (Real NVPs) are frequently used due to their good empirical performance. In theory, increasing the depth of normalizing flows should lead to more accurate posterior approximations. However, in practice, training deep normalizing flows for approximating high-dimensional posterior distributions is often infeasible due to the high variance of the stochastic gradients. In this work, we show that previous methods for stabilizing the variance of stochastic gradient descent can be insufficient to achieve stable training of Real NVPs. As the source of the problem, we identify that, during training, samples often exhibit unusual high values. As a remedy, we propose a combination of two methods: (1) soft-thresholding of the scale in Real NVPs, and (2) a bijective soft log transformation of the samples. We evaluate these and other previously proposed modification on several challenging target distributions, including a high-dimensional horseshoe logistic regression model. Our experiments show that with our modifications, stable training of Real NVPs for posteriors with several thousand dimensions is possible, allowing for more accurate marginal likelihood estimation via importance sampling. Moreover, we evaluate several common training techniques and architecture choices and provide practical advise for training NFs for high-dimensional variational inference.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2402.16408")

Code

Syntology Ran 11 of 15 code samples harvested from 1 repository linked to this paper; 4 have no recorded run. Of those that ran: 11 ran with no contract checked.

By repository: official repository: 15 samples from 1 repository, 11 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

andrade-stats/normalizing-flows officialmentioned in papermentioned on GitHubjaxNOASSERTION report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

15 samples harvested; 11 ran; 0 honoured the contract we drafted; 4 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

11ran
4unverified

Licence: 15 of the 15 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from andrade-stats/normalizing-flows. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: 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. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

chi2_simple andrade-stats/normalizing-flows/core_adjusted.py official repository ran licence not identified · pointer only · 4afcfcc45bcc2493 · report
getAllModuleIndices andrade-stats/normalizing-flows/analysis.py official repository ran licence not identified · pointer only · 822c2d0cbf925d06 · report
getEmptyStatDic andrade-stats/normalizing-flows/analysis.py official repository ran fingerprinted licence not identified · pointer only · 510987f49c20c772 · report
getNrFalseDetections andrade-stats/normalizing-flows/evaluation.py official repository ran licence not identified · pointer only · 399570b135a60e80 · report
getOutlierRecall andrade-stats/normalizing-flows/evaluation.py official repository ran licence not identified · pointer only · f8b7c4915f5875d0 · report
getVec andrade-stats/normalizing-flows/analysis.py official repository ran licence not identified · pointer only · 8b2d5fe633436d0a · report
get_log_prob_multivariate_t andrade-stats/normalizing-flows/densities.py official repository ran licence not identified · pointer only · 94e580bb6e619979 · report
leakyClamp andrade-stats/normalizing-flows/new_flows.py official repository ran fingerprinted licence not identified · pointer only · 40fd67c68c2dce9b · report
showOutlierDetectionPerformance_power_fdr andrade-stats/normalizing-flows/evaluation.py official repository ran licence not identified · pointer only · cbd75af666284269 · report
softClampAsymAdvanced andrade-stats/normalizing-flows/new_flows.py official repository ran fingerprinted licence not identified · pointer only · add8722ad720659f · report
softClampAsymNew andrade-stats/normalizing-flows/new_flows.py official repository ran licence not identified · pointer only · c039b5cd7098af7d · report
get_log_prob_inv_gamma andrade-stats/normalizing-flows/densities.py official repository unverified licence not identified · pointer only · 70e480ffce9632e5 · report
loadArray andrade-stats/normalizing-flows/commons.py official repository unverified licence not identified · pointer only · 8487032f2eeabb41 · report
loadStatistics andrade-stats/normalizing-flows/commons.py official repository unverified licence not identified · pointer only · 8c4b93348da52ad9 · report
moveToDevice andrade-stats/normalizing-flows/commons.py official repository unverified licence not identified · pointer only · 50ad8e41c0b7de01 · report

Tasks

Variational Inference

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Logistic RegressionNormalizing Flows

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections