SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2301.13823 · ICML · 2023

Grounding Language Models to Images for Multimodal Inputs and Outputs

Ruslan Salakhutdinov, Jing Koh, Daniel Fried

arXiv · PDF · Open in the Atlas

Code that ran

6 of 8 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, 0 violated it and 2 have no contract verdict; 4 failures of our instrument; 2 no recorded run), measured 2026-11-22; 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/2301.13823.json · badge: /api/ran/2301.13823.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
kohjingyu/fromage canonical (classifier label)
classifier basis not recorded on the link
6 ran · 0 no recorded run
albertotestoni/ndq_visual_objects community
Papers with Code archive
0 ran · 2 no recorded run
FunctionStatusWhere it lives
collate_fn Ran
ran; our contract draft was wrong, not the code
kohjingyu/fromage/fromage/data.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from ciodar/universalattribution, is pointer only (licence: NONE) · get_code("12c09a1a10ca585d")
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 ciodar/universalattribution, 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.

contrastive_loss Ran
ran; our contract draft was wrong, not the code
kohjingyu/fromage/fromage/losses.py
code served (permissive licence) · get_code("83ada93fd84968cc")
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 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 expects:
# - logits: torch.Tensor
# cross_entropy expects logits of shape (batch_size, num_classes)
# and targets of shape (batch_size,) with class indices
# The targets are torch.arange(len(logits)) so len(logits) is the batch size
# and the number of classes must match the second dimension

batch_size = 2
num_classes = 4

logits = torch.randn(batch_size, num_classes)

ARGS = {
    "logits": logits,
}
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 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
get_image_from_url Ran
ran on a synthesized input
kohjingyu/fromage/fromage/utils.py
code served (permissive licence) · get_code("9fbf7d0daff2eccf")
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 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.

import torch
import numpy as np
from unittest.mock import Mock, patch
from PIL import Image
from io import BytesIO

# Mock the requests.get to avoid network calls
mock_response = Mock()

# Create a small valid RGB image
img = Image.new('RGB', (100, 100), color='red')
img_bytes = BytesIO()
img.save(img_bytes, format='PNG')
img_bytes.seek(0)
mock_response.content = img_bytes.getvalue()

ARGS = {
    "url": "https://example.com/image.png"
}

# Patch requests.get to return our mock response
import requests
original_get = requests.get
requests.get = lambda url: mock_response
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, requests, torch — 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
pad_to_size Ran
ran; our contract draft was wrong, not the code
kohjingyu/fromage/fromage/utils.py
code served (permissive licence) · get_code("a584078acaadacc6")
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 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 small test image that is smaller than the target size
# The function expects a PIL Image object with a .size attribute
test_image = Image.new('RGB', (100, 80), color='red')

ARGS = {
    'x': test_image,
    'size': 256
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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
scores_to_ranks Ran
ran; our contract draft was wrong, not the code
kohjingyu/fromage/evals/eval_visdial_generation.py
code served (permissive licence) · get_code("a2edc415218fdd3f")
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 int, shape (2, 3, 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 expects scores as a torch.Tensor with shape (batch_size, num_rounds, num_options)
# Based on the code: batch_size=20, but we'll use smaller values for testing
# Let's use batch_size=2, num_rounds=3, num_options=4 for tiny tensors

batch_size = 2
num_rounds = 3
num_options = 4

# Create random scores tensor with shape (batch_size, num_rounds, num_options)
scores = torch.randn(batch_size, num_rounds, num_options)

ARGS = {
    "scores": scores
}
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 int, shape (2, 3, 4) — shape (2, 3, 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
truncate_caption Ran
ran on a synthesized input
kohjingyu/fromage/fromage/utils.py
code served (permissive licence) · get_code("43921a5397c18717")
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

ARGS = {
    "caption": "Hello world. This is a test.\nAnother line."
}
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
FromageModel Not yet run
unverified (harvested, no recorded run)
albertotestoni/ndq_visual_objects/fromage/fromage/models.py
code served (permissive licence) · get_code("89078d34c804bdb7")
How it ran

no invocation recorded.

FrozenArgs Not yet run
unverified (harvested, no recorded run)
albertotestoni/ndq_visual_objects/fromage/fromage/models.py
code served (permissive licence) · get_code("6d795e2eab6b7b69")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 4 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 2 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
collate_fn 15 other papers
2 dated earlier, 13 later
2003.04618 (2020-03)
Convolutional Occupancy Networks
2209.09552 (2022-09)
Cross-modal Learning for Image-Guided Point Cloud Shape Completion
2310.05473 (2023-10)
Sentence-level Prompts Benefit Composed Image Retrieval
and 12 more not named here
contrastive_loss 3 other papers
3 later
2312.02252 (2023-12)
StoryGPT-V: Large Language Models as Consistent Story Visualizers
2402.18695 (2024-02)
Grounding Language Models for Visual Entity Recognition
2602.19146 (2026-02)
VIGiA: Instructional Video Guidance via Dialogue Reasoning and Retrieval
pad_to_size 2 other papers
2 dated earlier
2112.05253 (2021-12)
MAGMA -- Multimodal Augmentation of Generative Models through Adapter-based Finetuning
2209.15162 (2022-09)
Linearly Mapping from Image to Text Space
scores_to_ranks 2 other papers
2 dated earlier
1912.02379 (2019-12)
Large-scale Pretraining for Visual Dialog: A Simple State-of-the-Art Baseline
2104.07511 (2021-04)
Ensemble of MRR and NDCG models for Visual Dialog

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

We propose an efficient method to ground pretrained text-only language models to the visual domain, enabling them to process arbitrarily interleaved image-and-text data, and generate text interleaved with retrieved images. Our method leverages the abilities of language models learnt from large scale text-only pretraining, such as in-context learning and free-form text generation. We keep the language model frozen, and finetune input and output linear layers to enable crossmodality interactions. This allows our model to process arbitrarily interleaved image-and-text inputs, and generate free-form text interleaved with retrieved images. We achieve strong zero-shot performance on grounded tasks such as contextual image retrieval and multimodal dialogue, and showcase compelling interactive abilities. Our approach works with any off-the-shelf language model and paves the way towards an effective, general solution for leveraging pretrained language models in visually grounded settings.

For agents

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

get_harvested_code_for_paper("2301.13823")
get_code_for_paper("2301.13823")
have("2301.13823")

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

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

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

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

Connect an agent — have() is free.