SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1812.04224 · 2018

On the Dimensionality of Word Embedding

arXiv · PDF · Open in the Atlas

Code that ran

6 of 7 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 6 have no contract verdict; 0 failures of our instrument; 1 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/1812.04224.json · badge: /api/ran/1812.04224.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
aaaasssddf/PIP-experiments canonical (classifier label)
classifier basis: census
6 ran · 1 no recorded run
FunctionStatusWhere it lives
build_dataset Ran
ran on a synthesized input
aaaasssddf/PIP-experiments/Wiki_corpus/split_counting_all_data.py
code served (permissive licence) · get_code("efd227d5a2b98f96")
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 collections
import numpy as np

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

# Create a small list of words to build a dataset from
words = ['apple', 'banana', 'apple', 'cherry', 'banana', 'apple', 'date', 'elderberry', 'fig', 'grape']

# Number of words to include in dictionary
n_words = 5

# Whether to include UNK token
with_UNK = True

# Whether to shuffle the word counts
shuffle = False

# Dictionary parameter - None means it will be created
dictionary = None

# Existing words set - can be None or a set of existing words to preserve
existing = None

ARGS = {
    'words': words,
    'n_words': n_words,
    'with_UNK': with_UNK,
    'shuffle': shuffle,
    'dictionary': dictionary,
    'existing': existing
}
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 tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
load_test_file Ran
ran on a synthesized input
aaaasssddf/PIP-experiments/forward_stability/cross_comparison.py
code served (permissive licence) · get_code("d8abb2b38f01fce6")
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 tempfile
import os

# Create a temporary test file with sample data
temp_dir = tempfile.mkdtemp()
test_file_path = os.path.join(temp_dir, "test_set.txt")

# Write sample data to the temporary file
with open(test_file_path, 'w') as f:
    f.write("value1,value2,value3\n")
    f.write("a;b;c\n")
    f.write("x,y,z\n")

ARGS = {
    "test_set_file": test_file_path
}
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 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
read_data Ran
ran on a synthesized input
aaaasssddf/PIP-experiments/Wiki_corpus/counting_all_data.py
code served (permissive licence) · get_code("f7f7bba7fc012cc6")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from io import StringIO
import tempfile
import os

# Create a temporary file with sample text data
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.txt')
sample_lines = [
    "the quick brown fox jumps over the lazy dog\n" * 100,
    "hello world python programming\n" * 100,
    "machine learning deep neural networks\n" * 100,
]
for line in sample_lines:
    temp_file.write(line)
temp_file.close()

filename = temp_file.name

ARGS = {
    'filename': filename
}
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 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
read_test_sets Ran
ran on a synthesized input
aaaasssddf/PIP-experiments/Wiki_corpus/counting_all_data.py
code served (permissive licence) · get_code("613b3db2ae078a0b")
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 os
import tempfile
import shutil

# Create a temporary directory with test CSV files
temp_dir = tempfile.mkdtemp()

# Create sample CSV files with word pairs
csv_file_1 = os.path.join(temp_dir, 'test1.csv')
with open(csv_file_1, 'w') as f:
    f.write('apple,banana\n')
    f.write('cherry,date\n')
    f.write('apple,cherry\n')

csv_file_2 = os.path.join(temp_dir, 'test2.csv')
with open(csv_file_2, 'w') as f:
    f.write('fig,grape\n')
    f.write('banana,date\n')

# Define the arguments dictionary
ARGS = {
    'directory': temp_dir
}
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
soft_threshold Ran
ran on a synthesized input
aaaasssddf/PIP-experiments/PIP_upper_bound/plot_upper_bd.py
code served (permissive licence) · get_code("a887f553c25857f7")
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

torch.manual_seed(0)

# The function soft_threshold takes two parameters: x and tau
# x appears to be a numeric value (compared with >)
# tau appears to be a numeric threshold value

# Create simple scalar values for both parameters
x = 5.0
tau = 2.0

ARGS = {
    "x": x,
    "tau": tau
}
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
test Ran
ran on a synthesized input
aaaasssddf/PIP-experiments/forward_stability/cross_comparison.py
code served (permissive licence) · get_code("c888017b3a38ec00")
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 numpy as np

# Construct the arguments for the test function

# rows: list of [word1, word2, score] tuples where words are strings
rows = [
    ["apple", "banana", 0.8],
    ["cat", "dog", 0.6],
    ["tree", "plant", 0.9],
]

# dictionary: maps word strings to integer indices
dictionary = {
    "apple": 0,
    "banana": 1,
    "cat": 2,
    "dog": 3,
    "tree": 4,
    "plant": 5,
}

# embeddings_U: numpy array of shape (num_words, embedding_dim)
# We need at least 6 rows to cover indices 0-5, with embedding dimension 4
embeddings_U = np.array([
    [1.0, 0.0, 0.0, 0.0],
    [0.9, 0.1, 0.0, 0.0],
    [0.0, 1.0, 0.0, 0.0],
    [0.0, 0.9, 0.1, 0.0],
    [0.0, 0.0, 1.0, 0.0],
    [0.0, 0.0, 0.9, 0.1],
], dtype=np.float32)

ARGS = {
    "rows": rows,
    "dictionary": dictionary,
    "embeddings_U": embeddings_U,
}
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 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
load_data Not yet run
unverified (harvested, no recorded run)
aaaasssddf/PIP-experiments/forward_stability/cross_comparison.py
code served (permissive licence) · get_code("b929c022362d66e5")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 7 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

In this paper, we provide a theoretical understanding of word embedding and its dimensionality. Motivated by the unitary-invariance of word embedding, we propose the Pairwise Inner Product (PIP) loss, a novel metric on the dissimilarity between word embeddings. Using techniques from matrix perturbation theory, we reveal a fundamental bias-variance trade-off in dimensionality selection for word embeddings. This bias-variance trade-off sheds light on many empirical observations which were previously unexplained, for example the existence of an optimal dimensionality. Moreover, new insights and discoveries, like when and how word embeddings are robust to over-fitting, are revealed. By optimizing over the bias-variance trade-off of the PIP loss, we can explicitly answer the open question of dimensionality selection for word embedding.

For agents

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

get_harvested_code_for_paper("1812.04224")
get_code_for_paper("1812.04224")
have("1812.04224")

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

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

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

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

Connect an agent — have() is free.