SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2410.14672 · 2024

BiGR: Harnessing Binary Latent Codes for Image Generation and Improved Visual Representation Capabilities

arXiv · PDF · Open in the Atlas

Code that ran

11 of 13 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, 0 violated it and 0 have no contract verdict; 9 failures of our instrument; 2 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/2410.14672.json · badge: /api/ran/2410.14672.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
haoosz/BiGR canonical (classifier label)
classifier basis: census
11 ran · 2 no recorded run
FunctionStatusWhere it lives
DiffAugment Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
haoosz/BiGR/bae/diffaug.py
pointer only (licence: MIT); the stored copy get_code serves, from SHH-Han/DNF-SR, is pointer only (licence: NOASSERTION) · get_code("1d566d068b0ed0af")
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 SHH-Han/DNF-SR, and GitHub could not classify the licence of that repository (NOASSERTION). 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.

add_weight_decay Ran
ran; our contract draft was wrong, not the code
haoosz/BiGR/train_ddp.py
code served (permissive licence) · get_code("7c91d7cbaabb7970")
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 torch.nn as nn

torch.manual_seed(0)

# Build a small model with various parameter types
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        # Regular weight (2D tensor, will decay)
        self.linear1 = nn.Linear(4, 3)
        # Bias (1D tensor, no decay)
        self.linear2 = nn.Linear(3, 2)
        # Batch norm (has weight and bias)
        self.bn = nn.BatchNorm1d(2)
        # A denoise_mlp layer (should skip decay)
        self.denoise_mlp = nn.Linear(2, 2)
        
    def forward(self, x):
        x = self.linear1(x)
        x = self.linear2(x)
        x = self.bn(x)
        x = self.denoise_mlp(x)
        return x

model = SimpleModel()

# Verify model has parameters with requires_grad
for name, param in model.named_parameters():
    param.requires_grad = True

ARGS = {
    'model': model,
    'weight_decay': 1e-05,
    'skip_list': ()
}
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
adjust_mask Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
haoosz/BiGR/apps/inpaint.py
code served (permissive licence) · get_code("c115fefb450f7ccc")
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 3, dtype family int, shape (256, 256, 3) 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

# Create a valid src_mask argument
# The function expects a 3D numpy array with shape (height, width, 3) for RGB
# It looks for white pixels (255, 255, 255) and adjusts the mask dimensions
src_mask = np.zeros((256, 256, 3), dtype=np.uint8)

# Add a white rectangular region in the mask
# Create a rectangle that has odd dimensions to trigger the adjustment logic
top, bottom = 50, 100  # height = 51 (odd)
left, right = 60, 110  # width = 51 (odd)
src_mask[top:bottom+1, left:right+1, :] = (255, 255, 255)

ARGS = {
    "src_mask": src_mask
}
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 3, dtype family int, shape (256, 256, 3) — shape (256, 256, 3) 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
all_reduce_mean Ran
ran, honoured the contract we drafted
haoosz/BiGR/misc.py
code served (permissive licence) · get_code("3dc19396537db789")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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.distributed as dist

torch.manual_seed(0)

# The function all_reduce_mean takes a single parameter 'x'
# Looking at the function body:
# - x is converted to a torch.tensor
# - If world_size > 1, it's moved to cuda and used with dist.all_reduce
# - Otherwise, x is returned as-is
# Since we're CPU-only and dist is not initialized, the function will return x unchanged
# We need to provide a numeric value that can be converted to a tensor

ARGS = {
    "x": 5.0
}
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 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
center_crop_arr Ran
ran; our contract draft was wrong, not the code
haoosz/BiGR/apps/enrich.py
code served (permissive licence) · get_code("ea73360d2d5d9224")
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 Image. 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.

from PIL import Image
import numpy as np

# Create a simple PIL Image for testing
# Make it larger than 2 * image_size so we can test the resizing logic
pil_image = Image.new('RGB', (256, 256), color='red')

# Define image_size parameter
image_size = 64

