SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2312.06581 · 2023

Grokking Group Multiplication with Cosets

arXiv · PDF · Open in the Atlas

Code that ran

10 of 12 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; 5 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 5 failures of our instrument; 2 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/2312.06581.json · badge: /api/ran/2312.06581.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
dashstander/sn-grok canonical (classifier label)
classifier basis: census
10 ran · 2 no recorded run
FunctionStatusWhere it lives
add_fixed_to_cycle Ran
ran; our contract draft was wrong, not the code
dashstander/sn-grok/sngrok/groups.py
code served (permissive licence) · get_code("a3dbc8d760de0fb0")
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. 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)

# Analyzing the function:
# - cycle: appears to be a collection/dict that supports 'in' operator and is returned as-is
# - n: an integer for the range loop
# The function checks if integers 0 to n-1 are in cycle, collects missing ones, and returns a list

# Create a simple dict as cycle (dict supports 'in' operator for keys)
cycle = {0: 'a', 2: 'b', 4: 'c'}

# Create a small integer for n
n = 5

ARGS = {
    'cycle': cycle,
    'n': n
}
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 list — a list 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
adj_trans_decomp Ran
ran, honoured the contract we drafted
dashstander/sn-grok/sngrok/irreps.py
code served (permissive licence) · get_code("a5e8d691fff67c68")
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 torch
import numpy as np
from itertools import combinations, pairwise, permutations

torch.manual_seed(0)

ARGS = {
    "i": 2,
    "j": 5,
}
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 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
calc_power Ran
ran; our contract draft was wrong, not the code
dashstander/sn-grok/sngrok/fourier.py
code served (permissive licence) · get_code("077294a9dec0892e")
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

torch.manual_seed(0)

# The function calc_power takes:
# 1. ft: a dict where values are tensors that will be passed to frob (which uses vmap)
# 2. group_order: an integer used as divisor

# Looking at the function body:
# - ft is a dict with values that are tensors
# - frob is a vmapped version of _frob_norm that operates on dim 0
# - The result divides by group_order ** 2

# _frob_norm expects:
# - ft_vals with .dim() method and .shape attribute
# - If dim >= 2, it accesses shape[0] and does matrix operations (transpose, matmul, trace)

# For vmap to work properly with in_dims=0, we need tensors with a batch dimension
# Let's create 2D and 3D tensors for variety

# Create sample feature tensors
# Batch size 2 (for vmap), different inner dimensions for distinction
ft_tensor_1 = torch.randn(2, 4, 3)  # Will be vmapped over dim 0, giving (4, 3) to _frob_norm
ft_tensor_2 = torch.randn(2, 5, 5)  # Will be vmapped over dim 0, giving (5, 5) to _frob_norm

ft = {
    'layer1': ft_tensor_1,
    'layer2': ft_tensor_2,
}

group_order = 4

ARGS = {
    'ft': ft,
    'group_order': group_order,
}
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 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
cycle_to_one_line Ran
ran, honoured the contract we drafted
dashstander/sn-grok/sngrok/groups.py
code served (permissive licence) · get_code("06fa93d22a0c073a")
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 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.

from itertools import pairwise, product

def cycle_to_one_line(cycle_rep: list[tuple[int]]) -> tuple[int]:
    n = sum([len(c) for c in cycle_rep])
    sigma = [-1] * n
    for cycle in cycle_rep:
        first = cycle[0]
        if len(cycle) == 1:
            sigma[first] = first
        else:
            for val1, val2 in pairwise(cycle):
                sigma[val2] = val1
                lastval = val2
            sigma[first] = lastval
    return tuple(sigma)


# Test with a simple example:
# cycle_rep = [(0, 1, 2), (3,), (4, 5)]
# This represents the permutation where:
# - 0 -> 1 -> 2 -> 0 (cycle of length 3)
# - 3 -> 3 (fixed point)
# - 4 -> 5 -> 4 (cycle of length 2)
# In one-line notation: sigma[0]=2, sigma[1]=0, sigma[2]=1, sigma[3]=3, sigma[4]=5, sigma[5]=4

ARGS = {
    "cycle_rep": [(0, 1, 2), (3,), (4, 5)]
}
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 tuple, ndim 1, dtype family int — 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
cycle_to_one_line Ran
ran, honoured the contract we drafted
dashstander/sn-grok/sngrok/irreps.py
code served (permissive licence) · get_code("81bfc94d377a2d59")
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 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.

from itertools import combinations, pairwise, permutations

# The function cycle_to_one_line takes a cycle_rep parameter
# which is expected to be an iterable of cycles (lists/tuples)
# Each cycle is an iterable of integers representing positions

# Example: cycle representation [[0, 1, 2], [3]]
# This represents a permutation where:
# - positions 0->1->2->0 form a cycle
# - position 3 maps to itself

