R1 revision: MBR agent with training-caption document frequencies
Browse filesEarlier releases computed the MBR document frequencies on the COCO Karpathy-test references. frama_infer.py now uses assets/mbr_df_coco_train.json.gz, computed from the 566,747 COCO training captions; verify_infer.py compares against the R1 files; the README states the correction and the R1 numbers.
Files changed (5)
- .gitattributes+1
- README.md+21-9
- assets/mbr_df_coco_train.json.gzAdded+3
- frama_infer.py+4-2
- verify_infer.py+4-3
33 unmodified lines34353633 unmodified lines*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -textassets/coco_train_captions.json filter=lfs diff=lfs merge=lfs -text33 unmodified lines3435363733 unmodified lines*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -textassets/coco_train_captions.json filter=lfs diff=lfs merge=lfs -textpredictions_r1/** filter=lfs diff=lfs merge=lfs -text
48 unmodified lines4950515253545515 unmodified lines7172737475767778798081828323 unmodified lines10710810911011111211311411511648 unmodified linesand all 20 candidates with every agent score.`--config five`, the default, uses bigG, BLIP, VQA, MBR and ground. It is the better choice forimages outside COCO: NoCaps 82.3 against 81.3 CIDEr and Flickr30k 72.1 against 70.5 for thesix-agent stack. `--config six` adds the LM agent and is best on COCO itself.## What runs15 unmodified lines## Results in the paperOfficial COCO caption toolkit, CIDEr / SPICE.| Benchmark | IFCap top-1 | FRAMA, 6 agents | FRAMA, 5 agents ||---|---|---|---|| COCO Karpathy test | 112.7 / 21.0 | 120.8 / 22.2 | 120.5 / 22.2 || NoCaps val, overall | 70.3 / 9.8 | 81.3 / 11.0 | 82.3 / 11.0 || Flickr30k Karpathy test | 63.7 / 17.0 | 70.5 / 18.2 | 72.1 / 18.5 |### Fidelity to the paper23 unmodified lines| `verify_infer.py` | stage-by-stage check against the paper's artifacts || `assets/coco_train_captions.json` | the retrieval corpus, COCO Karpathy-train captions || `assets/coco_train_captions_bigG14_fp16.npy` | their ViT-bigG/14 text embeddings, float16, 1.45 GB || `assets/mbr_df_coco_karpathy_test.json.gz` | n-gram document frequencies used by the MBR agent |The MBR agent weighs n-grams with the document frequencies the paper used, computed over the COCOKarpathy-test reference captions. They act as a fixed text statistic for any new image.## License48 unmodified lines4950515253545515 unmodified lines717273747576777879808182838485868788899023 unmodified lines11411511611711811912012112212312412512612712848 unmodified linesand all 20 candidates with every agent score.`--config five`, the default, uses bigG, BLIP, VQA, MBR and ground. It is the better choice forimages outside COCO: NoCaps 82.2 against 81.2 CIDEr and Flickr30k 72.3 against 70.7 for thesix-agent stack. `--config six` adds the LM agent and is best on COCO itself.## What runs15 unmodified lines## Results in the paperOfficial COCO caption toolkit, CIDEr / SPICE, revised manuscript (R1, October 2026).| Benchmark | IFCap top-1 | FRAMA, 6 agents | FRAMA, 5 agents ||---|---|---|---|| COCO Karpathy test | 112.7 / 21.0 | 120.7 / 22.2 | 120.5 / 22.2 || NoCaps val, overall | 70.3 / 9.8 | 81.2 / 11.0 | 82.2 / 11.0 || Flickr30k Karpathy test | 63.7 / 17.0 | 70.7 / 18.3 | 72.3 / 18.5 |**Correction in R1.** Releases before October 2026 computed the n-gram document frequencies of theMBR agent on the COCO Karpathy-test reference captions, which lets test statistics into theselection. The MBR agent now uses frequencies from the 566,747 COCO training captions of thecaptioner (`assets/mbr_df_coco_train.json.gz`). With the earlier frequencies the six-agent stackscored 120.8 / 81.3 / 70.5 CIDEr and the five-agent stack 120.5 / 82.3 / 72.1. The selectedcaptions of every rule in the revised paper are in `predictions_r1/`.### Fidelity to the paper23 unmodified lines| `verify_infer.py` | stage-by-stage check against the paper's artifacts || `assets/coco_train_captions.json` | the retrieval corpus, COCO Karpathy-train captions || `assets/coco_train_captions_bigG14_fp16.npy` | their ViT-bigG/14 text embeddings, float16, 1.45 GB || `assets/mbr_df_coco_train.json.gz` | n-gram document frequencies of the MBR agent, from the COCO training captions || `predictions_r1/<benchmark>/<rule>__<split>.json` | the selected caption of every rule in the revised paper, with the reference captions, in the IFCap evaluation format || `assets/mbr_df_coco_karpathy_test.json.gz` | superseded: frequencies from the test references, used before the R1 revision; do not use |The MBR agent weighs n-grams with document frequencies computed over the COCO training captions ofthe captioner, a fixed text statistic that involves no test data. Its scores equal the released`mbr_trainidf_coco.npy` of the revised paper exactly; we rechecked this on 40 COCO beams after thechange. The end-to-end comparison in the table above was run before the change of frequencies, and`verify_infer.py` now compares against the R1 files.## License
123version https://git-lfs.github.com/spec/v1oid sha256:43314708f8202580d26a1ca15ed0a436f7e96d1b9646ad72d1d6d7d7026da095size 16969177362 unmodified lines36336436536636736836925 unmodified lines395396397398399400401362 unmodified linesclass MbrCider:"""CIDEr-D between two candidates, with the paper's fixed n-gram document frequencies."""def __init__(self, path):d = json.load(gzip.open(path, "rt"))25 unmodified linesdef stage_mbr(recs):cider = MbrCider(os.path.join(ASSETS, "mbr_df_coco_karpathy_test.json.gz"))for r in recs:v = [cider.vec(_tok(b["caption"])) for b in r["beam"]]K = len(v)362 unmodified lines36336436536636736836925 unmodified lines395396397398399400401402403362 unmodified linesclass MbrCider:"""CIDEr-D between two candidates, with n-gram document frequencies from the training captions."""def __init__(self, path):d = json.load(gzip.open(path, "rt"))25 unmodified linesdef stage_mbr(recs):# Document frequencies from the 566,747 COCO training captions of the captioner. Earlier releases# used frequencies computed on the COCO Karpathy-test references, which leaks test information.cider = MbrCider(os.path.join(ASSETS, "mbr_df_coco_train.json.gz"))for r in recs:v = [cider.vec(_tok(b["caption"])) for b in r["beam"]]K = len(v)
2 unmodified lines345678910111213141535 unmodified lines515253545556572 unmodified linespython verify_infer.py --ifcap_root <IFCap checkout with annotations and val2014> \--ref <folder with coco_beam_dump.json, features.npz, vqascore_coco.jsonl, ground_coco.jsonl,mbr_self_coco.npy, stack6_all_equal__overall.json, stack5_noLM_blip_bigG_vqa_mbr_ground__overall.json> \--n 96python verify_infer.py --ifcap_root ... --retrieval_only --n 5000Retrieval is compared with caption_coco_image_coco_bigG_9.json, the BLIP-ITM step with..._bigG_blip5.json and its entity file, the beam with the stored dump, every agent with itsreleased score file, and the final pick with the paper's prediction files."""import argparse, json, osimport numpy as np35 unmodified linesfpos = {str(x): i for i, x in enumerate(npz["image_names"])}vqa = {json.loads(l)["image_name"]: json.loads(l)["vqascore"] for l in open(R("vqascore_coco.jsonl"))}gro = {json.loads(l)["image_name"]: json.loads(l) for l in open(R("ground_coco.jsonl"))}mbr = np.load(R("mbr_self_coco.npy"))picks = {c: {p["image_name"]: p["prediction"] for p in json.load(open(R(f)))}for c, f in (("six", "stack6_all_equal__overall.json"), ("five", "stack5_noLM_blip_bigG_vqa_mbr_ground__overall.json"))}2 unmodified lines34567891011121314151635 unmodified lines525354555657582 unmodified linespython verify_infer.py --ifcap_root <IFCap checkout with annotations and val2014> \--ref <folder with coco_beam_dump.json, features.npz, vqascore_coco.jsonl, ground_coco.jsonl,mbr_trainidf_coco.npy, stack6_all_equal__overall.json, stack5_noLM_blip_bigG_vqa_mbr_ground__overall.json> \--n 96python verify_infer.py --ifcap_root ... --retrieval_only --n 5000Retrieval is compared with caption_coco_image_coco_bigG_9.json, the BLIP-ITM step with..._bigG_blip5.json and its entity file, the beam with the stored dump, every agent with itsreleased score file, and the final pick with the paper's prediction files. Since the R1 revision the MBRreference is mbr_trainidf_coco.npy and the prediction files are those of predictions_r1/coco/."""import argparse, json, osimport numpy as np35 unmodified linesfpos = {str(x): i for i, x in enumerate(npz["image_names"])}vqa = {json.loads(l)["image_name"]: json.loads(l)["vqascore"] for l in open(R("vqascore_coco.jsonl"))}gro = {json.loads(l)["image_name"]: json.loads(l) for l in open(R("ground_coco.jsonl"))}mbr = np.load(R("mbr_trainidf_coco.npy")) # R1: MBR document frequencies from the training captionspicks = {c: {p["image_name"]: p["prediction"] for p in json.load(open(R(f)))}for c, f in (("six", "stack6_all_equal__overall.json"), ("five", "stack5_noLM_blip_bigG_vqa_mbr_ground__overall.json"))}
.gitattributes+1
README.md+21-9
assets/mbr_df_coco_train.json.gzAdded+3
frama_infer.py+4-2
verify_infer.py+4-3