SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2206.00100 · CVPR · 2022

VALHALLA: Visual Hallucination for Machine Translation

Yi Li, Yoon Kim, David Cox, Richard Chen, Nuno Vasconcelos, Rameswar Panda, Rogerio Feris

arXiv · PDF · Open in the Atlas

Code that ran

10 of 10 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; 0 honoured the contract we drafted, 2 violated it and 4 have no contract verdict; 4 failures of our instrument; 0 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/2206.00100.json · badge: /api/ran/2206.00100.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
jerryyli/valhalla-nmt community (classifier label)
classifier basis not recorded on the link
10 ran · 0 no recorded run
FunctionStatusWhere it lives
always Ran
ran; our contract draft was wrong, not the code
jerryyli/valhalla-nmt/models/hallucinate/dalle.py
code served (permissive licence) · get_code("fe5dd5258046898c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) 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.

ARGS = {
    'val': 42
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
none outside the standard library — 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
cast_tuple Ran
ran on a synthesized input
jerryyli/valhalla-nmt/models/hallucinate/transformer.py
code served (permissive licence) · get_code("87478659023a0eda")
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 tuple, ndim 1, dtype family int; 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

torch.manual_seed(0)

# Analyzing the function:
# - cast_tuple takes 'val' and 'depth' parameters
# - It checks if val is a list and converts to tuple
# - It checks if val is a tuple, and if not, repeats it 'depth' times
# - depth defaults to 1

# Test case 1: val is a list
val_list = [1, 2, 3]
depth_val = 1

# Test case 2: val is already a tuple
val_tuple = (4, 5, 6)

# Test case 3: val is a scalar that needs repetition
val_scalar = 42

# Test case 4: val is a tensor
val_tensor = torch.randn(2, 4)

ARGS = {
    "val": [1, 2, 3],
    "depth": 2
}
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 tuple, ndim 1, dtype family int — a tuple 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
cp_path_to_dir Ran
ran; our contract draft was wrong, not the code
jerryyli/valhalla-nmt/DALLE-pytorch/train_dalle.py
code served (permissive licence) · get_code("7ae941c6130274cb")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned PosixPath. 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 pathlib import Path
import tempfile
import os

# Create a temporary directory structure for testing
temp_dir = tempfile.mkdtemp()
temp_path = Path(temp_dir)

# Create a checkpoint file path (not an actual file, just a path)
cp_file_path = temp_path / "model_checkpoint.pth"

# Define the arguments
ARGS = {
    "cp_path": cp_file_path,
    "tag": "best"
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type PosixPath — a PosixPath output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a PosixPath 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
default Ran
ran, violated the contract we drafted
jerryyli/valhalla-nmt/models/hallucinate/dalle.py
pointer only (licence: MIT); 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 (MIT), 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.

eval_str_list Ran
ran on a synthesized input
jerryyli/valhalla-nmt/dataclass/utils.py
code served (permissive licence) · get_code("ad7205079f7814cf")
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 ast

# Test case 1: String representation of a list with floats
test_string = "[1.5, 2.7, 3.14]"

# Test case 2: String representation of a list with ints
test_string_ints = "[1, 2, 3]"

# Test case 3: Empty string
test_empty = ""

# Test case 4: None value
test_none = None

# Test case 5: Already a list
test_list = [1.0, 2.0, 3.0]

# Test case 6: Single value string
test_single = "42"

ARGS = {
    "x": "[1.5, 2.7, 3.14]",
    "x_type": float,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — 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
exists Ran
ran, violated the contract we drafted
jerryyli/valhalla-nmt/DALLE-pytorch/train_dalle.py
pointer only (licence: MIT); the stored copy get_code serves, from ThomasMrY/VCT, is pointer only (licence: NONE) · get_code("aa5486a3650902d8")
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 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.

get_symbols_to_strip_from_output Ran
ran; our contract draft was wrong, not the code
jerryyli/valhalla-nmt/generate.py
pointer only (licence: MIT); the stored copy get_code serves, from urvashik/knnmt, is pointer only (licence: NONE) · get_code("88ce019380f10478")
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 urvashik/knnmt, 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_trainable_params Ran
ran; our contract draft was wrong, not the code
jerryyli/valhalla-nmt/DALLE-pytorch/train_dalle.py
code served (permissive licence) · get_code("863c2d358b6285ad")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned list. 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.layer1 = nn.Linear(4, 3)
        self.layer2 = nn.Linear(3, 2)
        self.frozen_layer = nn.Linear(2, 5)
        
        # Freeze one layer to test the requires_grad filtering
        for param in self.frozen_layer.parameters():
            param.requires_grad = False
    
    def forward(self, x):
        x = self.layer1(x)
        x = self.layer2(x)
        x = self.frozen_layer(x)
        return x

model = SimpleModel()

ARGS = {
    'model': model
}
Setup block drafted by
a language model, Claude Sonnet 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 list — a list output has no array shape of its own; none is 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
interpret_dc_type Ran
ran on a synthesized input
jerryyli/valhalla-nmt/dataclass/utils.py
code served (permissive licence) · get_code("cd971280708e837c")
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 type. 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 re
from typing import Any, Dict, List, Optional, Tuple, Type, Union

torch.manual_seed(0)

# Test case 1: A string (should raise RuntimeError)
field_type_1 = "SomeType"

# Test case 2: Any type (should return str)
field_type_2 = Any

# Test case 3: A simple type like int
field_type_3 = int

# Test case 4: Optional[int] (Union[int, None])
field_type_4 = Optional[int]

# Test case 5: Union[str, None]
field_type_5 = Union[str, None]

# We'll use field_type_3 (int) as the main test case
ARGS = {
    "field_type": int
}
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 type — a type output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a type 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
module_name_fordropout Ran
ran on a synthesized input
jerryyli/valhalla-nmt/models/transformer_discrete_encoder.py
code served (permissive licence) · get_code("006572a6fdddbaed")
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 str. 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)

# The function takes a module_name string parameter
# It checks if module_name equals 'TransformerJointEncoderBase' and returns a transformed name
# Otherwise it returns the module_name unchanged

ARGS = {
    'module_name': 'TransformerJointEncoderBase'
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 6 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 3 the same month, 4 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
exists 486 other papers
98 dated earlier, 5 the same month, 380 later, 1 same year, order not determinable, 2 undated · 78 only as an assembly brick
1603.08155 (2016-03)
Perceptual Losses for Real-Time Style Transfer and Super-Resolution
1611.07004 (2016-11)
Image-to-Image Translation with Conditional Adversarial Networks
1804.04637 (2018-04)
EMBER: An Open Dataset for Training Static PE Malware Machine Learning Models
and 483 more not named here
default 163 other papers
53 dated earlier, 1 the same month, 108 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
always 56 other papers
2 dated earlier, 1 the same month, 53 later
2102.12092 (2021-02)
Zero-Shot Text-to-Image Generation
2107.03312 (2021-07)
SoundStream: An End-to-End Neural Audio Codec
2206.02779 (2022-06)
Blended Latent Diffusion
and 53 more not named here
get_symbols_to_strip_from_output 13 other papers
9 dated earlier, 3 later, 1 same year, order not determinable
2010.00710 (2020-10)
Nearest Neighbor Machine Translation
2105.05498 (2021-05)
Improving Lexically Constrained Neural Machine Translation with Source-Conditioned Masked Span Prediction
2105.13022 (2021-05)
Adaptive Nearest Neighbor Machine Translation
and 10 more not named here
cp_path_to_dir 2 other papers
2 dated earlier
2102.12092 (2021-02)
Zero-Shot Text-to-Image Generation
2202.04053 (2022-02)
DALL-Eval: Probing the Reasoning Skills and Social Biases of Text-to-Image Generation Models
get_trainable_params 2 other papers
2 dated earlier
2102.12092 (2021-02)
Zero-Shot Text-to-Image Generation
2202.04053 (2022-02)
DALL-Eval: Probing the Reasoning Skills and Social Biases of Text-to-Image Generation 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-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

Designing better machine translation systems by considering auxiliary inputs such as images has attracted much attention in recent years. While existing methods show promising performance over the conventional text-only translation systems, they typically require paired text and image as input during inference, which limits their applicability to real-world scenarios. In this paper, we introduce a visual hallucination framework, called VALHALLA, which requires only source sentences at inference time and instead uses hallucinated visual representations for multimodal machine translation. In particular, given a source sentence an autoregressive hallucination transformer is used to predict a discrete visual representation from the input text, and the combined text and hallucinated representations are utilized to obtain the target translation. We train the hallucination transformer jointly with the translation transformer using standard backpropagation with cross-entropy losses while being guided by an additional loss that encourages consistency between predictions using either ground-truth or hallucinated visual representations. Extensive experiments on three standard translation datasets with a diverse set of language pairs demonstrate the effectiveness of our approach over both text-only baselines and state-of-the-art methods. Project

For agents

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

get_harvested_code_for_paper("2206.00100")
get_code_for_paper("2206.00100")
have("2206.00100")

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

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

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

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

Connect an agent — have() is free.