SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2604.19052 · 2026

Cell-Based Representation of Relational Binding in Language Models

Kentaro Inui, Kevin Wang, Neel Nanda, Nicholas Joseph, Arthur Conmy, Alexandre Variengien, Yuntao Bai, Amanda Askell, Anna Chen, Nova Dassarma, Tom Henighan, Nelson Elhage, and 4 more

arXiv · PDF · Open in the Atlas

Code that ran

6 of 7 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 0 have no contract verdict; 6 failures of our instrument; 1 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/2604.19052.json · badge: /api/ran/2604.19052.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
cl-tohoku/CBR-Subsapce canonical (classifier label)
classifier basis: census
6 ran · 1 no recorded run
FunctionStatusWhere it lives
ablate_table Ran
ran; our contract draft was wrong, not the code
cl-tohoku/CBR-Subsapce/script/activation_extraction.py
code served (permissive licence) · get_code("05a7143db65a537f")
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 str. 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)

# The function ablate_table takes input_t and att as parameters
# It calls .replace() on input_t with att and a space ' ' as arguments
# This means input_t should be a string and att should be a string

input_t = "This is a sample table with some attributes"
att = "sample"

ARGS = {
    "input_t": input_t,
    "att": att
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
compute_prev_clue_pos Ran
ran; our contract draft was wrong, not the code
cl-tohoku/CBR-Subsapce/script/activation_extraction.py
code served (permissive licence) · get_code("33499ef388d0360c")
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 (1,) 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)

# Construct input_ids tensor
# The function searches for clue_id within this tensor using nonzero()
# Make it small but with enough elements to find matches
input_ids = torch.tensor([101, 5, 102, 5, 103, 5, 104], dtype=torch.long)

# Construct clue_id
# This should be a value that exists in input_ids so nonzero() finds it
clue_id = 5

