SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2003.02645 · 2020

SentenceMIM: A Latent Variable Language Model

arXiv · PDF · Open in the Atlas

Code that ran

8 of 9 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 3 have no contract verdict; 5 failures of our instrument; 1 no recorded run), measured 2026-11-21; 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/2003.02645.json · badge: /api/ran/2003.02645.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
seraphlabs-ca/SentenceMIM-demo community (classifier label)
classifier basis not recorded on the link
8 ran · 1 no recorded run
FunctionStatusWhere it lives
centropy Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
seraphlabs-ca/SentenceMIM-demo/npeet/entropy_estimators.py
code served (permissive licence) · get_code("d6a4bd5e2a990c1d")
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 float64, ndim 0, 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

np.random.seed(0)

# Create small sample data for x and y
# x: 5 samples with 2 features
x = np.array([
    [1.0, 2.0],
    [1.5, 2.5],
    [2.0, 3.0],
    [2.5, 3.5],
    [3.0, 4.0]
], dtype=np.float64)

# y: 5 samples with 1 feature (must match number of samples as x)
y = np.array([
    [1.0],
    [1.5],
    [2.0],
    [2.5],
    [3.0]
], dtype=np.float64)

ARGS = {
    'x': x,
    'y': y,
    'k': 2,
    'base': 2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
entropy Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
seraphlabs-ca/SentenceMIM-demo/npeet/entropy_estimators.py
code served (permissive licence) · get_code("2053e11470cf9117")
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 float64, ndim 0, 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

np.random.seed(0)

# Create a small dataset of sample vectors
# x should be a list/array of vectors
x = np.array([
    [1.3, 2.1, 0.5, 1.2],
    [3.7, 1.8, 2.3, 0.9],
    [5.1, 3.2, 1.1, 2.4],
    [2.4, 0.7, 3.1, 1.5],
    [4.2, 2.9, 2.8, 0.6],
])

ARGS = {
    'x': x,
    'k': 3,
    'base': 2,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
idx2word Ran
ran on a synthesized input
seraphlabs-ca/SentenceMIM-demo/utils.py
code served (permissive licence) · get_code("28f59233765ea788")
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

torch.manual_seed(0)

# idx: tensor of shape (batch_size, seq_length) containing word IDs
idx = torch.tensor([
    [1, 2, 3, 0],
    [4, 5, 0, 0]
])

# i2w: dictionary mapping string word IDs to word strings
i2w = {
    '0': '<pad>',
    '1': 'hello',
    '2': 'world',
    '3': 'how',
    '4': 'are',
    '5': 'you'
}

# pad_idx: the index used for padding
pad_idx = 0

ARGS = {
    'idx': idx,
    'i2w': i2w,
    'pad_idx': pad_idx
}
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 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
interpolate Ran
ran on a synthesized input
seraphlabs-ca/SentenceMIM-demo/utils.py
code served (permissive licence) · get_code("2c8e364ecb5ae5e4")
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 float, shape (7, 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 numpy as np

# The function interpolate takes:
# - start: a 1D array of shape (D,) where D is the number of dimensions
# - end: a 1D array of shape (D,) with the same shape as start
# - steps: an integer for the number of interpolation steps

# Create small sample arrays
start = np.array([0.0, 1.0, 2.0, 3.0])
end = np.array([10.0, 11.0, 12.0, 13.0])
steps = 5

ARGS = {
    "start": start,
    "end": end,
    "steps": steps
}
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 2, dtype family float, shape (7, 4) — shape (7, 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
load_vocab Ran
ran on a synthesized input
seraphlabs-ca/SentenceMIM-demo/auxiliary.py
code served (permissive licence) · get_code("21afa721a457190d")
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 json
import tempfile
import shutil

# Create a temporary directory structure with a mock vocab file
temp_dir = tempfile.mkdtemp()
ptb_dir = os.path.join(temp_dir, 'ptb')
os.makedirs(ptb_dir, exist_ok=True)

# Create a mock PTB vocab file
mock_vocab = {
    'word1': 0,
    'word2': 1,
    'word3': 2,
    '<unk>': 3,
    '<eos>': 4
}
vocab_path = os.path.join(ptb_dir, 'ptb.vocab.json')
with open(vocab_path, 'w') as f:
    json.dump(mock_vocab, f)

# Create a mock args object
class Args:
    def __init__(self, data_dir):
        self.data_dir = data_dir

args = Args(data_dir=temp_dir)
dataset_name = 'ptb'

ARGS = {
    'dataset_name': dataset_name,
    'args': args
}
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
millify Ran
ran; our contract draft was wrong, not the code
seraphlabs-ca/SentenceMIM-demo/auxiliary.py
code served (permissive licence) · get_code("ced1f70cde38d11e")
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 math

millnames = ['', ' K', ' M', ' G', ' T']

def millify(n):
    """
    Return a human readable number.
    """
    n = float(n)
    millidx = max(0, min(len(millnames) - 1, int(math.floor(0 if n == 0 else math.log10(abs(n)) / 3))))
    return '{:.0f}{}'.format(n / 10 ** (3 * millidx), millnames[millidx])


ARGS = {
    'n': 1500000
}
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
tc Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
seraphlabs-ca/SentenceMIM-demo/npeet/entropy_estimators.py
code served (permissive licence) · get_code("520921d2ed21ae8d")
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 float64, ndim 0, 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
from scipy.special import digamma

np.random.seed(0)

# Create a small sample dataset
# The function expects xs to be a 2D array where each row is a sample
# and each column is a feature
xs = np.array([
    [1.2, 2.3, 3.1, 4.5],
    [1.5, 2.1, 3.4, 4.2],
    [1.8, 2.5, 3.0, 4.8],
    [1.3, 2.4, 3.2, 4.1],
    [1.6, 2.2, 3.3, 4.6]
], dtype=np.float64)

ARGS = {
    'xs': xs,
    'k': 2,
    'base': 2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
to_var Ran
ran; our contract draft was wrong, not the code
seraphlabs-ca/SentenceMIM-demo/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from TheZino/Image_captioning_SATell, is pointer only (licence: NONE) · get_code("502c50812b7f31ab")
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 TheZino/Image_captioning_SATell, 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.

load_dataset Not yet run
unverified (harvested, no recorded run)
seraphlabs-ca/SentenceMIM-demo/auxiliary.py
code served (permissive licence) · get_code("3787c3920ff25517")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 5 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 5 later) and 4 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
to_var 9 other papers
4 dated earlier, 5 later · 1 only as an assembly brick
1502.03044 (2015-02)
Show, Attend and Tell: Neural Image Caption Generation with Visual Attention
1511.06349 (2015-11)
Generating Sentences from a Continuous Space
1704.03162 (2017-04)
Show, Ask, Attend, and Answer: A Strong Baseline For Visual Question Answering
and 6 more not named here
centropy 2 other papers
1 dated earlier, 1 later
1411.2003 (2014-11)
Efficient Estimation of Mutual Information for Strongly Dependent Variables
2303.00596 (2023-03)
Information Plane Analysis for Dropout Neural Networks
entropy 2 other papers
1 dated earlier, 1 later
1411.2003 (2014-11)
Efficient Estimation of Mutual Information for Strongly Dependent Variables
2303.00596 (2023-03)
Information Plane Analysis for Dropout Neural Networks
tc 2 other papers
1 dated earlier, 1 later
1411.2003 (2014-11)
Efficient Estimation of Mutual Information for Strongly Dependent Variables
2303.00596 (2023-03)
Information Plane Analysis for Dropout Neural Networks
millify 1 other paper
1 later
2212.03574 (2022-12)
Learning rigid dynamics with face interaction graph networks

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-21.

Repositories linked to this paper

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

Abstract

SentenceMIM is a probabilistic auto-encoder for language data, trained with Mutual Information Machine (MIM) learning to provide a fixed length representation of variable length language observations (i.e., similar to VAE). Previous attempts to learn VAEs for language data faced challenges due to posterior collapse. MIM learning encourages high mutual information between observations and latent variables, and is robust against posterior collapse. As such, it learns informative representations whose dimension can be an order of magnitude higher than existing language VAEs. Importantly, the SentenceMIM loss has no hyper-parameters, simplifying optimization. We compare sentenceMIM with VAE, and AE on multiple datasets. SentenceMIM yields excellent reconstruction, comparable to AEs, with a rich structured latent space, comparable to VAEs. The structured latent representation is demonstrated with interpolation between sentences of different lengths. We demonstrate the versatility of sentenceMIM by utilizing a trained model for question-answering and transfer learning, without fine-tuning, outperforming VAE and AE with similar architectures.

For agents

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

get_harvested_code_for_paper("2003.02645")
get_code_for_paper("2003.02645")
have("2003.02645")

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

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

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

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

Connect an agent — have() is free.