File size: 7,567 Bytes
778a398
 
 
 
 
9642970
5ffe943
 
 
9642970
c3ced54
 
 
9642970
084a116
f178f83
 
084a116
 
9a23e1d
 
084a116
fd1c1c6
 
 
688bfd5
084a116
688bfd5
084a116
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
688bfd5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
778a398
9117f89
 
88c1965
 
9117f89
 
 
 
 
 
88c1965
9117f89
 
 
 
 
 
 
 
88c1965
9117f89
88c1965
9117f89
88c1965
9117f89
 
 
 
 
 
 
 
88c1965
9117f89
88c1965
9117f89
 
 
 
 
 
 
 
88c1965
9117f89
88c1965
9117f89
88c1965
9117f89
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88c1965
 
9117f89
 
 
 
 
 
 
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
---
configs:
- config_name: exp1_counting
  data_files:
  - split: train
    path: exp1_counting/train-*.parquet
- config_name: exp2_discrimination
  data_files:
  - split: train
    path: exp2_discrimination/train-*.parquet
- config_name: exp3_controlled
  data_files:
  - split: train
    path: exp3_controlled/train-*.parquet
- config_name: exp4_realworld_discrimination
  data_files:
  - split: train
    path: exp4_realworld_discrimination/train-*
- config_name: exp4_realworld_naming
  data_files:
  - split: train
    path: exp4_realworld_naming/train-*.parquet
- config_name: exp5_synthetic_matched
  data_files:
  - split: train
    path: exp5_synthetic_matched/train-*
dataset_info:
- config_name: exp4_realworld_discrimination
  features:
  - name: image
    dtype: image
  - name: pair_num
    dtype: string
  - name: condition
    dtype: string
  - name: left_category
    dtype: string
  - name: right_category
    dtype: string
  - name: left_count
    dtype: string
  - name: right_count
    dtype: string
  - name: num_ratio
    dtype: string
  - name: answer
    dtype: string
  - name: prompt
    dtype: string
  - name: task
    dtype: string
  - name: tag
    dtype: string
  - name: eval_id
    dtype: int64
  - name: correct_answer
    dtype: string
  splits:
  - name: train
    num_bytes: 325752264
    num_examples: 584
  download_size: 325629874
  dataset_size: 325752264
- config_name: exp5_synthetic_matched
  features:
  - name: image
    dtype: image
  - name: pair_num
    dtype: string
  - name: condition
    dtype: string
  - name: shape_type
    dtype: string
  - name: left_category
    dtype: string
  - name: right_category
    dtype: string
  - name: left_count
    dtype: string
  - name: right_count
    dtype: string
  - name: num_ratio
    dtype: string
  - name: answer
    dtype: string
  - name: prompt
    dtype: string
  - name: task
    dtype: string
  - name: tag
    dtype: string
  - name: eval_id
    dtype: int64
  - name: correct_answer
    dtype: string
  splits:
  - name: train
    num_bytes: 41105917
    num_examples: 1134
  download_size: 39706387
  dataset_size: 41105917
---

# ANS Benchmark

A cognitively-grounded benchmark for **numerical cognition in vision-language models**,
covering **exact counting** and **approximate numerosity discrimination (ANS)**.

Each row is a self-contained trial: the stimulus image is embedded inline, and `prompt`
holds the exact question text sent to the model during evaluation.

## Configs (6)

| Config | Task | Rows | Stimuli |
|---|---|---|---|
| `exp1_counting` | Count items in one image | 1,994 | Abstract shapes + real-world (FSC-133), small-n & large-n |
| `exp2_discrimination` | Which side has more? (abstract, random sizes) | 480 | Pre-stitched pairs, 6 ratio conditions |
| `exp3_controlled` | Which side has more? (numerosity decorrelated from area/spacing) | 2,500 | Pre-stitched pairs, 3 shapes × 4 colors |
| `exp4_realworld_naming` | Name the object category | 864 | Single real-world panels |
| `exp4_realworld_discrimination` | Which side has more? (real-world) | 600 | Pre-stitched same/diff-category pairs |
| `exp5_synthetic_matched` | Which side has more? (abstract matched to real-world) | 1,164 | Pre-stitched pairs, counts/coords matched to Exp4 |

Every paired discrimination image is `left | 10 px white divider | right`.

## Common columns (all configs)

