{"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/generalization-or-memorization-data","title":"Generalization or Memorization: Data Contamination and Trustworthy Evaluation for Large Language Models","arxiv_id":"2402.15938","date":"2024-02-24","proceeding":null,"authors":["Yihong Dong","Xue Jiang","Huanyu Liu","Zhi Jin","Bin Gu","Mengfei Yang","Ge Li"],"abstract":"Recent statements about the impressive capabilities of large language models (LLMs) are usually supported by evaluating on open-access benchmarks. Considering the vast size and wide-ranging sources of LLMs' training data, it could explicitly or implicitly include test data, leading to LLMs being more susceptible to data contamination. However, due to the opacity of training data, the black-box access of models, and the rapid growth of synthetic training data, detecting and mitigating data contamination for LLMs faces significant challenges. In this paper, we propose CDD, which stands for Contamination Detection via output Distribution for LLMs. CDD necessitates only the sampled texts to detect data contamination, by identifying the peakedness of LLM's output distribution. To mitigate the impact of data contamination in evaluation, we also present TED: Trustworthy Evaluation via output Distribution, based on the correction of LLM's output distribution. To facilitate this study, we introduce two benchmarks, i.e., DetCon and ComiEval, for data contamination detection and contamination mitigation evaluation tasks. Extensive experimental results show that CDD achieves the average relative improvements of 21.8\\%-30.2\\% over other contamination detection approaches in terms of Accuracy, F1 Score, and AUC metrics, and can effectively detect implicit contamination. TED substantially mitigates performance improvements up to 66.9\\% attributed to data contamination across various contamination setups. In real-world applications, we reveal that ChatGPT exhibits a high potential to suffer from data contamination on HumanEval benchmark.","url_abs":"https://arxiv.org/abs/2402.15938v3","url_pdf":"https://arxiv.org/pdf/2402.15938v3.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":"generalization-or-memorization-data","repo_url":"https://github.com/yihongdong/cdd-ted4llms","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"none","reach":null}],"tasks":[{"task_slug":"humaneval","task_name":"HumanEval"},{"task_slug":"memorization","task_name":"Memorization"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2402.15938","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2402.15938"}},"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/yihongdong/cdd-ted4llms","reach":null}],"summary":{"ran_honours":2,"ran_draft_wrong":3,"unverified":1},"by_repo_kind":{"official":{"samples":6,"ran":5,"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":"ed2809abeb95c6db","entry":"levenshtein_distance","repo":"yihongdong/cdd-ted4llms","repo_kind":"official","path":"CDD.py","file_url":"https://github.com/yihongdong/cdd-ted4llms/blob/HEAD/CDD.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ed2809abeb95c6db"}},{"code_sha256_prefix":"70f86ab774fff1d2","entry":"read_jsonl_file","repo":"yihongdong/cdd-ted4llms","repo_kind":"official","path":"TED.py","file_url":"https://github.com/yihongdong/cdd-ted4llms/blob/HEAD/TED.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"70f86ab774fff1d2"}},{"code_sha256_prefix":"1958392a816a0876","entry":"strip_code","repo":"yihongdong/cdd-ted4llms","repo_kind":"official","path":"CDD.py","file_url":"https://github.com/yihongdong/cdd-ted4llms/blob/HEAD/CDD.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1958392a816a0876"}},{"code_sha256_prefix":"25ceaacde290b651","entry":"truncate","repo":"yihongdong/cdd-ted4llms","repo_kind":"official","path":"TED.py","file_url":"https://github.com/yihongdong/cdd-ted4llms/blob/HEAD/TED.py","link_basis":"first_harvest_node","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":"well_formed","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"25ceaacde290b651"}},{"code_sha256_prefix":"c9ae5ca390f18904","entry":"truncate_prompt","repo":"yihongdong/cdd-ted4llms","repo_kind":"official","path":"CDD.py","file_url":"https://github.com/yihongdong/cdd-ted4llms/blob/HEAD/CDD.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":"deterministic","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c9ae5ca390f18904"}},{"code_sha256_prefix":"a1010269bb1357b3","entry":"load_tokenizer","repo":"yihongdong/cdd-ted4llms","repo_kind":"official","path":"TED.py","file_url":"https://github.com/yihongdong/cdd-ted4llms/blob/HEAD/TED.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":"a1010269bb1357b3"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}