NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Teaching Captioners to Name What They See, Not What They Expect

Image captioners trained on one dataset often fail on another in a specific way. Shown a photo of an object they never saw during caption training, such as a harp, they often do not fall silent. They describe something familiar that the training captions made likely, such as "a woman playing a guitar." This proposal argues that a large share of the well-documented drop on out-of-domain images is this kind of substitution. The language half of the model overrides what the vision half already perceives. The proposal attacks the substitution at its source. During training, at the positions in a reference caption that carry visual content (nouns, adjectives, content verbs), the decoder is required to be measurably more confident with the image than without it. At function words like "the" and "of" it is left free to lean on grammar.

The work has two parts. The first is a cross-dataset diagnostic. It splits the out-of-domain drop into three causes: perception failures (the image encoder never registered the object), omissions (it registered it but the caption skipped it), and substitutions (the caption named a familiar wrong object instead). The second is a training-time regularizer that uses part-of-speech tags, the grammatical labels such as noun or article, only to decide where image dependence is enforced. It adds no inference cost. The test is whether the regularizer reduces substitutions on held-out corpora more than inference-time fixes and syntax-guided decoders do, without the fluency loss that discriminative training pays.

Core Claim

The claim has two parts, and each can be falsified on its own. The diagnostic part says that on the out-of-domain split of nocaps, a meaningful fraction of the gap to humans comes from substituting in-vocabulary objects. That gap is 66.7 CIDEr for the best reported baseline against 91.6 for humans, where CIDEr is the standard score of n-gram overlap with human references. The diagnostic further says these substitutions occur even when a simple linear probe on the frozen image features can detect the novel object. The method part says this substitution can be reduced at its source. The regularizer is a hinge penalty on the gap between the decoder's log-probability of each reference content word with and without the image:

$$ \mathcal{L} = \mathcal{L}_{\text{MLE}} + \lambda \sum_{t \in C} \max\Big(0,\; m - \big[\log p(w_t \mid w_{<t}, v) - \log p(w_t \mid w_{<t}, \varnothing)\big]\Big) $$

Here $\mathcal{L}_{\text{MLE}}$ is ordinary next-word cross-entropy. $w_t$ is the reference word at position $t$, and $w_{<t}$ are the words before it. $v$ is the image features and $\varnothing$ is a null visual input, meaning zeroed cross-attention keys. $C$ is the set of positions that an off-the-shelf part-of-speech tagger marks as content words in the reference caption. $m$ is a margin and $\lambda$ a weight. The tags come from the reference text, so no tag predictor exists at inference time and decoding costs exactly what the base model costs.

Relation to Prior Work

Three papers motivate the proposal by documenting the problem from different sides. nocaps built the in-, near-, and out-of-domain splits and showed that oracle object detections do not close the human gap. That points to integrating detections into language, not to perception, as the bottleneck. It measured this only with overlap metrics, so it cannot say whether the failures are omissions or substitutions. Object Hallucination in Image Captioning introduced CHAIR, the fraction of mentioned objects that are not in the image. It reported rates of 7.4% to 17.7% on COCO and showed that CIDEr-optimized training raises them, but the measure was restricted to COCO's 80 classes and in-domain images. ScaleCap argues for an "integration bottleneck" in large vision-language models. In contrast, Visual Contrastive Decoding treats prior dominance as triggered by degraded perception. The diagnostic here is designed to settle which view holds under dataset shift, using a perception probe kept separate from the caption.

Two lines of work supply the mechanism we reuse. The image-versus-no-image contrast is taken from VCD, which subtracts logits from a noise-corrupted image at every decoding step, and from ScaleCap's Contrastive Sentence Rating, which discards whole sentences that are probable without the image. Both act at inference, on every token or every sentence, and leave the model unchanged. We move the contrast into training and restrict it to content positions. The idea of treating syntax and semantics differently comes from the Part-of-Speech-Guided Transformer, which predicts the next word's tag and shifts attention toward the image for nouns and verbs. It also comes from syntactic planning work, which showed that interleaving tags with words improves Recall@5 on held-out adjective–noun pairs by over 2 points. Both changed where the model looks. Neither penalized the model for not needing the image, and both evaluated only within COCO or Flickr30k separately. Our use of tags is deliberately minimal: they mark where the penalty applies and do nothing else.

Two papers constrain the design. DiscriTune rewards captions that let a frozen CLIP retriever find the target image. It transfers well across corpora, for example 36.2% versus a previous 29.9% on ImageCoDe, but it loses CIDEr and inherits CLIP's blind spots. That is a warning against any objective defined by an external model, and it is why our signal is the captioner's own likelihood. Compositional Feature Alignment shows that pooled fine-tuning entangles domain and class features, and it requires domain labels and classification heads. We do not adopt it, because captioning corpora lack clean domain labels. We cite it as the reason pooled multi-dataset fine-tuning is not assumed to be a safe default.

Research Program

The base model is a SmallCap-style captioner: a frozen CLIP image encoder and a frozen GPT-2 decoder, with only cross-attention trained. We run it both with and without its retrieval prompts. This setup is cheap, retraining is fast, and the frozen encoder makes the perception probe meaningful, because the features cannot change during caption training. All models train on COCO Karpathy-split captions only.

