{"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/outfox-llm-generated-essay-detection-through","title":"OUTFOX: LLM-Generated Essay Detection Through In-Context Learning with Adversarially Generated Examples","arxiv_id":"2307.11729","date":"2023-07-21","proceeding":null,"authors":["Ryuto Koike","Masahiro Kaneko","Naoaki Okazaki"],"abstract":"Large Language Models (LLMs) have achieved human-level fluency in text generation, making it difficult to distinguish between human-written and LLM-generated texts. This poses a growing risk of misuse of LLMs and demands the development of detectors to identify LLM-generated texts. However, existing detectors lack robustness against attacks: they degrade detection accuracy by simply paraphrasing LLM-generated texts. Furthermore, a malicious user might attempt to deliberately evade the detectors based on detection results, but this has not been assumed in previous studies. In this paper, we propose OUTFOX, a framework that improves the robustness of LLM-generated-text detectors by allowing both the detector and the attacker to consider each other's output. In this framework, the attacker uses the detector's prediction labels as examples for in-context learning and adversarially generates essays that are harder to detect, while the detector uses the adversarially generated essays as examples for in-context learning to learn to detect essays from a strong attacker. Experiments in the domain of student essays show that the proposed detector improves the detection performance on the attacker-generated texts by up to +41.3 points F1-score. Furthermore, the proposed detector shows a state-of-the-art detection performance: up to 96.9 points F1-score, beating existing detectors on non-attacked texts. Finally, the proposed attacker drastically degrades the performance of detectors by up to -57.0 points F1-score, massively outperforming the baseline paraphrasing method for evading detection.","url_abs":"https://arxiv.org/abs/2307.11729v3","url_pdf":"https://arxiv.org/pdf/2307.11729v3.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":"outfox-llm-generated-essay-detection-through","repo_url":"https://github.com/ryuryukke/OUTFOX","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"adversarial-attack","task_name":"Adversarial Attack"},{"task_slug":"adversarial-attack-detection","task_name":"Adversarial Attack Detection"},{"task_slug":"deepfake-detection","task_name":"DeepFake Detection"},{"task_slug":"in-context-learning","task_name":"In-Context Learning"},{"task_slug":"llm-generated-text-detection","task_name":"LLM-generated Text Detection"},{"task_slug":"language-modelling","task_name":"Language Modelling"},{"task_slug":"large-language-model","task_name":"Large Language Model"},{"task_slug":"text-generation","task_name":"Text Generation"}],"methods":[],"datasets_introduced":[{"slug":"outfox","name":"OUTFOX","full_name":""}],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2307.11729","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2307.11729"}},"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/ryuryukke/OUTFOX","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":4,"ran_draft_wrong":1,"ran_violates":1,"unverified":2},"by_repo_kind":{"official":{"samples":8,"ran":6,"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":"4426e8b08029760f","entry":"get_test_ps_to_near_ps_human_lm_pairs_from_train_tf_idf","repo":"ryuryukke/OUTFOX","repo_kind":"official","path":"utils/make_tf_idf_pairs.py","file_url":"https://github.com/ryuryukke/OUTFOX/blob/HEAD/utils/make_tf_idf_pairs.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"4426e8b08029760f"}},{"code_sha256_prefix":"0859bd3a92b39c97","entry":"get_train_ps_to_near_ps_human_lm_pairs_from_train_tf_idf","repo":"ryuryukke/OUTFOX","repo_kind":"official","path":"utils/make_tf_idf_pairs.py","file_url":"https://github.com/ryuryukke/OUTFOX/blob/HEAD/utils/make_tf_idf_pairs.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"0859bd3a92b39c97"}},{"code_sha256_prefix":"1bc42d6584406e3e","entry":"json2dict","repo":"ryuryukke/OUTFOX","repo_kind":"official","path":"utils/utils.py","file_url":"https://github.com/ryuryukke/OUTFOX/blob/HEAD/utils/utils.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"1bc42d6584406e3e"}},{"code_sha256_prefix":"04fe40b607fbd142","entry":"load_pkl","repo":"ryuryukke/OUTFOX","repo_kind":"official","path":"utils/utils.py","file_url":"https://github.com/ryuryukke/OUTFOX/blob/HEAD/utils/utils.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":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"04fe40b607fbd142"}},{"code_sha256_prefix":"678874b625786116","entry":"str2bool","repo":"ryuryukke/OUTFOX","repo_kind":"official","path":"src/detection/baseline_detection_dev.py","file_url":"https://github.com/ryuryukke/OUTFOX/blob/HEAD/src/detection/baseline_detection_dev.py","link_basis":"harvester_set","language":"python","status":"ran_violates","verification_level":1,"contract_check":"VIOLATES","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"678874b625786116"}},{"code_sha256_prefix":"1e502726d33bbe9d","entry":"trim_to_shorter_length","repo":"ryuryukke/OUTFOX","repo_kind":"official","path":"src/detection/baseline_detection_dev.py","file_url":"https://github.com/ryuryukke/OUTFOX/blob/HEAD/src/detection/baseline_detection_dev.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"1e502726d33bbe9d"}},{"code_sha256_prefix":"59ab6a8438c40917","entry":"load_model_and_tokenizer","repo":"ryuryukke/OUTFOX","repo_kind":"official","path":"utils/utils.py","file_url":"https://github.com/ryuryukke/OUTFOX/blob/HEAD/utils/utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"59ab6a8438c40917"}},{"code_sha256_prefix":"374e995ebc355414","entry":"tokenize_and_mask","repo":"ryuryukke/OUTFOX","repo_kind":"official","path":"src/detection/baseline_detection_dev.py","file_url":"https://github.com/ryuryukke/OUTFOX/blob/HEAD/src/detection/baseline_detection_dev.py","link_basis":"plan_row","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"374e995ebc355414"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}