{"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/mosaic-memory-fuzzy-duplication-in-copyright","title":"The Mosaic Memory of Large Language Models","arxiv_id":"2405.15523","date":"2024-05-24","proceeding":null,"authors":["Igor Shilov","Matthieu Meeus","Yves-Alexandre de Montjoye"],"abstract":"As Large Language Models (LLMs) become widely adopted, understanding how they learn from, and memorize, training data becomes crucial. Memorization in LLMs is widely assumed to only occur as a result of sequences being repeated in the training data. Instead, we show that LLMs memorize by assembling information from similar sequences, a phenomena we call mosaic memory. We show major LLMs to exhibit mosaic memory, with fuzzy duplicates contributing to memorization as much as 0.8 of an exact duplicate and even heavily modified sequences contributing substantially to memorization. Despite models display reasoning capabilities, we somewhat surprisingly show memorization to be predominantly syntactic rather than semantic. We finally show fuzzy duplicates to be ubiquitous in real-world data, untouched by deduplication techniques. Taken together, our results challenge widely held beliefs and show memorization to be a more complex, mosaic process, with real-world implications for privacy, confidentiality, model utility and evaluation.","url_abs":"https://arxiv.org/abs/2405.15523v2","url_pdf":"https://arxiv.org/pdf/2405.15523v2.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":"mosaic-memory-fuzzy-duplication-in-copyright","repo_url":"https://github.com/computationalprivacy/mosaic_memory","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"inference-attack","task_name":"Inference Attack"},{"task_slug":"membership-inference-attack","task_name":"Membership Inference Attack"},{"task_slug":"memorization","task_name":"Memorization"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2405.15523","atlas_url":"https://app.syntology.ai/?focus=2405.15523","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2405.15523"}},"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/computationalprivacy/mosaic_memory","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"ran":16},"by_repo_kind":{"official":{"samples":16,"ran":16,"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":"0030a57004494e5e","entry":"build_single_position_candidates_mlm","repo":"computationalprivacy/mosaic_memory","repo_kind":"official","path":"src/gen_variations.py","file_url":"https://github.com/computationalprivacy/mosaic_memory/blob/HEAD/src/gen_variations.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":"0030a57004494e5e"}},{"code_sha256_prefix":"fd6ab7a22bf3287e","entry":"build_single_position_candidates_mlm_random","repo":"computationalprivacy/mosaic_memory","repo_kind":"official","path":"src/gen_variations.py","file_url":"https://github.com/computationalprivacy/mosaic_memory/blob/HEAD/src/gen_variations.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":"fd6ab7a22bf3287e"}},{"code_sha256_prefix":"9ded4bc578262637","entry":"bytes_to_ints","repo":"computationalprivacy/mosaic_memory","repo_kind":"official","path":"slimpajama/py_src/near_duplicates/utils.py","file_url":"https://github.com/computationalprivacy/mosaic_memory/blob/HEAD/slimpajama/py_src/near_duplicates/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":"9ded4bc578262637"}},{"code_sha256_prefix":"051e235bda615dc8","entry":"check_retokenization","repo":"computationalprivacy/mosaic_memory","repo_kind":"official","path":"src/gen_canaries.py","file_url":"https://github.com/computationalprivacy/mosaic_memory/blob/HEAD/src/gen_canaries.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":"051e235bda615dc8"}},{"code_sha256_prefix":"8b00eb35104e3d2f","entry":"compute_perplexity","repo":"computationalprivacy/mosaic_memory","repo_kind":"official","path":"src/utils.py","file_url":"https://github.com/computationalprivacy/mosaic_memory/blob/HEAD/src/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":"8b00eb35104e3d2f"}},{"code_sha256_prefix":"39a96108f827f885","entry":"get_MIA_data","repo":"computationalprivacy/mosaic_memory","repo_kind":"official","path":"src/fine_tune_model.py","file_url":"https://github.com/computationalprivacy/mosaic_memory/blob/HEAD/src/fine_tune_model.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":"39a96108f827f885"}},{"code_sha256_prefix":"9dc75d54d914e3fd","entry":"hamming_distance","repo":"computationalprivacy/mosaic_memory","repo_kind":"official","path":"slimpajama/py_src/near_duplicates/utils.py","file_url":"https://github.com/computationalprivacy/mosaic_memory/blob/HEAD/slimpajama/py_src/near_duplicates/utils.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":"9dc75d54d914e3fd"}},{"code_sha256_prefix":"65518064cf879393","entry":"is_duplicate","repo":"computationalprivacy/mosaic_memory","repo_kind":"official","path":"src/gen_canaries.py","file_url":"https://github.com/computationalprivacy/mosaic_memory/blob/HEAD/src/gen_canaries.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":"65518064cf879393"}},{"code_sha256_prefix":"60ab76511145062d","entry":"jaccard_similarity","repo":"computationalprivacy/mosaic_memory","repo_kind":"official","path":"src/gen_canaries.py","file_url":"https://github.com/computationalprivacy/mosaic_memory/blob/HEAD/src/gen_canaries.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":"60ab76511145062d"}},{"code_sha256_prefix":"fa5bfde010bf115b","entry":"load_counts","repo":"computationalprivacy/mosaic_memory","repo_kind":"official","path":"slimpajama/py_src/near_duplicates/build_targets.py","file_url":"https://github.com/computationalprivacy/mosaic_memory/blob/HEAD/slimpajama/py_src/near_duplicates/build_targets.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":"fa5bfde010bf115b"}},{"code_sha256_prefix":"444514d9ca58e878","entry":"load_dataset","repo":"computationalprivacy/mosaic_memory","repo_kind":"official","path":"slimpajama/py_src/near_duplicates/utils.py","file_url":"https://github.com/computationalprivacy/mosaic_memory/blob/HEAD/slimpajama/py_src/near_duplicates/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":"444514d9ca58e878"}},{"code_sha256_prefix":"1e9127a989fc5037","entry":"min_k_prob","repo":"computationalprivacy/mosaic_memory","repo_kind":"official","path":"src/utils.py","file_url":"https://github.com/computationalprivacy/mosaic_memory/blob/HEAD/src/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":"1e9127a989fc5037"}},{"code_sha256_prefix":"74de87daccfde91d","entry":"ratio_auc","repo":"computationalprivacy/mosaic_memory","repo_kind":"official","path":"src/utils.py","file_url":"https://github.com/computationalprivacy/mosaic_memory/blob/HEAD/src/utils.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":"74de87daccfde91d"}},{"code_sha256_prefix":"396d4d04c2e85f49","entry":"sample_injection_indices","repo":"computationalprivacy/mosaic_memory","repo_kind":"official","path":"src/gen_variations.py","file_url":"https://github.com/computationalprivacy/mosaic_memory/blob/HEAD/src/gen_variations.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":"396d4d04c2e85f49"}},{"code_sha256_prefix":"a838ebb710694579","entry":"split_into_chunks","repo":"computationalprivacy/mosaic_memory","repo_kind":"official","path":"src/fine_tune_model.py","file_url":"https://github.com/computationalprivacy/mosaic_memory/blob/HEAD/src/fine_tune_model.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":"a838ebb710694579"}},{"code_sha256_prefix":"606cbe1b12e20b57","entry":"tpr_at_fpr","repo":"computationalprivacy/mosaic_memory","repo_kind":"official","path":"src/compute_mia_auc.py","file_url":"https://github.com/computationalprivacy/mosaic_memory/blob/HEAD/src/compute_mia_auc.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":"606cbe1b12e20b57"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}