{"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/straightness-of-rectified-flow-a-theoretical","title":"On the Wasserstein Convergence and Straightness of Rectified Flow","arxiv_id":"2410.14949","date":"2024-10-19","proceeding":null,"authors":["Vansh Bansal","Saptarshi Roy","Purnamrita Sarkar","Alessandro Rinaldo"],"abstract":"Diffusion models have emerged as a powerful tool for image generation and denoising. Typically, generative models learn a trajectory between the starting noise distribution and the target data distribution. Recently Liu et al. (2023b) proposed Rectified Flow (RF), a generative model that aims to learn straight flow trajectories from noise to data using a sequence of convex optimization problems with close ties to optimal transport. If the trajectory is curved, one must use many Euler discretization steps or novel strategies, such as exponential integrators, to achieve a satisfactory generation quality. In contrast, RF has been shown to theoretically straighten the trajectory through successive rectifications, reducing the number of function evaluations (NFEs) while sampling. It has also been shown empirically that RF may improve the straightness in two rectifications if one can solve the underlying optimization problem within a sufficiently small error. In this paper, we make two contributions. First, we provide a theoretical analysis of the Wasserstein distance between the sampling distribution of RF and the target distribution. Our error rate is characterized by the number of discretization steps and a novel formulation of straightness stronger than that in the original work. Secondly, we present general conditions guaranteeing uniqueness and straightness of 1-RF, which is in line with previous empirical findings. As a byproduct of our analysis, we show that, in one dimension, RF started at the standard Gaussian distribution yields the Monge map. Additionally, we also present empirical results on both simulated and real datasets to validate our theoretical findings. The code is available at https://github.com/bansal-vansh/rectified-flow.","url_abs":"https://arxiv.org/abs/2410.14949v6","url_pdf":"https://arxiv.org/pdf/2410.14949v6.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":"straightness-of-rectified-flow-a-theoretical","repo_url":"https://github.com/bansal-vansh/rectified-flow","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"denoising","task_name":"Denoising"},{"task_slug":"image-generation","task_name":"Image Generation"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2410.14949","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2410.14949"}},"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":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/bansal-vansh/rectified-flow","reach":{"status":"ok"}}],"summary":{"unverified":7},"by_repo_kind":{"official":{"samples":7,"ran":0,"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":7,"samples":[{"code_sha256_prefix":"acee3106924910c2","entry":"compute_norm_squared_full_derivative","repo":"bansal-vansh/rectified-flow","repo_kind":"official","path":"real-data/straightness.py","file_url":"https://github.com/bansal-vansh/rectified-flow/blob/HEAD/real-data/straightness.py","link_basis":"plan_row","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":"acee3106924910c2"}},{"code_sha256_prefix":"9da8172da0f91e5b","entry":"compute_scores","repo":"bansal-vansh/rectified-flow","repo_kind":"official","path":"simulated-data/gaussian.py","file_url":"https://github.com/bansal-vansh/rectified-flow/blob/HEAD/simulated-data/gaussian.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":"9da8172da0f91e5b"}},{"code_sha256_prefix":"5c14fa88c2b691fa","entry":"compute_weights","repo":"bansal-vansh/rectified-flow","repo_kind":"official","path":"simulated-data/gaussian.py","file_url":"https://github.com/bansal-vansh/rectified-flow/blob/HEAD/simulated-data/gaussian.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":"5c14fa88c2b691fa"}},{"code_sha256_prefix":"3379901e9c2a25f8","entry":"create_save_dir","repo":"bansal-vansh/rectified-flow","repo_kind":"official","path":"real-data/utils.py","file_url":"https://github.com/bansal-vansh/rectified-flow/blob/HEAD/real-data/utils.py","link_basis":"plan_row","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":"3379901e9c2a25f8"}},{"code_sha256_prefix":"3944b220ba759545","entry":"generate_mixture_samples","repo":"bansal-vansh/rectified-flow","repo_kind":"official","path":"simulated-data/gaussian.py","file_url":"https://github.com/bansal-vansh/rectified-flow/blob/HEAD/simulated-data/gaussian.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":"3944b220ba759545"}},{"code_sha256_prefix":"c5957497bd84f1cb","entry":"get_dataloader","repo":"bansal-vansh/rectified-flow","repo_kind":"official","path":"real-data/data.py","file_url":"https://github.com/bansal-vansh/rectified-flow/blob/HEAD/real-data/data.py","link_basis":"plan_row","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":"c5957497bd84f1cb"}},{"code_sha256_prefix":"643e229256ef78bc","entry":"postprocess","repo":"bansal-vansh/rectified-flow","repo_kind":"official","path":"real-data/utils.py","file_url":"https://github.com/bansal-vansh/rectified-flow/blob/HEAD/real-data/utils.py","link_basis":"plan_row","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":"643e229256ef78bc"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}