kosmos1-eval
Language Is Not All You Need: Aligning Perception with Language Models — Huang et al. (2023) (arXiv:2302.14045, 2023)
What this evaluates
Evaluates multimodal large language models on a comprehensive suite of perception-language, nonverbal reasoning, OCR-free text understanding, and web page comprehension tasks. It measures zero-shot and few-shot cross-modal transfer, in-context learning, and the ability to align visual perception with language generation without external tools or fine-tuning.
Datasets
- MS COCO Caption — total 123287; splits: train (113287), val (5000), test (5000)
- Flickr30k — total ?; splits: test (-1)
- VQAv2 — total ?; splits: test-dev (-1)
- VizWiz — total ?; splits: test-dev (-1)
- Raven IQ Test — total 50; splits: test (50); repo https://aka.ms/kosmos-iq50
- Rendered SST-2 — total ?; splits: test (-1)
- HatefulMemes — total ?; splits: validation (-1)
- WebSRC — total ?; splits: test (-1)
Metrics
CIDEr (primary) — range: [0, 100] (score)
- Consensus-based Image Description Evaluation. Computes n-gram similarity between generated captions and multiple ground-truth captions, weighted by inverse document frequency (IDF) scores across a reference corpus.
SPICE — range: [0, 1]
- Semantic Propositional Image Caption Evaluation. Matches semantic propositions (objects, attributes, relationships) between prediction and ground truth using a scene graph parser, reporting F1 scores.
VQA accuracy (primary) — range: [0, 100] (percent)
- Percentage of correctly answered questions. Predictions are normalized per VQAv2 rules, and up to 3 correct answers are accepted per question.
Accuracy — range: [0, 100] (percent)
- Fraction of instances where the predicted candidate or label exactly matches the ground truth. Used for Raven IQ and Rendered SST-2.
ROC AUC — range: [0, 1]
- Area under the Receiver Operating Characteristic curve, measuring binary classification performance on HatefulMemes.
Exact Match (EM) — range: [0, 100] (percent)
- Fraction of predictions that exactly match the reference answer string character-for-character.
F1 — range: [0, 100] (percent)
- Harmonic mean of token-level precision and recall for open-ended answers.
Input / output format
Input: Varies by task: (1) Image + text prompt (e.g., 'An image of', 'Question: {question} Answer: {answer}'); (2) Flattened matrix images + verbal instruction for IQ test; (3) Image of rendered text or web page layout. Resolution fixed at 224x224 for vision tasks.
Output: Natural language caption, short answer string, or probability distribution over candidate images/labels. For IQ test, model outputs 'Yes'/'No' probability for each candidate appended separately.
Scoring recipe
def score_task(task, preds, gold, config):
if task == 'captioning':
cider = compute_cider(preds, gold)
spice = compute_spice(preds, gold)
return cider, spice
elif task == 'vqa':
preds = [p.split('</s>')[0] for p in preds] # stop at EOS
preds = [normalize(p) for p in preds]
gold = [normalize(g) for g in gold]
correct = sum(1 for p in preds if p in gold)
return correct / len(preds)
elif task == 'iq_test':
probs = [model.predict_prob(cand, prompt) for cand in config['candidates']]
pred = config['candidates'][argmax(probs)]
return (pred == gold)
elif task in ['sst2', 'hatefulmemes', 'websrc']:
return compute_standard_metric(preds, gold, task)
Common pitfalls
- Using external OCR tools for OCR-free tasks violates the zero-shot setup and inflates performance.
- VQA answers must be truncated at the token before normalization and accuracy calculation.
- Few-shot settings sample demonstrations randomly from the training set, not the validation or test sets.
- Raven IQ evaluation appends each candidate separately and selects the one yielding the highest 'Yes' probability, rather than generating a direct answer.
Evidence (verbatim from paper)
We use COCOEvalCap to compute CIDEr and SPICE scores as the evaluation metrics. We follow the normalization rules of the VQAv2 evaluation code when computing the VQA accuracy. We evaluate the performance of VQA in an open-ended setting that Kosmos-1 generates answers and stops at the (“end of sequence”) token.
Citation
@misc{huang2023language,
title={Language Is Not All You Need: Aligning Perception with Language Models},
author={Huang et al. (2023)},
year={2023},
note={arXiv:2302.14045}
}
1---2name: kosmos1-eval3description: Evaluates multimodal large language models on a comprehensive suite of perception-language, nonverbal reasoning, OCR-free text understanding, and web page comprehension tasks. It measures zero-shot and few-shot cross-modal transfer, in-context learning, and the ability to align visual perception with language generation without external tools or fine-tuning. Use when the user wants to benchmark on MS COCO Caption, Flickr30k, VQAv2, VizWiz, Raven IQ Test, Rendered SST-2, HatefulMemes, WebSRC, or asks about evaluating this task. Reports CIDEr, VQA accuracy.4---56# kosmos1-eval78> Language Is Not All You Need: Aligning Perception with Language Models — Huang et al. (2023) (arXiv:2302.14045, 2023)910## What this evaluates1112Evaluates multimodal large language models on a comprehensive suite of perception-language, nonverbal reasoning, OCR-free text understanding, and web page comprehension tasks. It measures zero-shot and few-shot cross-modal transfer, in-context learning, and the ability to align visual perception with language generation without external tools or fine-tuning.1314## Datasets1516- **MS COCO Caption** — total 123287; splits: train (113287), val (5000), test (5000)17- **Flickr30k** — total ?; splits: test (-1)18- **VQAv2** — total ?; splits: test-dev (-1)19- **VizWiz** — total ?; splits: test-dev (-1)20- **Raven IQ Test** — total 50; splits: test (50); repo https://aka.ms/kosmos-iq5021- **Rendered SST-2** — total ?; splits: test (-1)22- **HatefulMemes** — total ?; splits: validation (-1)23- **WebSRC** — total ?; splits: test (-1)2425## Metrics2627- `CIDEr` **(primary)** — range: [0, 100] (score)28 - Consensus-based Image Description Evaluation. Computes n-gram similarity between generated captions and multiple ground-truth captions, weighted by inverse document frequency (IDF) scores across a reference corpus.29- `SPICE` — range: [0, 1]30 - Semantic Propositional Image Caption Evaluation. Matches semantic propositions (objects, attributes, relationships) between prediction and ground truth using a scene graph parser, reporting F1 scores.31- `VQA accuracy` **(primary)** — range: [0, 100] (percent)32 - Percentage of correctly answered questions. Predictions are normalized per VQAv2 rules, and up to 3 correct answers are accepted per question.33- `Accuracy` — range: [0, 100] (percent)34 - Fraction of instances where the predicted candidate or label exactly matches the ground truth. Used for Raven IQ and Rendered SST-2.35- `ROC AUC` — range: [0, 1]36 - Area under the Receiver Operating Characteristic curve, measuring binary classification performance on HatefulMemes.37- `Exact Match (EM)` — range: [0, 100] (percent)38 - Fraction of predictions that exactly match the reference answer string character-for-character.39- `F1` — range: [0, 100] (percent)40 - Harmonic mean of token-level precision and recall for open-ended answers.4142## Input / output format4344**Input**: Varies by task: (1) Image + text prompt (e.g., 'An image of', 'Question: {question} Answer: {answer}'); (2) Flattened matrix images + verbal instruction for IQ test; (3) Image of rendered text or web page layout. Resolution fixed at 224x224 for vision tasks.4546**Output**: Natural language caption, short answer string, or probability distribution over candidate images/labels. For IQ test, model outputs 'Yes'/'No' probability for each candidate appended separately.4748## Scoring recipe4950```python51def score_task(task, preds, gold, config):52 if task == 'captioning':53 cider = compute_cider(preds, gold)54 spice = compute_spice(preds, gold)55 return cider, spice56 elif task == 'vqa':57 preds = [p.split('</s>')[0] for p in preds] # stop at EOS58 preds = [normalize(p) for p in preds]59 gold = [normalize(g) for g in gold]60 correct = sum(1 for p in preds if p in gold)61 return correct / len(preds)62 elif task == 'iq_test':63 probs = [model.predict_prob(cand, prompt) for cand in config['candidates']]64 pred = config['candidates'][argmax(probs)]65 return (pred == gold)66 elif task in ['sst2', 'hatefulmemes', 'websrc']:67 return compute_standard_metric(preds, gold, task)68```6970## Common pitfalls7172- Using external OCR tools for OCR-free tasks violates the zero-shot setup and inflates performance.73- VQA answers must be truncated at the </s> token before normalization and accuracy calculation.74- Few-shot settings sample demonstrations randomly from the training set, not the validation or test sets.75- Raven IQ evaluation appends each candidate separately and selects the one yielding the highest 'Yes' probability, rather than generating a direct answer.7677## Evidence (verbatim from paper)7879> We use COCOEvalCap to compute CIDEr and SPICE scores as the evaluation metrics. We follow the normalization rules of the VQAv2 evaluation code when computing the VQA accuracy. We evaluate the performance of VQA in an open-ended setting that Kosmos-1 generates answers and stops at the </s> (“end of sequence”) token.8081## Citation8283```bibtex84@misc{huang2023language,85 title={Language Is Not All You Need: Aligning Perception with Language Models},86 author={Huang et al. (2023)},87 year={2023},88 note={arXiv:2302.14045}89}90```9192- arXiv: 2302.14045