NullVoider commited on
Commit
9da43d1
·
verified ·
1 Parent(s): 45cbc6f

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +210 -0
README.md CHANGED
@@ -1,3 +1,213 @@
1
  ---
2
  license: cc-by-nc-4.0
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  license: cc-by-nc-4.0
3
  ---
4
+ # Memory Archive: A Memory-Grounded Training Paradigm for Computer Use Agents
5
+
6
+ [![License: CC BY-NC 4.0](https://img.shields.io/badge/License-CC%20BY--NC%204.0-lightgrey.svg)](LICENSE)
7
+ [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.20176599.svg)](https://doi.org/10.5281/zenodo.20176599)
8
+ [![Project Dockyard](https://img.shields.io/badge/Project-Dockyard-purple)](https://github.com/nullvoider07/Memory-Archive)
9
+ [![Paper](https://img.shields.io/badge/Paper-PDF-red)](memory_archive.pdf)
10
+
11
+ **Kartik . A** · Independent Researcher · Project Dockyard
12
+
13
+ 📄 [Read the Paper (PDF)](memory_archive_paradigm.pdf)  ·  💻 [Memory Archive Tool](https://github.com/nullvoider07/Memory-Archive)
14
+
15
+ > **Publication note:** As an independent researcher, this architecture is published as an open-science preprint via Zenodo (CERN) to establish formal prior art. A permanent, globally recognised DOI is attached to this work. The full paper is available here in both PDF and Markdown.
16
+
17
+ ---
18
+
19
+ ## The Problem
20
+
21
+ The dominant CUA training pipeline trains on `(screenshot, action)` pairs and deploys with plain-text prompts and retrieved documents the model has never seen during training. Every task boundary is a distribution shift. Binary outcome rewards provide no per-step signal. Every execution is zero-shot regardless of prior experience with the same task.
22
+
23
+ ## The Central Thesis
24
+
25
+ > **Format consistency eliminates the train-deploy distribution gap.**
26
+ >
27
+ > The `memory.md` artifact — a structured procedural document with per-step reasoning, actuation commands, and image references — is the same object at pre-training, supervised fine-tuning, post-training RL, and inference. The model trains on exactly what it retrieves at runtime. Additionally, the trained model generates its own `memory.md` at inference time, growing the library continuously and providing a multi-dimensional evaluation signal during training without any external benchmark.
28
+
29
+ ---
30
+
31
+ ## Abstract
32
+
33
+ Memory Archive produces a structured, annotated dataset comprising per-step actuation records, process-level reasoning annotations, visual state triples, and compiled task guides called memories. This data is used across all four stages of the CUA training and deployment lifecycle: pre-training, supervised fine-tuning, post-training reinforcement, and inference-time retrieval. Reasoning annotations are produced by a VLM Reasoning Model as the primary source, with human annotation as an alternative mode. The paper covers all four training stages at full technical depth — mathematical formulations, actuation artifact treatment, data construction pipelines, algorithm specifications, hyperparameter guidance, and failure mode analysis. A fifth section covers self-generated memory as an in-training evaluation mechanism.
34
+
35
+ ---
36
+
37
+ ## System Architecture
38
+
39
+ <div align="center">
40
+
41
+ ![Memory Archive System Architecture](images/fig01.png)
42
+
43
+ *Memory Archive connects to Control-Center (actuation via gRPC), The-Eyes (screen capture via HTTP), and a VLM Reasoning Model. Both the VLM (primary) and human annotator (alternative) produce the same schema in `reasoning.jsonl`.*
44
+
45
+ </div>
46
+
47
+ ---
48
+
49
+ ## The Four Training Stages
50
+
51
+ <div align="center">
52
+
53
+ ![Training Pipeline Overview](images/fig04.png)
54
+
55
+ *`memory.md` threads through all four stages as the shared format currency — the same artifact the model retrieves and follows at inference.*
56
+
57
+ </div>
58
+
59
+ ### Stage 1 — Pre-Training: Format Internalization
60
+
61
+ The base model learns what a well-formed memory looks like, how step sections are structured, and how image references relate to actuation commands — before any task-specific fine-tuning.
62
+
63
+ **Data mix:** `memory.md` documents (40%) · `reasoning.jsonl` + image triples (30%) · actuation command files (20%) · general GUI screenshots (10%)
64
+
65
+ **3-phase curriculum:** actuation vocabulary → step-level visual-intent alignment → full compiled memories
66
+
67
+ ---
68
+
69
+ ### Stage 2 — SFT: Actuation as a First-Class Target
70
+
71
+ SFT uses **Formulation B** — a retrieved `memory.md` is in context at every training step. The model learns to read and follow a memory at train time, not just at inference.
72
+
73
+ **Key design:** `CommandEvent JSON` and step headers are full-weight targets (`w = 1.0`). Reasoning uses stage-dependent weighting (0.75 early → 0.50 late). Memory tokens are masked entirely (`w = 0.0`).
74
+
75
+ <div align="center">
76
+
77
+ ![SFT Training Example Construction](images/fig05.png)
78
+
79
+ *All Memory Archive artifacts assembled into a single multi-step training sequence.*
80
+
81
+ </div>
82
+
83
+ ---
84
+
85
+ ### Stage 3 — Post-Training RL: Memory Adherence
86
+
87
+ **Algorithm:** GRPO — eliminates a separate value network, critical given 150+ image encodings per session in the KV cache.
88
+
89
+ **Three-component reward** ($G = 8$ trajectories per task):
90
+
91
+ | Component | Weight | What it measures |
92
+ |---|---|---|
93
+ | $R_{\text{align}}$ — Step Alignment | $\alpha = 0.3$ | Cosine similarity between agent reasoning and memory step text (domain-specific CUA encoder) |
94
+ | $R_{\text{spatial}}$ — Visual Grounding | $\beta = 0.4$ | Euclidean pixel distance: agent click vs memory at-frame annotation |
95
+ | $R_{\text{outcome}}$ — Outcome Consistency | $\gamma = 0.3$ | Visual encoder similarity between agent after-frame and memory after-frame |
96
+
97
+ $R_{\text{spatial}}$ carries the highest weight — spatial precision is the hardest CUA skill to acquire from language supervision alone.
98
+
99
+ <div align="center">
100
+
101
+ ![GRPO Training Loop](images/fig06.png)
102
+
103
+ ![Memory Adherence Reward Structure](images/fig07.png)
104
+
105
+ </div>
106
+
107
+ ---
108
+
109
+ ### Stage 4 — Inference: Retrieval-Augmented Execution
110
+
111
+ <div align="center">
112
+
113
+ ![Inference-Time Memory Retrieval Pipeline](images/fig08.png)
114
+
115
+ ![Two-Stage Retrieval Stack](images/fig09.png)
116
+
117
+ </div>
118
+
119
+ **Two-stage retrieval:** Bi-encoder HNSW (top-50 in ~3ms) → cross-encoder re-ranker (top-3 in ~80ms). Confidence gate at 0.65. OS/version pre-filter prevents stale memories.
120
+
121
+ **Working memory update:** deviation from the retrieved memory is tracked per step. Three consecutive steps with deviation score > 0.4 triggers re-retrieval or new memory creation.
122
+
123
+ **New memory creation:** on task success in the generalisation path, the full execution trajectory is compiled into a new `memory.md` and added to the library — growing it endogenously each cycle.
124
+
125
+ <div align="center">
126
+
127
+ ![Format Consistency Lifecycle](images/fig10.png)
128
+
129
+ *New memories created at inference and self-generated memories passing quality review both feed back into the pre-training corpus.*
130
+
131
+ </div>
132
+
133
+ ---
134
+
135
+ ## Self-Generated Memory as In-Training Evaluation
136
+
137
+ At training checkpoints, the model produces its own `memory.md` through live CUA sessions. This gives four diagnostic signals without any external benchmark:
138
+
139
+ | Signal | Detects | Threshold |
140
+ |---|---|---|
141
+ | MinHash LSH similarity to training memories | Overfitting | > 0.85 flags verbatim reproduction |
142
+ | Step count completeness + causal connective density | Underfitting | Monitored across training |
143
+ | Entity overlap: reasoning vs at/after frames | Context-awareness | > 0.75 average |
144
+ | Step count ratio < 1.0 vs human baseline | Super-human performance | Flagged for human review |
145
+
146
+ ---
147
+
148
+ ## Comparison with Existing CUA Approaches
149
+
150
+ | System | Process Labels | Memory at Inference | Format Consistency |
151
+ |---|---|---|---|
152
+ | Behavioral Cloning | None | None | Low |
153
+ | UI-TARS / OpenCUA-32B | Synthetic CoT | None | Medium |
154
+ | ICAL | VLM-abstracted | Retrieved (implicit) | High |
155
+ | HyMEM | None | Graph-structured | Medium |
156
+ | SkillRL | Distilled skills | Hierarchical skills | Medium |
157
+ | **Memory Archive** | **VLM-gen + human cal** | **`memory.md` (same as training)** | **High — all stages identical** |
158
+
159
+ ---
160
+
161
+ ## Repository Structure
162
+
163
+ ```
164
+ memory-archive-paradigm/
165
+ ├── images/
166
+ │ ├── fig01.png # Fig 1: System Architecture
167
+ │ ├── fig04.png # Fig 4: Training Pipeline Overview
168
+ │ ├── fig05.png # Fig 5: SFT Training Example Construction
169
+ │ ├── fig06.png # Fig 6: GRPO Training Loop
170
+ │ ├── fig07.png # Fig 7: Memory Adherence Reward
171
+ │ ├── fig08.png # Fig 8: Inference-Time Retrieval Pipeline
172
+ │ ├── fig09.png # Fig 9: Two-Stage Retrieval Stack
173
+ │ └── fig10.png # Fig 10: Format Consistency Lifecycle
174
+ ├── .gitattributes
175
+ ├── .gitignore
176
+ ├── CITATION.cff # Machine-readable citation
177
+ ├── LICENSE # CC BY-NC 4.0
178
+ ├── README.md
179
+ └── memory_archive_paradigm.pdf # Compiled Paper
180
+ ```
181
+
182
+ ---
183
+
184
+ ## Memory Archive Tool
185
+
186
+ The data collection system that generates the training corpus described in this paper is developed as part of **Project Dockyard**.
187
+
188
+ 👉 **[github.com/nullvoider07/Memory-Archive](https://github.com/nullvoider07/Memory-Archive)**
189
+
190
+ ---
191
+
192
+ ## Citation
193
+
194
+ ```bibtex
195
+ @misc{kartik2026memoryarchive,
196
+ title = {Memory Archive: A Memory-Grounded Training Paradigm
197
+ for Computer Use Agents},
198
+ author = {Kartik A.},
199
+ year = {2026},
200
+ howpublished = {Project Dockyard},
201
+ doi = {10.5281/zenodo.20176599},
202
+ note = {Independent Research. Preprint available at Zenodo:
203
+ \url{https://doi.org/10.5281/zenodo.20176599}}
204
+ }
205
+ ```
206
+
207
+ ---
208
+
209
+ ## License
210
+
211
+ This work is licensed under the [CC-BY-NC 4.0](LICENSE).
212
+
213
+ © 2026 Kartik A. · Project Dockyard