ARGS = {
    "input_ids": input_ids,
    "clue_id": clue_id,
    "last": 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 Tensor, ndim 1, dtype family int, shape (1,) — shape (1,) 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
compute_prev_clue_pos Ran
ran; our contract draft was wrong, not the code
cl-tohoku/CBR-Subsapce/script/activation_perturbing.py
code served (permissive licence) · get_code("48e8b43449667b2a")
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 int, shape (1, 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)

# Create input_ids tensor with some sample token IDs
# Shape: (1, 10) - batch size 1, sequence length 10
input_ids = torch.tensor([[101, 102, 103, 104, 105, 103, 106, 107, 103, 108]])

# Create clue_id - a token ID that appears multiple times in input_ids
clue_id = 103

ARGS = {
    "input_ids": input_ids,
    "clue_id": clue_id,
    "last": 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 Tensor, ndim 2, dtype family int, shape (1, 2) — shape (1, 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_model_and_tokenizer Ran
ran; our contract draft was wrong, not the code
cl-tohoku/CBR-Subsapce/script/activation_perturbing.py
code served (permissive licence) · get_code("5fa86ace27601859")
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 tuple, 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.

import torch
from unittest.mock import Mock, MagicMock

torch.manual_seed(0)

# Create mock tokenizer
mock_tokenizer = Mock()
mock_tokenizer.pad_token_id = 0
mock_tokenizer.eos_token_id = 2
mock_tokenizer.padding_side = 'left'

# Create mock model
mock_model = Mock()

# Mock AutoTokenizer.from_pretrained to return our mock tokenizer
import transformers
original_tokenizer = transformers.AutoTokenizer.from_pretrained
transformers.AutoTokenizer.from_pretrained = Mock(return_value=mock_tokenizer)

# Mock AutoModelForCausalLM.from_pretrained to return our mock model
original_model = transformers.AutoModelForCausalLM.from_pretrained
transformers.AutoModelForCausalLM.from_pretrained = Mock(return_value=mock_model)

ARGS = {
    'model_name': 'llama',
    'device': 'cpu'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple 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
load_tb_data Ran
ran; our contract draft was wrong, not the code
cl-tohoku/CBR-Subsapce/script/activation_perturbing.py
code served (permissive licence) · get_code("7e180b6abfc921ff")
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 tuple. 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 json
import tempfile
import os

torch.manual_seed(0)

class MockTokenizer:
    def __init__(self):
        self.vocab_size = 1000
    
    def encode(self, text):
        # Return a mock token sequence, last element varies by text
        hash_val = abs(hash(text)) % self.vocab_size
        return [hash_val - 1, hash_val]
    
    def __call__(self, texts, padding=False, return_tensors=None):
        # texts is a list of strings
        max_len = max(len(self.encode(t)) for t in texts) if texts else 10
        input_ids = []
        for text in texts:
            tokens = self.encode(text)
            if padding:
                tokens = tokens + [0] * (max_len - len(tokens))
            else:
                tokens = tokens[:max_len]
            input_ids.append(tokens)
        
        if return_tensors == 'pt':
            return {'input_ids': torch.tensor(input_ids, dtype=torch.long)}
        return {'input_ids': input_ids}

# Create temporary data file with valid JSON lines
temp_data = []
for i in range(2):
    sample = {
        'ents': ['alice', 'bob', 'charlie'],
        'atts1': ['smart', 'tall', 'brave'],
        'atts2': ['kind', 'fast', 'strong'],
        'atts3': ['quiet', 'loud', 'calm'],
        'atts4': ['blue', 'red', 'green'],
        'input': 'This is a context about entities.',
        't_input': 'Table || formatted || context',
        's_input': 'Story formatted context with details'
    }
    temp_data.append(sample)

# Write to temporary file
with tempfile.NamedTemporaryFile(mode='w', suffix='.jsonl', delete=False, encoding='utf-8') as f:
    temp_file_path = f.name
    for sample in temp_data:
        f.write(json.dumps(sample) + '\n')

ARGS = {
    'tokenizer': MockTokenizer(),
    'num_samples': 2,
    'data_file': temp_file_path,
    'rand': True,
    'data_tp': 'space',
    'input_tp': 'story',
    'enti': 1,
    'atti': 2
}
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 tuple — a tuple 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
load_tb_data Ran
ran; our contract draft was wrong, not the code
cl-tohoku/CBR-Subsapce/script/activation_sampling.py
code served (permissive licence) · get_code("14c37284e3ade770")
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 tuple. 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 json
import tempfile
import os

class StandInTokenizer:
    def encode(self, text):
        # Return a list of token IDs, with last one being the word token
        return [100, 101, 102, 103]
    
    def __call__(self, texts, padding=True, return_tensors=None):
        # Tokenize a list of texts and return a dict with input_ids
        max_len = max(len(text.split()) for text in texts) + 1 if texts else 10
        input_ids = []
        for text in texts:
            tokens = [101] * min(max_len, 10)
            input_ids.append(tokens)
        
        if return_tensors == 'pt':
            return {
                'input_ids': torch.tensor(input_ids, dtype=torch.long),
                'attention_mask': torch.ones(len(input_ids), max_len, dtype=torch.long)
            }
        return {'input_ids': input_ids}

# Create a temporary data file with the expected JSON structure
temp_file = tempfile.NamedTemporaryFile(mode='w', suffix='.jsonl', delete=False, encoding='utf-8')
temp_file_path = temp_file.name

# Write sample data matching the expected structure
sample_data = {
    'ents': ['entity1', 'entity2', 'entity3'],
    'atts1': ['attr1_1', 'attr1_2', 'attr1_3'],
    'atts2': ['attr2_1', 'attr2_2', 'attr2_3'],
    'atts3': ['attr3_1', 'attr3_2', 'attr3_3'],
    'atts4': ['attr4_1', 'attr4_2', 'attr4_3'],
    'input': 'This is some context input',
    't_input': 'This is table context',
    's_input': 'This is story context'
}

for i in range(5):
    temp_file.write(json.dumps(sample_data) + '\n')
temp_file.close()

torch.manual_seed(0)

ARGS = {
    'tokenizer': StandInTokenizer(),
    'num_samples': 2,
    'data_file': temp_file_path,
    'rand': True
}
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 tuple — a tuple 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
get_model_and_tokenizer Not yet run
unverified (harvested, no recorded run)
cl-tohoku/CBR-Subsapce/script/activation_extraction.py
code served (permissive licence) · get_code("d40c60f64831192e")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 7 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.

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

Understanding a discourse requires tracking entities and the relations that hold between them. While Large Language Models (LLMs) perform well on relational reasoning, the mechanism by which they bind entities, relations, and attributes remains unclear. We study discourselevel relational binding and show that LLMs encode it via a Cell-based Binding Representation (CBR): a low-dimensional linear subspace in which each "cell" corresponds to an entity-relation index pair, and bound attributes are retrieved from the corresponding cell during inference. Using controlled multi-sentence data annotated with entity and relation indices, we identify the CBR subspace by decoding these indices from attribute-token activations with Partial Least Squares regression. Across domains and two model families, the indices are linearly decodable and form a grid-like geometry in the projected space. We further find that context-specific CBR representations are related by translation vectors in activation space, enabling cross-context transfer. Finally, activation patching shows that manipulating this subspace systematically changes relational predictions and that perturbing it disrupts performance, providing causal evidence that LLMs rely on CBR for relational binding. Code and data are available at https: //github.com/cl-tohoku/CBR-Subsapce.

For agents

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

get_harvested_code_for_paper("2604.19052")
get_code_for_paper("2604.19052")
have("2604.19052")

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

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

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

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

Connect an agent — have() is free.