{"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-2609-03629","title":"EraseSAE: Surgical Concept Erasure in Text-to-Video Diffusion Models via Sparse Autoencoders","arxiv_id":"2609.03629","date":"2026-09-03","proceeding":null,"authors":["Xinghao Wang","Dong Li","Wei Yu","Yingwei Pan","Tao Gong","Qi Chu","Nenghai Yu","Ting Yao"],"abstract":"Recent advances in text-to-video (T2V) diffusion models have demonstrated remarkable generative capabilities, yet their reliance on loosely curated training data raises pressing safety and copyright concerns. Concept erasure offers a principled remedy by removing unwanted semantics from pretrained models while preserving remaining concepts. However, existing approaches typically operate at a coarse granularity misaligned with the fine-grained, distributed nature of concept representations, leading to incomplete removal or degraded generation quality. We argue that surgical erasure fundamentally requires intervention at the level of monosemantic features, where each unit encodes a single interpretable concept. To this end, we propose EraseSAE, a novel framework that leverages sparse autoencoders to achieve surgical concept erasure in DiT-based T2V diffusion models via a principled decompose-attribute-erase pipeline. We first introduce the Partitioned Convolutional Sparse Autoencoder, which decomposes dense spatiotemporal activations into disentangled, interpretable sparse features while preserving spatiotemporal coherence. A contrastive attribution mechanism then contrasts activations from paired prompts to isolate concept-specific feature kernels. At inference, timestep-resolved spatiotemporal masks derived from the identified kernels confine erasure to regions where the target concept is active, leaving unrelated content intact. Extensive experiments across diverse diffusion models and concept erasure tasks demonstrate that EraseSAE achieves precise and robust concept removal with minimal quality degradation, substantially outperforming state-of-the-art methods. The code is available at https://github.com/HiDream-ai/EraseSAE.","url_abs":"https://arxiv.org/abs/2609.03629","url_pdf":"https://arxiv.org/pdf/2609.03629","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=2609.03629","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2609.03629"}},"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/HiDream-ai/EraseSAE","reach":{"status":"ok"}}],"summary":{"unverified":24},"by_repo_kind":{"found_in_text":{"samples":24,"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":24,"samples":[{"code_sha256_prefix":"b2e81a1edccffb1a","entry":"activation_references_for_kernels","repo":"HiDream-ai/EraseSAE","repo_kind":"found_in_text","path":"inference/cli_utils.py","file_url":"https://github.com/HiDream-ai/EraseSAE/blob/HEAD/inference/cli_utils.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":"b2e81a1edccffb1a"}},{"code_sha256_prefix":"90dc9ff2abfdc2d3","entry":"binarize_attention_mask","repo":"HiDream-ai/EraseSAE","repo_kind":"found_in_text","path":"model/attention_masks.py","file_url":"https://github.com/HiDream-ai/EraseSAE/blob/HEAD/model/attention_masks.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":"90dc9ff2abfdc2d3"}},{"code_sha256_prefix":"e1b1606d33030e87","entry":"build_penalty_mask","repo":"HiDream-ai/EraseSAE","repo_kind":"found_in_text","path":"model/celebrity_partitioned_sae.py","file_url":"https://github.com/HiDream-ai/EraseSAE/blob/HEAD/model/celebrity_partitioned_sae.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":"e1b1606d33030e87"}},{"code_sha256_prefix":"802b53bdfe8de1fc","entry":"calculate_aux_loss","repo":"HiDream-ai/EraseSAE","repo_kind":"found_in_text","path":"model/celebrity_partitioned_sae.py","file_url":"https://github.com/HiDream-ai/EraseSAE/blob/HEAD/model/celebrity_partitioned_sae.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":"802b53bdfe8de1fc"}},{"code_sha256_prefix":"2e3b3b46446742c4","entry":"capture_effective_mask","repo":"HiDream-ai/EraseSAE","repo_kind":"found_in_text","path":"inference/mask_artifacts.py","file_url":"https://github.com/HiDream-ai/EraseSAE/blob/HEAD/inference/mask_artifacts.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":"2e3b3b46446742c4"}},{"code_sha256_prefix":"00665b8a9cafb385","entry":"checkpoint_pointer_path","repo":"HiDream-ai/EraseSAE","repo_kind":"found_in_text","path":"model/checkpoint_io.py","file_url":"https://github.com/HiDream-ai/EraseSAE/blob/HEAD/model/checkpoint_io.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":"00665b8a9cafb385"}},{"code_sha256_prefix":"83a19197727095ac","entry":"compute_cross_attention_mask","repo":"HiDream-ai/EraseSAE","repo_kind":"found_in_text","path":"model/attention_masks.py","file_url":"https://github.com/HiDream-ai/EraseSAE/blob/HEAD/model/attention_masks.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":"83a19197727095ac"}},{"code_sha256_prefix":"324a38e38c776a3d","entry":"create_dataloader_for_layer","repo":"HiDream-ai/EraseSAE","repo_kind":"found_in_text","path":"training/cog_celebs.py","file_url":"https://github.com/HiDream-ai/EraseSAE/blob/HEAD/training/cog_celebs.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":"324a38e38c776a3d"}},{"code_sha256_prefix":"0001b6cf0099e7f8","entry":"create_dataloader_for_layer","repo":"HiDream-ai/EraseSAE","repo_kind":"found_in_text","path":"training/cog_nudity.py","file_url":"https://github.com/HiDream-ai/EraseSAE/blob/HEAD/training/cog_nudity.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":"0001b6cf0099e7f8"}},{"code_sha256_prefix":"119b201cd050d212","entry":"get_model_path","repo":"HiDream-ai/EraseSAE","repo_kind":"found_in_text","path":"configs/config_loader.py","file_url":"https://github.com/HiDream-ai/EraseSAE/blob/HEAD/configs/config_loader.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":"119b201cd050d212"}},{"code_sha256_prefix":"831d18d1d3b9d7c8","entry":"get_partition_schedule","repo":"HiDream-ai/EraseSAE","repo_kind":"found_in_text","path":"model/partition_objectives.py","file_url":"https://github.com/HiDream-ai/EraseSAE/blob/HEAD/model/partition_objectives.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":"831d18d1d3b9d7c8"}},{"code_sha256_prefix":"42334cbdfccc3fce","entry":"get_warmup_schedule","repo":"HiDream-ai/EraseSAE","repo_kind":"found_in_text","path":"model/celebrity_partitioned_sae.py","file_url":"https://github.com/HiDream-ai/EraseSAE/blob/HEAD/model/celebrity_partitioned_sae.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":"42334cbdfccc3fce"}},{"code_sha256_prefix":"e03692116e99085d","entry":"load_checkpoint_model_config","repo":"HiDream-ai/EraseSAE","repo_kind":"found_in_text","path":"model/checkpoint_io.py","file_url":"https://github.com/HiDream-ai/EraseSAE/blob/HEAD/model/checkpoint_io.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":"e03692116e99085d"}},{"code_sha256_prefix":"30180de1929a7196","entry":"load_json","repo":"HiDream-ai/EraseSAE","repo_kind":"found_in_text","path":"configs/config_loader.py","file_url":"https://github.com/HiDream-ai/EraseSAE/blob/HEAD/configs/config_loader.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":"30180de1929a7196"}},{"code_sha256_prefix":"b50e656309cf3492","entry":"ordered_concepts_from_map","repo":"HiDream-ai/EraseSAE","repo_kind":"found_in_text","path":"inference/cli_utils.py","file_url":"https://github.com/HiDream-ai/EraseSAE/blob/HEAD/inference/cli_utils.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":"b50e656309cf3492"}},{"code_sha256_prefix":"999a197347fe9545","entry":"parse_target_layers","repo":"HiDream-ai/EraseSAE","repo_kind":"found_in_text","path":"training/cog_celebs.py","file_url":"https://github.com/HiDream-ai/EraseSAE/blob/HEAD/training/cog_celebs.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":"999a197347fe9545"}},{"code_sha256_prefix":"91b39df4bc1a1f77","entry":"partition_contrastive_loss","repo":"HiDream-ai/EraseSAE","repo_kind":"found_in_text","path":"model/partition_objectives.py","file_url":"https://github.com/HiDream-ai/EraseSAE/blob/HEAD/model/partition_objectives.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":"91b39df4bc1a1f77"}},{"code_sha256_prefix":"b9834b84275567cf","entry":"partition_leakage_loss","repo":"HiDream-ai/EraseSAE","repo_kind":"found_in_text","path":"model/partition_objectives.py","file_url":"https://github.com/HiDream-ai/EraseSAE/blob/HEAD/model/partition_objectives.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":"b9834b84275567cf"}},{"code_sha256_prefix":"501b2ce1d7e5728c","entry":"resolve_layer_checkpoint","repo":"HiDream-ai/EraseSAE","repo_kind":"found_in_text","path":"model/checkpoint_io.py","file_url":"https://github.com/HiDream-ai/EraseSAE/blob/HEAD/model/checkpoint_io.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":"501b2ce1d7e5728c"}},{"code_sha256_prefix":"5c74a4b4c803a3d2","entry":"run_global_stats_collection","repo":"HiDream-ai/EraseSAE","repo_kind":"found_in_text","path":"training/cog_celebs.py","file_url":"https://github.com/HiDream-ai/EraseSAE/blob/HEAD/training/cog_celebs.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":"5c74a4b4c803a3d2"}},{"code_sha256_prefix":"fb2776e47bf70228","entry":"run_global_stats_collection","repo":"HiDream-ai/EraseSAE","repo_kind":"found_in_text","path":"training/cog_nudity.py","file_url":"https://github.com/HiDream-ai/EraseSAE/blob/HEAD/training/cog_nudity.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":"fb2776e47bf70228"}},{"code_sha256_prefix":"d36772ddde1f91a1","entry":"save_step_mask_artifacts","repo":"HiDream-ai/EraseSAE","repo_kind":"found_in_text","path":"inference/mask_artifacts.py","file_url":"https://github.com/HiDream-ai/EraseSAE/blob/HEAD/inference/mask_artifacts.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":"d36772ddde1f91a1"}},{"code_sha256_prefix":"dc7f0b127bbc5656","entry":"str2bool","repo":"HiDream-ai/EraseSAE","repo_kind":"found_in_text","path":"configs/config_loader.py","file_url":"https://github.com/HiDream-ai/EraseSAE/blob/HEAD/configs/config_loader.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":"dc7f0b127bbc5656"}},{"code_sha256_prefix":"0acb1ed2b9e34902","entry":"validated_target_kernels","repo":"HiDream-ai/EraseSAE","repo_kind":"found_in_text","path":"inference/cli_utils.py","file_url":"https://github.com/HiDream-ai/EraseSAE/blob/HEAD/inference/cli_utils.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":"0acb1ed2b9e34902"}}]},"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_daily_20260904.json"},"syntology_extracted_results":{"kind":"leaderboard_placements","source":"Syntology's leaderboard-shaped extractor over the paper's own arXiv-HTML tables: a model pointed at a cell, the number was read from that cell and checked against the board's metric, dataset, split and scale, and an independent check accepted the entry; not reviewed by the paper's authors or the archive's editors","extractor_model":"global.anthropic.claude-sonnet-4-5-20250929-v1:0","verifier_model":null,"prompt_sha":"fa63d4bb9d755694","coverage":{"sentence":"Syntology has checked 6,795 of the 9,581 papers on this site that are newer than the archive; results from the others appear after they are checked.","papers_newer_than_archive":9581,"papers_checked":6795},"entries":[],"not_placed":{"boards":0,"rejected_by_independent_check":0,"refused_by_a_rule":0,"check_did_not_answer":0,"proposed_without_a_cell":0,"declined_by_site":0}}}