CLAIR : Evaluating Image Captions with Large Language Models (2023)

Abstract: The evaluation of machine-generated image captions poses an interesting yet persistent challenge. Effective evaluation measures must consider numerous dimensions of similarity, including semantic relevance, visual structure, object interactions, caption diversity, and specificity. Existing highly-engineered measures attempt to capture specific aspects, but fall short in providing a holistic score that aligns closely with human judgments. Here, we propose CLAIR, a novel method that leverages the zero-shot language modeling capabilities of large language models (LLMs) to evaluate candidate captions. In our evaluations, CLAIR demonstrates a stronger correlation with human judgments of caption quality compared to existing measures. Notably, on Flickr8K-Expert, CLAIR achieves relative correlation improvements over SPICE of 39.6% and over image-augmented methods such as RefCLIP-S of 18.3%. Moreover, CLAIR provides noisily interpretable results by allowing the language model to identify the underlying reasoning behind its assigned score.

## introduction & background automatically evaluating the quality of image captions is challenging. there are many dimensions to consider, such as grammatical quality, semantic relevance, correctness, and specificity, among others. to ensure fair evaluations, most image captioning works employ a suite of measures, each capturing different aspects. for instance, n-gram-based measures like bleu @xcite or @xcite broadly measure content overlap, spice @xcite compares scene graph structures, and clipscore, tifa, seetrue and vpeval @xcite you are trying to tell if a candidate set of captions is describing the same image as a reference set of captions. candidate set: {candidate captions} reference set: {reference captions} on a precise scale from 0 to 100, how likely is it that the candidate set is describing the same image as the reference set? (json format, with a key "score", value between 0 and 100, and a key "reason" with a string value.) figure 1 : clair: a (surprisingly simple) large language model-based measure for image caption evaluation. we find that clair not only correlates strongly with human judgments of caption quality but can also generate interpretable reasons for the generated scores. @xcite @xcite directly incorporate visual information. unfortunately, while significant strides have been made in automated evaluation, human preference studies remain the most reliable (yet costly) source of caption evaluation. fortunately, recent advances in large language models (llms) have opened new avenues for automatic evaluation. models trained with reinforcement learning from human feedback @xcite ) or similar methods are particularly useful for open-ended evaluation tasks, including image captioning, due to their explicit training to align with human preferences. in our work, paralleling several recent works which find that llms can act as effective "judges" for selecting the better answer from two candidates @xcite @xcite , we explore the ability of llms to evaluate caption quality in the multimodal setting. we introduce clair (criterion using language models for image caption rating), a measure which scores a candidate caption based on the likelihood that it describes the same image as a set of references by directly asking an llm to produce a numeric rating. we further query the llm to provide a reason for its score, providing a level of interpretability to the scalar rating. as far as we are aware, this is the first paper to explore replacing measures of semantic text quality with directly obtained llm judgments, however concurrently, @xcite have shown that directly providing an answer rating can align highly with human preferences on a range of standard language-based tasks, such as conversational instruction following. through several experiments on captioning datasets such as ms-coco @xcite , flickr8k @xcite , and pascal-50s @xcite , we find that clair correlates surprisingly well with human preferences, outperforming prior captioning measures. we additionally propose clair e , where we ensemble the outputs of several llms by taking the average score, leading to further improvements. despite a simple pipeline using an llm prompt with minimal output parsing, clair's strong correlation with human preferences suggests that it captures multiple dimensions of caption similarity at once -a feature that prior measures struggle to achieve alone. more generally, clair demonstrates how language-only models can evaluate vision-language tasks. we show llms can provide not only reliable scalar ratings but also corresponding reasoning for a given rating, offering a valuable combination of accuracy and interpretability. ## clair: llms for caption evaluation in clair, we adapt the zero-shot in-context learning approach described in @xcite to score candidate captions with large language models (llms). this involves converting the caption evaluation problem into a human-readable text completion task which is solved by the llm. using the prompt in figure 1 , clair first generates completions from the llm and then parses those completions into both candidate scores and an explainable reason for the score. we use a greedy sampling method (@xmath1, while acknowledging the inherent nondeterminism in llms (see section 4). clair's experimental implementation is surprisingly simple: it uses no in-context examples (is entirely zeroshot), and default inference parameters for the apis. see appendix b for further implementation details. the choice of language model directly affects the quality of the clair measure -more accurate models should produce evaluations that align better with human judgment. we explore three language models: gpt-3.5 (chatgpt) (openai, 2022), claude (instant) @xcite , and palm @xcite . unfortunately, we found for several open-weight language models including koala @xcite and vicuna @xcite that clair aligned poorly with human judgment. as clair is language model-agnostic, we can leverage the different distributions learned by each model and combine their decisions in an ensemble approach we term clair e . we calculate individual clair scores for each model and compute an unweighted average to obtain the ensemble score. ## evaluation & discussion to evaluate the quality of the measure, we run several evaluations that compare scores generated by clair to both human judgments of caption quality and other image captioning evaluation measures. we additionally provide several qualitative examples in figure 2 . a unique benefit of clair is that it provides not only numeric scores but is also introspectable, as it can identify which details in the candidate caption set match the reference set. ## limitations while clair correlates well with human judgments of caption quality, it has several limitations: non-determinism and parsing errors: because clair depends on the output of a language model, the measure can be non-deterministic and noisy. for instance, it may fail to elicit a judgment (e.g., "as an ai language model, i cannot see, and thus, cannot determine if the image captions match the references"), or rarely, generate malformed json output. to address these issues, we perform multiple queries to the llm, sometimes at higher temperatures if necessary. as a consequence, the measure may differ between runs, although we found the variance to be relatively insignificant (< 0.01 in many of the experiments). additionally, since the language models used are not open-source, the models are subject to arbitrary change, replacement, or removal, which limits the efficacy of the measure as a long-term comparable measurement. we hope that increasing open access to language models with efforts such as koala @xcite and vicuna @xcite , will help to alleviate these challenges in the future. increased cost: clair relies on language models which contain many billions of parameters. these language models have not only monetary cost but also human and environmental costs @xcite which can reduce its utility as a target during training, such as for self-critical sequence training @xcite . while api-based llms may be considered costly, even open-source llms have a cost (which can often be hard to quantify). clair on the ms-coco dataset uses an average of 226.148 tokens per sample (on openai's api), representing a cost of @xmath00.00033 per sample (gpt 3.5). for palm, this drops to $0.000113 per sample. we hope that over time, advances in llm inference (such as quantization and distillation), coupled with improvements in architecture will continue to yield lower-cost alternatives with strong performance on the caption evaluation task. hallucination: while clair does suffer from potential hallucination, we strongly believe that this weakness does not diminish the fact that clair still correlates strongly with human judgment. in clair, hallucinations in the score manifest as "incorrect" judgements of similarity, while hallucinations in the explanations manifest as poorly grounded explanations of the score/quality. hallucinations in the score should be considered false negatives (blind spots instead of hallucinations). in the case of hallucinations in the explanations, such hallucinations may lead to misinterpretation, but arguably less misinterpretation than a black box method, and may even indicate misunderstandings in the model. hallucination is a well-known challenge of current llms and is the subject of a great amount of research on instruction-tuning, rlhf, rlaif, and other methods. as hallucination and instruction-following performance of the base models improves, clair inherit similar improvements. explainability: while clair generates explanations for each rating, clair has no strict scoring rubric. much like human judgments, there is no direct way of attributing changes in score to changes in caption quality. for similar reasons, it is difficult to evaluate the quality of the generated explanations. qualitatively, the explanations are generally reasonable and consider multiple axes of judgment. ## conclusion this work introduces clair, an llm-based evaluation measure for image captioning. clair's superior performance compared to highlyengineered measures indicates a remarkable fact: llms are well aligned with human judgments of caption quality, even more so than some measures designed specifically for semantic similarity. clair is only a glimpse into how llms can be used for evaluation tasks, and image captioning is only the beginning. we hope that our work will inspire further exploration of similar measures in other vision and language domains, such as visual storytelling @xcite , where human evaluation of generated text remains a challenging task.