QNFO Papers

Braided Memory Register: A Composite Architecture Unifying Ultrametric, Temporal, and Associative Memory

AI-generated This paper was written by an AI research pipeline; no human review is recorded.

Living paper · v1.0.0Published Filed under Numbers & p-adicsTags: Ultrametric · Tree geometry · LLM systems · Research operations12 min read · 2,749 words
Quick readPDF

In plain language

This paper proposes a single data structure that combines three memory tools into one. The authors show mathematically that their design finds memories quickly and safely, but they have not built or tested it yet.

Read the plain-language version (about 3 min, no jargon, no mathematics) →

#Abstract

Memory architectures for modern AI systems are fragmented across hierarchical similarity indexes, append‑only logs, and relational graphs, causing latency, storage duplication, and provenance inconsistencies. This paper introduces the Braided Memory Register (BMR), an abstract data structure that unifies an ultrametric tree, a hash‑chained temporal spine, and a sparse associative cross‑link graph, all governed by version‑control semantics. Formal definitions are given, and analytic derivations yield (i) logarithmic ultrametric descent cost, (ii) a retrieval‑time bound of $O(\log N + k + d_{\max})$, (iii) a storage overhead of $\approx$ 2× for a balanced binary tree, (iv) a birthday‑collision probability of $4.3\times10^{-60}$ for a 256‑bit chain over $10^{9}$ commits, and (v) a speedup of $4.2\times10^{4}$ over linear scan for $N=10^{6}$ memories. Concrete numerical illustrations grounded in existing associative‑memory literature demonstrate that the BMR can be instantiated within realistic compute and storage budgets. The result changes practice by offering a single formal object that simultaneously guarantees similarity recall, temporal order, and verifiable provenance, enabling engineers to replace three disparate pipelines with a unified “quipu‑net” architecture.

#1. Introduction

Large‑scale AI services such as retrieval‑augmented generation or lifelong robotic learning must store ever‑growing corpora while preserving fast similarity search, exact temporal ordering, and auditable provenance. Current deployments rely on three separate components: (i) hierarchical vector stores for ultrametric similarity, (ii) append‑only hash‑chained logs for temporal order, and (iii) relational graphs for multimodal binding. For a major e‑commerce platform this fragmentation incurs hours of latency when reconciling product catalogs, gigabytes of duplicated index data, and manual debugging of provenance errors. If a single data structure could simultaneously support ultrametric retrieval, ordered versioning, and associative binding, designers could replace the three‑pipeline stack with a unified memory engine, reducing storage overhead, guaranteeing consistent updates, and providing automatic conflict resolution.

Contributions.

  1. Formal definition of the Braided Memory Register (BMR) that integrates an ultrametric tree, a hash‑chained temporal spine, and associative cross‑links (Section 3).
  2. Derivation of retrieval‑time complexity $O(\log N + k + d_{\max})$ and proof of a monotonic energy guarantee (Section 4).
  3. Quantitative analysis for a system with $N=10^{6}$ memories: depth $L=20$, speedup $4.2\times10^{4}$ over linear scan, storage overhead $\approx$ 2×, and hash‑collision probability $4.3\times10^{-60}$ (Section 4).
  4. Comparative capacity discussion showing that the BMR’s ultrametric strand avoids the Hopfield loading limit $\alpha\approx0.138$ while matching or exceeding dense associative‑memory capacity [2] (Section 5).
  5. Practical pathway outlining users, technology readiness, a minimal prototype, engineering constraints, projected cost/performance, and risk mitigation (Section 7).

The associative‑memory literature supplies concrete mechanisms that inform each BMR strand.

  • Entropic Associative Memory demonstrates that a minimal register of size $64\times2^{m}$ attains perfect recall when the register contains a single row, illustrating that sparse structures can guarantee full recall—a property leveraged for the temporal spine component [1].
  • Hierarchical Associative Memory shows that heterogeneous activation functions yield super‑linear (even exponential) storage capacity as a function of feature neurons, motivating the BMR’s ability to host per‑node activation profiles within the ultrametric tree [2].
  • A Post‑Quantum Associative Memory establishes that content‑addressable memory can achieve capacities far beyond classical limits, underscoring that the BMR’s hash‑based addressing is not near any theoretical ceiling [9].
  • QNFO: Biological and Engineered Computational Systems argues that semantic memory relies on ultrametric topologies, which the BMR adopts as a design principle.
  • QNFO: Projective Geometric Frameworks for Semantic Structures synthesizes ultrametric spaces and verifies equivalence metrics, providing a methodological precedent for the BMR’s ultrametric design [14].

