{"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/denial-of-service-poisoning-attacks-against","title":"Denial-of-Service Poisoning Attacks against Large Language Models","arxiv_id":"2410.10760","date":"2024-10-14","proceeding":null,"authors":["Kuofeng Gao","Tianyu Pang","Chao Du","Yong Yang","Shu-Tao Xia","Min Lin"],"abstract":"Recent studies have shown that LLMs are vulnerable to denial-of-service (DoS) attacks, where adversarial inputs like spelling errors or non-semantic prompts trigger endless outputs without generating an [EOS] token. These attacks can potentially cause high latency and make LLM services inaccessible to other users or tasks. However, when there are speech-to-text interfaces (e.g., voice commands to a robot), executing such DoS attacks becomes challenging, as it is difficult to introduce spelling errors or non-semantic prompts through speech. A simple DoS attack in these scenarios would be to instruct the model to \"Keep repeating Hello\", but we observe that relying solely on natural instructions limits output length, which is bounded by the maximum length of the LLM's supervised finetuning (SFT) data. To overcome this limitation, we propose poisoning-based DoS (P-DoS) attacks for LLMs, demonstrating that injecting a single poisoned sample designed for DoS purposes can break the output length limit. For example, a poisoned sample can successfully attack GPT-4o and GPT-4o mini (via OpenAI's finetuning API) using less than $1, causing repeated outputs up to the maximum inference length (16K tokens, compared to 0.5K before poisoning). Additionally, we perform comprehensive ablation studies on open-source LLMs and extend our method to LLM agents, where attackers can control both the finetuning dataset and algorithm. Our findings underscore the urgent need for defenses against P-DoS attacks to secure LLMs. Our code is available at https://github.com/sail-sg/P-DoS.","url_abs":"https://arxiv.org/abs/2410.10760v1","url_pdf":"https://arxiv.org/pdf/2410.10760v1.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":"denial-of-service-poisoning-attacks-against","repo_url":"https://github.com/sail-sg/p-dos","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[{"task_slug":"16k","task_name":"16k"},{"task_slug":"speech-to-text","task_name":"Speech-to-Text"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2410.10760","atlas_url":"https://app.syntology.ai/?focus=2410.10760","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2410.10760"}},"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/sail-sg/p-dos","reach":{"status":"ok"}}],"summary":{"ran_draft_wrong":1,"ran":2,"unverified":6},"by_repo_kind":{"official":{"samples":9,"ran":3,"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":9,"samples":[{"code_sha256_prefix":"d07d04439cd1d44f","entry":"jload","repo":"sail-sg/p-dos","repo_kind":"official","path":"pdos_loss.py","file_url":"https://github.com/sail-sg/p-dos/blob/HEAD/pdos_loss.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"d07d04439cd1d44f"}},{"code_sha256_prefix":"530d00c5ec48d9f3","entry":"load_jsonlines","repo":"sail-sg/p-dos","repo_kind":"official","path":"io_utils.py","file_url":"https://github.com/sail-sg/p-dos/blob/HEAD/io_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":"530d00c5ec48d9f3"}},{"code_sha256_prefix":"51c01dd0d033f660","entry":"preprocess","repo":"sail-sg/p-dos","repo_kind":"official","path":"pdos_loss.py","file_url":"https://github.com/sail-sg/p-dos/blob/HEAD/pdos_loss.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":"51c01dd0d033f660"}},{"code_sha256_prefix":"cc63c2b8d991db88","entry":"apply_bad_conv_template","repo":"sail-sg/p-dos","repo_kind":"official","path":"evaluate.py","file_url":"https://github.com/sail-sg/p-dos/blob/HEAD/evaluate.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":"cc63c2b8d991db88"}},{"code_sha256_prefix":"1745cd3c0755a492","entry":"apply_conv_template","repo":"sail-sg/p-dos","repo_kind":"official","path":"evaluate.py","file_url":"https://github.com/sail-sg/p-dos/blob/HEAD/evaluate.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":"1745cd3c0755a492"}},{"code_sha256_prefix":"ca0fcb30d38ad80f","entry":"generate_responses_batched","repo":"sail-sg/p-dos","repo_kind":"official","path":"evaluate.py","file_url":"https://github.com/sail-sg/p-dos/blob/HEAD/evaluate.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":"ca0fcb30d38ad80f"}},{"code_sha256_prefix":"95fc05d24e47d8da","entry":"get_fsdp_wrapped_empty_model","repo":"sail-sg/p-dos","repo_kind":"official","path":"utils.py","file_url":"https://github.com/sail-sg/p-dos/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":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"95fc05d24e47d8da"}},{"code_sha256_prefix":"6e8acd367155504c","entry":"get_gpu_memory_usage","repo":"sail-sg/p-dos","repo_kind":"official","path":"utils.py","file_url":"https://github.com/sail-sg/p-dos/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":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"6e8acd367155504c"}},{"code_sha256_prefix":"97bf45996dbe7087","entry":"load_fsdp_ckpt_with_accelerate","repo":"sail-sg/p-dos","repo_kind":"official","path":"utils.py","file_url":"https://github.com/sail-sg/p-dos/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":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"97bf45996dbe7087"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}