BLIP3o-Recap / README.md
zli12321's picture
Document the Gemma 3 4B IT recaptions
da1c740 verified
|
Raw History Blame Contribute Delete
10.6 kB
metadata
license: apache-2.0
task_categories:
  - image-to-text
size_categories:
  - 1M<n<10M
pretty_name: BLIP3o Recap 1M
configs:
  - config_name: default
    data_files:
      - split: train
        path: '*.tar'

BLIP3o-Recap

1,000,000 image–caption pairs sampled from BLIP3o/BLIP3o-Pretrain-Long-Caption at revision e4d07091a466d1a1e35a9b0c61caddc78d14a059.

The source dataset has about 27.2 million images, each with a long caption (about 120 tokens) produced by Qwen2.5-VL-7B-Instruct. This repo is a fixed 1,000,000-pair subset of those existing pairs. The captions in the tars were not regenerated; two new captions per image are provided separately in recaptions/ (see Recaptions).

Sampling

Shards were taken at even intervals from each of the three webdataset groups, so the subset is spread across the corpus.

Group Shards kept Pairs
sa_*.tar 36 402,626
webdataset_shard_*.tar 52 498,922
webdataset_JDB_*.tar 10 98,452
Total 98 1,000,000

webdataset_JDB_270_part.tar contains the first 8,469 pairs from source shard webdataset_JDB_270.tar. Every other shard is an unchanged copy of the source file. Per-shard counts are in subset_manifest.json.

Format

Each shard is a WebDataset tar. An example is two files that share a key:

  • <key>.jpg
  • <key>.txt (the long caption)

Load

from datasets import load_dataset

ds = load_dataset(
    "webdataset",
    data_files="https://huggingface.co/datasets/IntelligenceLab/BLIP3o-Recap/resolve/main/*.tar",
    split="train",
)

For local files:

import glob
from datasets import load_dataset

ds = load_dataset("webdataset", data_files=glob.glob("/path/to/shards/*.tar"), split="train")

Recaptions

recaptions/<shard>.parquet holds, for every image of <shard>.tar (same order, 1,000,000 rows in total), the original caption and two new captions written by Qwen2.5-VL-3B-Instruct. The images are not duplicated; join on key.

Column Content
key example key in the tar (<key>.jpg)
source_shard tar file name
orig_caption the original <key>.txt caption
recap_1, recap_2 two new captions, one paragraph each
from datasets import load_dataset

recaps = load_dataset(
    "parquet",
    data_files="hf://datasets/IntelligenceLab/BLIP3o-Recap/recaptions/*.parquet",
    split="train",
)

Generation

  • Model: Qwen/Qwen2.5-VL-3B-Instruct, vLLM 0.31.0, bf16, images capped at 640×28×28 pixels.
  • Code: code/recaption.py (run, fix, stats, export) and code/launch.sh (one worker per GPU).
  • Both captions are two samples (n=2) of the same prompt: temperature 0.8, top-p 0.9, at most 160 new tokens.
  • Prompt (verbatim):
System: You are an image captioner. Describe only what is visible.

User: Describe this image in ONE paragraph of 70–90 words.
Order: main subject(s) (count, category, color, size, pose/action) → spatial relations (left/right, front/behind, near/far) → background and setting → lighting, viewpoint, and medium (photo, illustration, 3D render, etc.).
Rules:
- Start directly with the main subject. Never begin with "The image", "This picture", "In this photo", or similar.
- State only what is clearly visible. No guesses ("likely", "possibly", "suggesting", "appears to be"), no mood words ("serene", "vibrant", "charming", "picturesque"), no interpretation of purpose or meaning.
- Quote visible text only if it is legible.
- No lists, no line breaks, no concluding summary sentence.

Constraints and filtering

The 3B model ignores parts of the prompt (without intervention about 60% of captions start with "The image …" and about 80% contain a banned word), so the rules are also enforced while decoding and checked afterwards.

Banned while decoding (every casing and leading-space token form, through vLLM bad_words and logit_bias):

  • words from the prompt: likely, possibly, appears, suggesting, serene, vibrant, charming, picturesque;
  • their inflections and the substitutes the model switched to: appear(ed/ing), suggest(s/ed), seem(s/ed/ingly), indicat(e/es/ed/ing/ive), perhaps, probably, might, possible, potentially, presumably, apparently, supposedly, hint(s/ing), impl(ies/ying), impression;
  • mood and interpretive words: tranquil, peaceful, idyllic, cozy, inviting, stunning, breathtaking, bustling, overall, atmosphere, ambiance, ambience, calm, lively, festive, scenic, striking, dramatic, majestic, grand, dynamic, typical, emphasiz(e/es/ed/ing), enjoy(s/ing), welcoming, relax(ed/ing), pleasant, playful, harmonious, elegant, whimsical, energetic, cheerful, celebratory, celebrating, intimate, aesthetic, iconic, mood, moody;
  • phrases: "creating a", "sense of", "giving a / it / the scene / the image", "adding a", "natural beauty", "looks like", "what looks", "could be", "may be";
  • openers: "The / This / These" + image, picture, photo, photograph, scene, illustration, snapshot; "In this", "In the image / picture / photo"; and "The", "This", "These" as the first word.

