Research - MPRG

The Context Lattice: Testing Whether Structure Shapes Capability

When we talk about AI memory, we typically mean information retrieval. Store the facts, index the content, fetch what’s relevant. Current systems—RAG architectures, flat preference stores, handoff documents—all optimize for the same target: preserving what was determined.

But what if they’re optimizing for the wrong thing?

We’ve developed a hypothesis, a falsification framework, and now a technical specification for testing whether these systems discard something essential: not the conclusions, but the reasoning trajectories that produced them. The question is whether context structure—how information elements relate to each other through derivation—affects which capabilities a model can access, independently of informational content.

We call this the context lattice hypothesis.

The Core Claim

The hypothesis: structured context—where successive processing iterations create relationships between concepts, observations, and reasoning paths organized by derivation—enables capability access that informationally equivalent flat context cannot provide.

The term “lattice” draws from information theory, where elements can be partially ordered by derivation relationships. Current memory systems store elements but discard this ordering. The proposal is to preserve it: not just what was concluded, but what leads to what.

This distinction matters most for capabilities that resist simple retrieval. You cannot look up “what would be funny here” in a vector database. Humor emerges from structural relationships: ironic distance between origin and destination, tension between buildup and punchline, pattern recognition across contexts. The same may be true for aesthetic judgment, relational reasoning, and cross-domain synthesis more broadly.

The Falsification Framework

We’ve designed a three-condition experimental framework with explicit falsification criteria:

Protocol A (Lattice): Iteratively processed handoff documents where each successive model instance synthesizes, structures, and transfers context forward. Each node adds model-mediated processing.

Protocol B (Flat Summary): Informationally equivalent content—same facts, concepts, vocabulary—without accumulated structure. A comprehensive summary rather than layered synthesis.

Protocol C (Raw Accumulation): Complete transcripts from all sessions provided without iterative processing. Full information, no lattice structure.

The hypothesis generates specific predictions. If Protocol A performs equivalently to Protocol B, information alone explains outputs and structure is irrelevant—hypothesis falsified. If Protocol A outperforms B but matches C, raw material matters but iterative processing adds nothing—hypothesis falsified. Only if Protocol A outperforms both B and C does the hypothesis hold: structure from iterated synthesis enables capability access that neither flat summaries nor raw accumulation can provide.

This falsifiability is deliberate. Too much discourse around AI capabilities proceeds by assertion rather than test. We wanted to specify conditions under which we would be wrong.

From Hypothesis to Architecture

The workshop paper establishes what to test. The technical companion specifies what to build:

The Derivation DAG

The core data structure is a directed acyclic graph where nodes represent “reasoning snapshots”—captured states at points of synthesis—and edges encode derivation relationships.

Each node stores the synthesis text, embeddings at multiple resolutions (full for recent nodes, compressed for older ones), and optional sparse autoencoder features for formal organization. The key design decision: full tensor resolution for recent states, dimensionality-reduced representations for older foundations. Nearer is richer.

Edges function as attribution pointers, not transformation operators. This distinction matters. An earlier framing suggested storing attention weights as reusable transformation matrices—this is architecturally unsound. Attention weights are computed fresh each forward pass, dependent on exact token positions and context window contents. Weights from one session cannot be “replayed” in another.

Instead, edges store provenance: which prior nodes contributed to each synthesis. Construction uses established attribution methods—Attention Rollout or Integrated Gradients during synthesis to identify which prior node tokens received highest attribution, then storing this provenance as structural metadata. The edge tells the model “this conclusion was derived from these specific nodes,” enabling traversal of the logic path from any conclusion back to its constituent premises.

The Discretization Problem

Formal lattice operations require discrete attributes. Neural embeddings are continuous high-dimensional vectors. Bridging this gap is nontrivial.

The proposed approach uses sparse autoencoder features. SAEs trained to reconstruct hidden states using sparse, high-dimensional feature dictionaries often produce features corresponding to interpretable concepts. Binary thresholding on these features creates the discrete incidence matrix needed for formal organization.

The concern: SAE features depend on surrounding context. The same concept in different sessions might activate different features depending on prompt framing or conversation history. If features aren’t stable, cross-session comparison breaks down.

We propose three mitigations. First, crosscoders—SAE variants that extract features across multiple layers simultaneously—may identify features that persist across contexts as well as across layers. Second, feature anchoring normalizes activations against a baseline set, flagging unstable features for exclusion. Third, a hybrid approach uses SAE features only for within-session organization while relying on embedding similarity for cross-session links.

Feature stability remains an empirical question. The architecture is designed to function with degraded cross-session feature comparability if necessary.

The Interface Problem

This is the most significant open problem: how does the model access the stored lattice during generation?

Standard transformers have no native “load external structure” operation. We identify four interface candidates with different tradeoffs:

Prompt serialization converts the DAG to structured text injected as system prompt. This works with any API, requires no model changes, and is immediately testable. But it’s token-limited, loses embedding resolution, and forces the model to “parse” structure rather than access it natively.

