File size: 4,755 Bytes
9cc8236
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ced0d9c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9cc8236
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ced0d9c
9cc8236
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42ad655
 
 
 
 
 
 
 
 
 
 
 
 
 
9cc8236
 
 
 
 
 
 
 
 
 
 
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
---
configs:
- config_name: N4_V16
  data_files:
  - split: train
    path: N4_V16/train-*.parquet
  - split: validation
    path: N4_V16/validation-*.parquet
  - split: test
    path: N4_V16/test-*.parquet

- config_name: N8_V16
  data_files:
  - split: train
    path: N8_V16/train-*.parquet
  - split: validation
    path: N8_V16/validation-*.parquet
  - split: test
    path: N8_V16/test-*.parquet

- config_name: N16_V16
  data_files:
  - split: train
    path: N16_V16/train-*.parquet
  - split: validation
    path: N16_V16/validation-*.parquet
  - split: test
    path: N16_V16/test-*.parquet

- config_name: N32_V16
  data_files:
  - split: train
    path: N32_V16/train-*.parquet
  - split: validation
    path: N32_V16/validation-*.parquet
  - split: test
    path: N32_V16/test-*.parquet

- config_name: N64_V16
  data_files:
  - split: train
    path: N64_V16/train-*.parquet
  - split: validation
    path: N64_V16/validation-*.parquet
  - split: test
    path: N64_V16/test-*.parquet

- config_name: N128_V16
  data_files:
  - split: train
    path: N128_V16/train-*.parquet
  - split: validation
    path: N128_V16/validation-*.parquet
  - split: test
    path: N128_V16/test-*.parquet

- config_name: N256_V16
  data_files:
  - split: train
    path: N256_V16/train-*.parquet
  - split: validation
    path: N256_V16/validation-*.parquet
  - split: test
    path: N256_V16/test-*.parquet

- config_name: N512_V16
  data_files:
  - split: train
    path: N512_V16/train-*.parquet
  - split: validation
    path: N512_V16/validation-*.parquet
  - split: test
    path: N512_V16/test-*.parquet

- config_name: N1024_V16
  data_files:
  - split: train
    path: N1024_V16/train-*.parquet
  - split: validation
    path: N1024_V16/validation-*.parquet
  - split: test
    path: N1024_V16/test-*.parquet
license: mit
task_categories:
- other
pretty_name: Recognition Memory
size_categories:
- 1M<n<10M
---

# Recognition Memory

A benchmark for memories that *recognise* rather than *recall*: the model sees a sequence
and must decide whether it is consistent with what it has stored, for example by using low
surprise as the familiarity signal.

## Subsets

`N4_V16`, `N8_V16`, `N16_V16`, `N32_V16`, `N64_V16`, `N128_V16`, `N256_V16`, `N512_V16`, `N1024_V16`: sequences of length N over a vocabulary of 16 tokens.
Splits: train 900,000 / validation 50,000 / test 100,000 samples.

## Fields

| field | type | description |
|---|---|---|
| `sequence` | `uint8[N]` | primary sequence, tokens i.i.d. uniform over `0..15` |
| `corrupted` | `uint8[8][N]` | 8 corrupted copies of `sequence` |
| `num_changed` | `uint16[8]` | number of tokens changed in each corrupted copy |

## Corruption process

For each corrupted copy, one position chosen uniformly at random is always changed, and each
of the other N-1 positions is changed independently with probability 1/(N-1). The number of
changed tokens is therefore `1 + Binomial(N-1, 1/(N-1))`, with expectation exactly 2. A changed
token is replaced by a uniformly random *different* token, so every corrupted copy differs from
the primary sequence. The 8 copies are drawn independently, so two copies of the
same sample can coincide (in about 4.4% of samples for N=4, 2.7% for N=8, 1.5% for N=16, and
roughly halving with each doubling of N after that).

Primary sequences are drawn i.i.d. and are not deduplicated. For N=4 there are only
16^4 = 65,536 possible sequences, so nearly all of them appear in train and every
validation/test sequence also appears in train. From N=16 up, overlap between splits is
essentially zero.

## Evaluation protocol

1. Give the memory the primary `sequence` (for example, in context before a separator).
2. Score `sequence` and each of its 8 `corrupted` copies with the memory's familiarity signal (for example,
   minus the summed surprise of the candidate, or a learned score).
3. Report, over the test split:
   - **acc9**: the share of samples where `sequence` scores strictly highest among the 9 candidates. A tie for the top
     score counts as 1/(number tied), so a constant score gives 1/9.
   - **pairwise**: the share of (`sequence`, corrupted copy) pairs where `sequence` scores higher, with ties counting
     as 1/2. Chance is 0.5.

Reference points: a memory that keeps only the sum of the tokens mod 16 (4 bits) gets acc9 about 0.85 at every N, and
one that also keeps a position-weighted sum (8 bits) about 0.97, because the corruptions are small edits.

## Usage

```python
from datasets import load_dataset
ds = load_dataset("irodkin/recognition-memory", "N64_V16")
```

## Reproduction

Generated with `generate.py` (base seed 20261030); every chunk of 50k samples is seeded from
`(seed, N, V, split, chunk)` and can be regenerated on its own.