SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2023.emnlp-main.534 · EMNLP · 2023

Disentangling Transformer Language Models as Superposed Topic Models

Jia Lim, Hady Lauw

Open in the Atlas

Code that ran

22 of 24 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; 1 honoured the contract we drafted, 1 violated it and 15 have no contract verdict; 5 failures of our instrument; 2 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/2023.emnlp-main.534.json · badge: /api/ran/2023.emnlp-main.534.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
PreferredAI/superposed-topics canonical (classifier label)
classifier basis: census
22 ran · 2 no recorded run
FunctionStatusWhere it lives
MEKC Ran
ran on a synthesized input
PreferredAI/superposed-topics/algo/extract.py
code served (permissive licence) · get_code("34b36873cee70936")
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 2, 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 cvxpy as cp
import numpy as np

# Construct a simple graph as a nested dictionary
# graph[i][j] represents the edge weight/score between nodes i and j
graph = {
    'node_0': {'node_1': 0.9, 'node_2': 0.7, 'node_3': 0.5},
    'node_1': {'node_2': 0.8, 'node_3': 0.6},
    'node_2': {'node_3': 0.4},
    'node_3': {},
    'node_4': {'node_0': 0.75, 'node_1': 0.65},
}

ARGS = {
    'graph': graph,
    'limit': 3,
    'solver': cp.GLPK_MI,
    'solver_options': {},
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cvxpy, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 2, 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
MMEKC Ran
ran on a synthesized input
PreferredAI/superposed-topics/algo/extract.py
code served (permissive licence) · get_code("af605bff9b2f73bd")
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 cvxpy as cp
import numpy as np

# Create a small graph for testing
# The graph is a dict of dicts where graph[i][j] = edge weight
np.random.seed(0)

# Create a small test graph with 15 nodes
num_nodes = 15
graph = {}
for i in range(num_nodes):
    graph[i] = {}
    for j in range(i + 1, num_nodes):
        # Add edges with random weights between 0 and 1
        graph[i][j] = np.random.uniform(0.3, 0.9)
    # Also add reverse edges to make it symmetric for the algorithm
    for j in range(i):
        if i in graph[j]:
            graph[i][j] = graph[j][i]

# Define arguments for MMEKC function
ARGS = {
    'g': graph,
    'thresholds': (0.4, 0.9),
    'size_limits': (3, 8),
    'time_limit_s': 60
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cvxpy, numpy — 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
aggregate_prob_graph Ran
ran on a synthesized input
PreferredAI/superposed-topics/algo/topics.py
code served (permissive licence) · get_code("86c49fddbb35a2ae")
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.

# Construct valid arguments for aggregate_prob_graph

# First, let's understand what the function needs:
# - graph: Dict[int, Dict[int, float]] - a dictionary mapping vocab ids to probability graphs
# - item: Tuple[int, Dict[int, float]] - a tuple of (vocab_id, count_graph)
# - num_windows: int - total number of windows in corpus
# - min_freq: int - lower bound for co-occurrence counts

# Create a small count graph (Dict[int, int])
# This maps co-occurrence vocab ids to their counts
count_graph = {
    0: 5,      # appears 5 times (>= min_freq)
    1: 2,      # appears 2 times (>= min_freq)
    2: 1,      # appears 1 time (< min_freq, will be filtered)
}

# Create an item tuple: (vocab_id, count_graph)
item = (10, count_graph)

# Initialize an empty graph that will be populated
graph = {}

# Set reasonable parameters
num_windows = 100
min_freq = 2

ARGS = {
    "graph": graph,
    "item": item,
    "num_windows": num_windows,
    "min_freq": min_freq,
}
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 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
apply_rotary_emb Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
PreferredAI/superposed-topics/llama/model.py
pointer only (licence: MIT); the stored copy get_code serves, from meituan-automl/visionllama, is pointer only (licence: NONE) · get_code("b47d48e431b34acd")
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 meituan-automl/visionllama, 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.

count_unique_words Ran
ran on a synthesized input
PreferredAI/superposed-topics/algo/reint.py
code served (permissive licence) · get_code("c15d5507b6ec9c0a")
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 numpy as np
from functools import reduce
import operator

def count_unique_words(topics):
    """
    Parameters
    ----------
    topics : list of list of identifier tokens
        Tokens can represent word or vocab identifiers 
        
    Returns
    -------
    int
        Number of unique tokens
    """
    return len(reduce(operator.or_, [set(t) for t in topics], set()))


# Create sample data: list of list of identifier tokens
# Each inner list represents tokens/identifiers for a topic
topics = [
    [1, 2, 3, 5],           # Topic 1: 4 tokens
    [2, 4, 6],              # Topic 2: 3 tokens
    [1, 7, 8, 9],           # Topic 3: 4 tokens
    [3, 5, 10]              # Topic 4: 3 tokens
]

ARGS = {
    "topics": topics
}
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 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
create_prob_graph Ran
ran on a synthesized input
PreferredAI/superposed-topics/algo/topics.py
code served (permissive licence) · get_code("838f929ee908ea82")
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

# Define ARGS dictionary with valid arguments for create_prob_graph
ARGS = {
    "graph": {0: 5, 1: 3, 2: 8, 3: 2, 4: 10},
    "num_windows": 100,
    "min_freq": 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 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
gelu Ran
ran, honoured the contract we drafted
PreferredAI/superposed-topics/gpt2/model.py
code served (permissive licence) · get_code("567f1a49bb4bce15")
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 ArrayImpl, 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 jax.numpy as jnp

# Construct a small input tensor for the gelu function
# The function expects a numeric array-like input
x = jnp.array([[-2.0, -1.0, 0.0, 1.0],
               [2.0, 3.0, -0.5, 0.5]], dtype=jnp.float32)

ARGS = {
    'x': x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, 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
get_encoder Ran
ran; our contract draft was wrong, not the code
PreferredAI/superposed-topics/gpt2/bpe_encoder.py
code served (permissive licence) · get_code("a60a309a8a0b21b2")
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 Encoder. 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 json
import os
import tempfile
import shutil

# Create a temporary directory structure for the model files
temp_dir = tempfile.mkdtemp()
model_name = "test_model"
model_path = os.path.join(temp_dir, model_name)
os.makedirs(model_path, exist_ok=True)

# Create a minimal encoder.json
encoder_dict = {
    "!": 0,
    "a": 1,
    "b": 2,
    "c": 3,
    " ": 4,
    "ab": 5,
    "bc": 6,
    "abc": 7,
}
with open(os.path.join(model_path, "encoder.json"), "w") as f:
    json.dump(encoder_dict, f)

# Create a minimal vocab.bpe file
# The format is: header line followed by merge operations
bpe_content = "#version: 0.2\n"
bpe_content += "a b\n"
bpe_content += "b c\n"
bpe_content += "a b c\n"
with open(os.path.join(model_path, "vocab.bpe"), "w") as f:
    f.write(bpe_content)

ARGS = {
    "model_name": model_name,
    "models_dir": temp_dir,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
regex — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Encoder — a Encoder output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Encoder 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_pairs Ran
ran; our contract draft was wrong, not the code
PreferredAI/superposed-topics/gpt2/bpe_encoder.py
code served (permissive licence) · get_code("d919ae32e5e4e616")
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 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

torch.manual_seed(0)

# The function get_pairs takes a word parameter
# A word is represented as a tuple of symbols (variable-length strings)
# The function iterates through the word and creates pairs of consecutive symbols

word = ("hello", "world", "test")

ARGS = {
    "word": word
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
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
greedy Ran
ran on a synthesized input
PreferredAI/superposed-topics/algo/reint.py
code served (permissive licence) · get_code("bd9d862ebfcc77cc")
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 ndarray, ndim 1, dtype family float, shape (5,) 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 numpy as np

# Build topics: list of list of identifier tokens
# Each topic is a list of word/vocab identifiers (integers)
topics = [
    [0, 1, 2],           # topic 0
    [1, 2, 3],           # topic 1
    [3, 4, 5],           # topic 2
    [0, 5, 6],           # topic 3
    [2, 6, 7],           # topic 4
]

# Build scores: list of floats (fitness scores for each topic)
scores = [0.9, 0.7, 0.85, 0.6, 0.75]

# Parameters
final_topic_num = 3
epsilon = 0
max_iteration = 5

ARGS = {
    'topics': topics,
    'scores': scores,
    'final_topic_num': final_topic_num,
    'epsilon': epsilon,
    'max_iteration': max_iteration,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float, shape (5,) — shape (5,) 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
heuristic Ran
ran on a synthesized input
PreferredAI/superposed-topics/algo/reint.py
code served (permissive licence) · get_code("a11e0c055ad48b20")
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 torch
import numpy as np

# Construct arguments for heuristic function

# t: int - index of query topic (simple integer)
t = 2

# selected: set of int - indices of selected topics
selected = {0, 1}

# words_cap: dict - counts of words of selected topics
words_cap = {
    'word_0': 1,
    'word_1': 2,
    'word_2': 3,
    'token_a': 1,
}

# topics: list of list of identifier tokens
# Each inner list represents tokens in a topic
topics = [
    ['word_0', 'word_1'],           # topic 0
    ['word_1', 'word_2'],           # topic 1
    ['token_a', 'word_0', 'new_token'],  # topic 2 (query topic)
    ['word_3', 'word_4'],           # topic 3
]

# limit: int - parameter controlling uniqueness of topics
limit = 1

ARGS = {
    't': t,
    'selected': selected,
    'words_cap': words_cap,
    'topics': topics,
    'limit': limit,
}
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 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
index_vocab Ran
ran on a synthesized input
PreferredAI/superposed-topics/algo/utils.py
code served (permissive licence) · get_code("a30d46e84554a631")
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 numpy as np

torch.manual_seed(0)

# vocab should be an iterable of words/strings
vocab = {"apple", "banana", "cherry", "date", "elderberry"}

ARGS = {
    "vocab": vocab
}
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 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
layer_norm Ran
ran on a synthesized input
PreferredAI/superposed-topics/gpt2/model.py
code served (permissive licence) · get_code("c9d3430dfeeed766")
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 ArrayImpl, 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 jax.numpy as jnp
import numpy as np

# Set seed for reproducibility
np.random.seed(0)

# Create small test tensors
batch_size = 2
feature_dim = 4

# x: input tensor of shape (batch_size, feature_dim)
x = jnp.array(np.random.randn(batch_size, feature_dim), dtype=jnp.float32)

# g: gain/scale parameter of shape (feature_dim,)
g = jnp.array(np.random.randn(feature_dim), dtype=jnp.float32)

# b: bias parameter of shape (feature_dim,)
b = jnp.array(np.random.randn(feature_dim), dtype=jnp.float32)

# eps: small constant for numerical stability
eps = 1e-05

ARGS = {
    'x': x,
    'g': g,
    'b': b,
    'eps': eps
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, 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
npmi Ran
ran on a synthesized input
PreferredAI/superposed-topics/algo/topics.py
code served (permissive licence) · get_code("ea9b4cd1fa3b6b59")
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 float, 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 torch
import numpy as np
from math import log

torch.manual_seed(0)

# Construct valid arguments for the npmi function
ARGS = {
    'p_a_b': 0.05,      # joint co-occurrence probability
    'p_a': 0.2,         # probability for word a
    'p_b': 0.3,         # probability for word b
    'smooth': True,     # use epsilon smoothing
    'default_to': 0     # default return value
}
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 float, 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
precompute_freqs_cis Ran
ran, violated the contract we drafted
PreferredAI/superposed-topics/llama/model.py
pointer only (licence: MIT); the stored copy get_code serves, from meituan-automl/visionllama, is pointer only (licence: NONE) · get_code("14a84c2cbfebc413")
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 meituan-automl/visionllama, 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.

process_beta_llama_efficient Ran
ran on a synthesized input
PreferredAI/superposed-topics/llama/shortlist.py
code served (permissive licence) · get_code("626145a9822c76bd")
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 ndarray, ndim 1, dtype family int, shape (0,) 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 numpy as np

# Analyze what the function needs:
# - beta: indices array (used to index into a boolean array of size 32000)
# - old_arr: array of indices (used as indices into shortlist_decoder dicts)
# - shortlist_decoder: dict with keys 'vocab2idx' and 'vocab2sum'
#   - 'vocab2idx' must support indexing with old_arr and bitwise & with beta_index
#   - 'vocab2sum' must support indexing with old_arr

# Create small valid inputs
# beta: array of indices into the 32000 vocabulary
beta = np.array([0, 5, 10, 15])

# old_arr: array of vocabulary indices that will be used to index into vocab2idx and vocab2sum
old_arr = np.array([0, 1, 2])

# shortlist_decoder: dict with vocab2idx and vocab2sum
# vocab2idx[old_arr] should return shape (len(old_arr), some_dim) for bitwise operations
# vocab2sum[old_arr] should return a value we can compare with the sum

# vocab2idx maps vocabulary indices to boolean arrays of shape (vocab_size,)
# For 3 vocabulary items, we need 3 boolean arrays of shape (32000,)
vocab2idx_value = np.array([
    np.random.randint(0, 2, 32000, dtype=bool),
    np.random.randint(0, 2, 32000, dtype=bool),
    np.random.randint(0, 2, 32000, dtype=bool),
])

# vocab2sum should map the same indices to scalar sums
vocab2sum_value = np.array([
    np.sum(vocab2idx_value[0]),
    np.sum(vocab2idx_value[1]),
    np.sum(vocab2idx_value[2]),
])

shortlist_decoder = {
    'vocab2idx': vocab2idx_value,
    'vocab2sum': vocab2sum_value,
}

ARGS = {
    'beta': beta,
    'old_arr': old_arr,
    'shortlist_decoder': shortlist_decoder,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family int, shape (0,) — shape (0,) 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
read_csv Ran
ran on a synthesized input
PreferredAI/superposed-topics/algo/utils.py
code served (permissive licence) · get_code("4c5cb65ab8f735fa")
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 ndarray, ndim 2, dtype family int, shape (3, 3) 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 pandas as pd
import io

# Create a small CSV content as a string
csv_content = "1,2,3\n4,5,6\n7,8,9"

# Create a file-like object from the string
f = io.StringIO(csv_content)

ARGS = {
    "f": f
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family int, shape (3, 3) — shape (3, 3) 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
read_isets Ran
ran on a synthesized input
PreferredAI/superposed-topics/algo/utils.py
code served (permissive licence) · get_code("45662146f3cd634b")
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 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 pandas as pd
import io
import numpy as np

def read_csv(f):
    try:
        return pd.read_csv(f, header=None).values
    except pd.errors.EmptyDataError:
        return []

def read_isets(f, id2vocab):
    lines = read_csv(f)
    if len(lines) == 0:
        return []
    sets = [[id2vocab[int(w)] for w in x.split()] for x in lines[:, 0]]
    return sets

# Create a mock id2vocab dictionary
id2vocab = {
    0: "apple",
    1: "banana",
    2: "cherry",
    3: "date",
    4: "elderberry"
}

# Create a CSV file content as a StringIO object
csv_content = "0 1 2\n3 4 1\n0 2 4"
f = io.StringIO(csv_content)

ARGS = {
    "f": f,
    "id2vocab": id2vocab
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — 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 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
reshape_for_broadcast Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
PreferredAI/superposed-topics/llama/model.py
pointer only (licence: MIT); the stored copy get_code serves, from alpha-vllm/llama2-accessory, is pointer only (licence: NOASSERTION) · get_code("70bf6ebaafd266c4")
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 alpha-vllm/llama2-accessory, and GitHub could not classify the licence of that repository (NOASSERTION). 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.

sample_top_p Ran
ran; our contract draft was wrong, not the code
PreferredAI/superposed-topics/llama/generation.py
pointer only (licence: MIT); the stored copy get_code serves, from lichenghaobuaa/tokenlearning, is pointer only (licence: NONE) · get_code("8845976729f4c4ee")
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 lichenghaobuaa/tokenlearning, 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.

softmax Ran
ran on a synthesized input
PreferredAI/superposed-topics/gpt2/model.py
code served (permissive licence) · get_code("43894c3f1d3469e3")
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 ArrayImpl, 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 jax.numpy as jnp

# Create a small test array for the softmax function
# The function operates on the last axis, so we create a 2D array
# with shape (2, 4) - batch size 2, feature dimension 4
x = jnp.array([
    [1.0, 2.0, 3.0, 4.0],
    [5.0, 6.0, 7.0, 8.0]
])

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, 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
star_heuristic Ran
ran on a synthesized input
PreferredAI/superposed-topics/algo/extract.py
code served (permissive licence) · get_code("78b7d2e942690d23")
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 numpy as np

# Construct a valid graph dictionary where:
# - keys are node indices (integers)
# - values are dictionaries mapping neighbor indices to edge weights (floats)
g = {
    0: {1: 0.5, 2: 0.7, 3: 0.6},
    1: {0: 0.5, 2: 0.8, 3: 0.4},
    2: {0: 0.7, 1: 0.8, 3: 0.9},
    3: {0: 0.6, 1: 0.4, 2: 0.9},
}

# Threshold tuple: (lower_bound, upper_bound) for edge weight filtering
threshold = (0.4, 0.9)

# Size limits tuple: (kappa_l, kappa_u)
# kappa_l: minimum group size required
# kappa_u: maximum neighbors to select from a star
size_limits = (2, 3)

ARGS = {
    "g": g,
    "threshold": threshold,
    "size_limits": size_limits,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — 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
load_gpt2_params_from_tf_ckpt Not yet run
unverified (harvested, no recorded run)
PreferredAI/superposed-topics/gpt2/utils.py
code served (permissive licence) · get_code("c7a78d4791d05747")
How it ran

no invocation recorded.

process_beta_llama Not yet run
unverified (harvested, no recorded run)
PreferredAI/superposed-topics/llama/shortlist.py
code served (permissive licence) · get_code("5fca77099b4a7ca3")
How it ran

no invocation recorded.

Also present in other papers' code

Of 24 samples lifted from this paper's linked repositories, 24 carry a function identity and 0 do not. Of the 24 distinct functions with an identity, 10 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 7 later) and 14 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
get_pairs 258 other papers
41 dated earlier, 150 later, 66 same year, order not determinable, 1 undated · 4 only as an assembly brick
1802.06474 (2018-02)
A Closed-form Solution to Photorealistic Image Stylization
1803.01128 (2018-03)
Seq2Sick: Evaluating the Robustness of Sequence-to-Sequence Models with Adversarial Examples
1809.00125 (2018-09)
Simple Fusion: Return of the Language Model
and 255 more not named here
reshape_for_broadcast 58 other papers
42 later, 16 same year, order not determinable · 2 only as an assembly brick
2303.09736 (2023-03)
Dynamic Structure Pruning for Compressing CNNs
2307.09288 (2023-07)
Llama 2: Open Foundation and Fine-Tuned Chat Models
2308.06595 (2023-08)
VisIT-Bench: A Benchmark for Vision-Language Instruction Following Inspired by Real-World Use
and 55 more not named here
apply_rotary_emb 55 other papers
41 later, 14 same year, order not determinable · 1 only as an assembly brick
2303.09736 (2023-03)
Dynamic Structure Pruning for Compressing CNNs
2307.09288 (2023-07)
Llama 2: Open Foundation and Fine-Tuned Chat Models
2308.06595 (2023-08)
VisIT-Bench: A Benchmark for Vision-Language Instruction Following Inspired by Real-World Use
and 52 more not named here
precompute_freqs_cis 47 other papers
33 later, 14 same year, order not determinable · 1 only as an assembly brick
2303.09736 (2023-03)
Dynamic Structure Pruning for Compressing CNNs
2307.09288 (2023-07)
Llama 2: Open Foundation and Fine-Tuned Chat Models
2308.06595 (2023-08)
VisIT-Bench: A Benchmark for Vision-Language Instruction Following Inspired by Real-World Use
and 44 more not named here
sample_top_p 26 other papers
17 later, 9 same year, order not determinable
2305.08322 (2023-05)
C-EVAL: A Multi-Level Multi-Discipline Chinese Evaluation Suite for Foundation Models
2305.11554 (2023-05)
ToolkenGPT: Augmenting Frozen Language Models with Massive Tools via Tool Embeddings
2307.09288 (2023-07)
Llama 2: Open Foundation and Fine-Tuned Chat Models
and 23 more not named here
count_unique_words 1 other paper
1 dated earlier
2022.emnlp-main.242 (2022 (year only))
Towards Reinterpreting Neural Topic Models via Composite Activations
gelu 1 other paper
1 later
2604.04756 (2026-04)
Darkness Visible: Reading the Exception Handler of a Language Model
get_encoder 1 other paper
1 later
2601.10926 (2026-01)
Selecting Language Models for Social Science: Start Small, Start Open, and Validate Preprint XX(X):1-22 ©The Author(s) 2026
greedy 1 other paper
1 dated earlier
2022.emnlp-main.242 (2022 (year only))
Towards Reinterpreting Neural Topic Models via Composite Activations
heuristic 1 other paper
1 dated earlier
2022.emnlp-main.242 (2022 (year only))
Towards Reinterpreting Neural Topic Models via Composite Activations

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

Topic Modelling is an established research area where the quality of a given topic is measured using coherence metrics. Often, we infer topics from Neural Topic Models (NTM) by interpreting their decoder weights, consisting of top-activated words projected from individual neurons. Transformer-based Language Models (TLM) similarly consist of decoder weights. However, due to its hypothesised superposition properties, the final logits originating from the residual path are considered uninterpretable. Therefore, we posit that we can interpret TLM as superposed NTM by proposing a novel weight-based, model-agnostic and corpus-agnostic approach to search and disentangle decoder-only TLM, potentially mapping individual neurons to multiple coherent topics. Our results show that it is empirically feasible to disentangle coherent topics from GPT-2 models using the Wikipedia corpus. We validate this approach for GPT-2 models using Zero-Shot Topic Modelling. Finally, we extend the proposed approach to disentangle and analyse LLaMA models.

For agents

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

get_harvested_code_for_paper("2023.emnlp-main.534")
get_code_for_paper("2023.emnlp-main.534")
have("2023.emnlp-main.534")

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

curl https://syntology.ai/api/ran/2023.emnlp-main.534.json

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

[![Syntology run record](https://syntology.ai/api/ran/2023.emnlp-main.534.svg)](https://syntology.ai/paper/2023.emnlp-main.534)

Connect an agent — have() is free.