SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · aaai_29913 · AAAI · 2024

Topic-VQ-VAE: Leveraging Latent Codebooks for Flexible Topic-Guided Document Generation

Youngjoon Yoo, Jongwon Choi

Open in the Atlas

Code that ran

11 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; 2 honoured the contract we drafted, 1 violated it and 1 has no contract verdict; 7 failures of our instrument; 1 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/aaai_29913.json · badge: /api/ran/aaai_29913.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
clovaai/TVQ-VAE canonical (classifier label)
classifier basis: census
11 ran · 1 no recorded run
FunctionStatusWhere it lives
Normalize Ran
ran; our contract draft was wrong, not the code
clovaai/TVQ-VAE/image_generation_t/taming/modules/diffusionmodules/model.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from Xingyu-Zheng/BiDM, is pointer only (licence: NONE) · get_code("c3a6b977022957cb")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from Xingyu-Zheng/BiDM, 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_params Ran
ran, honoured the contract we drafted
clovaai/TVQ-VAE/image_generation_t/taming/modules/util.py
code served (permissive licence) · get_code("5ef87f1a172f152b")
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 torch.nn as nn

torch.manual_seed(0)

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.linear2(x)
        return x

model = SimpleModel()

ARGS = {
    "model": model
}
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
disabled_train Ran
ran, violated the contract we drafted
clovaai/TVQ-VAE/image_generation_t/taming/models/cond_transformer.py
code served (permissive licence) · get_code("4cb732f513d69dfd")
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 SimpleModel. 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

torch.manual_seed(0)

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

model = SimpleModel()

ARGS = {
    "self": model,
    "mode": True
}
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 SimpleModel — a SimpleModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleModel 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_ckpt_path Ran
ran; our contract draft was wrong, not the code
clovaai/TVQ-VAE/image_generation_t/taming/util.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from lxa9867/ControlVAR, is pointer only (licence: NONE) · get_code("e70eb36cf08faee4")
How it ran

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

get_data Ran
ran on a synthesized input
clovaai/TVQ-VAE/image_generation_t/make_samples_tvq.py
code served (permissive licence) · get_code("1e7aa4bd48cdf845")
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 MinimalDataModule. 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 typing import Any, Dict

torch.manual_seed(0)

# Create a minimal stand-in class that satisfies the data module interface
class MinimalDataModule:
    def __init__(self, **kwargs):
        self.params = kwargs
    
    def prepare_data(self):
        pass
    
    def setup(self):
        pass

# Register the stand-in class in a way that get_obj_from_str can find it
import sys
from types import ModuleType

# Create a fake module and register it
fake_module = ModuleType('fake_data_module')
fake_module.MinimalDataModule = MinimalDataModule
sys.modules['fake_data_module'] = fake_module

# Create a valid config dict that instantiate_from_config expects
config = {
    'target': 'fake_data_module.MinimalDataModule',
    'params': {
        'batch_size': 2,
        'num_workers': 0
    }
}

ARGS = {
    'config': config
}
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 MinimalDataModule — a MinimalDataModule output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MinimalDataModule 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_obj_from_str Ran
ran; our contract draft was wrong, not the code
clovaai/TVQ-VAE/image_generation_t/make_samples_tvq.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from LIAGM/DAEFR, is pointer only (licence: NONE) · get_code("4e4f3bef7e8672e8")
How it ran

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

get_timestep_embedding Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
clovaai/TVQ-VAE/image_generation_t/taming/modules/diffusionmodules/model.py
code served (permissive licence) · get_code("cb49209c125de1b4")
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
import math

torch.manual_seed(0)

# The function takes two parameters:
# 1. timesteps: a 1D tensor of timestep indices
# 2. embedding_dim: an integer specifying the embedding dimension

# Create a small 1D tensor of timesteps (batch size 2)
timesteps = torch.tensor([0, 5], dtype=torch.int64)

# Create an embedding dimension (use 4 as specified)
embedding_dim = 4

ARGS = {
    "timesteps": timesteps,
    "embedding_dim": embedding_dim,
}
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
md5_hash Ran
ran; our contract draft was wrong, not the code
clovaai/TVQ-VAE/image_generation_t/taming/util.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from zh460045050/V2L-Tokenizer, is pointer only (licence: NONE) · get_code("07d90bd6ae1be7db")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from zh460045050/V2L-Tokenizer, 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.

nonlinearity Ran
ran; our contract draft was wrong, not the code
clovaai/TVQ-VAE/image_generation_t/taming/modules/diffusionmodules/model.py
code served (permissive licence) · get_code("3137073275f8c21a")
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 function takes a single parameter 'x' which is used with:
# - multiplication operator (*)
# - torch.sigmoid() function
# This means x should be a tensor

x = torch.randn(2, 4)

ARGS = {
    "x": x
}
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
reparameterize Ran
ran; our contract draft was wrong, not the code
clovaai/TVQ-VAE/document_analysis/model.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from sharan21/EPAAE, is pointer only (licence: NONE) · get_code("447585e6fedec167")
How it ran

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

