SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2408.07413 · 2024

Knowledge in Superposition: Unveiling the Failures of Lifelong Knowledge Editing for Large Language Models

arXiv · PDF · Open in the Atlas

Code that ran

We lifted 16 functions out of this paper's own repositories and ran 10 of them in a sandbox. "Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results.

RepositoryRoleRan
chenhuihu/knowledge_in_superposition canonical 10 of 16
FunctionStatusWhere it lives
determine_layer_name Ran chenhuihu/knowledge_in_superposition/Cache_Cov.py
pointer only (licence: NONE) · get_code("ef6d3fcae5aa04d7")
determine_tmp_name Ran chenhuihu/knowledge_in_superposition/compute.py
pointer only (licence: NONE) · get_code("d36c806492129e96")
flatten_masked_batch Ran chenhuihu/knowledge_in_superposition/layer_stats.py
pointer only (licence: NONE) · get_code("671bcc4fbf0b1905")
get_inv_cov Ran chenhuihu/knowledge_in_superposition/compute.py
pointer only (licence: NONE) · get_code("1db0192c8fbf80f5")
get_model_layers Ran chenhuihu/knowledge_in_superposition/Cache_Cov.py
pointer only (licence: NONE) · get_code("b4f4ac5c6a3bcd42")
get_words_idxs_in_templates Ran chenhuihu/knowledge_in_superposition/repr_tools.py
pointer only (licence: NONE) · get_code("1cb19125da056278")
hierarchical_subsequence Ran chenhuihu/knowledge_in_superposition/util/nethook.py
pointer only (licence: NONE) · get_code("920b394e7ad80c53")
load_model_and_tokenizer Ran chenhuihu/knowledge_in_superposition/Cache_Cov.py
pointer only (licence: NONE) · get_code("411e60fba7b021a5")
recursive_copy Ran chenhuihu/knowledge_in_superposition/util/nethook.py
pointer only (licence: NONE) · get_code("70f6ab8bde55420e")
subsequence Ran chenhuihu/knowledge_in_superposition/util/nethook.py
pointer only (licence: NONE) · get_code("440ff98c2b1ae1aa")
dict_to_ Not yet run chenhuihu/knowledge_in_superposition/layer_stats.py
pointer only (licence: NONE) · get_code("4b87278bcf65e54d")
generate_fast Not yet run chenhuihu/knowledge_in_superposition/util/generate.py
pointer only (licence: NONE) · get_code("706b5f6ef6d2c225")
load_dataset Not yet run chenhuihu/knowledge_in_superposition/Compute_Activation_Cos.py
pointer only (licence: NONE) · get_code("83a986ce81035e7d")
load_dataset Not yet run chenhuihu/knowledge_in_superposition/Compute_QMatrix.py
pointer only (licence: NONE) · get_code("942eeba18c39fde7")
load_model_and_tokenizer Not yet run chenhuihu/knowledge_in_superposition/Compute_Activation_Cos.py
pointer only (licence: NONE) · get_code("f8698e8cdcb6e36c")
make_padded_batch Not yet run chenhuihu/knowledge_in_superposition/layer_stats.py
pointer only (licence: NONE) · get_code("59ff38281d7c12b8")

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Knowledge editing aims to update outdated or incorrect knowledge in large language models (LLMs). However, current knowledge editing methods have limited scalability for lifelong editing. This study explores the fundamental reason why knowledge editing fails in lifelong editing. We begin with the closed-form solution derived from linear associative memory, which underpins state-of-the-art knowledge editing methods. We extend the solution from single editing to lifelong editing, and through rigorous mathematical derivation, identify an interference term in the final solution, suggesting that editing knowledge may impact irrelevant knowledge. Further analysis of the interference term reveals a close relationship with superposition between knowledge representations. When knowledge superposition does not exist in language models, the interference term vanishes, allowing for lossless knowledge editing. Experiments across numerous language models reveal that knowledge superposition is universal, exhibiting high kurtosis, zero mean, and heavy-tailed distributions with clear scaling laws. Ultimately, by combining theory and experiments, we demonstrate that knowledge superposition is the fundamental reason for the failure of lifelong editing. Moreover, this is the first study to investigate knowledge editing from the perspective of superposition and provides a comprehensive observation of superposition across numerous real-world language models. Code available at https://github.com/ChenhuiHu/knowledge_in_superposition.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2408.07413")
get_code_for_paper("2408.07413")
have("2408.07413")

Connect an agent — have() is free.