SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2310.13121 · ICLR · 2024

Understanding Addition in Transformers

Fazl Barez, Philip Quirke

arXiv · PDF · Open in the Atlas

Code that ran

12 of 16 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 12 have no contract verdict; 0 failures of our instrument; 4 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; 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/2310.13121.json · badge: /api/ran/2310.13121.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
PhilipQuirke/verified_transformers community (classifier label)
classifier basis not recorded on the link
12 ran · 4 no recorded run
FunctionStatusWhere it lives
algo_task Ran
ran on a synthesized input
PhilipQuirke/verified_transformers/quanta_maths/maths_diagram.py
code served (permissive licence) · get_code("399dff67cea1fa9e")
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 re

_POS_LABEL = re.compile('^[AD]\\d+$')

def algo_task(body: str) -> str:
    """Extract the task code from an ``Algo:`` tag body.

    Grammar: ``<posLabel>.<TASK>[.<extra>]`` where ``posLabel`` is an answer /
    digit label (``A5``, ``D4``) and ``TASK`` is the algorithmic role
    (``SA``, ``GT``, ``ND``, ``STC`` ...). A bare control task has no dot
    (``OPR``, ``SGN``). Examples::

        A5.SA    -> SA
        D4.GT    -> GT
        A5.ND.A5 -> ND     (trailing parameter ignored)
        A0.STC   -> STC
        OPR      -> OPR

    The task is the component after an optional leading position label; the old
    ``split('.')[-1]`` mis-read three-part tags (``A5.ND.A5`` -> ``A5``).
    """
    parts = body.split('.')
    if len(parts) > 1 and _POS_LABEL.match(parts[0]):
        return parts[1]
    return parts[0]


