{"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/unifying-bayesian-flow-networks-and-diffusion","title":"Unifying Bayesian Flow Networks and Diffusion Models through Stochastic Differential Equations","arxiv_id":"2404.15766","date":"2024-04-24","proceeding":null,"authors":["Kaiwen Xue","Yuhao Zhou","Shen Nie","Xu Min","Xiaolu Zhang","Jun Zhou","Chongxuan Li"],"abstract":"Bayesian flow networks (BFNs) iteratively refine the parameters, instead of the samples in diffusion models (DMs), of distributions at various noise levels through Bayesian inference. Owing to its differentiable nature, BFNs are promising in modeling both continuous and discrete data, while simultaneously maintaining fast sampling capabilities. This paper aims to understand and enhance BFNs by connecting them with DMs through stochastic differential equations (SDEs). We identify the linear SDEs corresponding to the noise-addition processes in BFNs, demonstrate that BFN's regression losses are aligned with denoise score matching, and validate the sampler in BFN as a first-order solver for the respective reverse-time SDE. Based on these findings and existing recipes of fast sampling in DMs, we propose specialized solvers for BFNs that markedly surpass the original BFN sampler in terms of sample quality with a limited number of function evaluations (e.g., 10) on both image and text datasets. Notably, our best sampler achieves an increase in speed of 5~20 times for free. Our code is available at https://github.com/ML-GSAI/BFN-Solver.","url_abs":"https://arxiv.org/abs/2404.15766v2","url_pdf":"https://arxiv.org/pdf/2404.15766v2.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":"unifying-bayesian-flow-networks-and-diffusion","repo_url":"https://github.com/ml-gsai/bfn-solver","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"bayesian-inference","task_name":"Bayesian Inference"}],"methods":[{"method_slug":"diffusion","method_name":"Diffusion"},{"method_slug":"speed","method_name":"SPEED"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2404.15766","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2404.15766"}},"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/ML-GSAI/BFN-Solver","reach":{"status":"ok"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ml-gsai/bfn-solver","reach":{"status":"ok"}}],"summary":{"ran":8,"unverified":4},"by_repo_kind":{"official":{"samples":12,"ran":8,"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":12,"samples":[{"code_sha256_prefix":"1a4845bc7b3d5654","entry":"ImageBFNSolver","repo":"ml-gsai/bfn-solver","repo_kind":"official","path":"bfnsolver_i.py","file_url":"https://github.com/ml-gsai/bfn-solver/blob/HEAD/bfnsolver_i.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1a4845bc7b3d5654"}},{"code_sha256_prefix":"c362b4cbfac8170f","entry":"attention_inner_heads","repo":"ML-GSAI/BFN-Solver","repo_kind":"official","path":"networks/unet_vdm.py","file_url":"https://github.com/ML-GSAI/BFN-Solver/blob/HEAD/networks/unet_vdm.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"c362b4cbfac8170f"}},{"code_sha256_prefix":"b17ebf2b2ef1cb60","entry":"gelu","repo":"ML-GSAI/BFN-Solver","repo_kind":"official","path":"networks/transformer.py","file_url":"https://github.com/ML-GSAI/BFN-Solver/blob/HEAD/networks/transformer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b17ebf2b2ef1cb60"}},{"code_sha256_prefix":"179411226b633de6","entry":"get_timestep_embedding","repo":"ML-GSAI/BFN-Solver","repo_kind":"official","path":"networks/unet_vdm.py","file_url":"https://github.com/ML-GSAI/BFN-Solver/blob/HEAD/networks/unet_vdm.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"179411226b633de6"}},{"code_sha256_prefix":"a91dc4fa6fd3684d","entry":"safe_exp","repo":"ML-GSAI/BFN-Solver","repo_kind":"official","path":"utils.py","file_url":"https://github.com/ML-GSAI/BFN-Solver/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"a91dc4fa6fd3684d"}},{"code_sha256_prefix":"34cc47ee17f6c9ee","entry":"safe_log","repo":"ML-GSAI/BFN-Solver","repo_kind":"official","path":"utils.py","file_url":"https://github.com/ML-GSAI/BFN-Solver/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"34cc47ee17f6c9ee"}},{"code_sha256_prefix":"1b5fa89b375364a0","entry":"sandwich","repo":"ML-GSAI/BFN-Solver","repo_kind":"official","path":"utils.py","file_url":"https://github.com/ML-GSAI/BFN-Solver/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1b5fa89b375364a0"}},{"code_sha256_prefix":"b6858c53f43787dc","entry":"zero_init","repo":"ML-GSAI/BFN-Solver","repo_kind":"official","path":"networks/unet_vdm.py","file_url":"https://github.com/ML-GSAI/BFN-Solver/blob/HEAD/networks/unet_vdm.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"b6858c53f43787dc"}},{"code_sha256_prefix":"e59f9e0c05888506","entry":"batch_sample","repo":"ml-gsai/bfn-solver","repo_kind":"official","path":"bfnsolver_i.py","file_url":"https://github.com/ml-gsai/bfn-solver/blob/HEAD/bfnsolver_i.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":"e59f9e0c05888506"}},{"code_sha256_prefix":"fe4eb545bbb728e0","entry":"conv_nd","repo":"ML-GSAI/BFN-Solver","repo_kind":"official","path":"networks/unet_improved.py","file_url":"https://github.com/ML-GSAI/BFN-Solver/blob/HEAD/networks/unet_improved.py","link_basis":"harvester_set","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":"fe4eb545bbb728e0"}},{"code_sha256_prefix":"a863803cdd5f3ce6","entry":"make_master_params","repo":"ML-GSAI/BFN-Solver","repo_kind":"official","path":"networks/unet_improved.py","file_url":"https://github.com/ML-GSAI/BFN-Solver/blob/HEAD/networks/unet_improved.py","link_basis":"harvester_set","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":"a863803cdd5f3ce6"}},{"code_sha256_prefix":"30e43bcf12d042b0","entry":"unflatten_master_params","repo":"ML-GSAI/BFN-Solver","repo_kind":"official","path":"networks/unet_improved.py","file_url":"https://github.com/ML-GSAI/BFN-Solver/blob/HEAD/networks/unet_improved.py","link_basis":"harvester_set","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":"30e43bcf12d042b0"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}