This repository contains the Python implementation and completed run logs for a controlled study of Memory as a Model. Six 0.5B LoRA adapters and a frozen 4B executive were evaluated on 216 synthetic questions using one RTX 4060 Laptop GPU.
| Condition | Held-out two-document accuracy |
|---|---|
| Iterative BM25 | 48.6% (35/72) |
| Full-reflection memory, multiple queries | 0.5% (1/216 across three seeds) |
| Oracle evidence | 100% (72/72) |
The paired difference between full-reflection memory and iterative BM25 was -48.1 percentage points, with a 95% topic-bootstrap interval from -52.8 to -43.1. These findings apply to the synthetic corpus and training budget used here.
Results summary | Training and evaluation logs | Matrix progress
Run this in a fresh checkout on Windows with Python 3.12. It rebuilds the locked synthetic dataset and scores the committed predictions using the standard library.
$ErrorActionPreference = 'Stop'
$env:PYTHONPATH = (Resolve-Path .\src).Path
python -m unittest discover -s tests -v
if ($LASTEXITCODE -ne 0) { throw 'Tests failed.' }
python -m memo_study build-data
if ($LASTEXITCODE -ne 0) { throw 'Dataset build failed.' }
if (Test-Path -LiteralPath .\runs\eval) { throw 'Use a fresh checkout for the replay.' }
New-Item -ItemType Directory -Force -Path .\runs | Out-Null
Copy-Item -LiteralPath .\artifacts\study-v1\logs\eval -Destination .\runs\eval -Recurse
$adapters = @('study-v1-full-17', 'study-v1-full-29', 'study-v1-full-43',
'study-v1-atomic-17', 'study-v1-atomic-29', 'study-v1-atomic-43')
python -m memo_study analyze --baseline-id study-v1-baselines --adapter-ids $adapters --run-id study-replayThe replay writes runs/analysis/study-replay/summary.json, which can be compared with the committed results summary. The recorded study includes 3,888 predictions, optimizer traces for all six adapters, and model and dataset hashes.
The locked setup uses Windows x64, Python 3.12, uv, an NVIDIA driver compatible with CUDA 12.8, and local Ollama. Install in a fresh checkout with the pinned executive build identified in the study config.
.\scripts\setup.ps1
$python = '.\.venv\Scripts\python.exe'
& $python -m memo_study build-data
& $python -m memo_study preflight --config smoke --run-id cuda-preflight
& $python -m memo_study matrix --config smoke --run-id smoke-v1
& $python -m scripts.resume_study --run-id study-rerunRepeat the last command after an interruption to reuse completed jobs. An interrupted job gets a fresh run ID, and an interrupted training job starts from step one. Generated datasets, checkpoints, and new run logs are written locally under data/ and runs/.
- src/memo_study contains data generation, adapters, evaluation, and analysis.
- configs contains the smoke and full-study settings.
- scripts contains the Windows setup and the run-or-resume command.
- tests checks corpus construction, iterative evidence lookup, and paired statistics.