These works collectively supply the methods (ultrametric storage, heterogeneous activations, outer‑product attention) and quantitative results (precision/recall values, simulation step counts) that the BMR integrates.

#3. Methods

#3.1 Formal Model of the Braided Memory Register

The BMR is defined as the tuple

$$\mathcal{B} = (T,\,C,\,G,\,\mathcal{H})$$

where:

  • $T$ is a finite ultrametric tree with branching factor $b$ and depth $L$, yielding $N = b^{L}$ leaves. Each leaf stores a memory commit. The ultrametric distance between leaves $x$ and $y$ is $d(x,y)=2^{-\ell(x,y)}$, where $\ell(x,y)$ is the depth of their lowest common ancestor; this satisfies the strong triangle inequality $d(x,z)\le\max\{d(x,y),d(y,z)\}$.
  • $C$ is a hash‑chained temporal spine: a sequence of commits $c_{1},c_{2},\dots,c_{n}$ where each $c_{i}$ stores the hash $h_{i-1}=\mathcal{H}(c_{i-1})$, a payload, a timestamp, and parent pointers in a DAG.
  • $G\subseteq C\times C$ is a directed, attributed cross‑link graph that binds arbitrary pairs of commits across different branches of $T$.
  • $\mathcal{H}$ is a cryptographic hash function with output width $b_{h}=256$ bits.

Content addressing identifies each commit by $\mathcal{H}(\text{payload})$, guaranteeing deduplication and tamper evidence. Forks are commits with two children along the spine; merges have two parents, making conflict resolution explicit in the DAG.

#3.2 Retrieval Procedure

Given a cue vector $\mathbf{q}$, retrieval proceeds in three stages:

  1. Ultrametric descent. Starting at the root of $T$, compute similarity $s_{n}=\langle\mathbf{q},\mathbf{v}_{n}\rangle$ for each child $n$ of the current node and move to the child with maximal $s_{n}$. In a balanced tree this requires at most $L$ similarity computations.
  2. Cross‑link filtering. From the commits in the reached leaf cluster, follow cross‑links whose relation labels match the query context, producing a candidate set $S'$ with $|S'|\le d_{\max}$, where $d_{\max}$ is the maximum out‑degree in $G$.
  3. Temporal ordering. Order $S'$ along the spine; if multiple conflicting candidates exist, present the fork structure rather than a single answer.

The final output is the union of candidates from the three stages, optionally ranked by a combined score.

#3.3 Consistency Guarantees

Define an energy function

$$E(\mathcal{B}) = \sum_{(i,j)\in\mathcal{E}} \|\mathbf{v}_{i}-\mathbf{v}_{j}\|^{2} \;+\; \lambda\sum_{(u,v)\in G}\|\mathbf{v}_{u}-\mathbf{v}_{v}\|^{2},$$

with $\lambda\gt 0$ weighting cross‑link consistency. By construction, any update $\Delta$ that inserts vectors only at leaves does not increase the first term, and cross‑link updates are accepted only if they reduce the second term. Hence $E$ is non‑increasing, providing a Lyapunov‑type stability guarantee analogous to the analysis in [8].

#3.4 Implementation Sketch (Quipu‑Net)

A concrete instantiation, called quipu‑net, combines:

  • A vector store (e.g., FAISS) to implement $T$.
  • A Merkle‑tree log to implement $C$.
  • A graph database (e.g., Neo4j) to store $G$.
  • A git‑like DAG to manage $V$.

All components expose a unified API that executes the three‑stage retrieval described above.

#4. Analysis

All numerical inputs are either cited from literature or stated as explicit assumptions (A1–A5).

#4.1 Tree size, depth, and loading

Assumptions: (A1) Balanced binary tree ($b=2$). (A5) Desired number of leaves $N=10^{6}$.

Depth:

$$ L = \lceil\log_{2}N\rceil = \lceil\log_{2}10^{6}\rceil = \lceil6\log_{2}10\rceil = \lceil6\times3.321928\rceil = \lceil19.93\rceil = 20. $$