retrieve Ran
ran, honoured the contract we drafted
clovaai/TVQ-VAE/image_generation_t/taming/util.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from lxa9867/ControlVAR, is pointer only (licence: NONE) · get_code("31543f3e2c18272e")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from lxa9867/ControlVAR, 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_model_from_config Not yet run
unverified (harvested, no recorded run)
clovaai/TVQ-VAE/image_generation_t/make_samples_tvq.py
code served (permissive licence) · get_code("79f00acd1002c860")
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, 10 are also present in other papers whose code we hold (10 with at least one paper dated earlier, 0 the same month, 6 later) and 2 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
disabled_train 173 other papers
75 dated earlier, 17 later, 81 same year, order not determinable · 5 only as an assembly brick
2012.09841 (2020-12)
Taming Transformers for High-Resolution Image Synthesis
2102.05379 (2021-02)
Argmax Flows and Multinomial Diffusion: Learning Categorical Distributions
2104.07652 (2021-04)
Geometry-Free View Synthesis: Transformers and no 3D Priors
and 170 more not named here
nonlinearity 156 other papers
63 dated earlier, 35 later, 58 same year, order not determinable · 25 only as an assembly brick
2104.07652 (2021-04)
Geometry-Free View Synthesis: Transformers and no 3D Priors
2106.00132 (2021-06)
On Fast Sampling of Diffusion Probabilistic Models
2106.06819 (2021-06)
D2C: Diffusion-Denoising Models for Few-shot Conditional Generation
and 153 more not named here
get_timestep_embedding 91 other papers
48 dated earlier, 9 later, 34 same year, order not determinable · 7 only as an assembly brick
2104.07652 (2021-04)
Geometry-Free View Synthesis: Transformers and no 3D Priors
2106.00132 (2021-06)
On Fast Sampling of Diffusion Probabilistic Models
2106.06819 (2021-06)
D2C: Diffusion-Denoising Models for Few-shot Conditional Generation
and 88 more not named here
Normalize 90 other papers
49 dated earlier, 18 later, 23 same year, order not determinable · 32 only as an assembly brick
2104.07652 (2021-04)
Geometry-Free View Synthesis: Transformers and no 3D Priors
2106.00132 (2021-06)
On Fast Sampling of Diffusion Probabilistic Models
2106.06819 (2021-06)
D2C: Diffusion-Denoising Models for Few-shot Conditional Generation
and 87 more not named here
get_obj_from_str 54 other papers
21 dated earlier, 12 later, 21 same year, order not determinable · 12 only as an assembly brick
2006.11239 (2020-06)
Denoising Diffusion Probabilistic Models
2102.05379 (2021-02)
Argmax Flows and Multinomial Diffusion: Learning Categorical Distributions
2112.00384 (2021-12)
Exploration into Translation-Equivariant Image Quantization
and 51 more not named here
md5_hash 30 other papers
13 dated earlier, 2 later, 15 same year, order not determinable
2008.01777 (2020-08)
Making Sense of CNNs: Interpreting Deep Representations & Their Invariances with INNs
2104.07652 (2021-04)
Geometry-Free View Synthesis: Transformers and no 3D Priors
2112.00384 (2021-12)
Exploration into Translation-Equivariant Image Quantization
and 27 more not named here
get_ckpt_path 10 other papers
3 dated earlier, 7 same year, order not determinable
2112.00384 (2021-12)
Exploration into Translation-Equivariant Image Quantization
Li_MAGE_MAsked_Generative_Encoder_To_Unify_Representation_Learning_and_Image_CVPR_2023_paper (2023 (year only))
MAGE: MAsked Generative Encoder to Unify Representation Learning and Image Synthesis
2308.07228 (2023-08)
RestoreFormer++: Towards Real-World Blind Face Restoration from Undegraded Key-Value Pairs
and 7 more not named here
retrieve 5 other papers
3 dated earlier, 2 same year, order not determinable
2112.00384 (2021-12)
Exploration into Translation-Equivariant Image Quantization
Li_MAGE_MAsked_Generative_Encoder_To_Unify_Representation_Learning_and_Image_CVPR_2023_paper (2023 (year only))
MAGE: MAsked Generative Encoder to Unify Representation Learning and Image Synthesis
2308.07228 (2023-08)
RestoreFormer++: Towards Real-World Blind Face Restoration from Undegraded Key-Value Pairs
and 2 more not named here
count_params 4 other papers
3 dated earlier, 1 same year, order not determinable
2112.00384 (2021-12)
Exploration into Translation-Equivariant Image Quantization
Li_MAGE_MAsked_Generative_Encoder_To_Unify_Representation_Learning_and_Image_CVPR_2023_paper (2023 (year only))
MAGE: MAsked Generative Encoder to Unify Representation Learning and Image Synthesis
2308.07228 (2023-08)
RestoreFormer++: Towards Real-World Blind Face Restoration from Undegraded Key-Value Pairs
and 1 more not named here
reparameterize 1 other paper
1 dated earlier
2205.02309 (2022-05)
Towards Robust and Semantically Organised Latent Representations for Unsupervised Text Style Transfer

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

This paper introduces a novel approach for topic modeling utilizing latent codebooks from Vector-Quantized Variational Auto-Encoder (VQ-VAE), discretely encapsulating the rich information of the pre-trained embeddings such as the pre-trained language model. From the novel interpretation of the latent codebooks and embeddings as conceptual bagof-words, we propose a new generative topic model called Topic-VQ-VAE (TVQ-VAE) which inversely generates the original documents related to the respective latent codebook. The TVQ-VAE can visualize the topics with various generative distributions including the traditional BoW distribution and the autoregressive image generation. Our experimental results on document analysis and image generation demonstrate that TVQ-VAE effectively captures the topic context which reveals the underlying structures of the dataset and supports flexible forms of document generation. Official implementation of the proposed TVQ-VAE is available at https: //github.com/clovaai/TVQ-VAE.

For agents

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

get_harvested_code_for_paper("aaai_29913")
get_code_for_paper("aaai_29913")
have("aaai_29913")

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

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

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

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

Connect an agent — have() is free.