The memory problem in AI
A language model without an external memory mechanism does not retain an application’s earlier sessions by itself. This project investigates reuse of computed states to address:
- No learning across sessions: Every conversation reinvents the wheel
- Computational waste: Identical attention patterns recomputed endlessly
- Context constraints: Hard limits on what the model can “remember”
The ARMS proposal
ARMS proposes using spatial partitioning as an organizing analogy for model-state memory. The intended architecture and the tested ARM prototype are distinct:
- State payload
- Store with coordinates
- Retrieve
- Reuse
- Hidden state
- Learned projection
- FAISS lookup
- Retrieve payload
The game engine analogy. Game engines can partition space to narrow collision searches. ARMS proposes a hierarchy to narrow memory searches. The analogy does not establish the same efficiency in high-dimensional model states; that requires measurement.
The project states its design philosophy in three lines:
The hierarchy IS the access pattern.
Position IS relationship.
The space IS the index.
The project uses a hippocampus analogy to motivate hierarchical memory. Its proposed storage and retrieval behavior must be evaluated separately from that analogy.
Architecture
ARMS uses hexagonal (ports and adapters) architecture with clean domain separation:
Six domains
-
CORE DOMAIN - Pure business logic, no I/O
- State representation
- Coordinate mathematics
- Hierarchy rules (chunk → doc → session → domain)
-
STORAGE DOMAIN - Tier management
- RAM / NVMe / Archive
- Promotion and eviction
- Memory mapping
-
INDEX DOMAIN - Spatial lookup
- 4096-dimensional indexing
- Temporal indexing
- Query execution
-
LATENCY DOMAIN - Runtime performance
- Tier latency probing
- Budget allocation
- Capacity tracking
-
INJECTION DOMAIN - Model integration
- PyTorch hook integration
- State format conversion
- Injection point selection
-
QUERY DOMAIN - External API
- Clean interface design
- Request validation
- Response formatting
The container model
The proposed container model groups state payloads into snapshots that could be stored and reused. Compatibility with a model’s tensor shapes, position handling and injection point is an integration requirement:
- Level 0: Global all memory
- Level 1: Domains AI Research, DevOps, Business, etc.
- Level 2: Sessions conversations within a domain
- Level 3: Documents logical groupings
- Level 4: Chunks leaf nodes holding the attention states
Each container stores:
- Centroid: 4096-dimensional mean of descendants
- Children: Pointers to child containers
- Timestamp: For temporal locality
- Metadata: Context, source, relationships
Reported results: ARM prototype
The ARM (Attention Reasoning Manifold) prototype uses learned coordinates, unlike the native-state design goal above. Its original reported metrics are retained below as preliminary claims with unresolved definitions.
The public ARMS repository describes validation limited to synthetic GPT-2 tests with fewer than 100 stored states. That repository description does not supply a run-level mapping to the compression table below.
| Metric | Value |
|---|---|
| Reported retrieval accuracy | 100%; metric and test-set definition not supplied here |
| Reported compression ratio | 5,372×; storage accounting unresolved |
| Reported cross-topic similarity | −0.33; distribution and decision criterion not supplied |
| Tested context lengths | 50–400 tokens; not proof of scale invariance |
How it works
- ContrastiveARMEncoder - Projects hidden states to 4096-dim coordinates using contrastive learning (InfoNCE loss)
- HierarchicalMemory - Multi-level memory with chunking
- MultiScaleTrainer - Trains encoder on varied context lengths
- CoordinateStore - FAISS-based vector index
Projection and payload storage
Attention states are projected to coordinates:
# Hidden state (768-dim) → Coordinate (4096-dim)
coordinate = encoder(hidden_state) # Learned projection
# Store at coordinate position
store.add(coordinate, attention_state)
# Retrieve by proximity
retrieved = store.nearest(query_coordinate, k=10)
What the prototype does not yet establish
The example stores both a coordinate and an attention_state payload. A 768-to-4,096-dimensional projection does not by itself explain a 5,372× storage reduction. To reproduce that ratio, a run record must identify the original tensor type, shape and precision; original byte count; stored payload and coordinate bytes; metadata; encoder weights; and which costs are amortized or excluded.
Likewise, retrieving the expected record is different from reconstructing a tensor exactly or preserving a downstream answer. A reconstruction claim needs a tensor comparison, numerical tolerance and task evaluation. None is defined alongside this table.
The original rationale included approximately 90% low-magnitude attention weights and a roughly 5,000× reduction. Low magnitude alone does not establish safe pruning; those statements remain hypotheses or incompletely specified observations, rather than general properties demonstrated here.
Design principles
The .kkrieger principle
The project draws an analogy to compact procedural assets: store a generator when it can reproduce the desired object. For ARMS, coordinates and metadata alone have not been shown here to reconstruct arbitrary states. The prototype code above explicitly stores a payload; compression accounting must include that payload or explain how it is regenerated.
Minimal core: five primitives
Point // Position in 4096-dim space
Id // Unique identifier (u128)
Blob // Opaque payload (attention state)
Proximity // Distance relationship
Merge // Composition operation
Everything else builds on these five primitives.
Implementation status
Scaffold reported in January 2026:
- 64 unit tests passing
- All 5 primitives implemented
- Trait contracts defined
- Memory and flat index adapters complete
Original build plan (January 2026):
- Phase 1: Core (complete). Pure logic, fully testable
- Phase 2: Ports (complete). StoragePort, IndexPort, LatencyPort contracts
- Phase 3: Adapters (in progress)
- RAM Storage Adapter ✓
- NVMe Storage Adapter
- Spatial Index Adapter ✓
- System Probe Adapter
- Phase 4: Inbound ports
- Query Port (Python bindings)
- Injection Port (PyTorch integration)
- Admin Port (CLI)
- Phase 5: Integration. Wire everything, integration tests
The scaffold and build plan above describe the January report, not a new September implementation test. The reported 64 passing unit tests concern software behavior; they do not verify the compression or reconstruction claims.
Related research
CMS: Computational Memory Snapshots
The original report lists separate CMS results without a run-level artifact mapping in this article. They are not validation of the ARMS compression ratio:
- 25× context extension (4K model → 100K effective)
- 84.8% compute reduction
- 18.4× compression ratio
CIT: Compute Image Tokenizer
A proposed direction for encoding attention as images; the following are research aims rather than validated ARMS results:
- Vision transformers can “read” attention patterns
- 100-1000× compression potential
- Human-inspectable memory visualizations
Conclusion
ARMS proposes a spatial organization for persistent model-state memory. The separate ARM prototype supplies early observations, but it does not establish general logarithmic retrieval, lossless compression or preserved downstream behavior. The next evidentiary step is a versioned run with complete storage accounting, defined retrieval and reconstruction metrics, and an evaluated model integration. This editorial revision adds those distinctions without new experiments.
Get started
The ARMS source repository contains the memory architecture; HAT is a related experimental index. Their availability does not mean that every adapter in the proposed build plan is complete:
- ARMS source: github.com/Lumi-node/ARMS
- HAT index: github.com/Lumi-node/HAT
- Installation and adapter status: Follow the instructions in the respective repositories
Part of ongoing research into computational memory systems at Automate Capture.