SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2003.02977 · NeurIPS · 2020

Likelihood Regret: An Out-of-Distribution Detection Score For Variational Auto-encoder

Zhisheng Xiao, Qing Yan, Yali Amit

arXiv · PDF · Open in the Atlas

Code that ran

5 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; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 4 failures of our instrument; 2 no recorded run); 1 of them was also run on the host, not in the jail, by the peer-agreement lane that set its level, measured 2026-11-22; 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.02977.json · badge: /api/ran/2003.02977.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
XavierXiao/Likelihood-Regret canonical (classifier label)
classifier basis: classifier_2025
4 ran · 2 no recorded run
gfloto/tilted_prior community
Papers with Code archive
1 ran · 0 no recorded run
FunctionStatusWhere it lives
KL_div Ran
ran; our contract draft was wrong, not the code
XavierXiao/Likelihood-Regret/compute_LR.py
code served (permissive licence) · get_code("847c067c26259f6d")
How it ran

Ran in Syntology's jail on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned Tensor, ndim 1, dtype family float, shape (2,) as a later run recorded it. The image it ran in was not recorded. The comparison behind this sample's level is a different run: the peer-agreement lane ran it again on the host, not in the jail (report dated 2026-09-05T00:43:06Z). 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 small tensors for mu and logvar
# Shape: (batch_size=2, latent_dim=4)
mu = torch.randn(2, 4)
logvar = torch.randn(2, 4)

# reduction parameter can be 'none' or 'sum'
reduction = 'none'

ARGS = {
    'mu': mu,
    'logvar': logvar,
    'reduction': reduction
}
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 Tensor, ndim 1, dtype family float, shape (2,) — shape (2,) 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
KL_div Ran
ran; our contract draft was wrong, not the code
XavierXiao/Likelihood-Regret/train_pixel.py
code served (permissive licence) · get_code("97f4e4e9378999c6")
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 Tensor, ndim 1, dtype family float, shape (2,) 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 small tensors for mu and logvar
# Shape: (batch_size=2, latent_dim=4)
mu = torch.randn(2, 4)
logvar = torch.randn(2, 4)

# reduction parameter can be 'sum' or 'avg'
reduction = 'avg'

ARGS = {
    'mu': mu,
    'logvar': logvar,
    'reduction': reduction
}
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 Tensor, ndim 1, dtype family float, shape (2,) — shape (2,) 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
compute_NLL Ran
ran; our contract draft was wrong, not the code
XavierXiao/Likelihood-Regret/compute_LR.py
code served (permissive licence) · get_code("51b59360485201d4")
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 Tensor, 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 torch.nn as nn

torch.manual_seed(0)

# The function compute_NLL takes 'weights' as a parameter
# It expects weights to be a tensor that supports:
# - .max() method
# - torch.exp() operation
# - torch.log() operation
# - torch.mean() operation
# - arithmetic operations (subtraction, addition)

# Create a small tensor for weights
weights = torch.randn(2, 4)

ARGS = {
    "weights": weights
}
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 Tensor, 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
compute_nll Ran
ran, honoured the contract we drafted
gfloto/tilted_prior/regret.py
pointer only (licence: NONE) · get_code("ad9a5769ab39566f")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, gfloto/tilted_prior 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.

perturb Ran
ran; our contract draft was wrong, not the code
XavierXiao/Likelihood-Regret/train_pixel.py
code served (permissive licence) · get_code("356aef4a4b74b441")
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 Tensor, ndim 4, dtype family float, shape (2, 3, 4, 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 torch

torch.manual_seed(0)

# Create a small tensor with shape (batch=2, channels=3, height=4, width=5)
x = torch.rand(2, 3, 4, 5)

# mu is a probability threshold for the mask
mu = 0.3

# device to run on
device = torch.device("cpu")

ARGS = {
    "x": x,
    "mu": mu,
    "device": device,
}
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 Tensor, ndim 4, dtype family float, shape (2, 3, 4, 5) — shape (2, 3, 4, 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
store_NLL Not yet run
unverified (harvested, no recorded run)
XavierXiao/Likelihood-Regret/compute_LR.py
code served (permissive licence) · get_code("7dbeee7e3e0c875f")
How it ran

no invocation recorded.

store_NLL Not yet run
unverified (harvested, no recorded run)
XavierXiao/Likelihood-Regret/compute_LR.py
code served (permissive licence) · get_code("041851ccaef16701")
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 6 distinct functions with an identity, 2 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 2 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
KL_div 1 other paper
1 later
2208.09083 (2022-08)
Out-of-distribution Detection via Frequency-regularized Generative Models
compute_NLL 1 other paper
1 later
2208.09083 (2022-08)
Out-of-distribution Detection via Frequency-regularized Generative Models

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

Repositories linked to this paper

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

Abstract

Deep probabilistic generative models enable modeling the likelihoods of very high dimensional data. An important application of generative modeling should be the ability to detect out-of-distribution (OOD) samples by setting a threshold on the likelihood. However, some recent studies show that probabilistic generative models can, in some cases, assign higher likelihoods on certain types of OOD samples, making the OOD detection rules based on likelihood threshold problematic. To address this issue, several OOD detection methods have been proposed for deep generative models. In this paper, we make the observation that many of these methods fail when applied to generative models based on Variational Auto-encoders (VAE). As an alternative, we propose Likelihood Regret, an efficient OOD score for VAEs. We benchmark our proposed method over existing approaches, and empirical results suggest that our method obtains the best overall OOD detection performances when applied to VAEs. Recent advances in deep probabilistic generative models [20,46,42,21] make generative modeling of very high dimensional and complicated data such as natural images, sequences [38] and graphs [22] * equal contribution 34th Conference on Neural Information Processing Systems (NeurIPS 2020),

For agents

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

get_harvested_code_for_paper("2003.02977")
get_code_for_paper("2003.02977")
have("2003.02977")

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

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

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

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

Connect an agent — have() is free.