SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2309.09812 · 2023

R2GenGPT: Radiology Report Generation with Frozen LLMs

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/2309.09812.json · badge: /api/ran/2309.09812.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
wang-zhanyu/r2gengpt canonical (classifier label)
classifier basis: census
11 ran · 2 no recorded run
FunctionStatusWhere it lives
cook_refs Ran
ran; our contract draft was wrong, not the code
wang-zhanyu/r2gengpt/evalcap/cider/cider_scorer.py
pointer only (licence: BSD-3-Clause); the stored copy get_code serves, from wenhuchen/data-to-text-evaluation-metric, is pointer only (licence: NOASSERTION) · get_code("4c1b107103b7c856")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (BSD-3-Clause), but get_code serves the stored copy, first harvested from wenhuchen/data-to-text-evaluation-metric, 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.

cook_refs Ran
ran; our contract draft was wrong, not the code
wang-zhanyu/r2gengpt/evalcap/bleu/bleu_scorer.py
code served (permissive licence) · get_code("7586e1d32f7325f7")
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 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.

from collections import defaultdict

ARGS = {
    'refs': [
        'the quick brown fox jumps over the lazy dog',
        'a quick brown fox leaps over a lazy dog'
    ],
    'eff': 'shortest',
    'n': 4
}
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 tuple, ndim 1, dtype family float — 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
cook_test Ran
ran; our contract draft was wrong, not the code
wang-zhanyu/r2gengpt/evalcap/cider/cider_scorer.py
pointer only (licence: BSD-3-Clause); the stored copy get_code serves, from wenhuchen/data-to-text-evaluation-metric, is pointer only (licence: NOASSERTION) · get_code("3573c4bc85f65dfd")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (BSD-3-Clause), but get_code serves the stored copy, first harvested from wenhuchen/data-to-text-evaluation-metric, 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.

cook_test Ran
ran; our contract draft was wrong, not the code
wang-zhanyu/r2gengpt/evalcap/bleu/bleu_scorer.py
code served (permissive licence) · get_code("7ac8f8f3cb7d5bc6")
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 dict. 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 collections import defaultdict

# First, let's understand what cook_test needs:
# - test: a string (test sentence)
# - crefs: a tuple of (reflen, refmaxcounts)
#   - reflen: a list of reference lengths
#   - refmaxcounts: a defaultdict of ngram counts
# - eff: optional string parameter (can be 'closest' or None)
# - n: integer for n-gram size (default 4)

# Build crefs by precooking reference sentences
def precook(s, n=4, out=False):
    """Takes a string as input and returns an object that can be given to
    either cook_refs or cook_test. This is optional: cook_refs and cook_test
    can take string arguments as well."""
    words = s.split()
    counts = defaultdict(int)
    for k in range(1, n + 1):
        for i in range(len(words) - k + 1):
            ngram = tuple(words[i:i + k])
            counts[ngram] += 1
    return (len(words), counts)

# Create reference sentences
ref1 = "the cat sat on the mat"
ref2 = "a cat is sitting on a mat"

# Precook references to get their lengths and ngram counts
ref1_precooked = precook(ref1, n=4)
ref2_precooked = precook(ref2, n=4)

# Combine reference lengths and max counts
reflen = [ref1_precooked[0], ref2_precooked[0]]
refmaxcounts = defaultdict(int)
for ngram, count in ref1_precooked[1].items():
    refmaxcounts[ngram] = max(refmaxcounts[ngram], count)
for ngram, count in ref2_precooked[1].items():
    refmaxcounts[ngram] = max(refmaxcounts[ngram], count)

crefs = (reflen, refmaxcounts)

# Create a test sentence
test = "the cat sat on the mat"

# Create eff parameter
eff = 'closest'

# Create n parameter
n = 4