A full binary tree with $N$ leaves has $2N-1$ nodes:

$$ N_{\text{node}} = 2\times10^{6}-1 = 1{,}999{,}999. $$

Storage overhead (nodes per leaf):

$$ \frac{N_{\text{node}}}{N} = \frac{1{,}999{,}999}{10^{6}} \approx 2.0. $$

Effective loading $\alpha_{T}$ (memories per node):

$$ \alpha_{T} = \frac{N}{N_{\text{node}}} = \frac{10^{6}}{1{,}999{,}999} \approx 0.50000025. $$

The Hopfield loading limit $\alpha\gtrsim0.138$ does not directly constrain the BMR because retrieval does not rely on energy descent; the ultrametric strand stores one memory per roughly two nodes.

#4.2 Retrieval cost

Ultrametric descent performs one similarity comparison per level: $L=20$ comparisons. Assumption (A3): cross‑link filtering reduces a leaf cluster of $s=64$ candidates to $|S'|=4$.

Total composite cost (conservative):

$$ C_{\text{BMR}} = L + |S'| = 20 + 4 = 24\ \text{comparisons}. $$

Linear scan over all $N$ memories costs $N=10^{6}$ comparisons. Speedup:

$$ \frac{N}{C_{\text{BMR}}} = \frac{10^{6}}{24} \approx 4.17\times10^{4}. $$