# Construct ARGS dictionary
ARGS = {
    'pil_image': pil_image,
    'image_size': image_size
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
PIL, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Image — a Image output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Image output the recorded ndim 3 and dtype family int 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
focal_loss Ran
ran; our contract draft was wrong, not the code
haoosz/BiGR/bae/binarylatent.py
code served (permissive licence) · get_code("3164da5cbc56c361")
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 3, dtype family float, shape (1, 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.functional as F

torch.manual_seed(0)

# Create small tensors for inputs and targets
# inputs: logits tensor, shape (2, 4) - batch_size=2, feature_dim=4
inputs = torch.randn(2, 4)

# targets: binary targets, shape (2, 4) - same shape as inputs
targets = torch.randint(0, 2, (2, 4)).float()

# alpha parameter: -1 means use dynamic weighting based on target distribution
alpha = -1

# gamma parameter: focusing parameter for focal loss
gamma = 2.0

ARGS = {
    'inputs': inputs,
    'targets': targets,
    'alpha': alpha,
    'gamma': gamma
}
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 3, dtype family float, shape (1, 2, 4) — shape (1, 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
get_grad_norm_ Ran
ran, honoured the contract we drafted
haoosz/BiGR/misc.py
pointer only (licence: MIT); the stored copy get_code serves, from sekeunkim/echofm, is pointer only (licence: NONE) · get_code("ba1356e8ceb654d2")
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 sekeunkim/echofm, 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_pretrain Ran
ran; our contract draft was wrong, not the code
haoosz/BiGR/bae/binaryae.py
code served (permissive licence) · get_code("fc854711df9c23ee")
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 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
import tempfile
import os

torch.manual_seed(0)

# Create a simple model with parameters that match what load_pretrain expects
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

# Create the model that will be loaded into
model = SimpleModel()

# Create a temporary file to save pretrained state dict
# The function expects a file where keys start with 'ae'
pretrain_state_dict = {
    'ae.linear.weight': torch.randn(3, 4),
    'ae.linear.bias': torch.randn(3),
}

# Create a temporary file and save the state dict
temp_file = tempfile.NamedTemporaryFile(delete=False, suffix='.pt')
temp_path = temp_file.name
temp_file.close()

torch.save(pretrain_state_dict, temp_path)

ARGS = {
    'model': model,
    'pretrain_path': temp_path,
}
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 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
process Ran
ran; our contract draft was wrong, not the code
haoosz/BiGR/apps/inpaint.py
code served (permissive licence) · get_code("3ebba5eb3f84bf5c")
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 4, dtype family float, shape (8, 3, 256, 256) as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 torchvision.utils import save_image
from time import time

torch.manual_seed(0)

# Create a minimal model that implements inpaint_with_cfg
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(10, 10)
    
    def inpaint_with_cfg(self, cond, max_new_tokens, input_seq, inpaint_mask, 
                         cond_padding, num_iter, out_dim, cfg_scale, cfg_schedule,
                         gumbel_temp, gumbel_schedule, sample_logits, proj_emb):
        # Return a tensor of shape (batch_size, max_new_tokens, out_dim)
        batch_size = cond.shape[0]
        return torch.randint(0, out_dim, (batch_size, max_new_tokens, 1))
    
    def eval(self):
        return super().eval()

# Create a minimal BAE model with decode and codebook_size
class MinimalBAE(nn.Module):
    def __init__(self):
        super().__init__()
        self.codebook_size = 512
        self.linear = nn.Linear(10, 10)
    
    def decode(self, latents):
        # latents shape: (batch_size, channels, latent_size, latent_size)
        # return decoded images: (batch_size, 3, image_size, image_size)
        batch_size = latents.shape[0]
        return torch.rand(batch_size, 3, 256, 256)
    
    def eval(self):
        return super().eval()

# Create minimal args object
class Args:
    def __init__(self):
        self.cls_token_num = 1
        self.num_sample_iter = 2
        self.cfg_scale = 7.5
        self.cfg_schedule = "linear"
        self.gumbel_temp = 1.0
        self.gumbel_schedule = "constant"

model = MinimalModel()
bae = MinimalBAE()
args = Args()

# Create small input tensors
batch_size = 2
latent_size = 16  # 256 // 16
inp = torch.randint(0, 512, (1, latent_size ** 2, 1))
mask = torch.ones(1, latent_size ** 2, 1)

# Arguments for process function
ARGS = {
    'model': model,
    'bae': bae,
    'save': '/tmp/output.png',
    'args': args,
    'inp': inp,
    'mask': mask,
    'cond': 42,
    'seed': 0,
    'image_size': 256,
    'num_classes': 1000
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, torchvision — 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 (8, 3, 256, 256) — shape (8, 3, 256, 256) 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
rand_brightness Ran
ran; our contract draft was wrong, not the code
haoosz/BiGR/bae/diffaug.py
pointer only (licence: MIT); the stored copy get_code serves, from postech-cvlab/pytorch-studiogan, is pointer only (licence: NOASSERTION) · get_code("011230b2b9b8fb6f")
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 postech-cvlab/pytorch-studiogan, and GitHub could not classify the licence of that repository (NOASSERTION). 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.

rand_saturation Ran
ran; our contract draft was wrong, not the code
haoosz/BiGR/bae/diffaug.py
pointer only (licence: MIT); the stored copy get_code serves, from postech-cvlab/pytorch-studiogan, is pointer only (licence: NOASSERTION) · get_code("5b0d8787e670fc63")
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 postech-cvlab/pytorch-studiogan, and GitHub could not classify the licence of that repository (NOASSERTION). 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.

create_logger Not yet run
unverified (harvested, no recorded run)
haoosz/BiGR/train_ddp.py
pointer only (licence: MIT); the stored copy get_code serves, from quandao10/slct, is pointer only (licence: NONE) · get_code("8382f7e48cc8a309")
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 quandao10/slct, 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. No invocation recorded.

get_lr Not yet run
unverified (harvested, no recorded run)
haoosz/BiGR/train_ddp.py
code served (permissive licence) · get_code("8909297ddc746f30")
How it ran

no invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 7 are also present in other papers whose code we hold (7 with at least one paper dated earlier, 4 the same month, 7 later) and 6 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
center_crop_arr 37 other papers
14 dated earlier, 2 the same month, 21 later
2211.17091 (2022-11)
Refining Generative Process with Discriminator Guidance in Score-based Diffusion Models
2212.09748 (2022-12)
Scalable Diffusion Models with Transformers
2311.09257 (2023-11)
UFOGen: You Forward Once Large Scale Text-to-Image Generation via Diffusion GANs
and 34 more not named here
all_reduce_mean 25 other papers
18 dated earlier, 1 the same month, 6 later
2105.12723 (2021-05)
Nested Hierarchical Transformer: Towards Accurate, Data-Efficient and Interpretable Visual Understanding
2204.09435 (2022-04)
Hephaestus: A large scale multitask dataset towards InSAR understanding
2211.12941 (2022-11)
EurNet: Efficient Multi-Range Relational Modeling of Spatial Multi-Relational Data
and 22 more not named here
get_grad_norm_ 21 other papers
14 dated earlier, 2 the same month, 5 later
2308.00566 (2023-08)
Stochastic positional embeddings improve masked image modeling
2310.12979 (2023-10)
Predicting a Protein's Stability under a Million Mutations
2311.13627 (2023-11)
Vamos: Versatile Action Models for Video Understanding
and 18 more not named here
rand_brightness 17 other papers
14 dated earlier, 1 later, 2 same year, order not determinable
1912.04958 (2019-12)
Analyzing and Improving the Image Quality of StyleGAN
2006.10738 (2020-06)
Differentiable Augmentation for Data-Efficient GAN Training
2007.15646 (2020-07)
Rewriting a Deep Generative Model
and 14 more not named here
rand_saturation 16 other papers
13 dated earlier, 1 later, 2 same year, order not determinable
1912.04958 (2019-12)
Analyzing and Improving the Image Quality of StyleGAN
2006.10738 (2020-06)
Differentiable Augmentation for Data-Efficient GAN Training
2007.15646 (2020-07)
Rewriting a Deep Generative Model
and 13 more not named here
create_logger 14 other papers
6 dated earlier, 1 the same month, 7 later
2212.09748 (2022-12)
Scalable Diffusion Models with Transformers
2405.20337 (2024-05)
OccSora: 4D Occupancy Generation Models as World Simulators for Autonomous Driving
2406.01733 (2024-06)
Learning-to-Cache: Accelerating Diffusion Transformer via Layer Caching
and 11 more not named here
DiffAugment 9 other papers
7 dated earlier, 1 later, 1 same year, order not determinable
2006.10738 (2020-06)
Differentiable Augmentation for Data-Efficient GAN Training
2104.03310 (2021-04)
Regularizing Generative Adversarial Networks under Limited Data
2111.01007 (2021-11)
Projected GANs Converge Faster
and 6 more not named here

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

We introduce BiGR, a novel conditional image generation model using compact binary latent codes for generative training, focusing on enhancing both generation and representation capabilities. BiGR is the first conditional generative model that unifies generation and discrimination within the same framework. BiGR features a binary tokenizer, a masked modeling mechanism, and a binary transcoder for binary code prediction. Additionally, we introduce a novel entropy-ordered sampling method to enable efficient image generation. Extensive experiments validate BiGR's superior performance in generation quality, as measured by FID-50k, and representation capabilities, as evidenced by linear-probe accuracy. Moreover, BiGR showcases zero-shot generalization across various vision tasks, enabling applications such as image inpainting, outpainting, editing, interpolation, and enrichment, without the need for structural modifications. Our findings suggest that BiGR unifies generative and discriminative tasks effectively, paving the way for further advancements in the field. We further enable BiGR to perform text-to-image generation, showcasing its potential for broader applications.

For agents

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

get_harvested_code_for_paper("2410.14672")
get_code_for_paper("2410.14672")
have("2410.14672")

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

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

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

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

Connect an agent — have() is free.