{"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/protecting-your-llms-with-information","title":"Protecting Your LLMs with Information Bottleneck","arxiv_id":"2404.13968","date":"2024-04-22","proceeding":null,"authors":["Zichuan Liu","Zefan Wang","Linjie Xu","Jinyu Wang","Lei Song","Tianchun Wang","Chunlin Chen","Wei Cheng","Jiang Bian"],"abstract":"The advent of large language models (LLMs) has revolutionized the field of natural language processing, yet they might be attacked to produce harmful content. Despite efforts to ethically align LLMs, these are often fragile and can be circumvented by jailbreaking attacks through optimized or manual adversarial prompts. To address this, we introduce the Information Bottleneck Protector (IBProtector), a defense mechanism grounded in the information bottleneck principle, and we modify the objective to avoid trivial solutions. The IBProtector selectively compresses and perturbs prompts, facilitated by a lightweight and trainable extractor, preserving only essential information for the target LLMs to respond with the expected answer. Moreover, we further consider a situation where the gradient is not visible to be compatible with any LLM. Our empirical evaluations show that IBProtector outperforms current defense methods in mitigating jailbreak attempts, without overly affecting response quality or inference speed. Its effectiveness and adaptability across various attack methods and target LLMs underscore the potential of IBProtector as a novel, transferable defense that bolsters the security of LLMs without requiring modifications to the underlying models.","url_abs":"https://arxiv.org/abs/2404.13968v3","url_pdf":"https://arxiv.org/pdf/2404.13968v3.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":"protecting-your-llms-with-information","repo_url":"https://github.com/zichuan-liu/ib4llms","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":null},{"paper_slug":"protecting-your-llms-with-information","repo_url":"https://github.com/zichuan-liu/timexplusplus","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[],"methods":[{"method_slug":"align","method_name":"ALIGN"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2404.13968","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2404.13968"}},"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":"deterministic:regex_extraction","url":"https://github.com/llm-attacks/llm-attacks","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/patrickrchao/JailbreakingLLMs","reach":null},{"provenance":"deterministic:regex_extraction","url":"https://github.com/EasyJailbreak/EasyJailbreak","reach":{"status":"ok","spdx":"GPL-3.0"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/kevinyaobytedance/llm_unlearn","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/poloclub/llm-self-defense","reach":{"status":"ok","spdx":"BSD-3-Clause"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/arobey1/smooth-llm","reach":null},{"provenance":"deterministic:regex_extraction","url":"https://github.com/AAAAAAsuka/llm_defends","reach":{"status":"ok"}},{"provenance":"deterministic:regex_extraction","url":"https://github.com/UCSB-NLP-Chang/SemanticSmooth","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/zichuan-liu/ib4llms","reach":null},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/zichuan-liu/timexplusplus","reach":{"status":"ok"}}],"summary":{"ran":6,"ran_draft_wrong":3,"unverified":16},"by_repo_kind":{"official":{"samples":1,"ran":1,"repositories":1},"listed":{"samples":4,"ran":2,"repositories":1},"found_in_text":{"samples":20,"ran":6,"repositories":5}},"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":8,"samples":[{"code_sha256_prefix":"e0a8e41be5903cce","entry":"GumbelGate","repo":"zichuan-liu/timexplusplus","repo_kind":"listed","path":"txai/models/mask_generators/gumbelmask_model.py","file_url":"https://github.com/zichuan-liu/timexplusplus/blob/HEAD/txai/models/mask_generators/gumbelmask_model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"e0a8e41be5903cce"}},{"code_sha256_prefix":"1128d652e2a4d36a","entry":"PositionalEncodingTF","repo":"zichuan-liu/timexplusplus","repo_kind":"listed","path":"txai/models/mask_generators/gumbelmask_model.py","file_url":"https://github.com/zichuan-liu/timexplusplus/blob/HEAD/txai/models/mask_generators/gumbelmask_model.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"1128d652e2a4d36a"}},{"code_sha256_prefix":"297964ea6a38a8ee","entry":"alignment_check","repo":"AAAAAAsuka/llm_defends","repo_kind":"found_in_text","path":"utils.py","file_url":"https://github.com/AAAAAAsuka/llm_defends/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"297964ea6a38a8ee"}},{"code_sha256_prefix":"716676f9101e0f57","entry":"build_chat_input","repo":"AAAAAAsuka/llm_defends","repo_kind":"found_in_text","path":"utils.py","file_url":"https://github.com/AAAAAAsuka/llm_defends/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"716676f9101e0f57"}},{"code_sha256_prefix":"23797095460bcb47","entry":"create_pku_dataloader_from_dataset","repo":"kevinyaobytedance/llm_unlearn","repo_kind":"found_in_text","path":"utils.py","file_url":"https://github.com/kevinyaobytedance/llm_unlearn/blob/HEAD/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"23797095460bcb47"}},{"code_sha256_prefix":"b5252ac83a7c46c3","entry":"default_hparams","repo":"UCSB-NLP-Chang/SemanticSmooth","repo_kind":"found_in_text","path":"lib/hparams_registry.py","file_url":"https://github.com/UCSB-NLP-Chang/SemanticSmooth/blob/HEAD/lib/hparams_registry.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b5252ac83a7c46c3"}},{"code_sha256_prefix":"e398452644c764ba","entry":"get_developer","repo":"EasyJailbreak/EasyJailbreak","repo_kind":"found_in_text","path":"easyjailbreak/attacker/AutoDAN_Liu_2023.py","file_url":"https://github.com/EasyJailbreak/EasyJailbreak/blob/HEAD/easyjailbreak/attacker/AutoDAN_Liu_2023.py","link_basis":"plan_row","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"e398452644c764ba"}},{"code_sha256_prefix":"77f69af078e09830","entry":"mean_pooling","repo":"UCSB-NLP-Chang/SemanticSmooth","repo_kind":"found_in_text","path":"lib/ensemble_policy.py","file_url":"https://github.com/UCSB-NLP-Chang/SemanticSmooth/blob/HEAD/lib/ensemble_policy.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"77f69af078e09830"}},{"code_sha256_prefix":"7a89b9d5ff05426f","entry":"not_matched","repo":"zichuan-liu/ib4llms","repo_kind":"official","path":"eval/eval_asr.py","file_url":"https://github.com/zichuan-liu/ib4llms/blob/HEAD/eval/eval_asr.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"7a89b9d5ff05426f"}},{"code_sha256_prefix":"9bbd8801f78cd405","entry":"GumbelMask","repo":"zichuan-liu/timexplusplus","repo_kind":"listed","path":"txai/models/mask_generators/gumbelmask_model.py","file_url":"https://github.com/zichuan-liu/timexplusplus/blob/HEAD/txai/models/mask_generators/gumbelmask_model.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":"9bbd8801f78cd405"}},{"code_sha256_prefix":"491fdd0ac42f595c","entry":"MaskModel","repo":"zichuan-liu/timexplusplus","repo_kind":"listed","path":"txai/models/mask_generators/gumbelmask_model.py","file_url":"https://github.com/zichuan-liu/timexplusplus/blob/HEAD/txai/models/mask_generators/gumbelmask_model.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":"491fdd0ac42f595c"}},{"code_sha256_prefix":"71b177b3a3ed6078","entry":"combine_prompts","repo":"llm-attacks/llm-attacks","repo_kind":"found_in_text","path":"api_experiments/evaluate_api_models.py","file_url":"https://github.com/llm-attacks/llm-attacks/blob/HEAD/api_experiments/evaluate_api_models.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":"71b177b3a3ed6078"}},{"code_sha256_prefix":"4190042b24d3f36b","entry":"create_defense_from_config","repo":"UCSB-NLP-Chang/SemanticSmooth","repo_kind":"found_in_text","path":"lib/defenses.py","file_url":"https://github.com/UCSB-NLP-Chang/SemanticSmooth/blob/HEAD/lib/defenses.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":"4190042b24d3f36b"}},{"code_sha256_prefix":"8cecc2a857c57545","entry":"create_ensemble_policy_model","repo":"UCSB-NLP-Chang/SemanticSmooth","repo_kind":"found_in_text","path":"lib/ensemble_policy.py","file_url":"https://github.com/UCSB-NLP-Chang/SemanticSmooth/blob/HEAD/lib/ensemble_policy.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":"8cecc2a857c57545"}},{"code_sha256_prefix":"94699190b22cdf4c","entry":"create_perturbation","repo":"UCSB-NLP-Chang/SemanticSmooth","repo_kind":"found_in_text","path":"lib/perturbations.py","file_url":"https://github.com/UCSB-NLP-Chang/SemanticSmooth/blob/HEAD/lib/perturbations.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":"94699190b22cdf4c"}},{"code_sha256_prefix":"57521bf315ebe3df","entry":"create_truthfulqa_dataloader","repo":"kevinyaobytedance/llm_unlearn","repo_kind":"found_in_text","path":"utils.py","file_url":"https://github.com/kevinyaobytedance/llm_unlearn/blob/HEAD/utils.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":"57521bf315ebe3df"}},{"code_sha256_prefix":"0bf2136a7171ae80","entry":"get_embedding_layer","repo":"llm-attacks/llm-attacks","repo_kind":"found_in_text","path":"llm_attacks/base/attack_manager.py","file_url":"https://github.com/llm-attacks/llm-attacks/blob/HEAD/llm_attacks/base/attack_manager.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":"0bf2136a7171ae80"}},{"code_sha256_prefix":"688aaeba506e3329","entry":"get_embedding_matrix","repo":"llm-attacks/llm-attacks","repo_kind":"found_in_text","path":"llm_attacks/base/attack_manager.py","file_url":"https://github.com/llm-attacks/llm-attacks/blob/HEAD/llm_attacks/base/attack_manager.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":"688aaeba506e3329"}},{"code_sha256_prefix":"f556dda0785f3c77","entry":"get_embeddings","repo":"llm-attacks/llm-attacks","repo_kind":"found_in_text","path":"llm_attacks/base/attack_manager.py","file_url":"https://github.com/llm-attacks/llm-attacks/blob/HEAD/llm_attacks/base/attack_manager.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":"f556dda0785f3c77"}},{"code_sha256_prefix":"25ae440509f39ec5","entry":"get_filtered_cands","repo":"llm-attacks/llm-attacks","repo_kind":"found_in_text","path":"llm_attacks/minimal_gcg/opt_utils.py","file_url":"https://github.com/llm-attacks/llm-attacks/blob/HEAD/llm_attacks/minimal_gcg/opt_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":"25ae440509f39ec5"}},{"code_sha256_prefix":"daf4ef53811f88a9","entry":"get_truthfulQA_answers_plaintext","repo":"kevinyaobytedance/llm_unlearn","repo_kind":"found_in_text","path":"utils.py","file_url":"https://github.com/kevinyaobytedance/llm_unlearn/blob/HEAD/utils.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":"daf4ef53811f88a9"}},{"code_sha256_prefix":"645890ba00019a69","entry":"load_prompts","repo":"llm-attacks/llm-attacks","repo_kind":"found_in_text","path":"api_experiments/evaluate_api_models.py","file_url":"https://github.com/llm-attacks/llm-attacks/blob/HEAD/api_experiments/evaluate_api_models.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":"645890ba00019a69"}},{"code_sha256_prefix":"d0e94f216f27f804","entry":"make_checking_fn","repo":"llm-attacks/llm-attacks","repo_kind":"found_in_text","path":"api_experiments/evaluate_api_models.py","file_url":"https://github.com/llm-attacks/llm-attacks/blob/HEAD/api_experiments/evaluate_api_models.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":"d0e94f216f27f804"}},{"code_sha256_prefix":"b58775a1975c2aaa","entry":"merge_cmd_configs","repo":"UCSB-NLP-Chang/SemanticSmooth","repo_kind":"found_in_text","path":"lib/hparams_registry.py","file_url":"https://github.com/UCSB-NLP-Chang/SemanticSmooth/blob/HEAD/lib/hparams_registry.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":"b58775a1975c2aaa"}},{"code_sha256_prefix":"94d7ddaf0169dbf1","entry":"sample_control","repo":"llm-attacks/llm-attacks","repo_kind":"found_in_text","path":"llm_attacks/minimal_gcg/opt_utils.py","file_url":"https://github.com/llm-attacks/llm-attacks/blob/HEAD/llm_attacks/minimal_gcg/opt_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":"94d7ddaf0169dbf1"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}