SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2601.22244 · 2026

Is Hierarchical Quantization Essential for Optimal Reconstruction?

Shirin Reyhanian, Laurenz Wiskott

arXiv · PDF · Open in the Atlas

Code that ran

10 of 12 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 3 honoured the contract we drafted, 5 violated it and 0 have no contract verdict; 2 failures of our instrument; 2 no recorded run), measured 2026-11-22; 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/2601.22244.json · badge: /api/ran/2601.22244.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
wiskott-lab/single-vs-hier-recon canonical (classifier label)
classifier basis: census
10 ran · 2 no recorded run
FunctionStatusWhere it lives
default Ran
ran, violated the contract we drafted
wiskott-lab/single-vs-hier-recon/vector_quantize_pytorch/residual_fsq.py
pointer only (licence: BSD-3-Clause); the stored copy get_code serves, from ThomasMrY/VCT, is pointer only (licence: NONE) · get_code("60fff7c3c400d7ff")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (BSD-3-Clause), but get_code serves the stored copy, first harvested from ThomasMrY/VCT, 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.

default Ran
ran, violated the contract we drafted
wiskott-lab/single-vs-hier-recon/vector_quantize_pytorch/sim_vq.py
code served (permissive licence) · get_code("99b3563ebc6734ad")
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 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

def exists(v):
    return v is not None

def default(v, d):
    return v if exists(v) else d

# Test case 1: v is not None
v_value = 42
d_value = 100
ARGS = {
    "v": v_value,
    "d": d_value
}
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 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
exists Ran
ran, violated the contract we drafted
wiskott-lab/single-vs-hier-recon/vector_quantize_pytorch/finite_scalar_quantization.py
code served (permissive licence) · get_code("b7c3487f192e31b7")
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 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

torch.manual_seed(0)

# The function exists(v) simply checks if v is not None
# It takes a single parameter 'v' and returns True if v is not None, False otherwise

# Test with a non-None value
ARGS = {
    "v": 42
}
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 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
first Ran
ran, violated the contract we drafted
wiskott-lab/single-vs-hier-recon/vector_quantize_pytorch/residual_sim_vq.py
code served (permissive licence) · get_code("0ff658860f6a6e4f")
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 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

torch.manual_seed(0)

# The function `first` takes an iterable `it` and returns its first element
# We need to provide an iterable that supports indexing with [0]

ARGS = {
    "it": [1, 2, 3, 4, 5]
}
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 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
first Ran
ran, violated the contract we drafted
wiskott-lab/single-vs-hier-recon/vector_quantize_pytorch/residual_fsq.py
code served (permissive licence) · get_code("015aca7d9bdf8a88")
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

torch.manual_seed(0)

