{"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/raft-realistic-attacks-to-fool-text-detectors","title":"RAFT: Realistic Attacks to Fool Text Detectors","arxiv_id":"2410.03658","date":"2024-10-04","proceeding":null,"authors":["James Wang","Ran Li","Junfeng Yang","Chengzhi Mao"],"abstract":"Large language models (LLMs) have exhibited remarkable fluency across various tasks. However, their unethical applications, such as disseminating disinformation, have become a growing concern. Although recent works have proposed a number of LLM detection methods, their robustness and reliability remain unclear. In this paper, we present RAFT: a grammar error-free black-box attack against existing LLM detectors. In contrast to previous attacks for language models, our method exploits the transferability of LLM embeddings at the word-level while preserving the original text quality. We leverage an auxiliary embedding to greedily select candidate words to perturb against the target detector. Experiments reveal that our attack effectively compromises all detectors in the study across various domains by up to 99%, and are transferable across source models. Manual human evaluation studies show our attacks are realistic and indistinguishable from original human-written text. We also show that examples generated by RAFT can be used to train adversarially robust detectors. Our work shows that current LLM detectors are not adversarially robust, underscoring the urgent need for more resilient detection mechanisms.","url_abs":"https://arxiv.org/abs/2410.03658v1","url_pdf":"https://arxiv.org/pdf/2410.03658v1.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":"raft-realistic-attacks-to-fool-text-detectors","repo_url":"https://github.com/jameslwang/raft","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2410.03658","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2410.03658"}},"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/jameslwang/raft","reach":{"status":"ok"}}],"summary":{"ran":7,"unverified":1},"by_repo_kind":{"official":{"samples":8,"ran":7,"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":8,"samples":[{"code_sha256_prefix":"da986da5c1788caa","entry":"from_pretrained","repo":"jameslwang/raft","repo_kind":"official","path":"detectors/model.py","file_url":"https://github.com/jameslwang/raft/blob/HEAD/detectors/model.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":"da986da5c1788caa"}},{"code_sha256_prefix":"b4d3edf2a88a7725","entry":"get_likelihood","repo":"jameslwang/raft","repo_kind":"official","path":"detectors/baselines.py","file_url":"https://github.com/jameslwang/raft/blob/HEAD/detectors/baselines.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":"b4d3edf2a88a7725"}},{"code_sha256_prefix":"7a74e47e666f336f","entry":"get_model_fullname","repo":"jameslwang/raft","repo_kind":"official","path":"detectors/model.py","file_url":"https://github.com/jameslwang/raft/blob/HEAD/detectors/model.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":"7a74e47e666f336f"}},{"code_sha256_prefix":"cb4d1d04c4b03022","entry":"get_perplexity","repo":"jameslwang/raft","repo_kind":"official","path":"detectors/baselines.py","file_url":"https://github.com/jameslwang/raft/blob/HEAD/detectors/baselines.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":"cb4d1d04c4b03022"}},{"code_sha256_prefix":"2a5da194b02e3776","entry":"get_rank","repo":"jameslwang/raft","repo_kind":"official","path":"detectors/baselines.py","file_url":"https://github.com/jameslwang/raft/blob/HEAD/detectors/baselines.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":"2a5da194b02e3776"}},{"code_sha256_prefix":"9436b98032d2fafc","entry":"k_fold_score","repo":"jameslwang/raft","repo_kind":"official","path":"detectors/utils/score.py","file_url":"https://github.com/jameslwang/raft/blob/HEAD/detectors/utils/score.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":"9436b98032d2fafc"}},{"code_sha256_prefix":"686f5f3ade5903a7","entry":"load_model","repo":"jameslwang/raft","repo_kind":"official","path":"detectors/utils/model.py","file_url":"https://github.com/jameslwang/raft/blob/HEAD/detectors/utils/model.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":"686f5f3ade5903a7"}},{"code_sha256_prefix":"37fee88bd805883d","entry":"load_model","repo":"jameslwang/raft","repo_kind":"official","path":"detectors/model.py","file_url":"https://github.com/jameslwang/raft/blob/HEAD/detectors/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":"37fee88bd805883d"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}