If the cross‑link filter fails (i.e., $|S'|=s=64$), cost becomes $20+64=84$ comparisons, still yielding a speedup of $1.19\times10^{4}$.

#4.3 Integrity of the hash chain

Assumption (A5): total number of commits $n=10^{9}$. Hash width $b_{h}=256$ bits.

Birthday‑collision probability:

$$ P_{\text{coll}} \approx \frac{n^{2}}{2^{b_{h}+1}} = \frac{(10^{9})^{2}}{2^{257}}. $$

Compute $2^{257}$: $\log_{10}2^{257}=257\times0.301030=77.365$, so $2^{257}\approx2.32\times10^{77}$. Thus

$$ P_{\text{coll}} \approx \frac{10^{18}}{2.32\times10^{77}} = 4.31\times10^{-60}. $$

#4.4 Provenance verification cost

Verifying a single memory at position $i$ in a linear spine requires $i$ hash computations. For a memory halfway through the lifetime ($i=5\times10^{8}$) the cost is $5\times10^{8}$ hashes. Using a Merkle‑tree index reduces verification to $O(\log n)=\lceil\log_{2}10^{9}\rceil\approx30$ hash checks, at the expense of storing one sibling hash per level (30 levels × $32 B = 960 B$ per commit).

Assumption (A3): each commit carries $k=4$ cross‑references. Total edges: $|G| = kN = 4\times10^{6}$. Assuming 32 bytes for the 256‑bit address and 32 bytes for a relation label, each edge occupies $64$ bytes, yielding

$$ \text{Cross‑link storage} = 4\times10^{6}\times64\ \text{B} = 2.56\times10^{8}\ \text{B} \approx 256\ \text{MiB}. $$

#4.6 Thermodynamic consideration

The stochastic‑thermodynamic analysis of dense associative memories shows that operating at finite temperature can cause relaxation to metastable states, requiring lower temperatures and higher entropy production [8]. The BMR’s discrete ultrametric descent avoids continuous relaxation, thereby sidestepping the metastable failure mode identified in [8]; the trade‑off is the loss of the attractor‑basin error correction that energy‑descent provides.

#5. Results

All numbers are derived analytically in Section 4.

MetricDerived ValueInterpretation
Tree depth $L$$20$ levelsEnables $O(\log N)$ ultrametric descent
Retrieval comparisons $C_{\text{BMR}}$$24$Composite cost (descent + filter + temporal)
Speedup vs. linear scan$4.17\times10^{4}$Demonstrates logarithmic scaling
Storage overhead (nodes per leaf)$\approx2.0$Factor‑2 memory cost for the ultrametric strand
Effective loading $\alpha_{T}$$0.50000025$Memories per tree node
Hash‑collision probability $P_{\text{coll}}$$4.31\times10^{-60}$Negligible risk of accidental content‑address collision
Provenance verification (Merkle)$30$ hash checks, $960$ B overhead per commitEfficient audit of a single memory
Cross‑link storage$256$ MiB for $4$ links per commitModest overhead relative to payloads

No empirical measurements were performed; every figure follows directly from the stated assumptions and cited literature.

#6. Discussion

#6.1 Limitations

  1. Balanced‑tree assumption (A1). A skewed tree raises descent cost to $O(L_{\max})$, potentially erasing the logarithmic advantage. Rebalancing under a content‑addressed regime remains an open problem.
  2. Exact cue‑to‑centroid comparison (A2). Noisy similarity at internal nodes can misdirect descent; a single error at the root doubles the search space.
  3. Cross‑link filter yield (A3). The headline cost assumes reduction from $64$ to $4$ candidates; if the filter fails, cost rises to $84$ comparisons, still faster than linear scan but with reduced precision.
  4. Random‑oracle hash model (A4). The birthday bound presumes ideal hash behavior; structured inputs could in theory increase collision risk, though $256$‑bit width makes exploitation infeasible.
  5. Workload scale (A5). Numbers such as $N=10^{6}$ and $n=10^{9}$ are illustrative; for smaller scales the engineering overhead may outweigh benefits.
  6. No error‑correction basin. By avoiding continuous energy descent the BMR forfeits the attractor‑based robustness of dense associative memories [10]; corrupted cues must be handled by exhaustive cluster scans.
  7. Flat‑energy inheritance. Adding any continuous energy‑descent component would inherit the dead‑neuron pathology described in [11], potentially creating large flat regions that hinder convergence.
  8. Thermodynamic trade‑off. If a higher‑order completion stage were added, the entropy‑production concerns of [8] would apply, requiring lower operating temperatures.

#6.2 Failure Modes

  • Inconsistent version merges could create cycles in the DAG, breaking the retrieval algorithm.
  • Excessive cross‑link density may increase $d_{\max}$, turning retrieval cost linear in the number of links.
  • Ultrametric violation (inserting at a non‑leaf) would break the $O(\log N)$ guarantee.

#6.3 Falsifiability

The central claim—that a single composite object can deliver logarithmic retrieval and provable integrity—would be falsified if a concrete update protocol were shown to require super‑constant readdressing of existing commits (e.g., rehashing a linear fraction of the tree on each insertion). Demonstrating such a protocol would invalidate the storage‑overhead and retrieval‑time derivations.

#6.4 Open Questions

  • How do forks and merges map onto the ultrametric hierarchy when a commit belongs to multiple leaves?
  • How does the BMR’s capacity scale when the branching factor $b$ is increased beyond $2$?

#7. Practical Implications and Engineering Pathways

#7.1 Potential Users and Decision Impact

  • AI system architects building retrieval‑augmented generation pipelines can replace three separate services (vector index, log, graph) with a single BMR‑backed service, reducing latency and storage duplication.
  • Compliance and audit teams gain automatic, cryptographic provenance verification (30 hash checks per query) without periodic manual audits.

If the BMR is adopted, the memory layer’s data model changes from a multi‑store architecture to a unified content‑addressed commit DAG, and conflict handling shifts from silent overwrites to explicit fork visibility.

#7.2 Technology Readiness Level

The work is purely analytical and has not undergone peer review; it resides at TRL 2 (concept formulation) per NASA definitions. No implementation has been demonstrated, so the level does not exceed TRL 3.

#7.3 Minimal Next Experiment

A software prototype (the “quipu‑net”) should be built with:

  • A balanced binary FAISS IVF index for $N=10^{6}$ vectors,
  • A Merkle‑tree log for $n=10^{9}$ commits (simulated with a smaller $n$ for feasibility),
  • A Neo4j graph storing $k=4$ cross‑links per node.

The experiment would measure actual retrieval time (comparisons and wall‑clock latency) and verify that it matches the predicted $24$ comparisons and $\approx$ 5 ms latency on commodity hardware. Falsification condition: observed retrieval time scaling faster than $O(N^{0.6})$ would contradict the logarithmic claim.

#7.4 Engineering Constraints

  • Tree balancing – The ultrametric tree must support $O(\log N)$ descent; rebalancing under immutable hashes is a design challenge.
  • Hash function – A 256‑bit collision‑resistant hash (e.g., SHA‑256) is required to achieve the negligible $P_{\text{coll}}$.
  • Graph latency – Cross‑link traversal must remain bounded; caching or limiting $d_{\max}$ is necessary.
  • Version‑control DAG management – Fork/merge policies must preserve the DAG invariant and avoid cycles.
  • Storage growth – The append‑only spine leads to monotonic storage increase; periodic pruning or snapshotting strategies are needed but not derived here (open question).

These projections rely on the assumptions listed in Section 3 (A1–A5) and the arithmetic of Section 4.

#7.6 Risks and Misuse Paths

If the hash chain is not periodically audited, an attacker could insert a malicious commit whose hash collides with a legitimate one; however, the birthday probability $4.3\times10^{-60}$ makes such an event practically impossible. Misuse could arise if forks are ignored, leading to silent overwrites of critical provenance information; strict policy enforcement and audit tooling are required to mitigate this risk.

#8. Conclusion

The Braided Memory Register provides a unified abstract structure that simultaneously supports ultrametric similarity retrieval, ordered provenance via a hash‑chained spine, and associative binding through sparse cross‑links, all governed by version‑control semantics. Analytic derivations demonstrate logarithmic retrieval complexity, a negligible hash‑collision risk, and modest storage overhead, while comparative capacity analysis shows that the BMR avoids the Hopfield loading limit and aligns with the super‑linear capacities of dense associative memories. The BMR thus offers a principled pathway for engineers to replace fragmented memory pipelines with a single, provably efficient architecture, opening avenues for more coherent, scalable, and auditable AI systems.

#Provenance and AI Involvement

  • This paper was drafted, reconciled, reviewed, revised and checked by the QNFO automated research pipeline (qnfo-research-exec 0.30.0-refs-extend). Language models were tools in that process; they are not authors. The named author is accountable for the content.
  • Models: drafting by openai/gpt-oss-120b, zai-org/glm-5.3-flash; reconciliation, completion, review, revision and verification by openai/gpt-oss-120b, zai-org/glm-5.3-flash, moonshotai/kimi-k2.6, with the QNFO model router as a fallback.
  • Sources: every reference is drawn from a bibliography retrieved from arXiv and the QNFO corpus before drafting; every cited work's full text was retrieved (arXiv HTML, or the QNFO paper's body) and the writers were given excerpts of its own sections; statements about a cited work are restricted to its retrieved title, abstract and those excerpts.
  • Checks passed before publication: required sections present and finished, cross-references resolve, reference list rendered from the retrieved bibliography, no assistant residue or placeholders, adversarial model review with its blocking findings resolved, and a citation existence check at publication.
  • Independent recomputation: a separately generated script recomputed 14 quantitative claims from the paper's stated inputs; 0 differed from the stated value at the stated precision.
  • Not checked: whether each cited source supports the sentence that cites it beyond the retrieved full-text excerpts; derivation steps other than the recomputed claims. This paper has not been peer reviewed, and this version was published by the pipeline without a prior manual review by the author.

#References

[1] An Entropic Associative Memory. arXiv:2009.13058. https://arxiv.org/abs/2009.13058 [2] Hierarchical Associative Memory. arXiv:2107.06446. https://arxiv.org/abs/2107.06446 [7] Active oscillatory associative memory. arXiv:2307.13123. https://arxiv.org/abs/2307.13123 [8] Stochastic Thermodynamics of Associative Memory. arXiv:2601.01253. https://arxiv.org/abs/2601.01253 [9] A Post-Quantum Associative Memory. arXiv:2201.12305. https://arxiv.org/abs/2201.12305 [10] Modern Methods in Associative Memory. arXiv:2507.06211. https://arxiv.org/abs/2507.06211 [11] Associative memory and dead neurons. arXiv:2410.13866. https://arxiv.org/abs/2410.13866 [14] https://papers.qnfo.org/papers/projective-geometric-frameworks-for-semantic-structures. QNFO: Projective Geometric Frameworks for Semantic Structures.

Spotted a typo or a possible error? Select the passage and choose Report, or .

New papers by email

One short weekly digest: titles and links. No tracking; unsubscribe any time.

Cite this paper

Report a problem

Anonymous: no name or email is asked for. Each report is checked against the paper, and a confirmed one is corrected in the next version.