SchemaMem: Schema-Indexed Recurrent Memory for Delayed State Retrieval
Organizations: College of Pharmacy, Chungnam National University Daejeon, Republic of Korea · Department of Computer Science & Engineering, Chungnam National University Daejeon, Republic of Korea
Abstract
Attention provides direct access to past representations, but retaining an ever-growing history is costly. Recurrent models bound persistent state, yet must preserve selected information while processing subsequent inputs. We introduce SchemaMem, an attention-based recurrent memory architecture combining chunk-local attention with a persistent, schema-indexed phase state. Learned schema embeddings provide a shared representational reference for reading and writing. Reads use the current state, whereas writes use the layer input and static schema embeddings, excluding direct feedback from that layer's own state. Chunk-boundary commits aggregate bounded phase increments through forward computation. The same parameters also support full-history attention training before and during recurrent training. We studied selective updates, preservation, and delayed retrieval in a controlled address--value task, comparing three-layer models with approximately matched parameter counts and persistent-state dimensions. Across nine address/value settings and three training seeds, SchemaMem has higher mean written-value retention at four times the maximum training delay than both baselines, which are trained toward a higher in-range accuracy target. Updated-value recovery favors SchemaMem in all nine settings against Mamba-3 and seven against Gated DeltaNet. Defaults consistently favor Gated DeltaNet over SchemaMem at that delay, and SchemaMem requires substantially more optimization steps. These results identify a promising retention--optimization trade-off in schema-indexed recurrence.
Figures & tables
| Model | Parameters | Persistent elements | Final target |
|---|---|---|---|
| SchemaMem | 54,336 | 16,896 | 95% |
| Mamba-3 | 55,128 | 16,752 | 99% |
| Gated DeltaNet | 55,260 | 17,280 | 99% |
| Retained-I | Updated-U | |||||
|---|---|---|---|---|---|---|
| Setting | SM | M3 | GDN | SM | M3 | GDN |
| A3V3 | 78.9 | 21.3 | 21.6 | 74.6 | 26.9 | 27.1 |
| A3V4 | 71.2 | 12.5 | 30.2 | 66.3 | 20.5 | 34.0 |
| A3V5 | 70.2 | 10.9 | 25.0 | 65.8 | 13.9 | 20.9 |
| A4V3 | 78.1 | 28.8 | 31.5 | 77.7 | 38.7 | 36.4 |
| A4V4 | 79.3 | 12.6 | 33.0 | 75.6 | 20.5 | 42.0 |
Appendix figures & tables6 assets
Supplementary material from the paper’s appendix.
Appendix
| Setting | Model | Retained-R | Retained-I | Updated | Default |
|---|---|---|---|---|---|
| A3V3 | SM | ||||
| A3V3 | M3 | ||||
| A3V3 | GDN | ||||
| A3V4 | SM | ||||
| A3V4 | M3 | ||||
| A3V4 | GDN |
| Setting | SchemaMem | Mamba-3 | Gated DeltaNet |
|---|---|---|---|
| A3V3 | 88,667 | 3,917 | 3,750 |
| A3V4 | 58,000 | 4,083 | 4,333 |
| A3V5 | 58,417 | 3,833 | 5,583 |
| A4V3 | 65,667 | 4,917 | 6,667 |
| A4V4 | 36,917 | 4,833 | 6,000 |
| A4V5 | 63,000 | 5,083 | 5,917 |
| Setting | Model | Seed | Tx | Maint | I (%) | U (%) | Pass |
|---|---|---|---|---|---|---|---|
| A3V3 | SM | 42 | 8,750 | 42,250 | 76.37 | 68.16 | yes |
| A3V3 | SM | 43 | 14,500 | 97,000 | 83.01 | 76.46 | yes |
| A3V3 | SM | 44 | 18,000 | 85,500 | 77.34 | 79.30 | yes |
| A3V3 | M3 | 42 | 1,500 | 2,000 | 25.78 | 35.45 | yes |
| A3V3 | M3 | 43 | 1,500 | 2,250 | 14.94 | 15.92 | yes |
| A3V3 | M3 | 44 | 1,500 | 3,000 | 23.05 | 29.30 | yes |
| Setting | Model | Scenario | Retained | Updated | Default |
|---|---|---|---|---|---|
| A3V3 | SM | retention | — | ||
| A3V3 | SM | interference | |||
| A3V3 | SM | overwrite | |||
| A3V3 | M3 | retention | — | ||
| A3V3 | M3 | interference | |||
| A3V3 | M3 | overwrite |
| Setting | State | Retained-R | Retained-I | Updated | Default |
|---|---|---|---|---|---|
| A3V3 | Normal | ||||
| A3V3 | |||||
| A3V4 | Normal | ||||
| A3V4 | |||||
| A3V5 | Normal | ||||
| A3V5 |
| Setting | State | Retained-R | Retained-I | Updated | Default |
|---|---|---|---|---|---|
| A3V3 | Normal | ||||
| A3V3 | |||||
| A3V4 | Normal | ||||
| A3V4 | |||||
| A3V5 | Normal | ||||
| A3V5 |