The diagnostic has three steps. First, we extend CHAIR to the Open Images vocabulary used by nocaps through a synonym map. Second, we label each nocaps validation caption's object mentions as correct, substituted, or hallucinated against the image-level Open Images labels. A substitution is a mention of a COCO class absent from the image while an unmentioned novel class is present. Third, we train a linear probe on frozen CLIP features to detect each novel class, using Open Images images disjoint from nocaps. Combining these three, every missed novel object is assigned to perception failure (the probe misses it), omission, or substitution. We report this breakdown per split for every system.

The method comparison trains the regularized model at a small grid of margins and weights. The tuning budget is the same as every trained baseline's, and selection uses COCO validation only. Using the target corpora for tuning would contaminate the cross-dataset claim.

Baselines

The naive reference point is the same base captioner trained with plain cross-entropy on COCO and evaluated zero-shot elsewhere, with greedy and beam decoding. Every effect is measured against it. If the regularizer does not reduce substitutions relative to this model, the idea fails.

The strongest reported number in the file for this setting is Up-Down with ELMo and Constrained Beam Search from nocaps. It scores 73.1 overall and 66.7 out-of-domain CIDEr. We cite these figures as the published reference but do not treat them as directly comparable, since that system uses older features and test-server evaluation. We re-run constrained beam search on our base model, with constraint words taken from a novel-class detector, so the comparison shares an encoder. SmallCap with web and human datastores is reported to beat OSCAR-Large on nocaps, but no exact number was found on Lacuna for it. We therefore re-run SmallCap retrieval with the same COCO-only datastore our models use, plus a variant with a broader datastore that we report separately as a different data condition.

The most direct competitor is VCD applied to the same base model. It has the same contrast, at inference, on all tokens, at double the per-token cost. Its reported gains, +7.4 POPE F1 and an MME rise from 565 to 604 on LLaVA-1.5, come from question-answering benchmarks, not captioning transfer. We tune its contrast strength and plausibility threshold on COCO validation with the same budget as our margin and weight. We also run a part-of-speech-gated attention decoder in the style of the Part-of-Speech-Guided Transformer, whose reported COCO CIDEr is 1.299 in-domain, and DiscriTune on the same base model. Beating these baselines means a lower substitution rate and lower extended CHAIR on nocaps out-of-domain, at out-of-domain CIDEr no worse than the naive model and within a small tolerance of VCD, with no added inference cost.

Two ablations isolate the key ingredient. The first applies the hinge penalty at every position instead of only content positions. If this matches the full method, the part-of-speech restriction is unnecessary. If it hurts fluency or CIDEr, the restriction is earning its place. The second replaces the margin penalty with simple random visual-token dropout during training. This checks whether any perturbation of image reliance, rather than the targeted contrast, produces the effect.

Why not just…?

Why not just use visual contrastive decoding at inference? This is the real threat. It applies the same image-versus-no-image contrast and needs no training. If VCD on our base model matches the regularizer's substitution reduction, the honest conclusion is that the training-time version buys only speed. VCD doubles per-token forward passes, while the regularizer costs nothing at inference. The head-to-head on nocaps out-of-domain substitution rate settles the question. We also expect a qualitative difference: VCD can only re-rank words the model already considers, while training can raise the probability of novel nouns the frozen decoder knows from pretraining. The diagnostic will show whether that difference appears.

Why not just swap the retrieval datastore? SmallCap shows that a richer datastore improves nocaps. However, retrieved captions come from similar-looking images and can bring in exactly the familiar wrong nouns that substitution consists of. We run retrieval with and without the regularizer. If retrieval alone removes substitution, the substitution breakdown will show it. If the two combine additively, they are complements rather than rivals.

Why not just force detected words in with constrained beam search? nocaps reports that constrained beam search produces disfluent phrases, needs hand-built blacklists, and still leaves a 66.7 versus 91.6 out-of-domain gap. It also depends on an external detector's vocabulary. Our re-run with the shared encoder tests whether forced inclusion reduces substitution or merely adds the novel word next to the wrong familiar one. Extended CHAIR detects the second outcome.

Why not just fine-tune on pooled multi-domain data? Pooling requires captioned target-domain data, which the cross-dataset setting forbids. Compositional Feature Alignment also shows that pooled fine-tuning entangles domain with content in classifiers. We do not run pooling as a main baseline, for the first reason. We note it as out of scope rather than defeated.

Proposed Experiments and Decisive Checks

Evaluation covers four test sets. The nocaps validation in-, near-, and out-of-domain splits use CIDEr, SPICE, extended CHAIR, substitution rate, and novel-object recall. Flickr30k measures a mild style shift. VizWiz measures image-quality shift. COCO Karpathy test measures in-domain fluency and standard CHAIR.

The first decisive check is the diagnostic. If substitutions are a small share of missed novel objects on the naive model, and perception failures dominate, the premise is wrong and the regularizer should not help. We would then report the decomposition as the finding, which addresses whether the bottleneck is perception or integration across nocaps, ScaleCap, and VCD.

The second check is that the regularizer's reduction in substitutions should grow from in-domain to out-of-domain. A uniform improvement would suggest generic regularization, not a fix to transfer.

The third check is VizWiz. Its shift comes mostly from blur and framing rather than novel vocabulary, so we predict a smaller benefit there. A large gain on VizWiz would mean the mechanism is something other than substitution, and we would report it as such.

The fourth check is the all-positions ablation together with fluency on COCO. It determines whether limiting the penalty to content words is what allows grounding to improve without the CIDEr loss that DiscriTune incurs.