SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2024.findings-acl.347 · ACL Findings · 2024

Mass-Editing Memory with Attention in Transformers: A cross-lingual exploration of knowledge

Aitor Gonzalez-Agirre, Marta Villegas, Daniel Tamayo, Javier Hernando

Open in the Atlas

Code that ran

8 of 8 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 6 failures of our instrument; 0 no recorded run), measured 2026-11-24; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2024.findings-acl.347.json · badge: /api/ran/2024.findings-acl.347.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
dtamayo-nlp/MEMAT canonical (classifier label)
classifier basis: census
8 ran · 0 no recorded run
FunctionStatusWhere it lives
build_alibi_tensor Ran
ran; our contract draft was wrong, not the code
dtamayo-nlp/MEMAT/Falcon/modelling_RW.py
pointer only (licence: MIT); the stored copy get_code serves, from bkhmsi/llm-localization, is pointer only (licence: NONE) · get_code("b4acc4f0962c97ca")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from bkhmsi/llm-localization, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

dropout_add Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
dtamayo-nlp/MEMAT/Falcon/modelling_RW.py
pointer only (licence: MIT); the stored copy get_code serves, from zthang/focus, is pointer only (licence: NONE) · get_code("6ef9ea8bea823588")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from zthang/focus, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

error Ran
ran on a synthesized input
dtamayo-nlp/MEMAT/Figure_9.py
code served (permissive licence) · get_code("071b2ae40fd43b0c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Construct the dictionary argument for the error function
# The function expects:
# - post_score: a tuple/list with at least 2 elements
# - post_neighborhood_success: a tuple/list with at least 2 elements
# - post_paraphrase_success: a tuple/list with at least 2 elements
# - post_rewrite_success: a tuple/list with at least 2 elements

dic = {
    'post_score': (1.5, 2.0),
    'post_neighborhood_success': (2.0, 3.0),
    'post_paraphrase_success': (4.0, 5.0),
    'post_rewrite_success': (6.0, 7.0)
}

ARGS = {
    'dic': dic
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
hierarchical_subsequence Ran
ran on a synthesized input
dtamayo-nlp/MEMAT/util/nethook.py
code served (permissive licence) · get_code("920b394e7ad80c53")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Sequential. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
from collections import OrderedDict

torch.manual_seed(0)

# Create a nested Sequential model to test hierarchical_subsequence
layer1 = nn.Linear(4, 3)
layer2 = nn.Linear(3, 2)
layer3 = nn.Linear(2, 5)

nested_seq = nn.Sequential(
    OrderedDict([
        ('linear1', layer1),
        ('linear2', layer2),
        ('linear3', layer3)
    ])
)

# Test case 1: No parameters (should return full sequential)
ARGS = {
    'sequential': nested_seq,
    'first': None,
    'last': None,
    'after': None,
    'upto': None,
    'share_weights': False,
    'depth': 0
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
recursive_copy Ran
ran; our contract draft was wrong, not the code
dtamayo-nlp/MEMAT/util/nethook.py
pointer only (licence: MIT); the stored copy get_code serves, from TrustedLLM/UnKE, is pointer only (licence: NONE) · get_code("70f6ab8bde55420e")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from TrustedLLM/UnKE, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

rotate_half Ran
ran; our contract draft was wrong, not the code
dtamayo-nlp/MEMAT/Falcon/modelling_RW.py
code served (permissive licence) · get_code("2502f906145be7f6")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

def rotate_half(x):
    x1, x2 = (x[..., :x.shape[-1] // 2], x[..., x.shape[-1] // 2:])
    return torch.cat((-x2, x1), dim=x1.ndim - 1)

# The function takes a single parameter 'x' which is a tensor
# It splits the last dimension in half, and concatenates (-x2, x1)
# We need a tensor with even last dimension

x = torch.randn(2, 4)

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
subsequence Ran
ran; our contract draft was wrong, not the code
dtamayo-nlp/MEMAT/util/nethook.py
code served (permissive licence) · get_code("440ff98c2b1ae1aa")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Sequential. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import copy
from collections import OrderedDict

torch.manual_seed(0)

# Build a nested Sequential model with multiple layers
sequential = nn.Sequential(
    OrderedDict([
        ('layer1', nn.Linear(4, 3)),
        ('layer2', nn.ReLU()),
        ('layer3', nn.Linear(3, 2)),
        ('nested', nn.Sequential(
            OrderedDict([
                ('sublayer1', nn.Linear(2, 2)),
                ('sublayer2', nn.ReLU()),
            ])
        )),
        ('layer4', nn.Linear(2, 1)),
    ])
)

ARGS = {
    'sequential': sequential,
    'first_layer': None,
    'last_layer': None,
    'after_layer': None,
    'upto_layer': None,
    'single_layer': None,
    'share_weights': False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Sequential — a Sequential output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
upd_matrix_match_shape Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
dtamayo-nlp/MEMAT/attention_translation/bilingual_multihead_optimization.py
pointer only (licence: MIT); the stored copy get_code serves, from KentoNishi/KE-ICML-2025, is pointer only (licence: NONE) · get_code("bad421a5838188a7")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from KentoNishi/KE-ICML-2025, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 7 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 0 the same month, 5 later) and 1 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
subsequence 49 other papers
7 dated earlier, 15 later, 27 same year, order not determinable
2007.15646 (2020-07)
Rewriting a Deep Generative Model
2009.05041 (2020-09)
Understanding the Role of Individual Units in a Deep Neural Network
2110.04292 (2021-10)
Toward a Visual Concept Vocabulary for GAN Latent Space
and 46 more not named here
recursive_copy 48 other papers
5 dated earlier, 14 later, 29 same year, order not determinable
2207.02774 (2022-07)
Local Relighting of Real Scenes
2210.07229 (2022-10)
Mass-Editing Memory in a Transformer
2302.12461 (2023-02)
Analyzing And Editing Inner Mechanisms Of Backdoored Language Models
and 45 more not named here
hierarchical_subsequence 46 other papers
4 dated earlier, 15 later, 27 same year, order not determinable
2210.07229 (2022-10)
Mass-Editing Memory in a Transformer
2302.12461 (2023-02)
Analyzing And Editing Inner Mechanisms Of Backdoored Language Models
2311.09053 (2023-11)
Assessing Knowledge Editing in Language Models via Relation Perspective
and 43 more not named here
rotate_half 9 other papers
6 dated earlier, 1 later, 2 same year, order not determinable
2305.11072 (2023-05)
Self-supervised Fine-tuning for Improved Content Representations by Speaker-invariant Clustering
2310.13802 (2023-10)
Improving Molecular Properties Prediction Through Latent Space Fusion
2311.04219 (2023-11)
OtterHD: A High-Resolution Multi-modality Model
and 6 more not named here
dropout_add 8 other papers
2 dated earlier, 5 same year, order not determinable, 1 undated
2311.04219 (2023-11)
OtterHD: A High-Resolution Multi-modality Model
2311.13230 (2023-11)
Enhancing Uncertainty-Based Hallucination Detection with Stronger Focus
2401.12522 (2024-01)
BiTA: Bi-Directional Tuning for Lossless Acceleration in Large Language Models
and 5 more not named here
upd_matrix_match_shape 7 other papers
3 later, 4 same year, order not determinable
2410.02355 (2024-10)
AlphaEdit: Null-Space Constrained Knowledge Editing for Language Models
2410.04045 (2024-10)
Neuron-Level Sequential Editing for Large Language Models
2410.17194 (2024-10)
Representation Shattering in Transformers: A Synthetic Study with Knowledge Editing
and 4 more not named here
build_alibi_tensor 6 other papers
2 dated earlier, 4 same year, order not determinable
2311.04219 (2023-11)
OtterHD: A High-Resolution Multi-modality Model
2311.13230 (2023-11)
Enhancing Uncertainty-Based Hallucination Detection with Stronger Focus
2401.12522 (2024-01)
BiTA: Bi-Directional Tuning for Lossless Acceleration in Large Language Models
and 3 more not named here

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-24.

Repositories linked to this paper

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

Abstract

Recent research has explored methods for updating and modifying factual knowledge in large language models, often focusing on specific multi-layer perceptron blocks. This study expands on this work by examining the effectiveness of existing knowledge editing methods across languages and delving into the role of attention mechanisms in this process. Drawing from the insights gained, we propose Mass-Editing Memory with Attention in Transformers (MEMAT), a method that achieves significant improvements in all metrics while requiring minimal parameter modifications. MEMAT delivers a remarkable 10% increase in magnitude metrics, benefits languages not included in the training data and also demonstrates a high degree of portability. Our code and data are at https://github.com/dtamayo-nlp/MEMAT.

For agents

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

get_harvested_code_for_paper("2024.findings-acl.347")
get_code_for_paper("2024.findings-acl.347")
have("2024.findings-acl.347")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2024.findings-acl.347.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2024.findings-acl.347.svg)](https://syntology.ai/paper/2024.findings-acl.347)

Connect an agent — have() is free.