ARGS = {
    'body': 'A5.SA'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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 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
analysis_repo_id Ran
ran on a synthesized input
PhilipQuirke/verified_transformers/quanta_maths/maths_model_loader.py
code served (permissive licence) · get_code("fd8e109236388bdb")
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

ARGS = {
    'model_name': 'gpt2'
}
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 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
calculate_ground_truth Ran
ran on a synthesized input
PhilipQuirke/verified_transformers/maths_catgen/maths_catgen.py
code served (permissive licence) · get_code("ca86994524345d15")
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

# Set random seed for reproducibility
torch.manual_seed(0)

# Define arguments for calculate_ground_truth function
ARGS = {
    'x': 42,
    'y': 18,
    'operation': 'sum'
}
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
cascade_answer_digit Ran
ran on a synthesized input
PhilipQuirke/verified_transformers/quanta_maths/maths_cascade.py
code served (permissive licence) · get_code("ed83c1c9929d4951")
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

torch.manual_seed(0)

ARGS = {
    'cls': 'ADD',
    'a': 42,
    'b': 17,
    'read_digit': 1,
    'n_digits': 3
}
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
generate_number_pairs Ran
ran on a synthesized input
PhilipQuirke/verified_transformers/maths_catgen/maths_catgen.py
code served (permissive licence) · get_code("1ab3a1296b48409c")
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 2, dtype family int; 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 random

ARGS = {
    'n_examples': 200,
    'min_val': 1,
    'max_val': 99,
    'include_negatives': False,
    'seed': 42,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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 list, ndim 2, dtype family int — 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_maths_min_complexity Ran
ran on a synthesized input
PhilipQuirke/verified_transformers/quanta_maths/maths_complexity.py
code served (permissive licence) · get_code("347a07a47fffdc12")
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
import torch.nn as nn

class MockNode:
    def __init__(self):
        self.tags = {
            ('major1', 'minor1'): '42',
            ('major1', 'minor2'): '15',
            ('major2', 'minor1'): '',
            ('major2', 'minor2'): '9x'
        }
    
    def min_tag_suffix(self, major_tag: str, minor_tag: str) -> str:
        key = (major_tag, minor_tag)
        return self.tags.get(key, '')

torch.manual_seed(0)

node = MockNode()

ARGS = {
    '_': None,
    'node': node,
    'major_tag': 'major1',
    'minor_tag': 'minor1',
    'num_shades': 8
}
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, 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
is_ground_truth_correct Ran
ran on a synthesized input
PhilipQuirke/verified_transformers/maths_catgen/maths_catgen.py
code served (permissive licence) · get_code("d0943274b76fe7d7")
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 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.

import re

def is_ground_truth_correct(answer: str, ground_truth: str) -> bool:
    """
    Returns True if the ground_truth appears as the final number in the answer, ignoring whitespace and punctuation.
    Accepts answers like '13', '13.', '13**', 'The answer is 13', '**13**', 'random text **13** random text', 'boxed{13}'.
    """
    answer_clean = answer.strip().rstrip('.!**')
    numbers = re.findall('-?[\\d,]+', answer_clean)
    numbers_clean = [num.replace(',', '') for num in numbers]
    answer_no_comma = answer.replace(',', '')
    return ground_truth == answer_no_comma or '**' + ground_truth + '**' in answer or 'boxed{' + ground_truth + '}' in answer or ('' + ground_truth + ' ' in answer_no_comma) or ('' + ground_truth + '.' in answer_no_comma) or (numbers_clean and abs(float(numbers_clean[-1]) - float(ground_truth)) < 0.001)

ARGS = {
    "answer": "The answer is **42**",
    "ground_truth": "42"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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
maths_data_generator_start Ran
ran on a synthesized input
PhilipQuirke/verified_transformers/quanta_maths/maths_data_generator.py
code served (permissive licence) · get_code("9053fb6a51465923")
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

torch.manual_seed(0)

class Config:
    def __init__(self):
        self.batch_size = 2
        self.n_ctx = 4
        self.n_digits = 3

cfg = Config()

ARGS = {
    "cfg": cfg
}
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
power_of_two Ran
ran on a synthesized input
PhilipQuirke/verified_transformers/quanta_maths/model_sae_train.py
code served (permissive licence) · get_code("3befe02a7e63e08a")
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

torch.manual_seed(0)

ARGS = {
    "n": 5
}
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
produce_pos_of Ran
ran on a synthesized input
PhilipQuirke/verified_transformers/quanta_maths/maths_batch.py
code served (permissive licence) · get_code("04ceb26cbeed6fe1")
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
import torch.nn as nn

class MockConfig:
    def an_to_position_name(self, k):
        # Must return a string starting with a letter followed by a number
        # The function extracts [1:] and converts to int, then subtracts 1
        # So if k=0, we return something like "a1" -> int("1") - 1 = 0
        # If k=1, we return "a2" -> int("2") - 1 = 1
        position_num = k + 1
        return f"a{position_num}"

cfg = MockConfig()
k = 0

ARGS = {
    "cfg": cfg,
    "k": k,
}
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
tag_linxfer_nodes Ran
ran on a synthesized input
PhilipQuirke/verified_transformers/quanta_maths/maths_batch.py
code served (permissive licence) · get_code("9f4c2eff18a07503")
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
import torch.nn as nn
import numpy as np
from typing import List, Optional


torch.manual_seed(0)
np.random.seed(0)


# Mock classes for the quanta_maths module dependencies
class MathsToken:
    PLUS = 0


class MockConfig:
    def __init__(self):
        self.n_digits = 4
        self.n_ctx = 16
    
    def ddn_to_position_name(self, n):
        return f"D{n}"


class MockNode:
    def __init__(self, position, layer, is_head):
        self.position = position
        self.layer = layer
        self.is_head = is_head
        self.tags = {}
    
    def add_tag(self, category, tag_str):
        if category not in self.tags:
            self.tags[category] = []
        self.tags[category].append(tag_str)
        return 1


class MockNodes:
    def __init__(self):
        self.nodes = [
            MockNode(position=2, layer=0, is_head=True),
            MockNode(position=3, layer=0, is_head=True),
            MockNode(position=2, layer=1, is_head=False),
        ]


class MockModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.layer0 = nn.Linear(4, 8)
        self.layer1 = nn.Linear(8, 4)
    
    def run_with_cache(self, q, names_filter=None):
        # Simulate running the model and returning cached activations
        # q shape: (1, n_ctx)
        batch_size, seq_len = q.shape
        
        # Create mock cache with hook_resid_post activations
        cache = {
            'blocks.0.hook_resid_post': torch.randn(batch_size, seq_len, 4)
        }
        
        # Return dummy logits and cache
        logits = torch.randn(batch_size, seq_len, 10)
        return logits, cache


# Mock functions that would be imported from quanta_maths
def make_a_maths_question_and_answer(cfg, q, start_pos, a, b, operation):
    """Mock function that populates q with a math question."""
    pass


def site_hook_and_pos(cfg, site_type, n, layer):
    """Mock function that returns site info and position."""
    pos = n + 2
    return (site_type, pos)


def first_layer(cfg):
    """Mock function that returns the first layer index."""
    return 0


def probe_accuracy_with_null(acts, labs, rng, n_perm):
    """Mock function that returns probe accuracy results."""
    return {
        'observed_acc': 0.75,
        'null_p': 0.01
    }


# Patch the imports so they work during function execution
import sys
from types import ModuleType

quanta_maths = ModuleType('quanta_maths')
quanta_maths_utilities = ModuleType('quanta_maths.maths_utilities')
quanta_maths_constants = ModuleType('quanta_maths.maths_constants')
quanta_maths_probe = ModuleType('quanta_maths.maths_probe')

quanta_maths_utilities.make_a_maths_question_and_answer = make_a_maths_question_and_answer
quanta_maths_constants.MathsToken = MathsToken
quanta_maths_probe.site_hook_and_pos = site_hook_and_pos
quanta_maths_probe.first_layer = first_layer
quanta_maths_probe.probe_accuracy_with_null = probe_accuracy_with_null

sys.modules['quanta_maths'] = quanta_maths
sys.modules['quanta_maths.maths_utilities'] = quanta_maths_utilities
sys.modules['quanta_maths.maths_constants'] = quanta_maths_constants
sys.modules['quanta_maths.maths_probe'] = quanta_maths_probe


ARGS = {
    'model': MockModel(),
    'cfg': MockConfig(),
    'nodes': MockNodes(),
    'digits': [1, 2],
    'n_q': 10,
    'seed': 42,
    'operation': MathsToken.PLUS,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, quanta_maths, 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
train_sae_epoch Ran
ran on a synthesized input
PhilipQuirke/verified_transformers/quanta_maths/model_sae_train.py
code served (permissive licence) · get_code("32f2563daf495763")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
import torch.nn as nn
import torch.optim as optim

torch.manual_seed(0)

class SimpleAutoencoder(nn.Module):
    def __init__(self, input_dim, encoding_dim):
        super().__init__()
        self.input_dim = input_dim
        self.encoding_dim = encoding_dim
        self.encoder = nn.Linear(input_dim, encoding_dim)
        self.decoder = nn.Linear(encoding_dim, input_dim)
    
    def forward(self, x):
        encoded = self.encoder(x)
        decoded = self.decoder(encoded)
        return encoded, decoded
    
    def loss(self, x, encoded, decoded):
        mse = nn.functional.mse_loss(decoded, x)
        sparsity_penalty = torch.abs(encoded).mean()
        l1_penalty = torch.norm(self.decoder.weight, p=1)
        total_loss = mse + sparsity_penalty + l1_penalty
        return total_loss, mse.item(), sparsity_penalty.item(), l1_penalty.item()

input_dim = 4
encoding_dim = 3
batch_size = 2

sae = SimpleAutoencoder(input_dim, encoding_dim)

def activation_generator():
    for i in range(2):
        batch = torch.randn(batch_size, input_dim)
        yield batch

ARGS = {
    "sae": sae,
    "activation_generator": activation_generator(),
    "epoch": 1,
    "learning_rate": 0.001,
    "max_grad_norm": 1.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 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
discover_behaviors Not yet run
unverified (harvested, no recorded run)
PhilipQuirke/verified_transformers/quanta_maths/maths_analysis.py
code served (permissive licence) · get_code("dcdc4c6bf6ba15aa")
How it ran

no invocation recorded.

discover_features Not yet run
unverified (harvested, no recorded run)
PhilipQuirke/verified_transformers/quanta_maths/maths_analysis.py
code served (permissive licence) · get_code("7901502e1427e114")
How it ran

no invocation recorded.

tag_pca_nodes Not yet run
unverified (harvested, no recorded run)
PhilipQuirke/verified_transformers/quanta_maths/maths_analysis.py
code served (permissive licence) · get_code("61fcda345a9b3c25")
How it ran

no invocation recorded.

tag_stc_nodes Not yet run
unverified (harvested, no recorded run)
PhilipQuirke/verified_transformers/quanta_maths/maths_batch.py
code served (permissive licence) · get_code("84273f34067cbf8d")
How it ran

no invocation recorded.

Also present in other papers' code

Of 16 samples lifted from this paper's linked repositories, 16 carry a function identity and 0 do not. Of the 16 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 16 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 the inner workings of machine learning models like Transformers is vital for their safe and ethical use. This paper provides a comprehensive analysis of a one-layer Transformer model trained to perform n-digit integer addition. Our findings suggest that the model dissects the task into parallel streams dedicated to individual digits, employing varied algorithms tailored to different positions within the digits. Furthermore, we identify a rare scenario characterized by high loss, which we explain. By thoroughly elucidating the model's algorithm, we provide new insights into its functioning. These findings are validated through rigorous testing and mathematical modeling, thereby contributing to the broader fields of model understanding and interpretability. Our approach opens the door for analyzing more complex tasks and multi-layer Transformer models.

For agents

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

get_harvested_code_for_paper("2310.13121")
get_code_for_paper("2310.13121")
have("2310.13121")

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

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

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

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

Connect an agent — have() is free.