{"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/what-the-daam-interpreting-stable-diffusion","title":"What the DAAM: Interpreting Stable Diffusion Using Cross Attention","arxiv_id":"2210.04885","date":"2022-10-10","proceeding":null,"authors":["Raphael Tang","Linqing Liu","Akshat Pandey","Zhiying Jiang","Gefei Yang","Karun Kumar","Pontus Stenetorp","Jimmy Lin","Ferhan Ture"],"abstract":"Large-scale diffusion neural networks represent a substantial milestone in text-to-image generation, but they remain poorly understood, lacking interpretability analyses. In this paper, we perform a text-image attribution analysis on Stable Diffusion, a recently open-sourced model. To produce pixel-level attribution maps, we upscale and aggregate cross-attention word-pixel scores in the denoising subnetwork, naming our method DAAM. We evaluate its correctness by testing its semantic segmentation ability on nouns, as well as its generalized attribution quality on all parts of speech, rated by humans. We then apply DAAM to study the role of syntax in the pixel space, characterizing head--dependent heat map interaction patterns for ten common dependency relations. Finally, we study several semantic phenomena using DAAM, with a focus on feature entanglement, where we find that cohyponyms worsen generation quality and descriptive adjectives attend too broadly. To our knowledge, we are the first to interpret large diffusion models from a visuolinguistic perspective, which enables future lines of research. Our code is at https://github.com/castorini/daam.","url_abs":"https://arxiv.org/abs/2210.04885v5","url_pdf":"https://arxiv.org/pdf/2210.04885v5.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":"what-the-daam-interpreting-stable-diffusion","repo_url":"https://github.com/castorini/daam","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"what-the-daam-interpreting-stable-diffusion","repo_url":"https://github.com/rishidarkdevil/daam-i2i","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"denoising","task_name":"Denoising"},{"task_slug":"descriptive","task_name":"Descriptive"},{"task_slug":"image-attribution","task_name":"Image Attribution"},{"task_slug":"image-generation","task_name":"Image Generation"},{"task_slug":"instance-segmentation","task_name":"Instance Segmentation"},{"task_slug":"semantic-segmentation","task_name":"Semantic Segmentation"},{"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"},{"task_slug":"unsupervised-semantic-segmentation","task_name":"Unsupervised Semantic Segmentation"}],"methods":[{"method_slug":"diffusion","method_name":"Diffusion"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2210.04885","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2210.04885"}},"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/castorini/daam","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/rishidarkdevil/daam-i2i","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":6},"by_repo_kind":{"official":{"samples":6,"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":"d4274e26209e1e74","entry":"auto_device","repo":"castorini/daam","repo_kind":"official","path":"daam/utils.py","file_url":"https://github.com/castorini/daam/blob/HEAD/daam/utils.py","link_basis":"harvester_set","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":"d4274e26209e1e74"}},{"code_sha256_prefix":"1459c659fad7b011","entry":"compute_ioa","repo":"castorini/daam","repo_kind":"official","path":"daam/evaluate.py","file_url":"https://github.com/castorini/daam/blob/HEAD/daam/evaluate.py","link_basis":"harvester_set","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":"1459c659fad7b011"}},{"code_sha256_prefix":"5682e07dbd1c3e8b","entry":"compute_iou","repo":"castorini/daam","repo_kind":"official","path":"daam/evaluate.py","file_url":"https://github.com/castorini/daam/blob/HEAD/daam/evaluate.py","link_basis":"harvester_set","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":"5682e07dbd1c3e8b"}},{"code_sha256_prefix":"04fefba0057375a2","entry":"compute_token_merge_indices","repo":"castorini/daam","repo_kind":"official","path":"daam/utils.py","file_url":"https://github.com/castorini/daam/blob/HEAD/daam/utils.py","link_basis":"harvester_set","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":"04fefba0057375a2"}},{"code_sha256_prefix":"f77ce1db1f158502","entry":"load_mask","repo":"castorini/daam","repo_kind":"official","path":"daam/evaluate.py","file_url":"https://github.com/castorini/daam/blob/HEAD/daam/evaluate.py","link_basis":"harvester_set","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":"f77ce1db1f158502"}},{"code_sha256_prefix":"0a61596f1e596fec","entry":"set_seed","repo":"castorini/daam","repo_kind":"official","path":"daam/utils.py","file_url":"https://github.com/castorini/daam/blob/HEAD/daam/utils.py","link_basis":"harvester_set","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":"0a61596f1e596fec"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}