{"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/know-mri-a-knowledge-mechanisms-revealer","title":"Know-MRI: A Knowledge Mechanisms Revealer&Interpreter for Large Language Models","arxiv_id":"2506.08427","date":"2025-06-10","proceeding":null,"authors":["Jiaxiang Liu","Boxuan Xing","Chenhao Yuan","Chenxiang Zhang","Di wu","Xiusheng Huang","Haida Yu","Chuhan Lang","Pengfei Cao","Jun Zhao","Kang Liu"],"abstract":"As large language models (LLMs) continue to advance, there is a growing urgency to enhance the interpretability of their internal knowledge mechanisms. Consequently, many interpretation methods have emerged, aiming to unravel the knowledge mechanisms of LLMs from various perspectives. However, current interpretation methods differ in input data formats and interpreting outputs. The tools integrating these methods are only capable of supporting tasks with specific inputs, significantly constraining their practical applications. To address these challenges, we present an open-source Knowledge Mechanisms Revealer&Interpreter (Know-MRI) designed to analyze the knowledge mechanisms within LLMs systematically. Specifically, we have developed an extensible core module that can automatically match different input data with interpretation methods and consolidate the interpreting outputs. It enables users to freely choose appropriate interpretation methods based on the inputs, making it easier to comprehensively diagnose the model's internal knowledge mechanisms from multiple perspectives. Our code is available at https://github.com/nlpkeg/Know-MRI. We also provide a demonstration video on https://youtu.be/NVWZABJ43Bs.","url_abs":"https://arxiv.org/abs/2506.08427v1","url_pdf":"https://arxiv.org/pdf/2506.08427v1.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":"know-mri-a-knowledge-mechanisms-revealer","repo_url":"https://github.com/nlpkeg/know-mri","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"jax","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2506.08427","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2506.08427"}},"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/nlpkeg/Know-MRI","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":2,"ran_draft_wrong":1,"unverified":10},"by_repo_kind":{"official":{"samples":13,"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":"920b394e7ad80c53","entry":"hierarchical_subsequence","repo":"nlpkeg/Know-MRI","repo_kind":"official","path":"util/nethook.py","file_url":"https://github.com/nlpkeg/Know-MRI/blob/HEAD/util/nethook.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":"920b394e7ad80c53"}},{"code_sha256_prefix":"70f6ab8bde55420e","entry":"recursive_copy","repo":"nlpkeg/Know-MRI","repo_kind":"official","path":"util/nethook.py","file_url":"https://github.com/nlpkeg/Know-MRI/blob/HEAD/util/nethook.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"70f6ab8bde55420e"}},{"code_sha256_prefix":"440ff98c2b1ae1aa","entry":"subsequence","repo":"nlpkeg/Know-MRI","repo_kind":"official","path":"util/nethook.py","file_url":"https://github.com/nlpkeg/Know-MRI/blob/HEAD/util/nethook.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":"440ff98c2b1ae1aa"}},{"code_sha256_prefix":"8a79e802ad524aaa","entry":"get_attributes","repo":"nlpkeg/Know-MRI","repo_kind":"official","path":"util/model_tokenizer.py","file_url":"https://github.com/nlpkeg/Know-MRI/blob/HEAD/util/model_tokenizer.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":"8a79e802ad524aaa"}},{"code_sha256_prefix":"656c09d4236422b4","entry":"get_processed_kvs","repo":"nlpkeg/Know-MRI","repo_kind":"official","path":"dataset_process/Bias_neuron_data.py","file_url":"https://github.com/nlpkeg/Know-MRI/blob/HEAD/dataset_process/Bias_neuron_data.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":"656c09d4236422b4"}},{"code_sha256_prefix":"a012ce5345ad553e","entry":"get_processed_kvs","repo":"nlpkeg/Know-MRI","repo_kind":"official","path":"dataset_process/Concept_edit.py","file_url":"https://github.com/nlpkeg/Know-MRI/blob/HEAD/dataset_process/Concept_edit.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":"a012ce5345ad553e"}},{"code_sha256_prefix":"6d9bb1c625b3ba5c","entry":"get_processed_kvs","repo":"nlpkeg/Know-MRI","repo_kind":"official","path":"dataset_process/FactSync.py","file_url":"https://github.com/nlpkeg/Know-MRI/blob/HEAD/dataset_process/FactSync.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":"6d9bb1c625b3ba5c"}},{"code_sha256_prefix":"de7d6f02d50c5d44","entry":"get_processed_kvs","repo":"nlpkeg/Know-MRI","repo_kind":"official","path":"dataset_process/GPT_data.py","file_url":"https://github.com/nlpkeg/Know-MRI/blob/HEAD/dataset_process/GPT_data.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":"de7d6f02d50c5d44"}},{"code_sha256_prefix":"9a173b0dd79a0e0d","entry":"get_processed_kvs","repo":"nlpkeg/Know-MRI","repo_kind":"official","path":"dataset_process/GSM8K.py","file_url":"https://github.com/nlpkeg/Know-MRI/blob/HEAD/dataset_process/GSM8K.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":"9a173b0dd79a0e0d"}},{"code_sha256_prefix":"4965125ed8ea9275","entry":"get_processed_kvs","repo":"nlpkeg/Know-MRI","repo_kind":"official","path":"dataset_process/Imdb.py","file_url":"https://github.com/nlpkeg/Know-MRI/blob/HEAD/dataset_process/Imdb.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":"4965125ed8ea9275"}},{"code_sha256_prefix":"5dad6c5c11e2ebf8","entry":"initialize_model_and_tokenizer","repo":"nlpkeg/Know-MRI","repo_kind":"official","path":"util/model_tokenizer.py","file_url":"https://github.com/nlpkeg/Know-MRI/blob/HEAD/util/model_tokenizer.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":"5dad6c5c11e2ebf8"}},{"code_sha256_prefix":"9dd82e5992fabe82","entry":"model_type","repo":"nlpkeg/Know-MRI","repo_kind":"official","path":"util/model_tokenizer.py","file_url":"https://github.com/nlpkeg/Know-MRI/blob/HEAD/util/model_tokenizer.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":"9dd82e5992fabe82"}},{"code_sha256_prefix":"6412922185890736","entry":"process_model_name","repo":"nlpkeg/Know-MRI","repo_kind":"official","path":"GUI/flask_server.py","file_url":"https://github.com/nlpkeg/Know-MRI/blob/HEAD/GUI/flask_server.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":"6412922185890736"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}