Datasets:
- What this document is (and is not)
- The Problem
- The Central Thesis
- Abstract
- System Architecture
- The Four Training Stages
- Self-Generated Memory & Executable Replay Verification
- Pre-Registered Experiments
- Inference Efficiency — TurboQuant
- Comparison with Existing CUA Approaches
- Open Problems (§6)
- The Corpus
- Memory Archive Tool
- Limitations and Scope
- Citation
- Acknowledgements
- License
Memory Archive: A Memory-Grounded Training Paradigm for Computer Use Agents
Kartik A. · Independent Researcher · Project Dockyard
📄 Read the Paper (PDF) · 🗂️ The Corpus (Hugging Face) · 💻 Memory Archive Tool
Publication note: As an independent researcher, this architecture is published as an open-science preprint via Zenodo (CERN) to establish formal prior art, with a permanent, globally recognised DOI. This is the design specification and pre-registered research protocol for the paradigm — not an empirical results paper.
What this document is (and is not)
This is a design specification and pre-registered research protocol, published to establish prior art and to fix an experimental design before any data is seen.
- Nothing here has been trained end-to-end. Every quantitative performance figure — task-success targets, latencies, reward weights, schema-validity rates — is a projection derived from principled reasoning and analogous published systems, and is marked as such in the paper (see §8, Limitations and Scope).
- The central claim is stated as a falsifiable, retrieval-conditional hypothesis, and the paper pre-registers the experiments that could refute it — including the minimum-cost first test (§5.3), whose design, metrics, and decision rule are fixed in advance.
- The architectural contributions — the artifact taxonomy, the format-consistency lifecycle, the three-component memory-adherence reward, and the two-stage retrieval stack — are stated as designs whose value is contingent on those experiments, not independent of them.
This framing is deliberate. The paradigm is offered as a testable set of design bets, not a claimed result.
The Problem
The dominant CUA training pipeline trains on (screenshot, action) pairs via behavioral cloning followed by outcome-supervised RL, and deploys with plain-text prompts and retrieved documents the model never saw during training. Five structural limitations are stated as design premises — assumptions consistent with published failure analyses of GUI agents, not results measured here:
- Outcome sparsity — binary task success/failure gives no per-step gradient on long-horizon tasks.
- Intent blindness — the model learns surface action patterns without causal understanding of task structure.
- Train–deploy format mismatch — screenshot/action training vs. plain-text deployment is a representational distribution gap at every task boundary.
- No persistent task knowledge — every execution is zero-shot regardless of prior experience with the identical task.
- Non-compositional generalisation — monolithic trajectory learning prevents reliable composition of learned sub-procedures into novel sequences.
Whether format mismatch — rather than grounding accuracy or long-horizon error compounding — is the binding constraint on current CUA performance is precisely what the experimental protocol (§5.1) is designed to test.
The Central Thesis
Format consistency eliminates the train–deploy distribution gap.
The
memory.mdartifact — 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.The claim is conditional on retrieval. The predicted advantage concentrates on tasks for which a relevant memory exists in the library, and falls back to a no-memory generalisation path otherwise — so the protocol stratifies every comparison by retrieval hit rate. Additionally, the trained model generates its own
memory.mdat inference time, growing the library continuously and providing a multi-dimensional in-training evaluation signal without any external benchmark.
Abstract
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 stages at full technical depth — mathematical formulations, actuation-artifact treatment, data-construction pipelines, algorithm specifications, hyperparameter guidance, failure-mode analysis, and an explicit compute-requirements model. No result is empirical; every quantitative figure is a projection and is marked as such. Section 5.3 pre-registers the minimum-cost experiment — a memory-conditioned SFT ablation — designed to falsify the central Format Consistency Hypothesis. A fifth section covers self-generated memory as an in-training evaluation mechanism, grounded by executable replay verification rather than model-derived judges alone.
System Architecture
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.
The Four Training Stages
memory.md threads through all four stages as the shared format currency — the same artifact the model retrieves and follows at inference.
Stage 1 — Pre-Training: Format Internalization
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.
Data mix: memory.md documents (40%) · reasoning.jsonl + image triples (30%) · actuation command files (20%) · general GUI screenshots (10%)
3-phase curriculum: actuation vocabulary → step-level visual-intent alignment → full compiled memories
Architecture requirement: a session with N steps encodes 3N images; the recommended context window is 128K–256K depending on backbone (a 50-step fixed-resolution session already costs ≈48K tokens before any memory.md text). Backbone choice — MHA vs. GQA, fixed vs. dynamic resolution — is the first architecture decision because it sets every session-length limit.
Stage 2 — SFT: Actuation as a First-Class Target
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. Critically, the in-context memory is retrieved from a different session of the same/similar task (never the session being supervised) — the same-session memory would be a circular oracle. Cold-start tasks with no cross-session partner use a partial memory (first k steps, remainder masked). 10–20% of retrieved memory steps are corrupted with plausible-but-incorrect alternatives, forcing the model to detect and override memory errors rather than reproduce them verbatim.
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). Per-step ordering is before → reasoning → action → at → after, mirroring causal reality (the click at-frame is a consequence of the action and is unavailable when the model must generate it).
Stage 3 — Post-Training RL: Memory Adherence
Algorithm: GRPO — eliminates a separate value network, critical given the multi-image KV cache (a duplicate critic backbone would hold an identical gigabyte-scale copy of the image encodings per session).
Three-component reward ($G = 8$ trajectories per task):
| Component | Weight | What it measures |
|---|---|---|
| $R_{\text{align}}$ — Step Alignment | $\alpha = 0.3$ | Cosine similarity between agent reasoning and memory step text (domain-specific CUA encoder), plus a Process Reward Model term ($\lambda = 0.2$) that scores step-level reasoning quality against the three-frame visual context |
| $R_{\text{spatial}}$ — Visual Grounding | $\beta = 0.4$ | Euclidean pixel distance: agent click vs. memory at-frame annotation, with per-pair tolerance $\tau_{\text{px}}$ (10 px tight / 50 px default) |
| $R_{\text{outcome}}$ — Outcome Consistency | $\gamma = 0.3$ | Visual-encoder similarity between agent terminal after-frame and memory terminal after-frame |
$R_{\text{spatial}}$ carries the highest weight — spatial precision is the hardest CUA skill to acquire from language supervision alone.
Reward correctness details that make the signal gameable-resistant:
- Monotonic alignment (DTW). Trajectory and memory need not have equal length or matching order; per-step terms operate over an explicit monotonic alignment, weighted by trajectory-side coverage so a path that aligns a few steps and wanders elsewhere cannot average away its low scores.
- Validity-conditional reward. On the injected-corruption episodes, per-step terms are computed against the pre-corruption original step — so "follow the memory when it is right, override it when it is wrong" is the literal optimum, closing the SFT↔RL contradiction rather than being a hoped-for side effect.
- PRM decoupling. The Process Reward Model is trained exclusively on human-annotated sessions and deployed frozen during RL, breaking the circular dependency of critiquing VLM annotations with a critic trained on the same signal.
- Cold-start protocol. A rule-based reward warm-up (first 10% of steps), single-step task curriculum, and group-size annealing ($G{=}4 \to 8$) prevent the degenerate $\text{std}(R)\approx 0$ that would make the group-relative advantage numerically unstable.
Stage 4 — Inference: Retrieval-Augmented Execution
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. Staleness half-life is per application category (web 30d · desktop productivity 90d · CLI 365d), not a uniform threshold. (All latencies are projections pending the §6.1 retrieval benchmark.)
Working memory update: deviation from the retrieved memory is tracked per step via after-frame similarity. Three consecutive steps with deviation score > 0.4 triggers re-retrieval or new-memory creation.
New memory creation: on task success in the generalisation path, the full execution trajectory is compiled into a new memory.md (pending_review = true) and added to the library — growing it endogenously each cycle.
New memories created at inference and self-generated memories passing quality review both feed back into the pre-training corpus.
Self-Generated Memory & Executable Replay Verification
At training checkpoints, the model produces its own memory.md through live CUA sessions — a multi-dimensional evaluation signal without any external benchmark. The load-bearing safeguard is that no self-generated memory enters training on the strength of model-derived scores alone:
Executable replay verification (judge-independent ground truth). Every candidate memory is replayed — its steps executed in a sandboxed OS by the actuation layer, and its terminal state checked by a programmatic task validator (file existence/content, application settings, accessibility-API state). The replay verdict is a function of OS state, not of any learned scorer, and is a hard gate: a memory can be retrievable, but it cannot enter the training corpus without a passing replay.
The VLM-derived signals below are retained as diagnostics but are never the sole basis for recycling data into training:
| Signal | Detects | Threshold |
|---|---|---|
| Executable replay pass | Task actually completed (not a look-alike final state) | Binary hard gate |
| MinHash LSH similarity to training memories, OOD tasks only | Overfitting (verbatim reproduction on novel tasks) | > 0.85 flags; track $G_{\text{gap}} = \overline{\text{sim}}{\text{in-dist}} - \overline{\text{sim}}{\text{OOD}}$ |
| Reasoning depth (causal-connective density + step completeness) | Underfitting | Monitored across training |
| Entity overlap: reasoning vs at/after frames | Context-awareness | > 0.75 average |
| Step-count ratio < 1.0 + $R_{\text{outcome}} > 0.85$ + procedure completeness | Super-human performance | All three → mandatory human review |
Self-training collapse safeguards: recycled self-generated memories are capped at 25% of any pre-training cycle; a frozen, never-retrained judge holdout raises a reward-drift alarm if acceptance scores climb without a matching replay-pass improvement; and replay verification gates every recycled memory.
Pre-Registered Experiments
The paradigm's value is stated as contingent on experiments whose designs are fixed here in advance.
Minimum-cost first test — the memory-conditioned SFT ablation (§5.3)
The full paradigm requires pre-training, RL, and a retrieval stack. The Format Consistency Hypothesis, however, admits a minimum-cost first test that needs none of them — and the paper commits to it as the first empirical milestone.
| Backbone | Qwen2-VL-2B-Instruct (GQA, dynamic resolution, 32K native), LoRA — a single 24–48 GB GPU |
| Corpus | the ≈100-session Phase-1 set, task-clustered so every session has a cross-session partner or a declared singleton — released and instantiated at 101 sessions |
| Split | by task cluster, never by session (≈80 train / 20 held-out — the recommended scale; the released corpus resolves to 36 clusters, supporting small-scale runs), verified cross-split MinHash similarity < 0.85 |
| Conditions | B+mem (Formulation B, cross-session memory in context, 10–20% corruption) vs. B−mem (identical in every respect except the memory block is removed); 3 seeds each |
| Decision rule | hypothesis survives iff B+mem exceeds B−mem on held-out next-action accuracy by ≥ 3 pp and a paired permutation test ($\alpha = 0.05$, two-tailed, $10^4$ permutations) rejects the null |
| Cost | six runs of a few GPU-hours each — roughly a weekend on one GPU |
Validity threats checked before believing any result: split leakage (controlled by the cross-split similarity check); winning by transcription (if the corrupted-step override rate is ≈0%, the model is copying memories, not learning to use them — the win does not support the hypothesis); and floor effects (if both conditions are at floor on held-out clusters, the corpus is too small and the experiment is uninformative, not negative).
This ablation is the direct motivation for the Memory Archive corpus-capture effort. That capture is now complete: 101 annotated sessions across 36 task clusters (see The Corpus) are the substrate this first falsification test runs on. The ≈80/20 cluster split is the recommended scale for the confirmatory run — task clusters, not sessions, are the exchangeable unit of the permutation test, so the held-out cluster count sets the attainable power. The released corpus resolves to 36 clusters, since ≈100 sessions yield fewer clusters than sessions whenever the same task is recorded across several modalities or operating systems, and therefore supports a small-scale run rather than the powered test.
Full three-condition protocol (§5.1)
- Condition A (full paradigm): format-consistent pre-training → memory-conditioned SFT → memory-adherence RL → retrieval at inference.
- Condition B (standard): same base model, no
memory.md, screenshot/action SFT, outcome RL, zero-shot inference. - Condition C (retrieval-only): trained as B, memory retrieval added at inference only.
Expected result: A > C > B. A-vs-C isolates the additional value of format-consistent training; C-vs-B isolates inference-only retrieval value. The design is paired (every task under every condition), analysed with a Wilcoxon signed-rank / paired permutation test on per-task differences, Bonferroni-corrected across the three nulls, powered at $N \approx 90$ tasks stratified across OSWorld categories. All comparisons are reported stratified by retrieval hit/miss, with the pre-registered prediction that the effect concentrates on retrieval hits — a flat hit/miss profile would indicate the improvement comes from something other than the hypothesised mechanism.
Inference Efficiency — TurboQuant
The inference KV cache has two unusually demanding properties: the context grows continuously as each step appends before/at/after image encodings, and the retrieved memory.md head is never evicted. TurboQuant (training-free, model-agnostic online vector quantization) is applied at two points, inference-only:
- KV-cache compression: 16-bit →
3.5 bit/element, a **4.6× reduction**, raising the concurrent-session ceiling on an 80 GB GPU (e.g. ≈21 → ≈98 sessions for a GQA 7B backbone). It relieves memory capacity, not context length. - Retrieval-index compression: the HNSW vector payload compresses ~9.1× (FP32 → 3.5-bit); end-to-end index compression is roughly half that once the uncompressed graph-link structure is counted.
An open empirical question (§7.1.1): annotated mouse at-frames concentrate KV energy in a spatially bounded region and may present a non-isotropic component that TurboQuant's rotation does not fully whiten — monitoring $R_{\text{spatial}}$ before/after activation is the required check before production deployment.
Comparison with Existing CUA Approaches
Scored on a formal, symmetric Format Consistency metric — the fraction of a fixed five-field artifact inventory structurally preserved from training to inference (half-credit where an artifact exists at only one end of the boundary). The Memory Archive row reflects design intent (no trained checkpoints); every baseline row describes a published, evaluated system.
| System | Process Labels | Memory at Inference | Format Consistency |
|---|---|---|---|
| Behavioral Cloning | None | None | Low (0/5) |
| UI-TARS / OpenCUA-32B | Synthetic CoT | None | Medium (2/5) |
| UI-R1 | None | None | Low (1/5) |
| ICAL | VLM-abstracted | Retrieved (implicit) | Medium–High (3.5/5) |
| HyMEM | None | Graph-structured | Medium (1.5/5) |
| SkillRL | Distilled skills | Hierarchical skills | Medium (1.5/5) |
| Memory Archive | VLM-gen + human cal | memory.md (same as training) |
High (5/5) — by design, untrained |
What the strongest counter-arguments get right (owed concessions): ICAL's abstraction is a robustness choice — compressing trajectories into causal programs deliberately discards the per-step pixel coordinates Memory Archive preserves; whether pixel-level grounding (with augmentation and staleness control) beats abstraction is an open empirical question. HyMEM's graph structure addresses task composition, which Memory Archive defers to §6.5 as an open problem. Table 5 legitimately claims a hypothesis about format consistency, backed by the pre-registered tests — not a win.
Broader lineage: the retrieval-and-reuse core has substantial precedent — Agent Workflow Memory (text-only workflow induction), Synapse (trajectory-as-exemplar), Agent S (web + episodic memory for GUI control), Voyager (self-generated, verified, retrieved skills in an embodied domain), and Reflexion (self-generated textual memory as a learning signal). Memory Archive's distinguishing commitments are narrower than "memory at inference": (1) the memory object is a first-class artifact at every training stage; (2) memories carry per-step visual grounding (at-frame references and click coordinates); (3) memory adherence and override are explicit RL training signals.
Open Problems (§6)
Stated as engineering/research prerequisites, not deferred nice-to-haves:
- Retrieval accuracy benchmark (critical) — precision@1, recall@5, false-positive rate across task/OS/version filter axes; required before deploying retrieval at all.
- Memory versioning & staleness (high) —
validity_envmetadata, compatibility pre-filtering, an $R_{\text{outcome}}$-divergence staleness detector. - VLM reasoning quality & human–VLM consistency (high) — the VLM is the primary annotation source, so its hallucination/step-conflation/vocabulary-drift is a precondition, not a deferred question.
- Actuation schema drift (high) — CommandEvent schema changes partially misalign existing data; needs version pinning + a migration pipeline.
- Memory composition (medium) — sequential chaining vs. hierarchical decomposition vs. cross-linked composition for multi-memory tasks.
- Auto-generated memory quality gate (medium) — two judge-independent hard gates (replay, novelty) plus a graded composite acceptance score.
- Continual learning & memory consolidation (medium) — merging new sessions into existing memories rather than always creating new ones.
The Corpus
The corpus this paradigm is built on has been captured and finalised. It is the empirical artifact of this work — every session recorded through the instrumentation described above, against live desktop environments rather than simulated ones.
| Sessions | 101, all fully annotated (annotation density 1.00) |
| Operating systems | macOS 52 · Windows 49 |
| Task clusters | 36 |
| Annotated steps | 884 |
| Per step | before / at / after frames, actuation record, reasoning annotation |
| Per session | compiled memory.md, actuation command files, metadata.json |
Sessions are paired for cross-session retrieval: 51 cross-procedure pairs (same task, different route), 38 cross-environment pairs (same task, different OS or interaction modality), and 12 declared singletons that use the cold-start partial-memory path.
The task-twin design is the corpus's distinguishing property — the same job is recorded across GUI and terminal modalities, and across macOS and Windows, so a memory compiled from one modality can be evaluated as retrieval context for its twin.
The corpus is publicly available on the Hugging Face Hub under CC BY-NC 4.0, recorded and annotated by the author using the Memory Archive collection system. Reasoning annotations in this release were authored through the human annotation mode, no VLM Reasoning Model was used in the annotation; every step label is human-authored.
👉 huggingface.co/datasets/NullVoider/Memory-Archive-Paradigm
Sessions live under data/sessions/<task-name>/, each carrying memory.md, metadata.json, commands/, reasoning/, and vision/ — the full artifact set of Table 1 in the paper.
Memory Archive Tool
The data collection system that generates the training corpus described in this paper is developed as part of Project Dockyard.
👉 github.com/nullvoider07/Memory-Archive
Limitations and Scope
The Memory Archive training paradigm presented here has not been trained end-to-end. The scope disclaimer covers not only the numerical hyperparameters — reward weights ($\alpha=0.3,\ \beta=0.4,\ \gamma=0.3$), GRPO group size ($G=8$), LoRA rank and learning rates, token loss weights, data mixing ratios, PRM calibration weights, retrieval thresholds ($\text{conf}=0.65,\ \text{dev}=0.4$), and staleness periods — but equally every performance figure: the SFT/RL targets, the retrieval recall and latency figures, the OSWorld variance planning value, and the phase-scale minimums. All are design recommendations and projections derived from principled reasoning and analogous published systems. None has been validated on any Memory Archive training run; each should be treated as a starting point requiring held-out validation before production use.
Validation milestones, in order of cost: first, the pre-registered memory-conditioned SFT ablation (§5.3) — a weekend of compute on the Phase-1 corpus, testing the format-prior component directly; second, a small-scale pre-training experiment on a 1B–3B VLM; third, the full three-condition protocol (§5.1).
Citation
@misc{kartik2026memoryarchive,
title = {Memory Archive: A Memory-Grounded Training Paradigm
for Computer Use Agents},
author = {Kartik A.},
year = {2026},
howpublished = {Project Dockyard},
doi = {10.5281/zenodo.22079081},
note = {Independent Research. Design specification and
pre-registered protocol. Preprint available at Zenodo:
\url{https://doi.org/10.5281/zenodo.22079081}}
}
Acknowledgements
I acknowledge Anthropic's Claude for assistance during the research and conceptualisation phase of this work. Both Claude and Google's Gemini provided support in debugging, formatting, and typesetting the final LaTeX manuscript.
License
This work is licensed under the CC-BY-NC 4.0.
© 2026 Kartik A. · Project Dockyard
- Downloads last month
- 91







