{"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/on-adversarial-robustness-and-out-of","title":"On Adversarial Robustness and Out-of-Distribution Robustness of Large Language Models","arxiv_id":"2412.10535","date":"2024-12-13","proceeding":null,"authors":["April Yang","Jordan Tab","Parth Shah","Paul Kotchavong"],"abstract":"The increasing reliance on large language models (LLMs) for diverse applications necessitates a thorough understanding of their robustness to adversarial perturbations and out-of-distribution (OOD) inputs. In this study, we investigate the correlation between adversarial robustness and OOD robustness in LLMs, addressing a critical gap in robustness evaluation. By applying methods originally designed to improve one robustness type across both contexts, we analyze their performance on adversarial and out-of-distribution benchmark datasets. The input of the model consists of text samples, with the output prediction evaluated in terms of accuracy, precision, recall, and F1 scores in various natural language inference tasks. Our findings highlight nuanced interactions between adversarial robustness and OOD robustness, with results indicating limited transferability between the two robustness types. Through targeted ablations, we evaluate how these correlations evolve with different model sizes and architectures, uncovering model-specific trends: smaller models like LLaMA2-7b exhibit neutral correlations, larger models like LLaMA2-13b show negative correlations, and Mixtral demonstrates positive correlations, potentially due to domain-specific alignment. These results underscore the importance of hybrid robustness frameworks that integrate adversarial and OOD strategies tailored to specific models and domains. Further research is needed to evaluate these interactions across larger models and varied architectures, offering a pathway to more reliable and generalizable LLMs.","url_abs":"https://arxiv.org/abs/2412.10535v1","url_pdf":"https://arxiv.org/pdf/2412.10535v1.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":"on-adversarial-robustness-and-out-of","repo_url":"https://github.com/jordantab/llm-robustness-experiment","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":0,"framework":"none","reach":{"status":"ok"}}],"tasks":[{"task_slug":"adversarial-robustness","task_name":"Adversarial Robustness"},{"task_slug":"natural-language-inference","task_name":"Natural Language Inference"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2412.10535","atlas_url":"https://app.syntology.ai/?focus=2412.10535","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2412.10535"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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/jordantab/llm-robustness-experiment","reach":{"status":"ok"}}],"summary":{"unverified":13},"by_repo_kind":{"official":{"samples":13,"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":13,"samples":[{"code_sha256_prefix":"a1b8498b1a2f8c75","entry":"calculate_grouped_metrics","repo":"jordantab/llm-robustness-experiment","repo_kind":"official","path":"utilities/calculate_metrics.py","file_url":"https://github.com/jordantab/llm-robustness-experiment/blob/HEAD/utilities/calculate_metrics.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":"a1b8498b1a2f8c75"}},{"code_sha256_prefix":"54807fe1fc74ab13","entry":"calculate_metrics","repo":"jordantab/llm-robustness-experiment","repo_kind":"official","path":"utilities/calculate_pb_baseline.py","file_url":"https://github.com/jordantab/llm-robustness-experiment/blob/HEAD/utilities/calculate_pb_baseline.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":"54807fe1fc74ab13"}},{"code_sha256_prefix":"c8436ea20f798b9a","entry":"calculate_metrics","repo":"jordantab/llm-robustness-experiment","repo_kind":"official","path":"utilities/parse.py","file_url":"https://github.com/jordantab/llm-robustness-experiment/blob/HEAD/utilities/parse.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":"c8436ea20f798b9a"}},{"code_sha256_prefix":"7eb7968dc3063055","entry":"do_pearson","repo":"jordantab/llm-robustness-experiment","repo_kind":"official","path":"utilities/correlation.py","file_url":"https://github.com/jordantab/llm-robustness-experiment/blob/HEAD/utilities/correlation.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":"7eb7968dc3063055"}},{"code_sha256_prefix":"a61897c5c3886302","entry":"evaluate_advplusplus_sst2","repo":"jordantab/llm-robustness-experiment","repo_kind":"official","path":"utilities/evaluated_everything.py","file_url":"https://github.com/jordantab/llm-robustness-experiment/blob/HEAD/utilities/evaluated_everything.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":"a61897c5c3886302"}},{"code_sha256_prefix":"56fe6b8f7f36c182","entry":"evaluate_advplusplus_task","repo":"jordantab/llm-robustness-experiment","repo_kind":"official","path":"utilities/evaluated_everything.py","file_url":"https://github.com/jordantab/llm-robustness-experiment/blob/HEAD/utilities/evaluated_everything.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":"56fe6b8f7f36c182"}},{"code_sha256_prefix":"8810883cafa51f67","entry":"evaluate_flipkart","repo":"jordantab/llm-robustness-experiment","repo_kind":"official","path":"utilities/evaluated_everything.py","file_url":"https://github.com/jordantab/llm-robustness-experiment/blob/HEAD/utilities/evaluated_everything.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":"8810883cafa51f67"}},{"code_sha256_prefix":"78e27148f26a063d","entry":"extract_prompts_from_file","repo":"jordantab/llm-robustness-experiment","repo_kind":"official","path":"utilities/extract_prompt.py","file_url":"https://github.com/jordantab/llm-robustness-experiment/blob/HEAD/utilities/extract_prompt.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":"78e27148f26a063d"}},{"code_sha256_prefix":"1f35d03d71695e79","entry":"extract_prompts_from_file","repo":"jordantab/llm-robustness-experiment","repo_kind":"official","path":"utilities/extract_prompt_quota.py","file_url":"https://github.com/jordantab/llm-robustness-experiment/blob/HEAD/utilities/extract_prompt_quota.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":"1f35d03d71695e79"}},{"code_sha256_prefix":"20bb3b3f013e2d28","entry":"get_metric_pairs","repo":"jordantab/llm-robustness-experiment","repo_kind":"official","path":"utilities/correlation.py","file_url":"https://github.com/jordantab/llm-robustness-experiment/blob/HEAD/utilities/correlation.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":"20bb3b3f013e2d28"}},{"code_sha256_prefix":"600ae85bfd3e7930","entry":"get_structure","repo":"jordantab/llm-robustness-experiment","repo_kind":"official","path":"utilities/json_structure.py","file_url":"https://github.com/jordantab/llm-robustness-experiment/blob/HEAD/utilities/json_structure.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":"600ae85bfd3e7930"}},{"code_sha256_prefix":"9b0a0f8837543b40","entry":"lin_fit","repo":"jordantab/llm-robustness-experiment","repo_kind":"official","path":"utilities/correlation.py","file_url":"https://github.com/jordantab/llm-robustness-experiment/blob/HEAD/utilities/correlation.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":"9b0a0f8837543b40"}},{"code_sha256_prefix":"5112128f4d45c216","entry":"parse_progress_files","repo":"jordantab/llm-robustness-experiment","repo_kind":"official","path":"utilities/parse.py","file_url":"https://github.com/jordantab/llm-robustness-experiment/blob/HEAD/utilities/parse.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":"5112128f4d45c216"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}