ARGS = {
    'test': test,
    'crefs': crefs,
    'eff': eff,
    'n': n
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
dec Ran
ran; our contract draft was wrong, not the code
wang-zhanyu/r2gengpt/evalcap/meteor/meteor.py
pointer only (licence: BSD-3-Clause); the stored copy get_code serves, from Maluuba/nlg-eval, is pointer only (licence: NOASSERTION) · get_code("ba9348aac71a3f72")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (BSD-3-Clause), but get_code serves the stored copy, first harvested from Maluuba/nlg-eval, 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.

enc Ran
ran; our contract draft was wrong, not the code
wang-zhanyu/r2gengpt/evalcap/meteor/meteor.py
pointer only (licence: BSD-3-Clause); the stored copy get_code serves, from Maluuba/nlg-eval, is pointer only (licence: NOASSERTION) · get_code("eaab50b5d9fea58a")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (BSD-3-Clause), but get_code serves the stored copy, first harvested from Maluuba/nlg-eval, 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.

get_linear_schedule_with_warmup Ran
ran; our contract draft was wrong, not the code
wang-zhanyu/r2gengpt/lightning_tools/optim.py
code served (permissive licence) · get_code("b2cebd35fd97df2a")
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 LambdaLR. 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 torch.optim import SGD

torch.manual_seed(0)

# Create a simple model
model = nn.Linear(4, 3)

# Create an optimizer
optimizer = SGD(model.parameters(), lr=0.1)

# Define arguments for get_linear_schedule_with_warmup
ARGS = {
    "optimizer": optimizer,
    "num_warmup_steps": 100,
    "num_training_steps": 1000,
    "last_epoch": -1,
}
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 LambdaLR — a LambdaLR output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a LambdaLR 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
lr_lambda Ran
ran, honoured the contract we drafted
wang-zhanyu/r2gengpt/lightning_tools/optim.py
code served (permissive licence) · get_code("d5b1a71db63d18e1")
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. 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)

ARGS = {
    "current_step": 5,
    "num_warmup_steps": 10,
    "num_training_steps": 100
}
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
my_lcs Ran
ran, honoured the contract we drafted
wang-zhanyu/r2gengpt/evalcap/rouge/rouge.py
pointer only (licence: BSD-3-Clause); the stored copy get_code serves, from alex-haochenli/reco, is pointer only (licence: NONE) · get_code("d6f215d655a876ee")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (BSD-3-Clause), but get_code serves the stored copy, first harvested from alex-haochenli/reco, 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.

precook Ran
ran; our contract draft was wrong, not the code
wang-zhanyu/r2gengpt/evalcap/bleu/bleu_scorer.py
code served (permissive licence) · get_code("ec4448373d72d636")
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 tuple, 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.

ARGS = {
    "s": "the quick brown fox jumps over the lazy dog",
    "n": 4,
    "out": False
}
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 tuple, ndim 1, dtype family float — 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
precook Ran
ran; our contract draft was wrong, not the code
wang-zhanyu/r2gengpt/evalcap/cider/cider_scorer.py
pointer only (licence: BSD-3-Clause); the stored copy get_code serves, from wenhuchen/data-to-text-evaluation-metric, is pointer only (licence: NOASSERTION) · get_code("9560e3e3e41bc1b2")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (BSD-3-Clause), but get_code serves the stored copy, first harvested from wenhuchen/data-to-text-evaluation-metric, 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_callbacks Not yet run
unverified (harvested, no recorded run)
wang-zhanyu/r2gengpt/lightning_tools/callbacks.py
code served (permissive licence) · get_code("19fe2eef2172c7b6")
How it ran

no invocation recorded.