Rejected and resampled (up to 3 times): an opener or banned word outside quotes (quoted visible text is kept verbatim), a line break or list, fewer than 60 words, or Chinese / Japanese / Korean characters outside quotes (the model sometimes drifts into Chinese mid-sentence). A caption cut off at 160 tokens keeps its complete sentences. There is no upper word limit.

The banned list grew in three rounds while inspecting outputs; after the main run, every caption that violated the final rules (110,176 of 2,000,000) was regenerated with the final rules. No other caption was changed.

Statistics

captions that still violate a rule 0.02% (439 images)
words per caption (p5 / median / p95) 63 / 81 / 108
recap_1 vs recap_2, same image: bigram Jaccard / ROUGE-L 0.157 / 0.394
recap_1 vs recap_2, different images: bigram Jaccard / ROUGE-L 0.041 / 0.231
recap_1 vs original caption: bigram Jaccard / ROUGE-L 0.091 / 0.289

The two captions of an image share the prompt's fixed sentence order but differ in wording and detail; on average 57% of the content words of recap_2 do not occur in recap_1.

Known limitations

These are small-model captions. A manual check of 16 captions found the main subject, colors, setting, medium and legible text correct in all of them, but about a third had one wrong secondary detail: left/right or front/back orientation, an object count, or an invented small object. The two captions of an image rarely make the same error. Some interpretive phrasing that is not on the banned lists remains.

Qwen3-VL-8B recaptions

qwen3-vl-8b-recaptions/<shard>.parquet holds one new caption for each of the first 500,000 images (subset index 0–499,999). The captions were written by Qwen/Qwen3-VL-8B-Instruct. See qwen3-vl-8b-recaptions/README.md for columns and the generation setup. Join on key.

from datasets import load_dataset

qwen3 = load_dataset(
    "parquet",
    data_files="hf://datasets/IntelligenceLab/BLIP3o-Recap/qwen3-vl-8b-recaptions/*.parquet",
    split="train",
)

Gemma-4-12B recaptions

gemma-4-12b-recaptions/<shard>.parquet has the same layout as recaptions/ (same columns, same order, 1,000,000 rows), but both new captions were written by google/gemma-4-12B-it. Join on key.

from datasets import load_dataset

gemma = load_dataset(
    "parquet",
    data_files="hf://datasets/IntelligenceLab/BLIP3o-Recap/gemma-4-12b-recaptions/*.parquet",
    split="train",
)

Generation

Same code, prompt, sampling (n=2, temperature 0.8, top-p 0.9, at most 160 new tokens), decode-time bans and reject/resample filter as the Qwen2.5-VL-3B recaptions above, with these differences:

  • --model google/gemma-4-12B-it; the prompt is rendered with Gemma's own chat template (thinking off), and images use Gemma's default processing (no 640×28×28 cap).
  • Gemma follows "count first" literally and started 61% of captions with "One …", so a caption-initial "One" is also banned (the captions then start with "A …").
  • 12 A100 GPUs, about 9 images/s per GPU. Almost no samples were rejected.

Statistics

captions that still violate a rule 1 (a 54-word caption of a text-only image, below the 60-word minimum)
words per caption (p5 / median / p95) 80 / 84 / 91
bert-large-uncased tokens incl. [CLS]/[SEP] (p5 / median / p95 / p99 / max) 99 / 106 / 117 / 126 / 188
recap_1 vs recap_2, same image: bigram Jaccard / ROUGE-L 0.246 / 0.522
recap_1 vs recap_2, different images: bigram Jaccard / ROUGE-L 0.039 / 0.211
recap_1 vs original caption: bigram Jaccard / ROUGE-L 0.060 / 0.242
Gemma recap_1 vs Qwen2.5-VL-3B recap_1, same image: ROUGE-L 0.288

Known limitations

A manual check of 24 captions (12 images) found the main subject and its count, colors, setting, medium and legible text correct in all of them; 5 had one wrong secondary detail (an action, a clothing item, a person count, the spelling of a name, a left/right reference). No invented objects were found. Compared with the Qwen2.5-VL-3B captions, the two Gemma captions of an image are closer to each other (39% of the content words of recap_2 are not in recap_1, against 57%): they mostly state the same facts in different words, with one or two different secondary details. Captions from different models (Gemma, Qwen2.5-VL-3B, the original Qwen2.5-VL-7B caption) differ more. Openings are formulaic: about 28% of captions start with "A single".

Gemma 3 4B IT recaptions

gemma-3-4b-it-recaptions/<shard>.parquet holds one new caption for each of the first 500,000 images (subset index 0–499,999). The captions were written by google/gemma-3-4b-it with vLLM 0.33.0, greedy decoding, and the same prompt as the Qwen3-VL-8B recaptions. See gemma-3-4b-it-recaptions/README.md. Join on key.

from datasets import load_dataset

gemma3 = load_dataset(
    "parquet",
    data_files="hf://datasets/IntelligenceLab/BLIP3o-Recap/gemma-3-4b-it-recaptions/*.parquet",
    split="train",
)

License

Apache-2.0, same as the source dataset.