{"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/step-aware-preference-optimization-aligning","title":"Aesthetic Post-Training Diffusion Models from Generic Preferences with Step-by-step Preference Optimization","arxiv_id":"2406.04314","date":"2024-06-06","proceeding":"CVPR 2025 1","authors":["Zhanhao Liang","Yuhui Yuan","Shuyang Gu","Bohan Chen","Tiankai Hang","Mingxi Cheng","Ji Li","Liang Zheng"],"abstract":"Generating visually appealing images is fundamental to modern text-to-image generation models. A potential solution to better aesthetics is direct preference optimization (DPO), which has been applied to diffusion models to improve general image quality including prompt alignment and aesthetics. Popular DPO methods propagate preference labels from clean image pairs to all the intermediate steps along the two generation trajectories. However, preference labels provided in existing datasets are blended with layout and aesthetic opinions, which would disagree with aesthetic preference. Even if aesthetic labels were provided (at substantial cost), it would be hard for the two-trajectory methods to capture nuanced visual differences at different steps. To improve aesthetics economically, this paper uses existing generic preference data and introduces step-by-step preference optimization (SPO) that discards the propagation strategy and allows fine-grained image details to be assessed. Specifically, at each denoising step, we 1) sample a pool of candidates by denoising from a shared noise latent, 2) use a step-aware preference model to find a suitable win-lose pair to supervise the diffusion model, and 3) randomly select one from the pool to initialize the next denoising step. This strategy ensures that diffusion models focus on the subtle, fine-grained visual differences instead of layout aspect. We find that aesthetics can be significantly enhanced by accumulating these improved minor differences. When fine-tuning Stable Diffusion v1.5 and SDXL, SPO yields significant improvements in aesthetics compared with existing DPO methods while not sacrificing image-text alignment compared with vanilla models. Moreover, SPO converges much faster than DPO methods due to the use of more correct preference labels provided by the step-aware preference model.","url_abs":"https://arxiv.org/abs/2406.04314v3","url_pdf":"https://arxiv.org/pdf/2406.04314v3.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":"step-aware-preference-optimization-aligning","repo_url":"https://github.com/rockeycoss/spo","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"denoising","task_name":"Denoising"},{"task_slug":"image-generation","task_name":"Image Generation"},{"task_slug":"text-to-image-generation-1","task_name":"Text to Image Generation"},{"task_slug":"text-to-image-generation","task_name":"Text-to-Image Generation"}],"methods":[{"method_slug":"dpo","method_name":"DPO"},{"method_slug":"diffusion","method_name":"Diffusion"},{"method_slug":"focus","method_name":"Focus"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2406.04314","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2406.04314"}},"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/rockeycoss/spo","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":3},"by_repo_kind":{"official":{"samples":3,"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":0,"samples":[{"code_sha256_prefix":"2f1d44684ed4167d","entry":"ddim_step_fetch_x0","repo":"rockeycoss/spo","repo_kind":"official","path":"spo_training_and_inference/spo/custom_diffusers/ddim_seperate.py","file_url":"https://github.com/rockeycoss/spo/blob/HEAD/spo_training_and_inference/spo/custom_diffusers/ddim_seperate.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":"2f1d44684ed4167d"}},{"code_sha256_prefix":"b8df268697a708f9","entry":"ddim_step_fetch_x_t_1","repo":"rockeycoss/spo","repo_kind":"official","path":"spo_training_and_inference/spo/custom_diffusers/ddim_seperate.py","file_url":"https://github.com/rockeycoss/spo/blob/HEAD/spo_training_and_inference/spo/custom_diffusers/ddim_seperate.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":"b8df268697a708f9"}},{"code_sha256_prefix":"ed1678cb71c1ff2f","entry":"ddim_step_with_logprob","repo":"rockeycoss/spo","repo_kind":"official","path":"spo_training_and_inference/spo/custom_diffusers/ddim_with_logprob.py","file_url":"https://github.com/rockeycoss/spo/blob/HEAD/spo_training_and_inference/spo/custom_diffusers/ddim_with_logprob.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":"ed1678cb71c1ff2f"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}