ARGS = {
    "l": [1, 2, 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 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
identity Ran
ran, honoured the contract we drafted
wiskott-lab/single-vs-hier-recon/vector_quantize_pytorch/lookup_free_quantization.py
code served (permissive licence) · get_code("f3232418205f7cbd")
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 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 torch

torch.manual_seed(0)

# The identity function takes a single parameter 't' and returns it unchanged
# We'll provide a simple tensor as the argument
t = torch.randn(2, 4)

ARGS = {
    "t": t
}
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 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
maybe Ran
ran; our contract draft was wrong, not the code
wiskott-lab/single-vs-hier-recon/vector_quantize_pytorch/finite_scalar_quantization.py
code served (permissive licence) · get_code("b9bfdb7303f2d1b7")
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 function. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
from functools import wraps, partial

torch.manual_seed(0)

def exists(v):
    return v is not None

def maybe(fn):

    @wraps(fn)
    def inner(x, *args, **kwargs):
        if not exists(x):
            return x
        return fn(x, *args, **kwargs)
    return inner


# Test function to pass as fn parameter
def sample_function(x, multiplier=2):
    """Simple test function that takes x and multiplies by multiplier"""
    return x * multiplier


# Create test tensor
test_tensor = torch.randn(2, 4)

ARGS = {
    "fn": sample_function
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
maybe_distributed_mean Ran
ran, honoured the contract we drafted
wiskott-lab/single-vs-hier-recon/vector_quantize_pytorch/lookup_free_quantization.py
code served (permissive licence) · get_code("c28ee8e71c4bd85d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 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 torch
import torch.nn as nn
from functools import partial, cache
import torch.distributed as dist
from torch.distributed import nn as dist_nn

torch.manual_seed(0)

# Create a small tensor to pass to the function
t = torch.randn(2, 4)

# ARGS dictionary mapping parameter names to values
ARGS = {
    "t": t
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 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
reduce_mean Ran
ran; our contract draft was wrong, not the code
wiskott-lab/single-vs-hier-recon/distributed.py
code served (permissive licence) · get_code("d9fafc4fdaefaf76")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 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 os
import torch
import torch.distributed as dist

torch.manual_seed(0)

# Set up environment to simulate non-distributed setting
os.environ['WORLD_SIZE'] = '1'

# Create a small tensor as input
x = torch.randn(2, 4)

ARGS = {
    'x': x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 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
round_up_multiple Ran
ran, honoured the contract we drafted
wiskott-lab/single-vs-hier-recon/vector_quantize_pytorch/residual_lfq.py
code served (permissive licence) · get_code("f4a977051ab63431")
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 math import ceil, log2

torch.manual_seed(0)

# Analyzing the function:
# - num: numeric value (int or float)
# - mult: numeric value (int or float) - multiplier
# The function rounds num up to the nearest multiple of mult

# Test with simple numeric values
num_val = 7
mult_val = 3

ARGS = {
    "num": num_val,
    "mult": mult_val
}
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
pack_one Not yet run
unverified (harvested, no recorded run)
wiskott-lab/single-vs-hier-recon/vector_quantize_pytorch/finite_scalar_quantization.py
code served (permissive licence) · get_code("ab03f61657f300bc")
How it ran

no invocation recorded.

unpack_one Not yet run
unverified (harvested, no recorded run)
wiskott-lab/single-vs-hier-recon/vector_quantize_pytorch/latent_quantization.py
code served (permissive licence) · get_code("4fdceb95b4bb47b7")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 11 are also present in other papers whose code we hold (11 with at least one paper dated earlier, 5 the same month, 5 later) and 1 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
default 163 other papers
157 dated earlier, 1 the same month, 4 later, 1 undated · 27 only as an assembly brick
1603.08155 (2016-03)
Perceptual Losses for Real-Time Style Transfer and Super-Resolution
1810.00825 (2018-10)
Set Transformer: A Framework for Attention-based Permutation-Invariant Neural Networks
1907.01470 (2019-07)
Augmenting Self-attention with Persistent Memory
and 160 more not named here
exists 27 other papers
22 dated earlier, 4 the same month, 1 later · 3 only as an assembly brick
1810.00825 (2018-10)
Set Transformer: A Framework for Attention-based Permutation-Invariant Neural Networks
2006.15055 (2020-06)
Object-Centric Learning with Slot Attention
2010.10241 (2020-10)
BYOL works even without batch statistics
and 24 more not named here
default 21 other papers
19 dated earlier, 2 the same month · 1 only as an assembly brick
2006.15055 (2020-06)
Object-Centric Learning with Slot Attention
2110.00218 (2021-10)
On the Importance of Gradients for Detecting Distributional Shifts in the Wild
2309.02612 (2023-09)
Music Source Separation with Band-Split RoPE Transformer
and 18 more not named here
identity 21 other papers
18 dated earlier, 2 later, 1 undated · 2 only as an assembly brick
2011.10043 (2020-11)
Propagate Yourself: Exploring Pixel-Level Consistency for Unsupervised Visual Representation Learning
2203.08913 (2022-03)
Memorizing Transformers
2302.04761 (2023-02)
Toolformer: Language Models Can Teach Themselves to Use Tools
and 18 more not named here
pack_one 16 other papers
14 dated earlier, 1 the same month, 1 later · 4 only as an assembly brick
2203.07852 (2022-03)
Block-Recurrent Transformers
2205.14135 (2022-05)
FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
2206.11990 (2022-06)
Equiformer: Equivariant Graph Attention Transformer for 3D Atomistic Graphs
and 13 more not named here
unpack_one 11 other papers
9 dated earlier, 1 the same month, 1 later · 4 only as an assembly brick
2203.07852 (2022-03)
Block-Recurrent Transformers
2205.14135 (2022-05)
FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
2206.11990 (2022-06)
Equiformer: Equivariant Graph Attention Transformer for 3D Atomistic Graphs
and 8 more not named here
first 5 other papers
5 dated earlier
2302.01327 (2023-02)
Dual PatchNorm
2310.17162 (2023-10)
Content-based Controls For Music Large Language Modeling
2311.15475 (2023-11)
MeshGPT: Generating Triangle Meshes with Decoder-Only Transformers
and 2 more not named here
round_up_multiple 2 other papers
2 dated earlier
2403.03181 (2024-03)
Behavior Generation with Latent Actions
2411.02038 (2024-11)
Addressing Representation Collapse in Vector Quantized Models with One Linear Layer
first 1 other paper
1 dated earlier
2411.02038 (2024-11)
Addressing Representation Collapse in Vector Quantized Models with One Linear Layer
maybe 1 other paper
1 dated earlier
2411.02038 (2024-11)
Addressing Representation Collapse in Vector Quantized Models with One Linear Layer
maybe_distributed_mean 1 other paper
1 dated earlier
2411.02038 (2024-11)
Addressing Representation Collapse in Vector Quantized Models with One Linear Layer

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

Vector-quantized variational autoencoders (VQ-VAEs) are central to models that rely on high reconstruction fidelity, from neural compression to generative pipelines. Hierarchical extensions, such as VQ-VAE2, are often credited with superior reconstruction performance because they split global and local features across multiple latent levels. However, since higher-level latents derive all their information from lower levels, they should not carry additional reconstructive content beyond what the lower-level already encodes. Combined with recent advances in training objectives and quantization mechanisms, this leads us to ask whether a single-level VQ-VAE, with matched representational budget and no codebook collapse, can equal the reconstruction fidelity of its hierarchical counterpart. Although the multi-scale structure of hierarchical models may improve perceptual quality in downstream tasks, the effect of hierarchy on reconstruction accuracy, isolated from codebook utilization and overall representational capacity, remains empirically underexamined. We revisit this question by comparing a two-level hierarchical VQ-VAE and a capacity-matched single-level model on high-resolution ImageNet images. Consistent with prior observations, we confirm that inadequate codebook utilization limits single-level VQ-VAEs and that overly high-dimensional embeddings destabilize quantization and increase codebook collapse. We show that lightweight interventions such as initialization from data, periodic reset of inactive codebook vectors, and systematic tuning of codebook size and dimension significantly reduce collapse and enable the single-level model to make effective use of its available capacity. Our results demonstrate that when representational budgets are matched, and codebook collapse is mitigated, single-level VQ-VAEs can match the reconstruction fidelity of hierarchical variants, challenging the assumption that hierarchical quantization is inherently superior for high-quality reconstructions. The code for reproducing our experiments is available at https://github.com/wiskott-lab/single-vs-hier-recon.

For agents

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

get_harvested_code_for_paper("2601.22244")
get_code_for_paper("2601.22244")
have("2601.22244")

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

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

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

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

Connect an agent — have() is free.