SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2502.11469 · ACL · 2025

If Attention Serves as a Cognitive Model of Human Memory Retrieval, What is the Plausible Memory Representation?

Yohei Oseki, Ryo Yoshida, Taiga Someya, ♠ Shinnosuke, Kohei Kajikawa, Yushi Sugimoto

arXiv · PDF · Open in the Atlas

Code that ran

6 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, 1 violated it and 4 have no contract verdict; 1 failure of our instrument; 2 no recorded run), measured 2026-11-23; 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/2502.11469.json · badge: /api/ran/2502.11469.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
aistairc/rnng-pytorch canonical (classifier label)
classifier basis not recorded on the link
6 ran · 2 no recorded run
FunctionStatusWhere it lives
get_between_brackets Ran
ran; our contract draft was wrong, not the code
aistairc/rnng-pytorch/preprocess.py
pointer only (licence: MIT); the stored copy get_code serves, from dpfried/rnng-bert, is pointer only (licence: NONE) · get_code("2347da1339a984a0")
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 dpfried/rnng-bert, 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.

get_in_order_actions Ran
ran on a synthesized input
aistairc/rnng-pytorch/utils.py
code served (permissive licence) · get_code("d5f368ce59e66adf")
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 list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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.

from nltk import Tree

# Construct a simple parse tree in string format
# The function expects a string representation of a Tree
simple_tree_str = "(S (NP (DET the) (N dog)) (VP (V barked)))"

# Test with subword_tokenized=False (default)
line_basic = simple_tree_str
subword_tokenized_basic = False

ARGS = {
    "line": line_basic,
    "subword_tokenized": subword_tokenized_basic,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
nltk — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
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
get_len_from_padded Ran
ran on a synthesized input
aistairc/rnng-pytorch/non_incremental_lm.py
code served (permissive licence) · get_code("150d1c5aa4363bf4")
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 1, dtype family int, shape (2,) 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)

# x is expected to be a 2D tensor where we compare against pad_id
# The function calls (x != pad_id).sum(1), so x needs shape (batch_size, seq_len)
# pad_id is a scalar integer used for comparison

x = torch.tensor([
    [1, 2, 3, 0],
    [5, 6, 0, 0]
])

pad_id = 0

ARGS = {
    "x": x,
    "pad_id": pad_id
}
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 1, dtype family int, shape (2,) — shape (2,) 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
get_next_bracket_index Ran
ran on a synthesized input
aistairc/rnng-pytorch/preprocess.py
code served (permissive licence) · get_code("1198e73fcec21ef0")
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 int, ndim 0, dtype family int, shape () 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

# Setup for get_next_bracket_index function
# The function takes a line (string) and start_idx (int) as parameters
# It searches for the next bracket character ('(' or ')') starting after start_idx

line = "hello (world) test"
start_idx = 5

ARGS = {
    "line": line,
    "start_idx": start_idx
}
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 int, ndim 0, dtype family int, shape () — shape () 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
is_next_open_bracket Ran
ran, violated the contract we drafted
aistairc/rnng-pytorch/preprocess.py
code served (permissive licence) · get_code("625f98c10e41a690")
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) and returned bool, ndim 0, dtype family float, shape () 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.

# Analyzing the function is_next_open_bracket
# It takes:
# - line: a string (iterated over with line[start_idx + 1:])
# - start_idx: an integer (used as index)
# The function searches for '(' or ')' characters after start_idx

ARGS = {
    "line": "hello(world)",
    "start_idx": 5
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, ndim 0, dtype family float, shape () — shape () 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
load_model Ran
ran on a synthesized input
aistairc/rnng-pytorch/beam_search.py
code served (permissive licence) · get_code("1b066f480d7472db")
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 DummyModel. 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

torch.manual_seed(0)

# Create a minimal model class
class DummyModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

# Create a minimal create_model function that will be imported
class MockTrain:
    @staticmethod
    def create_model(args, action_dict, vocab):
        model = DummyModel()
        return model

import sys
from types import ModuleType
train_module = ModuleType('train')
train_module.create_model = MockTrain.create_model
sys.modules['train'] = train_module

# Create action_dict - a simple mapping of actions
action_dict = {
    'move_up': 0,
    'move_down': 1,
    'move_left': 2,
    'move_right': 3
}

# Create vocab - a simple vocabulary mapping
vocab = {
    'word1': 0,
    'word2': 1,
    'word3': 2,
    'word4': 3
}

# Create checkpoint with model_state_dict path
model_for_checkpoint = DummyModel()
checkpoint = {
    'model_state_dict': model_for_checkpoint.state_dict(),
    'args': type('Args', (), {
        'hidden_dim': 64,
        'vocab_size': 100,
        'action_size': 4
    })()
}

ARGS = {
    'checkpoint': checkpoint,
    'action_dict': action_dict,
    'vocab': vocab
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, train — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DummyModel — a DummyModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DummyModel 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
get_in_order_max_stack_size Not yet run
unverified (harvested, no recorded run)
aistairc/rnng-pytorch/utils.py
code served (permissive licence) · get_code("eaef2bc09a44696e")
How it ran

no invocation recorded.

get_top_down_max_stack_size Not yet run
unverified (harvested, no recorded run)
aistairc/rnng-pytorch/utils.py
code served (permissive licence) · get_code("32207d9ca8369ad2")
How it ran

no invocation 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, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 0 later) and 6 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
is_next_open_bracket 3 other papers
3 dated earlier
1602.07776 (2016-02)
Recurrent Neural Network Grammars
2108.00104 (2021-08)
Structural Guidance for Transformer Language Models
2110.02283 (2021-10)
Co-training an Unsupervised Constituency Parser with Weak Supervision
get_between_brackets 2 other papers
2 dated earlier
1602.07776 (2016-02)
Recurrent Neural Network Grammars
2108.00104 (2021-08)
Structural Guidance for Transformer Language Models

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-23.

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 work in computational psycholinguistics has revealed intriguing parallels between attention mechanisms and human memory retrieval, focusing primarily on vanilla Transformers that operate on token-level representations. However, computational psycholinguistic research has also established that syntactic structures provide compelling explanations for human sentence processing that token-level factors cannot fully account for. In this paper, we investigate whether the attention mechanism of Transformer Grammar (TG), which uniquely operates on syntactic structures as representational units, can serve as a cognitive model of human memory retrieval, using Normalized Attention Entropy (NAE) as a linking hypothesis between models and humans. Our experiments demonstrate that TG's attention achieves superior predictive power for self-paced reading times compared to vanilla Transformer's, with further analyses revealing independent contributions from both models. These findings suggest that human sentence processing involves dual memory representations-one based on syntactic structures and another on token sequences-with attention serving as the general memory retrieval algorithm, while highlighting the importance of incorporating syntactic structures as representational units.

For agents

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

get_harvested_code_for_paper("2502.11469")
get_code_for_paper("2502.11469")
have("2502.11469")

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

curl https://syntology.ai/api/ran/2502.11469.json

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

[![Syntology run record](https://syntology.ai/api/ran/2502.11469.svg)](https://syntology.ai/paper/2502.11469)

Connect an agent — have() is free.