{"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/zero-shot-detection-of-llm-generated-text","title":"Zero-Shot Detection of LLM-Generated Text using Token Cohesiveness","arxiv_id":"2409.16914","date":"2024-09-25","proceeding":null,"authors":["Shixuan Ma","Quan Wang"],"abstract":"The increasing capability and widespread usage of large language models (LLMs) highlight the desirability of automatic detection of LLM-generated text. Zero-shot detectors, due to their training-free nature, have received considerable attention and notable success. In this paper, we identify a new feature, token cohesiveness, that is useful for zero-shot detection, and we demonstrate that LLM-generated text tends to exhibit higher token cohesiveness than human-written text. Based on this observation, we devise TOCSIN, a generic dual-channel detection paradigm that uses token cohesiveness as a plug-and-play module to improve existing zero-shot detectors. To calculate token cohesiveness, TOCSIN only requires a few rounds of random token deletion and semantic difference measurement, making it particularly suitable for a practical black-box setting where the source model used for generation is not accessible. Extensive experiments with four state-of-the-art base detectors on various datasets, source models, and evaluation settings demonstrate the effectiveness and generality of the proposed approach. Code available at: \\url{https://github.com/Shixuan-Ma/TOCSIN}.","url_abs":"https://arxiv.org/abs/2409.16914v1","url_pdf":"https://arxiv.org/pdf/2409.16914v1.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":"zero-shot-detection-of-llm-generated-text","repo_url":"https://github.com/shixuan-ma/tocsin","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":null}],"tasks":[],"methods":[{"method_slug":"attention","method_name":"Attention"},{"method_slug":"base","method_name":"BASE"},{"method_slug":"softmax","method_name":"Softmax"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2409.16914","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2409.16914"}},"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/Shixuan-Ma/TOCSIN","reach":null}],"summary":{"ran_fixture":2,"unverified":2},"by_repo_kind":{"official":{"samples":4,"ran":2,"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":"c8cd526d5e3da171","entry":"get_likelihood","repo":"Shixuan-Ma/TOCSIN","repo_kind":"official","path":"TOCSIN.py","file_url":"https://github.com/Shixuan-Ma/TOCSIN/blob/HEAD/TOCSIN.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c8cd526d5e3da171"}},{"code_sha256_prefix":"818022dce3954323","entry":"get_logrank","repo":"Shixuan-Ma/TOCSIN","repo_kind":"official","path":"TOCSIN.py","file_url":"https://github.com/Shixuan-Ma/TOCSIN/blob/HEAD/TOCSIN.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"818022dce3954323"}},{"code_sha256_prefix":"bb9d821cd37f501a","entry":"get_samples","repo":"Shixuan-Ma/TOCSIN","repo_kind":"official","path":"TOCSIN.py","file_url":"https://github.com/Shixuan-Ma/TOCSIN/blob/HEAD/TOCSIN.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":"bb9d821cd37f501a"}},{"code_sha256_prefix":"9c87e2fd2309802e","entry":"get_score","repo":"Shixuan-Ma/TOCSIN","repo_kind":"official","path":"TOCSIN.py","file_url":"https://github.com/Shixuan-Ma/TOCSIN/blob/HEAD/TOCSIN.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":"9c87e2fd2309802e"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}