File size: 2,297 Bytes
aea9140
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
aa47a16
aea9140
aa47a16
aea9140
 
 
aa47a16
aea9140
 
 
aa47a16
aea9140
 
 
 
 
 
 
 
 
 
 
aa47a16
aea9140
 
 
 
 
 
 
 
 
c74404f
aea9140
 
 
 
aa47a16
aea9140
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
---
license: mit
task_categories:
  - image-to-image
  - visual-document-retrieval
language:
  - en
tags:
  - retrieval
  - multimodal
  - composed-image-retrieval
size_categories:
  - 1K<n<10K
configs:
  - config_name: default
    data_files:
      - split: train
        path: pairs_img/train-*.parquet
---

# ret-sample — reasoning-retrieval query→positive pairs

Composed-image-retrieval (CIR) style pairs: a **query image + instruction** retrieves a
**target image**. Images are embedded directly in the parquet, so nothing external is needed
to train or browse.

- **3,127 pairs** · 8 shards · **341 MB**
- Built for [`williamium3000/Qwenvl2d5`](https://github.com/williamium3000/Qwenvl2d5)
  (`ret-streaming-retsample` branch) and streamable by it with no S3 credentials.

## Columns
| column | type | meaning |
|---|---|---|
| `q_image` | `Image()` | query image (PIL on access; stored as original JPEG bytes) |
| `pos_image` | `Image()` | positive/target image |
| `instruction` | string | the query instruction (what to retrieve) |
| `caption` | string | caption of the positive |
| `q_key`, `pos_key` | string | `blake3(raw file bytes)[:16]` content ids |
| `group_id` | int | near-duplicate cluster id (teacher cosine ≥ 0.98) |
| `n_text_tokens` | int | exact instruction length, Qwen2.5-VL tokenizer |
| `task`, `subset` | string | `cir`; source subset (results / instruct / …) |

## Usage
```python
from datasets import load_dataset
ds = load_dataset("Icey444/ret-sample", split="train")
r = ds[0]
r["q_image"]        # PIL.Image
r["instruction"]    # "What would I need to use to navigate through a place like this?"
r["pos_image"]      # PIL.Image
```

Training (in the repo above):
```bash
bash scripts/sft_ret_sample_streaming.sh     # --dataset ret_sample%100
```

## Notes
- **No hard negatives.** The training code uses in-batch InfoNCE; its collator explicitly
  cannot take a 3rd item per instance, so mined negatives would be carried and never read.
- Images are stored **undecoded** and decoded to PIL once at preprocess time — lossless
  (verified byte-identical through the pipeline) and no per-epoch re-encode.
- Source images originate from `jeffrey/reasoning_retrieval` on the zillion2 store; the
  `_key` columns are content hashes of those exact bytes.