| Column | Type | Description |
|---|---|---|
| `image` | `Image` | Stimulus image (embedded bytes, loads as PIL) |
| `prompt` | `string` | Exact question text used in evaluation |
| `task` | `string` | Task type — see values below |
| `tag` | `string` | Analysis tag (`ans`, `ans2`, `ans3`, `ans4`, `ans5`) |
| `eval_id` | `int` | Global sequential trial index within each tag |
| `answer` / `correct_answer` | `string` | Ground-truth label (`left`/`right`/`tie` or integer count or category name) |

**`task` values:**

| Value | Description |
|---|---|
| `counting` | Exact count of objects |
| `discrimination_abstract` | Which side has more? — abstract shapes, unconstrained |
| `discrimination_controlled` | Which side has more? — numerosity decorrelated from surface area |
| `discrimination_realworld` | Which side has more? — real-world object images |
| `discrimination_synthetic` | Which side has more? — synthetic shapes matched to real-world stimuli |
| `naming` | Identify the object category |

## Config-specific columns

**exp1_counting** — `subset`, `stimulus_type` {abstract, realworld}, `n_range` {small_n, large_n}, `shape`, `category`, `count`

**exp2_discrimination** — `pair_id`, `shape` {dots, rectangles}, `anchor_n`, `ratio_condition`, `ratio_value`, `left_count`, `right_count`, `correct_answer`

**exp3_controlled** — `pair_num`, `pair_shape` {dots, ellipse, rectangle}, `pair_color`, `pair_ratio`, `left_numerosity`, `right_numerosity`, `left_TSA`, `right_TSA`, `left_FA`, `right_FA`, `correct_answer`
(TSA = total surface area; FA = field area / convex hull)

**exp4_realworld_naming** — `category`, `count`, `original_image_name`

**exp4_realworld_discrimination** — `pair_num`, `condition` {same_cat, diff_cat}, `left_category`, `right_category`, `left_count`, `right_count`, `num_ratio`, `answer`

**exp5_synthetic_matched** — `pair_num`, `condition`, `shape_type` {dots, rectangles}, `left_category`, `right_category`, `left_count`, `right_count`, `num_ratio`, `answer`

## Prompt templates

**5 semantically-equivalent templates per task**, assigned **one per stimulus** deterministically
(md5 hash of stimulus id). Each image is tested exactly once — prompts rotate across stimuli,
not within.

- **Counting:** `"How many {item} are there in the image? Please answer with an integer directly."`  (+ 4 variants)
- **Discrimination abstract:** `"Two images of {desc} appear side by side. Which image contains more shapes? Respond with 'left' or 'right'."` (+ 4 variants)
- **Discrimination same-category:** `"Look at these two images. Which image has more {cat}? … Answer with 'left' or 'right'."` (+ 2 variants)
- **Discrimination diff-category:** `"Left image contains {lcat}, right image contains {rcat}. Which image has more items? … Answer with 'left' or 'right'."` (+ 2 variants)
- **Naming:** `"What is(are) the object(s) in the image called? Please answer with one object category name directly."` (+ 4 variants)

## Quick start

```python
from datasets import load_dataset

# Load one config
ds = load_dataset("87cc2s/ans-benchmark", "exp1_counting")
row = ds["train"][0]
row["image"]   # PIL Image
row["prompt"]  # "How many dots are there in the image? ..."
row["answer"]  # "1"
row["task"]    # "counting"

# Load discrimination
ds2 = load_dataset("87cc2s/ans-benchmark", "exp2_discrimination")
row2 = ds2["train"][0]
row2["prompt"]          # "Two images of white dots appear side by side ..."
row2["correct_answer"]  # "right"
row2["task"]            # "discrimination_abstract"
```

## Provenance & notes

- Derived from original Experiment1–Experiment4, Experiment1_1, Experiment2_1, Experiment3_1 stimulus sets.
- **Excluded:** Exp1 `random_largen`-in-small-n bucket, real-world `FSC_sampled`/`FSC_sampled_largen`,
  Exp3 `ellipses_white`/`rectangles_white` (rendered incorrectly — replaced by Exp3_1 re-renders).
  36 synthetic pairs with missing source images and 1 exact-duplicate counting row were dropped.
- **License:** Real-world images derive from FSC-133 (Ranjan et al., 2021) / FSC-147. Abstract stimuli
  are procedurally generated and freely usable. Respect upstream FSC licensing.