WenxingZhu commited on
Commit
479cdae
·
verified ·
1 Parent(s): cd9018c

Document embedding generation details

Browse files
Files changed (1) hide show
  1. README.md +60 -1
README.md CHANGED
@@ -19,7 +19,7 @@ tags:
19
 
20
  # Multimodal Embedding 100M
21
 
22
- This dataset contains a 100M-row multimodal embedding corpus derived from LAION-400M-style embedding data. It is intended for large-scale vector database ingestion, ANN index construction, nearest-neighbor search, and retrieval benchmark experiments.
23
 
24
  The dataset is stored as Parquet files and organized to keep each directory below Hugging Face's per-directory file-count limit.
25
 
@@ -33,6 +33,65 @@ The dataset is stored as Parquet files and organized to keep each directory belo
33
 
34
  Total: 100,020,000 rows across 16,827 Parquet files.
35
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  ## Directory Layout
37
 
38
  ```text
 
19
 
20
  # Multimodal Embedding 100M
21
 
22
+ This dataset contains a 100M-row multimodal embedding corpus generated from LAION-400M-style image-text WebDataset shards. It is intended for large-scale vector database ingestion, ANN index construction, nearest-neighbor search, and retrieval benchmark experiments.
23
 
24
  The dataset is stored as Parquet files and organized to keep each directory below Hugging Face's per-directory file-count limit.
25
 
 
33
 
34
  Total: 100,020,000 rows across 16,827 Parquet files.
35
 
36
+ ## Embedding Generation
37
+
38
+ The embeddings were generated from image-caption pairs in the `laion-400m-256` WebDataset shard format. Each input sample was decoded as a PIL image plus caption text, then encoded into one vector with `Qwen/Qwen3-VL-Embedding-8B`.
39
+
40
+ Generation configuration:
41
+
42
+ | Property | Value |
43
+ | --- | --- |
44
+ | Embedding model | `Qwen/Qwen3-VL-Embedding-8B` |
45
+ | Inference engine | vLLM, `runner="pooling"` |
46
+ | Inference dtype | `bfloat16` |
47
+ | Batch size | 16 samples per embedding batch |
48
+ | Output dimension | 4096 |
49
+ | Stored dtype | `float32` in Parquet |
50
+ | Normalization | L2 normalized after model inference |
51
+ | Search metric | Inner Product; because vectors are L2-normalized, IP ranking is equivalent to cosine-similarity ranking |
52
+
53
+ Prompt template:
54
+
55
+ ```python
56
+ [
57
+ {
58
+ "role": "system",
59
+ "content": [{"type": "text", "text": "Represent the user's input."}],
60
+ },
61
+ {
62
+ "role": "user",
63
+ "content": [
64
+ {"type": "image", "image": image},
65
+ {"type": "text", "text": caption},
66
+ ],
67
+ },
68
+ ]
69
+ ```
70
+
71
+ The prompt was rendered with the model tokenizer's chat template and passed to vLLM together with `multi_modal_data={"image": image}` through the embedding API. Each full image-caption pair produces exactly one 4096-dimensional vector; there is no text chunking or multi-vector output per sample.
72
+
73
+ Source-field handling:
74
+
75
+ - Caption text is read from the WebDataset `txt` field when present, otherwise from `json.caption`.
76
+ - Sample key is read from `json.key` when present, otherwise from WebDataset `__key__`.
77
+ - If image preparation fails, the sample falls back to text-only embedding using the same system instruction.
78
+ - If a batch embedding call fails, the batch is retried one sample at a time.
79
+ - If a single-sample embedding call still fails, a zero vector is emitted for that sample before normalization-safe storage.
80
+
81
+ Split assignment:
82
+
83
+ - Raw shard outputs are first written as `key:string, emb:fixed_size_list<float32>[4096]`.
84
+ - Final `train` and `test` files add continuous zero-based `id:int64` values.
85
+ - `train` contains the first 100,000,000 rows in deterministic shard order.
86
+ - `test` contains the following 10,000 rows and is disjoint from `train`.
87
+ - The Hugging Face `train/shard-*` directories are only repository-layout shards; they do not change vector ids or row contents.
88
+
89
+ Ground-truth generation:
90
+
91
+ - The `neighbors` split contains brute-force top-100 nearest neighbors for all 10,000 test vectors against the 100,000,000 train vectors.
92
+ - Scores are inner products over the L2-normalized vectors.
93
+ - `neighbors[i]` and `scores[i]` are aligned and sorted by descending score.
94
+
95
  ## Directory Layout
96
 
97
  ```text