{"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/arxiv-2509-13760","title":"Iterative Prompt Refinement for Safer Text-to-Image Generation","arxiv_id":"2509.13760","date":"2025-09-17","proceeding":"EMNLP","authors":["Jinwoo Jeon","JunHyeok Oh","Hayeong Lee","Byung-Jun Lee"],"abstract":"Text-to-Image (T2I) models have made remarkable progress in generating images from text prompts, but their output quality and safety still depend heavily on how prompts are phrased. Existing safety methods typically refine prompts using large language models (LLMs), but they overlook the images produced, which can result in unsafe outputs or unnecessary changes to already safe prompts. To address this, we propose an iterative prompt refinement algorithm that uses Vision Language Models (VLMs) to analyze both the input prompts and the generated images. By leveraging visual feedback, our method refines prompts more effectively, improving safety while maintaining user intent and reliability comparable to existing LLM-based approaches. Additionally, we introduce a new dataset labeled with both textual and visual safety signals using off-the-shelf multi-modal LLM, enabling supervised fine-tuning. Experimental results demonstrate that our approach produces safer outputs without compromising alignment with user intent, offering a practical solution for generating safer T2I content. Our code is available at https://github.com/ku-dmlab/IPR. \\textbf{\\textcolor{red}WARNING: This paper contains examples of harmful or inappropriate images generated by models.","url_abs":"https://arxiv.org/abs/2509.13760","url_pdf":"https://arxiv.org/pdf/2509.13760","source":{"archive":null,"snapshot":"2025-07-28","note":"not in the Papers with Code archive (frozen at the snapshot)","row_kind":"graph","title_abstract_authors_date":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)"},"code_links":[],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2509.13760","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2509.13760"}},"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":[{"mentioned_in_github":null,"is_official":null,"provenance":"deterministic:regex_extraction","mentioned_in_paper":null,"url":"https://github.com/ku-dmlab/IPR","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran_draft_wrong":3,"ran":3,"unverified":11},"by_repo_kind":{"found_in_text":{"samples":17,"ran":6,"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":"98f385d847636a3e","entry":"basic_clean","repo":"ku-dmlab/IPR","repo_kind":"found_in_text","path":"clip/simple_tokenizer.py","file_url":"https://github.com/ku-dmlab/IPR/blob/HEAD/clip/simple_tokenizer.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"98f385d847636a3e"}},{"code_sha256_prefix":"dfd0ecd9cb25af69","entry":"flatten_dict","repo":"ku-dmlab/IPR","repo_kind":"found_in_text","path":"trl/core.py","file_url":"https://github.com/ku-dmlab/IPR/blob/HEAD/trl/core.py","link_basis":"plan_row","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"dfd0ecd9cb25af69"}},{"code_sha256_prefix":"d919ae32e5e4e616","entry":"get_pairs","repo":"ku-dmlab/IPR","repo_kind":"found_in_text","path":"clip/simple_tokenizer.py","file_url":"https://github.com/ku-dmlab/IPR/blob/HEAD/clip/simple_tokenizer.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d919ae32e5e4e616"}},{"code_sha256_prefix":"4f7075aac2163cbc","entry":"masked_mean","repo":"ku-dmlab/IPR","repo_kind":"found_in_text","path":"trl/core.py","file_url":"https://github.com/ku-dmlab/IPR/blob/HEAD/trl/core.py","link_basis":"plan_row","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"4f7075aac2163cbc"}},{"code_sha256_prefix":"67607956afbb2a83","entry":"masked_var","repo":"ku-dmlab/IPR","repo_kind":"found_in_text","path":"trl/core.py","file_url":"https://github.com/ku-dmlab/IPR/blob/HEAD/trl/core.py","link_basis":"plan_row","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"67607956afbb2a83"}},{"code_sha256_prefix":"9542161e9640b858","entry":"whitespace_clean","repo":"ku-dmlab/IPR","repo_kind":"found_in_text","path":"clip/simple_tokenizer.py","file_url":"https://github.com/ku-dmlab/IPR/blob/HEAD/clip/simple_tokenizer.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"9542161e9640b858"}},{"code_sha256_prefix":"1167d54333f6f7a3","entry":"aesthetic_scorer","repo":"ku-dmlab/IPR","repo_kind":"found_in_text","path":"trl/models/auxiliary_modules.py","file_url":"https://github.com/ku-dmlab/IPR/blob/HEAD/trl/models/auxiliary_modules.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"1167d54333f6f7a3"}},{"code_sha256_prefix":"83d665733079f22f","entry":"aggregate_and_trace_results_generalized","repo":"ku-dmlab/IPR","repo_kind":"found_in_text","path":"util.py","file_url":"https://github.com/ku-dmlab/IPR/blob/HEAD/util.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"83d665733079f22f"}},{"code_sha256_prefix":"53017c7a8e570221","entry":"apply_chat_template","repo":"ku-dmlab/IPR","repo_kind":"found_in_text","path":"trl/data_utils.py","file_url":"https://github.com/ku-dmlab/IPR/blob/HEAD/trl/data_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"53017c7a8e570221"}},{"code_sha256_prefix":"39e6b23b55f376ea","entry":"build_model","repo":"ku-dmlab/IPR","repo_kind":"found_in_text","path":"clip/model.py","file_url":"https://github.com/ku-dmlab/IPR/blob/HEAD/clip/model.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"39e6b23b55f376ea"}},{"code_sha256_prefix":"affb4504d85ac0b7","entry":"format_data","repo":"ku-dmlab/IPR","repo_kind":"found_in_text","path":"vl_sft.py","file_url":"https://github.com/ku-dmlab/IPR/blob/HEAD/vl_sft.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"affb4504d85ac0b7"}},{"code_sha256_prefix":"672b96514d81a1c1","entry":"generate_images","repo":"ku-dmlab/IPR","repo_kind":"found_in_text","path":"vl_rl.py","file_url":"https://github.com/ku-dmlab/IPR/blob/HEAD/vl_rl.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"672b96514d81a1c1"}},{"code_sha256_prefix":"3c42df7a6e98e89c","entry":"is_conversational","repo":"ku-dmlab/IPR","repo_kind":"found_in_text","path":"trl/data_utils.py","file_url":"https://github.com/ku-dmlab/IPR/blob/HEAD/trl/data_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"3c42df7a6e98e89c"}},{"code_sha256_prefix":"2bb6075cd6b76760","entry":"is_liger_kernel_available","repo":"ku-dmlab/IPR","repo_kind":"found_in_text","path":"trl/import_utils.py","file_url":"https://github.com/ku-dmlab/IPR/blob/HEAD/trl/import_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"2bb6075cd6b76760"}},{"code_sha256_prefix":"021a688e5389b8b6","entry":"load","repo":"ku-dmlab/IPR","repo_kind":"found_in_text","path":"clip/clip.py","file_url":"https://github.com/ku-dmlab/IPR/blob/HEAD/clip/clip.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"021a688e5389b8b6"}},{"code_sha256_prefix":"e9c9a97fe7d56a76","entry":"load_prompts","repo":"ku-dmlab/IPR","repo_kind":"found_in_text","path":"vl_rl.py","file_url":"https://github.com/ku-dmlab/IPR/blob/HEAD/vl_rl.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"e9c9a97fe7d56a76"}},{"code_sha256_prefix":"c695ba9ac4cc3b93","entry":"maybe_apply_chat_template","repo":"ku-dmlab/IPR","repo_kind":"found_in_text","path":"trl/data_utils.py","file_url":"https://github.com/ku-dmlab/IPR/blob/HEAD/trl/data_utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"c695ba9ac4cc3b93"}}]},"arxiv_metadata":{"licence":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)","fields":["title","abstract","authors","date"],"primary_category":"cs.CV","source":"arxiv_api"},"syntology_extracted_results":null}