Two models working together
A captioning system has two parts. The vision encoder turns the image into a compact set of features — a numerical summary of what is visible. The language model takes those features and generates a sentence word by word. At each step it conditions on both the visual features and the words already produced, so the sentence stays connected to the image.
Generating a caption step by step
Suppose the image shows a dog jumping over a log. The model might generate: start → "a" → "dog" → "jumping" → "over" → "a" → "log" → end. Each word is chosen based on the visual features and the words so far. If the visual features are weak on the log, the model might still produce "a dog jumping" and stop, or produce a plausible but incorrect ending. The fluency of the sentence does not guarantee its accuracy.
Why captions can be confidently wrong
The language model is optimized to produce fluent, likely sentences. If the visual signal is ambiguous or the model has a strong prior from training, it can generate a sentence that reads well but misdescribes the image. Caption quality depends on both the visual features and the language model's tendency to stay faithful to them.