{"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/reflected-flow-matching","title":"Reflected Flow Matching","arxiv_id":"2405.16577","date":"2024-05-26","proceeding":null,"authors":["Tianyu Xie","Yu Zhu","Longlin Yu","Tong Yang","Ziheng Cheng","Shiyue Zhang","Xiangyu Zhang","Cheng Zhang"],"abstract":"Continuous normalizing flows (CNFs) learn an ordinary differential equation to transform prior samples into data. Flow matching (FM) has recently emerged as a simulation-free approach for training CNFs by regressing a velocity model towards the conditional velocity field. However, on constrained domains, the learned velocity model may lead to undesirable flows that result in highly unnatural samples, e.g., oversaturated images, due to both flow matching error and simulation error. To address this, we add a boundary constraint term to CNFs, which leads to reflected CNFs that keep trajectories within the constrained domains. We propose reflected flow matching (RFM) to train the velocity model in reflected CNFs by matching the conditional velocity fields in a simulation-free manner, similar to the vanilla FM. Moreover, the analytical form of conditional velocity fields in RFM avoids potentially biased approximations, making it superior to existing score-based generative models on constrained domains. We demonstrate that RFM achieves comparable or better results on standard image benchmarks and produces high-quality class-conditioned samples under high guidance weight.","url_abs":"https://arxiv.org/abs/2405.16577v1","url_pdf":"https://arxiv.org/pdf/2405.16577v1.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":"reflected-flow-matching","repo_url":"https://github.com/tyuxie/RFM","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":null}],"tasks":[],"methods":[{"method_slug":"normalizing-flows","method_name":"Normalizing Flows"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2405.16577","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2405.16577"}},"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/tyuxie/RFM","reach":null}],"summary":{"ran":2,"ran_draft_wrong":1,"unverified":1},"by_repo_kind":{"official":{"samples":4,"ran":3,"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":"fadc09791070e54b","entry":"TruncatedNormal","repo":"tyuxie/RFM","repo_kind":"official","path":"CIFAR10/utils/flow.py","file_url":"https://github.com/tyuxie/RFM/blob/HEAD/CIFAR10/utils/flow.py","link_basis":"first_harvest_node","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":"fadc09791070e54b"}},{"code_sha256_prefix":"716f010ea71ab348","entry":"TruncatedStandardNormal","repo":"tyuxie/RFM","repo_kind":"official","path":"CIFAR10/utils/flow.py","file_url":"https://github.com/tyuxie/RFM/blob/HEAD/CIFAR10/utils/flow.py","link_basis":"first_harvest_node","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":"716f010ea71ab348"}},{"code_sha256_prefix":"eeb5b8effffc6cdd","entry":"pad_t_like_x","repo":"tyuxie/RFM","repo_kind":"official","path":"CIFAR10/utils/flow.py","file_url":"https://github.com/tyuxie/RFM/blob/HEAD/CIFAR10/utils/flow.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"eeb5b8effffc6cdd"}},{"code_sha256_prefix":"086a0116e614d49e","entry":"ConditionalFlowMatcher","repo":"tyuxie/RFM","repo_kind":"official","path":"CIFAR10/utils/flow.py","file_url":"https://github.com/tyuxie/RFM/blob/HEAD/CIFAR10/utils/flow.py","link_basis":"first_harvest_node","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":"086a0116e614d49e"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}