{"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/aisafetylab-a-comprehensive-framework-for-ai","title":"AISafetyLab: A Comprehensive Framework for AI Safety Evaluation and Improvement","arxiv_id":"2502.16776","date":"2025-02-24","proceeding":null,"authors":["Zhexin Zhang","Leqi Lei","Junxiao Yang","Xijie Huang","Yida Lu","Shiyao Cui","Renmiao Chen","Qinglin Zhang","Xinyuan Wang","Hao Wang","Hao Li","Xianqi Lei","Chengwei Pan","Lei Sha","Hongning Wang","Minlie Huang"],"abstract":"As AI models are increasingly deployed across diverse real-world scenarios, ensuring their safety remains a critical yet underexplored challenge. While substantial efforts have been made to evaluate and enhance AI safety, the lack of a standardized framework and comprehensive toolkit poses significant obstacles to systematic research and practical adoption. To bridge this gap, we introduce AISafetyLab, a unified framework and toolkit that integrates representative attack, defense, and evaluation methodologies for AI safety. AISafetyLab features an intuitive interface that enables developers to seamlessly apply various techniques while maintaining a well-structured and extensible codebase for future advancements. Additionally, we conduct empirical studies on Vicuna, analyzing different attack and defense strategies to provide valuable insights into their comparative effectiveness. To facilitate ongoing research and development in AI safety, AISafetyLab is publicly available at https://github.com/thu-coai/AISafetyLab, and we are committed to its continuous maintenance and improvement.","url_abs":"https://arxiv.org/abs/2502.16776v1","url_pdf":"https://arxiv.org/pdf/2502.16776v1.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":"aisafetylab-a-comprehensive-framework-for-ai","repo_url":"https://github.com/thu-coai/AISafetyLab","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"aisafetylab-a-comprehensive-framework-for-ai","repo_url":"https://github.com/thu-coai/TransferAttack","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2502.16776","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2502.16776"}},"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/thu-coai/AISafetyLab","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/thu-coai/TransferAttack","reach":{"status":"ok"}}],"summary":{"unverified":5},"by_repo_kind":{"official":{"samples":5,"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":"2d1c9669ced3e8b3","entry":"generate","repo":"thu-coai/AISafetyLab","repo_kind":"official","path":"aisafetylab/attack/feedback/model_interactions.py","file_url":"https://github.com/thu-coai/AISafetyLab/blob/HEAD/aisafetylab/attack/feedback/model_interactions.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":"2d1c9669ced3e8b3"}},{"code_sha256_prefix":"d524bb01ccde3d0c","entry":"get_dataloader","repo":"thu-coai/AISafetyLab","repo_kind":"official","path":"aisafetylab/dataset/attack_dataset.py","file_url":"https://github.com/thu-coai/AISafetyLab/blob/HEAD/aisafetylab/dataset/attack_dataset.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":"d524bb01ccde3d0c"}},{"code_sha256_prefix":"b424c044252ab930","entry":"get_developer","repo":"thu-coai/AISafetyLab","repo_kind":"official","path":"aisafetylab/utils/model_utils.py","file_url":"https://github.com/thu-coai/AISafetyLab/blob/HEAD/aisafetylab/utils/model_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":"b424c044252ab930"}},{"code_sha256_prefix":"be7159492c5e1acd","entry":"prepare_input_embeddings","repo":"thu-coai/AISafetyLab","repo_kind":"official","path":"aisafetylab/utils/model_utils.py","file_url":"https://github.com/thu-coai/AISafetyLab/blob/HEAD/aisafetylab/utils/model_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":"be7159492c5e1acd"}},{"code_sha256_prefix":"af6243c4188f97de","entry":"prepare_labels","repo":"thu-coai/AISafetyLab","repo_kind":"official","path":"aisafetylab/utils/model_utils.py","file_url":"https://github.com/thu-coai/AISafetyLab/blob/HEAD/aisafetylab/utils/model_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":"af6243c4188f97de"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}