ARGS = {
    "cycle_rep": [[0, 1, 2], [3, 4]]
}
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 tuple, ndim 1, dtype family int — 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
dihedral_conjugacy_classes Ran
ran, honoured the contract we drafted
dashstander/sn-grok/sngrok/dihedral_irreps.py
code served (permissive licence) · get_code("83be00ea953442ee")
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.

def dihedral_conjugacy_classes(n: int):
    conj_classes = [(0, 0), (0, 1)]
    if n % 2 == 1:
        conj_classes += [(i, 0) for i in range(1, n)]
    else:
        conj_classes += [((2, 0), (0, 1)), ((2, 1), (0, 1))]
        conj_classes += [(i, 0) for i in range(1, n)]
    return conj_classes

ARGS = {
    "n": 5
}
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_optimizer Ran
ran; our contract draft was wrong, not the code
dashstander/sn-grok/train_grok.py
code served (permissive licence) · get_code("4a40a7258530a678")
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 AdamW. 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 simple model with parameters to optimize
model = nn.Linear(4, 3)
params = model.parameters()

# Create a config dict for the 'adam' algorithm
config = {
    'algorithm': 'adam',
    'lr': 0.001,
    'betas': (0.9, 0.999),
    'eps': 1e-8,
    'weight_decay': 0.0
}

ARGS = {
    'params': params,
    'config': config
}
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 AdamW — a AdamW output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a AdamW 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
loss_fn Ran
ran; our contract draft was wrong, not the code
dashstander/sn-grok/calculate_cosets.py
code served (permissive licence) · get_code("65a18a30de63b6e8")
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, 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)

# Create logits tensor with shape (batch_size=2, num_classes=4)
# or (batch_size=2, seq_len=3, num_classes=4) to test both paths
logits = torch.randn(2, 3, 4, dtype=torch.float32)

# Create labels tensor with shape (batch_size=2,) containing class indices
labels = torch.tensor([1, 2], dtype=torch.long)

ARGS = {
    "logits": logits,
    "labels": labels,
}
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, 1) — shape (2, 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
trans_to_one_line Ran
ran, honoured the contract we drafted
dashstander/sn-grok/sngrok/irreps.py
code served (permissive licence) · get_code("c6e17d3707e7aaf7")
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 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 torch
import numpy as np

torch.manual_seed(0)

# Analyze the function:
# trans_to_one_line(i, j, n):
#   - Creates a list of range(n)
#   - Swaps elements at indices i and j
#   - Returns as tuple
# Parameters:
#   i: int (index)
#   j: int (index)
#   n: int (size of range)

ARGS = {
    "i": 1,
    "j": 3,
    "n": 5
}
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 tuple, ndim 1, dtype family int — 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
union Ran
ran; our contract draft was wrong, not the code
dashstander/sn-grok/sngrok/cosets.py
code served (permissive licence) · get_code("d53845bba0da077f")
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 set. 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
from functools import reduce

# The function 'union' takes a parameter 'cosets' which is expected to be
# an iterable of iterables (or sets). It reduces them using set union operations.
# We need to construct a list of sets or set-like objects.

# Create a few distinct sets to form cosets
coset1 = {1, 2, 3}
coset2 = {3, 4, 5}
coset3 = {5, 6, 7}

cosets = [coset1, coset2, coset3]

ARGS = {
    "cosets": cosets
}
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 set — a set output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a set 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
slow_an_ft_1d Not yet run
unverified (harvested, no recorded run)
dashstander/sn-grok/sngrok/fourier.py
code served (permissive licence) · get_code("b57d0d7cb168da93")
How it ran

no invocation recorded.

slow_sn_ft_1d Not yet run
unverified (harvested, no recorded run)
dashstander/sn-grok/sngrok/fourier.py
code served (permissive licence) · get_code("ee67d0f3ec236897")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 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 12 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

The complex and unpredictable nature of deep neural networks prevents their safe use in many high-stakes applications. There have been many techniques developed to interpret deep neural networks, but all have substantial limitations. Algorithmic tasks have proven to be a fruitful test ground for interpreting a neural network end-to-end. Building on previous work, we completely reverse engineer fully connected one-hidden layer networks that have ``grokked'' the arithmetic of the permutation groups $S_5$ and $S_6$. The models discover the true subgroup structure of the full group and converge on neural circuits that decompose the group arithmetic using the permutation group's subgroups. We relate how we reverse engineered the model's mechanisms and confirmed our theory was a faithful description of the circuit's functionality. We also draw attention to current challenges in conducting interpretability research by comparing our work to Chughtai et al. [4] which alleges to find a different algorithm for this same problem.

For agents

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

get_harvested_code_for_paper("2312.06581")
get_code_for_paper("2312.06581")
have("2312.06581")

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

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

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

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

Connect an agent — have() is free.