create_datasets Not yet run
unverified (harvested, no recorded run)
wang-zhanyu/r2gengpt/dataset/data_helper.py
code served (permissive licence) · get_code("09f67cc7856cfd02")
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, 12 are also present in other papers whose code we hold (8 with at least one paper dated earlier, 0 the same month, 12 later) and 1 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
cook_refs 25 other papers
14 dated earlier, 10 later, 1 same year, order not determinable
1411.5726 (2014-11)
CIDEr: Consensus-based Image Description Evaluation
1502.03044 (2015-02)
Show, Attend and Tell: Neural Image Caption Generation with Visual Attention
1503.01817 (2015-03)
YFCC100M: The New Data in Multimedia Research
and 22 more not named here
cook_test 22 other papers
12 dated earlier, 9 later, 1 same year, order not determinable
1411.5726 (2014-11)
CIDEr: Consensus-based Image Description Evaluation
1502.03044 (2015-02)
Show, Attend and Tell: Neural Image Caption Generation with Visual Attention
1503.01817 (2015-03)
YFCC100M: The New Data in Multimedia Research
and 19 more not named here
precook 22 other papers
16 dated earlier, 6 later
1411.4555 (2014-11)
Show and Tell: A Neural Image Caption Generator
1502.03044 (2015-02)
Show, Attend and Tell: Neural Image Caption Generation with Visual Attention
1611.09268 (2016-11)
MS MARCO: A Human Generated MAchine Reading COmprehension Dataset
and 19 more not named here
cook_refs 21 other papers
15 dated earlier, 6 later
1502.03044 (2015-02)
Show, Attend and Tell: Neural Image Caption Generation with Visual Attention
1611.09268 (2016-11)
MS MARCO: A Human Generated MAchine Reading COmprehension Dataset
1611.09571 (2016-11)
Predicting Human Eye Fixations via an LSTM-based Saliency Attentive Model
and 18 more not named here
precook 14 other papers
6 dated earlier, 7 later, 1 same year, order not determinable
1411.5726 (2014-11)
CIDEr: Consensus-based Image Description Evaluation
1502.03044 (2015-02)
Show, Attend and Tell: Neural Image Caption Generation with Visual Attention
1806.00807 (2018-06)
Learning Semantic Sentence Embeddings using Sequential Pair-wise Discriminator
and 11 more not named here
my_lcs 7 other papers
6 dated earlier, 1 later
1503.01817 (2015-03)
YFCC100M: The New Data in Multimedia Research
1608.00272 (2016-08)
Modeling Context in Referring Expressions
1802.06842 (2018-02)
Zero-Shot Question Generation from Knowledge Graphs for Unseen Predicates and Entity Types
and 4 more not named here
dec 4 other papers
3 dated earlier, 1 later
1706.09799 (2017-06)
Relevance of Unsupervised Metrics in Task-Oriented Dialogue for Evaluating Natural Language Generation
2109.08365 (2021-09)
CodeQA: A Question Answering Dataset for Source Code Comprehension
2022.findings-naacl.160 (2022 (year only))
Learning Structural Information for Syntax-Controlled Paraphrase Generation
and 1 more not named here
enc 4 other papers
3 dated earlier, 1 later
1706.09799 (2017-06)
Relevance of Unsupervised Metrics in Task-Oriented Dialogue for Evaluating Natural Language Generation
2109.08365 (2021-09)
CodeQA: A Question Answering Dataset for Source Code Comprehension
2022.findings-naacl.160 (2022 (year only))
Learning Structural Information for Syntax-Controlled Paraphrase Generation
and 1 more not named here
add_callbacks 1 other paper
1 later
aaai_32596 (2025 (year only))
HC-LLM: Historical-Constrained Large Language Models for Radiology Report Generation
create_datasets 1 other paper
1 later
aaai_32596 (2025 (year only))
HC-LLM: Historical-Constrained Large Language Models for Radiology Report Generation
get_linear_schedule_with_warmup 1 other paper
1 later
aaai_32596 (2025 (year only))
HC-LLM: Historical-Constrained Large Language Models for Radiology Report Generation
lr_lambda 1 other paper
1 later
aaai_32596 (2025 (year only))
HC-LLM: Historical-Constrained Large Language Models for Radiology Report Generation

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

Large Language Models (LLMs) have consistently showcased remarkable generalization capabilities when applied to various language tasks. Nonetheless, harnessing the full potential of LLMs for Radiology Report Generation (R2Gen) still presents a challenge, stemming from the inherent disparity in modality between LLMs and the R2Gen task. To bridge this gap effectively, we propose R2GenGPT, which is a novel solution that aligns visual features with the word embedding space of LLMs using an efficient visual alignment module. This innovative approach empowers the previously static LLM to seamlessly integrate and process image information, marking a step forward in optimizing R2Gen performance. R2GenGPT offers the following benefits. First, it attains state-of-the-art (SOTA) performance by training only the lightweight visual alignment module while freezing all the parameters of LLM. Second, it exhibits high training efficiency, as it requires the training of an exceptionally minimal number of parameters while achieving rapid convergence. By employing delta tuning, our model only trains 5M parameters (which constitute just 0.07\% of the total parameter count) to achieve performance close to the SOTA levels. Our code is available at https://github.com/wang-zhanyu/R2GenGPT.

For agents

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

get_harvested_code_for_paper("2309.09812")
get_code_for_paper("2309.09812")
have("2309.09812")

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

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

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

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

Connect an agent — have() is free.