SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2106.07631 · NeurIPS · 2021

Improved Transformer for High-Resolution GANs

Zizhao Zhang, Han Zhang, Ting Chen, Long Zhao, Dimitris Metaxas

arXiv · PDF · Open in the Atlas

Code that ran

3 of 4 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 2 failures of our instrument; 1 no recorded run), measured 2026-11-23; 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/2106.07631.json · badge: /api/ran/2106.07631.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
google-research/hit-gan canonical (classifier label)
classifier basis: classifier_2025
3 ran · 1 no recorded run
FunctionStatusWhere it lives
Block Ran
ran on a synthesized input · constructed an object; no result was computed
google-research/hit-gan/models/generators.py
code served (permissive licence) · get_code("6c10eab79338dde3")
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 an instance of its own class, Block: the run constructed the object and did not call it, so no result was computed. 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 tensorflow as tf
import numpy as np

# Create stand-in classes for the dependencies that Block uses
class MultiAxisAttention(tf.keras.layers.Layer):
    def __init__(self, num_heads, key_dim, attn_axes, attn_type='multi_head', dropout=0.0, **kwargs):
        super().__init__()
        self.num_heads = num_heads
        self.key_dim = key_dim
        self.attn_axes = attn_axes
        self.attn_type = attn_type
        self.dropout = dropout

    def call(self, queries, values, training=None):
        return queries

class MLP(tf.keras.layers.Layer):
    def __init__(self, dropout=0.0, norm_type='layer', activation=tf.nn.gelu, **kwargs):
        super().__init__()
        self.dropout = dropout
        self.norm_type = norm_type
        self.activation = activation

    def call(self, inputs, training=None):
        return inputs

def make_norm_layer(norm_type):
    return tf.keras.layers.LayerNormalization()

# Create a mock layers module
class MockLayers:
    MultiAxisAttention = MultiAxisAttention
    MLP = MLP
    make_norm_layer = staticmethod(make_norm_layer)

# Patch the layers module into the Block's namespace
import sys
mock_layers = MockLayers()

# Define the arguments dictionary
ARGS = {
    'attn_axes': [[0], [1]],
    'num_heads': 4,
    'dropout': 0.1,
    'attn_dropout': 0.05,
    'attn_type': 'multi_head',
    'norm_type': 'layer',
    'activation': tf.nn.gelu,
    'kernel_initializer': 'glorot_uniform',
    'bias_initializer': 'zeros',
    'name': 'attention_block'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Block — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Block 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
block_images Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
google-research/hit-gan/models/generators.py
code served (permissive licence) · get_code("8826aa509040430b")
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 EagerTensor, ndim 4, dtype family float, shape (2, 6, 4, 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 tensorflow as tf
import numpy as np

# Set seed for reproducibility
tf.random.set_seed(0)

# Create a small test image tensor
# Shape: (batch_size, height, width, channels)
# Using distinct sizes: batch=2, height=4, width=6, channels=3
batch_size = 2
height = 4
width = 6
channels = 3
patch_size = 2

# Create a random image tensor
inputs = tf.random.normal(shape=(batch_size, height, width, channels), dtype=tf.float32)

ARGS = {
    "inputs": inputs,
    "patch_size": patch_size
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 4, dtype family float, shape (2, 6, 4, 3) — shape (2, 6, 4, 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
unblock_images Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
google-research/hit-gan/models/generators.py
code served (permissive licence) · get_code("5ec2d4992747d874")
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 EagerTensor, ndim 4, dtype family float, shape (2, 6, 8, 12) 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 tensorflow as tf

# Create a small batch of blocked image patches
# The function expects inputs of shape (batch, height, width, channels)
# where height = grid_height * grid_width and channels = patch_size^2 * original_channels

batch_size = 2
grid_size = 4
patch_size = 2
original_channels = 3

# Calculate the spatial dimensions needed
# outputs after reshape will be (-1, grid_height, grid_width, patch_size^2 * channel_dim)
# so inputs should have shape (batch, grid_height * grid_width, grid_width, patch_size^2 * original_channels)
grid_height = 3
grid_width = grid_size

# Create inputs tensor with shape (batch, grid_height * grid_width, grid_width, patch_size^2 * original_channels)
# This matches what the function expects before the first reshape
inputs_shape = (batch_size, grid_height * grid_width, grid_width, patch_size ** 2 * original_channels)
inputs = tf.random.normal(inputs_shape, dtype=tf.float32)

ARGS = {
    "inputs": inputs,
    "grid_size": grid_size,
    "patch_size": patch_size,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 4, dtype family float, shape (2, 6, 8, 12) — shape (2, 6, 8, 12) 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
HiTGenerator Not yet run
unverified (harvested, no recorded run)
google-research/hit-gan/models/generators.py
code served (permissive licence) · get_code("4130dcea05fdd401")
How it ran

no invocation recorded.

Also present in other papers' code

Of 4 samples lifted from this paper's linked repositories, 4 carry a function identity and 0 do not. Of the 4 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 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.

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

Attention-based models, exemplified by the Transformer, can effectively model long range dependency, but suffer from the quadratic complexity of self-attention operation, making them difficult to be adopted for high-resolution image generation based on Generative Adversarial Networks (GANs). In this paper, we introduce two key ingredients to Transformer to address this challenge. First, in low-resolution stages of the generative process, standard global self-attention is replaced with the proposed multi-axis blocked self-attention which allows efficient mixing of local and global attention. Second, in high-resolution stages, we drop self-attention while only keeping multi-layer perceptrons reminiscent of the implicit neural function. To further improve the performance, we introduce an additional self-modulation component based on cross-attention. The resulting model, denoted as HiT, has a nearly linear computational complexity with respect to the image size and thus directly scales to synthesizing high definition images. We show in the experiments that the proposed HiT achieves state-of-the-art FID scores of 30.83 and 2.95 on unconditional ImageNet 128 × 128 and FFHQ 256 × 256, respectively, with a reasonable throughput. We believe the proposed HiT is an important milestone for generators in GANs which are completely free of convolutions. Our code is made publicly available at https://github.com/google-research/hit-gan.

For agents

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

get_harvested_code_for_paper("2106.07631")
get_code_for_paper("2106.07631")
have("2106.07631")

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

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

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

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

Connect an agent — have() is free.