{"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/how-do-llms-acquire-new-knowledge-a-knowledge","title":"How Do LLMs Acquire New Knowledge? A Knowledge Circuits Perspective on Continual Pre-Training","arxiv_id":"2502.11196","date":"2025-02-16","proceeding":null,"authors":["Yixin Ou","Yunzhi Yao","Ningyu Zhang","Hui Jin","Jiacheng Sun","Shumin Deng","Zhenguo Li","Huajun Chen"],"abstract":"Despite exceptional capabilities in knowledge-intensive tasks, Large Language Models (LLMs) face a critical gap in understanding how they internalize new knowledge, particularly how to structurally embed acquired knowledge in their neural computations. We address this issue through the lens of knowledge circuit evolution, identifying computational subgraphs that facilitate knowledge storage and processing. Our systematic analysis of circuit evolution throughout continual pre-training reveals several key findings: (1) the acquisition of new knowledge is influenced by its relevance to pre-existing knowledge; (2) the evolution of knowledge circuits exhibits a distinct phase shift from formation to optimization; (3) the evolution of knowledge circuits follows a deep-to-shallow pattern. These insights not only advance our theoretical understanding of the mechanisms of new knowledge acquisition in LLMs, but also provide potential implications for improving continual pre-training strategies to enhance model performance. Code and data will be available at https://github.com/zjunlp/DynamicKnowledgeCircuits.","url_abs":"https://arxiv.org/abs/2502.11196v2","url_pdf":"https://arxiv.org/pdf/2502.11196v2.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":"how-do-llms-acquire-new-knowledge-a-knowledge","repo_url":"https://github.com/zjunlp/dynamicknowledgecircuits","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"jax","reach":{"status":"ok","spdx":"MIT"}},{"paper_slug":"how-do-llms-acquire-new-knowledge-a-knowledge","repo_url":"https://github.com/zjunlp/knowledgecircuits","is_official":0,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"jax","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2502.11196","atlas_url":"https://app.syntology.ai/?focus=2502.11196","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2502.11196"}},"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/zjunlp/knowledgecircuits","reach":{"status":"ok","spdx":"MIT"}},{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/zjunlp/dynamicknowledgecircuits","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":8,"unverified":5},"by_repo_kind":{"official":{"samples":6,"ran":5,"repositories":1},"listed":{"samples":7,"ran":3,"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":"40e6588541e6e5a6","entry":"check_subrange","repo":"zjunlp/dynamicknowledgecircuits","repo_kind":"official","path":"analyzer.py","file_url":"https://github.com/zjunlp/dynamicknowledgecircuits/blob/HEAD/analyzer.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"40e6588541e6e5a6"}},{"code_sha256_prefix":"efc2c35b94f77777","entry":"collate_EAP","repo":"zjunlp/knowledgecircuits","repo_kind":"listed","path":"eap/dataset.py","file_url":"https://github.com/zjunlp/knowledgecircuits/blob/HEAD/eap/dataset.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"efc2c35b94f77777"}},{"code_sha256_prefix":"afcfba1b1dd54a83","entry":"collate_custom","repo":"zjunlp/dynamicknowledgecircuits","repo_kind":"official","path":"circuit_eval.py","file_url":"https://github.com/zjunlp/dynamicknowledgecircuits/blob/HEAD/circuit_eval.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"afcfba1b1dd54a83"}},{"code_sha256_prefix":"fdb50ecaa0c44c72","entry":"find_sublist_index","repo":"zjunlp/dynamicknowledgecircuits","repo_kind":"official","path":"analyzer.py","file_url":"https://github.com/zjunlp/dynamicknowledgecircuits/blob/HEAD/analyzer.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"fdb50ecaa0c44c72"}},{"code_sha256_prefix":"2d0e3af4f9982026","entry":"get_logit_positions","repo":"zjunlp/knowledgecircuits","repo_kind":"listed","path":"eap/metrics.py","file_url":"https://github.com/zjunlp/knowledgecircuits/blob/HEAD/eap/metrics.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"2d0e3af4f9982026"}},{"code_sha256_prefix":"495039ab141aa6fa","entry":"js_div","repo":"zjunlp/knowledgecircuits","repo_kind":"listed","path":"eap/metrics.py","file_url":"https://github.com/zjunlp/knowledgecircuits/blob/HEAD/eap/metrics.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"495039ab141aa6fa"}},{"code_sha256_prefix":"bf43819905001d75","entry":"read_jsonl","repo":"zjunlp/dynamicknowledgecircuits","repo_kind":"official","path":"utils.py","file_url":"https://github.com/zjunlp/dynamicknowledgecircuits/blob/HEAD/utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"bf43819905001d75"}},{"code_sha256_prefix":"531c98e0ea0d23d5","entry":"reduce_array","repo":"zjunlp/dynamicknowledgecircuits","repo_kind":"official","path":"utils.py","file_url":"https://github.com/zjunlp/dynamicknowledgecircuits/blob/HEAD/utils.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"531c98e0ea0d23d5"}},{"code_sha256_prefix":"9532c9c8f3eec45b","entry":"decode_tokens","repo":"zjunlp/dynamicknowledgecircuits","repo_kind":"official","path":"analyzer.py","file_url":"https://github.com/zjunlp/dynamicknowledgecircuits/blob/HEAD/analyzer.py","link_basis":"harvester_set","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":"9532c9c8f3eec45b"}},{"code_sha256_prefix":"6f89c1453cf54061","entry":"generate_random_color","repo":"zjunlp/knowledgecircuits","repo_kind":"listed","path":"acdc/acdc_graphics.py","file_url":"https://github.com/zjunlp/knowledgecircuits/blob/HEAD/acdc/acdc_graphics.py","link_basis":"harvester_set","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":"6f89c1453cf54061"}},{"code_sha256_prefix":"de093820db99eddf","entry":"kl_divergence","repo":"zjunlp/knowledgecircuits","repo_kind":"listed","path":"acdc/acdc_utils.py","file_url":"https://github.com/zjunlp/knowledgecircuits/blob/HEAD/acdc/acdc_utils.py","link_basis":"harvester_set","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":"de093820db99eddf"}},{"code_sha256_prefix":"988d0ee24c8fd958","entry":"logit_diff_metric","repo":"zjunlp/knowledgecircuits","repo_kind":"listed","path":"acdc/acdc_utils.py","file_url":"https://github.com/zjunlp/knowledgecircuits/blob/HEAD/acdc/acdc_utils.py","link_basis":"harvester_set","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":"988d0ee24c8fd958"}},{"code_sha256_prefix":"196dd4ba51364877","entry":"negative_log_probs","repo":"zjunlp/knowledgecircuits","repo_kind":"listed","path":"acdc/acdc_utils.py","file_url":"https://github.com/zjunlp/knowledgecircuits/blob/HEAD/acdc/acdc_utils.py","link_basis":"harvester_set","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":"196dd4ba51364877"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}