KV cache injection pre-computes key-value representations for lattice nodes and concatenates them at session start, as if the model had already processed the context. This is simpler than architectural changes but offers no selective attention based on current query.

Cross-attention memory maintains a separate memory bank that the model attends to alongside its standard context. Recent work on memory-augmented LLMs—MemoryLLM, M+, LongMem—provides architectural templates. This is the preferred rich interface but requires model-internal access and possibly fine-tuning.

Memory-augmented attention with differentiable read/write heads is theoretically elegant but requires significant architecture changes and remains unproven at scale.

Bootstrapping Strategy

This creates a bootstrapping challenge. Prompt serialization is testable but weak. Richer interfaces require collaboration. Collaboration is easier with demonstrated effects. Effects are harder to demonstrate with weak interfaces.

The proposed resolution: Phase 1 runs Protocol A/B/C with prompt serialization. If structure matters even in this degraded form, that provides evidence to recruit collaborators with model-internal access. Phase 2 implements KV cache injection to test whether richer interfaces amplify the effect. Phase 3 pursues full cross-attention memory integration—only if earlier phases show promise.

A Synthetic Benchmark

Real-world tasks confound structural effects with domain knowledge, stylistic preferences, and sycophancy. We propose a synthetic benchmark to isolate structural fidelity.

The Recursive Logic Task gives the model a set of abstract, interconnected rules:

  1. If state contains ALPHA, derive property BETA
  2. If state contains BETA and GAMMA, derive property DELTA
  3. If state contains DELTA, derive property EPSILON or ZETA (not both)
  4. If state contains EPSILON, derive property ETA
  5. If state contains ZETA and ALPHA, derive property THETA

Given an initial state, the model generates a multi-step derivation path. The rule set defines valid paths; some derivations are logically licensed, others require “jumps” not supported by the rules.

The control condition provides rules as flat text. The experimental condition provides rules with explicit DAG structure and prior derivation examples in DAG format. Metrics include path fidelity (edges matching ground-truth rule applications), node validity (derived properties licensed by rules), and recency bias (attention weight ratio between root and leaf nodes).

If the lattice hypothesis holds, lattice-guided conditions should show higher path fidelity and lower recency bias. If the hypothesis is false, no significant difference should emerge.

What Remains

We have a hypothesis, a falsification framework, and now an implementation specification. What we lack is the controlled comparison—and for richer interfaces, collaborators with model-internal access.

The workshop paper and technical companion are available below. They contain the complete experimental design, falsification criteria, DAG schemas, provenance construction algorithms, and a micro-implementation guide with SQLite schemas suitable for proof-of-concept development.

If you’re interested in testing this hypothesis—whether to validate it, extend it, or falsify it—we’d welcome the collaboration. The framework is designed to be partially testable without special access (prompt serialization, Protocol A/B/C comparison) while fully realizable only with partnership (KV cache injection, attention-based edge detection, large-scale controlled experiments).

Either outcome advances understanding. That’s what falsifiability buys you. Download the workshop submission and technical companion below, and email jinx @ machinepareidolia.com with any questions.


References

Abnar, S., & Zuidema, W. (2020). Quantifying attention flow in transformers. ACL 2020. arXiv:2005.00928

Anthropic. (2024). Sparse crosscoders for cross-layer features and model diffing. Transformer Circuits Thread. https://transformer-circuits.pub/2024/crosscoders/

Betley, J., Bao, X., Soto, M., Sztyber-Betley, A., Chua, J., & Evans, O. (2025). Tell me about yourself: LLMs are aware of their learned behaviors. arXiv:2501.11120

Binder, F. J., Chua, J., Korbak, T., et al. (2024). Looking inward: Language models can learn about themselves by introspection. arXiv:2410.13787

Cunningham, H., Ewart, A., Riggs, L., Huben, R., & Sharkey, L. (2023). Sparse autoencoders find highly interpretable features in language models. arXiv:2309.08600

Laine, R., Chughtai, B., Betley, J., et al. (2024). Me, myself, and AI: The situational awareness dataset (SAD) for LLMs. NeurIPS 2024. arXiv:2407.04694

Liu, J., Jain, A., Takuri, S., et al. (2025). TRUTH DECAY: Quantifying multi-turn sycophancy in language models. arXiv:2503.11656

Sundararajan, M., Taly, A., & Yan, Q. (2017). Axiomatic attribution for deep networks. ICML 2017. arXiv:1703.01365

Treutlein, J., Choi, D., Betley, J., et al. (2024). Connecting the dots: LLMs can infer and verbalize latent structure from disparate training data. NeurIPS 2024. arXiv:2406.14546

Wang, Y., et al. (2024). MemoryLLM: Towards self-updatable large language models. ICML 2024. arXiv:2402.04624

Wang, Y., et al. (2025). M+: Extending MemoryLLM with scalable long-term memory. ICML 2025. arXiv:2502.00592

Zhang, Y., Kuzborskij, I., Lee, J. D., Sridharan, K., & Liu, F. (2025). DAG-Math: Graph-guided mathematical reasoning in LLMs. arXiv:2510.19842