LatticeMemory / README.md
dfrokido's picture
Fix compression ratio (10.7x -> 32x) and Int4 recall numbers, add GitHub link, clarify E8 Shape Memory is a separate project
8027757 verified
|
Raw
History Blame Contribute Delete
2.94 kB
---
title: LatticeMemory
emoji: πŸ”·
colorFrom: blue
colorTo: purple
sdk: gradio
sdk_version: "5.0.1"
app_file: app.py
pinned: true
short_description: "32x compressed semantic index with E8 addresses"
---
# LatticeMemory
**32x smaller index. Same retrieval quality on cache hits. Every concept has a permanent address.**
[**β†’ GitHub**](https://github.com/sangmorg1-debug/latticememory) | [**β†’ 2-minute pitch deck**](https://sangmorg1-debug.github.io/e8-Project/pitch/pitch_deck.html)
## What This Is
LatticeMemory uses the E8 lattice β€” the densest mathematical sphere packing in 8 dimensions β€” as a universal address space for meaning. Every text embedding snaps to its nearest E8 coordinate: a 128-byte address that is **32x smaller** than float32 and enables **O(1) retrieval** on exact or near-duplicate cache hits.
## Benchmarks
**Compression (bge-large 1024-dim, 1M docs):**
| Method | Compression | Index size | Retrieval p50 @ 100K docs |
|---|---|---|---|
| Float32 | 1x | 4.1 GB | 20.8 ms |
| **E8 keys (LatticeMemory)** | **32x** | **0.13 GB** | **O(1) on key hit** |
**Fallback quality (1K docs, 100 paraphrase queries, recall vs float32):**
| Fallback | Compression vs float32 | Recall@10 overlap | Search p50 |
|---|---|---|---|
| Float32 | 1x | 100.0% | 0.14 ms |
| Int8 | 4x | 95.1% | 1.97 ms |
| Int4 | 8x | 12.1% (retrieval-unsafe) | 4.21 ms |
- E8 keys are a fast-path cache layer, not a drop-in replacement for ANN search β€” they catch exact/near-identical text instantly; novel queries fall through to the dense fallback (Int8 recommended for RAG/QA).
- STS quality: **0.8714** (bge-large RF-Snap) vs 0.8637 float32 baseline (+0.0077)
## Model
This Space uses [`dfrokido/bge-large-e8-snap`](https://huggingface.co/dfrokido/bge-large-e8-snap) β€” bge-large-en-v1.5 fine-tuned with RF-Snap training to align embeddings to the E8 lattice while improving STS quality above the float baseline.
## Try It
Type any text to see its E8 address (permanent semantic coordinate) and retrieve from a 500-doc MS-MARCO corpus. Compare float32 vs RF-Snap latency live.
## E8 Shape Memory *(experimental, separate project)*
A parallel experiment applying the same E8 lattice addressing to 3D point cloud data instead of text. Point cloud patches are split into 8-coordinate blocks and snapped to their nearest E8 point, giving each geometric region a permanent lattice address. This is packaged as a standalone desktop prototype (CLIP + OpenShape PointBERT encoders, Rust backend, Blender integration) β€” it is **not** part of the `latticememory` Python package or this Space's demo.
## Links
- [**GitHub (latticememory)**](https://github.com/sangmorg1-debug/latticememory)
- [**2-min pitch deck**](https://sangmorg1-debug.github.io/e8-Project/pitch/pitch_deck.html)
- Model: [`dfrokido/bge-large-e8-snap`](https://huggingface.co/dfrokido/bge-large-e8-snap)
- Contact for design partnerships: dfrokido@gmail.com