Skip to content
AI.info

Research

Graph Memory: A Structured and Interpretable Framework for Modality-Agnostic Embedding-Based Inference

Overview Research area: Machine learning — non-parametric embedding-based inference, prototype learning, graph diffusion, and multimodal learning. Technical level: Intermediate (readable without deep

Graph Memory: A Structured and Interpretable Framework for Modality-Agnostic Embedding-Based Inference
arXiv
2511.14961
Published
2025-11-18
Authors
Artur A. Oliveira, Mateus Espadoto, Roberto M. Cesar, Roberto Hirata

AI summary

Overview

Research area: Machine learning — non-parametric embedding-based inference, prototype learning, graph diffusion, and multimodal learning.

Technical level: Intermediate (readable without deep background, though graph diffusion and calibration metrics are used throughout).

Scope: This paper introduces Graph Memory (GM), a structured non-parametric framework that replaces instance-level memories with a compact graph of reliability-annotated prototype regions and performs inference by diffusing query evidence over that graph, evaluated on synthetic benchmarks, breast histopathology, and a multimodal clinical dataset.

What This Paper Is About

Most embedding-based classifiers either learn a global parametric decision boundary or rely on local neighborhoods of individual stored samples (as in kNN and its variants). Neither family keeps a reusable, region-level representation of how parts of the embedding space relate, where ambiguity concentrates, or how much each region should be trusted. The paper's goal is to build a compact, interpretable memory of prototype regions with explicit relations and reliability scores, and to show that inference over this memory is accurate, better calibrated, smoother, and far smaller than instance-based alternatives — including in multimodal settings where each modality gets its own graph.

Key Contributions

  1. Graph Memory (GM) as a reusable non-parametric structure. Each node is a cluster-level prototype characterized by centroid, support, dominant class, and purity, plus geometric and stability metrics (normalized silhouette, dispersion, margin, instability) aggregated into a scalar reliability score r_c in [0,1].

  2. Reliability-weighted prototype graph with evidence diffusion. Edges encode Gaussian-kernel affinity between prototypes (restricted to k-nearest prototypes), and inference propagates a query-dependent activation vector via a random-walk-with-restart process converging to a stationary distribution that blends local similarity with global structure.

  3. Unification of existing methods as limiting cases. GM recovers kNN (one prototype per instance, α = 0), nearest-centroid (one prototype per class, r_c ≡ 1), and label propagation (α > 0, uniform reliabilities), providing a single framework that bridges instance-level, class-level, and graph-based reasoning.

  4. Modality-agnostic multimodal extension. Independent graph memories are built per modality, each producing its own calibrated posterior, combined through reliability-aware late fusion, with a cross-modal agreement index that makes disagreement an explicit output rather than a failure.

Main Findings

  • Synthetic accuracy is comparable; calibration is better. On moons and circles (4000 samples each, 50/50 split), GM with K = 120 prototypes reached 0.936 (0.008) accuracy and 0.178 (0.010) NLL on moons, and 0.947 (0.005) accuracy and 0.178 (0.009) NLL on circles, versus kNN at 0.402 (0.062) and 0.331 (0.043) NLL respectively, and Label Spreading at 0.226 (0.018) and 0.206 (0.028). Accuracy was matched or exceeded, using roughly 10% of training samples.

  • Robustness under long-tail imbalance. With an 8:1 imbalance and K = 112 prototypes, GM achieved 0.871 (0.018) accuracy and 0.339 (0.052) NLL on moons, versus kNN at 0.880 (0.012) and 0.758 (0.192), and budget-kNN at 0.689 (0.033) and 1.153 (0.414) — a large drop for naive prototype compression that GM did not exhibit.

  • Smoother decision boundaries. GM reduced 2D Dirichlet energy by 30–40% relative to kNN and by 94% relative to Label Spreading. For example, on imbalanced circles GM scored 0.403 (0.044) versus kNN 0.663 (0.036) and Label Spreading 6.500 (0.726).

  • Strong results on breast histopathology (IDC). Using frozen 512-D ResNet18 embeddings and only K = 32 prototypes, GM reached the highest accuracy at 0.845 (0.000) with NLL 0.420 (0.000). kNN scored 0.840 (0.000) accuracy with NLL 1.039 (0.000), Label Spreading 0.826 (0.000) with NLL 0.531 (0.000), and the linear probe 0.836 (0.000) with NLL 0.397 (0.000). GM also had the lowest graph Dirichlet energy (0.291) versus kNN (0.321) and Label Spreading (0.344).

  • Multimodal fusion improves over either modality alone. On a synthetic blobs + moons benchmark, the fused model reached 0.995 (0.002) accuracy, 0.171 (0.004) NLL, and 0.183 (0.005) E_2D, compared with GM1 (blobs) at 0.991 (0.002) / 0.080 (0.007) / 0.418 (0.014) and GM2 (moons) at 0.873 (0.010) / 0.325 (0.004) / 0.297 (0.016). Fusion gave the smoothest boundaries even where a single modality had lower NLL.

  • AURORA multimodal clinical results. On 52 patients with a fixed 50/50 split (26/26), GM on whole-slide images reached 0.933 (0.034) accuracy and 0.917 (0.561) NLL, GM on gene expression reached 0.951 (0.039) and 0.236 (0.279), and the fused model reached 0.971 (0.013) and 0.120 (0.025). Graph Dirichlet energy was 0.634 (0.111) for WSI and 0.514 (0.122) for genetic features.

  • Calibration advantage is not universal across every metric. In the IDC table, the linear probe had a lower NLL (0.397) than GM (0.420), so the paper's claim of "near-parametric NLL" on IDC is accurate as stated, while the abstract's broader claim about "substantially better calibration" refers to comparisons against kNN and Label Spreading.

  • Memory footprint. The abstract claims an order-of-magnitude smaller memory footprint than the baselines; specific memory measurements are not reported in the available content.

  • Selected hyperparameters. Synthetic: K = 120 (balanced) or 112 (imbalanced), k_graph = 10, α = 0.5, β = 0.1, attach-k = 8. IDC: K = 32, same remaining hyperparameters. AURORA: one prototype per training sample, k_graph = 6, attach-k = 3, α = 0.1, β = 0.05. Reliability weights λ_i default to 1. Results are reported as mean (std) over ten runs.

Methodology in Plain English

The approach has three steps. First, all embeddings — regardless of class — are partitioned into K groups using K-means or K-medoids, so mixed boundary regions stay together instead of being split by per-class clustering. Each group becomes a prototype storing its centroid, how many samples it covers, its most frequent class, and its purity.

Second, each prototype gets a reliability score from five signals: how well separated it is from neighboring clusters (a rescaled silhouette), how spread out its members are (dispersion), how far its centroid is from centroids of other classes (margin), how often its members get reassigned to other prototypes under small Gaussian noise (instability), and its purity. Dispersion and margin are unbounded, so they are rescaled using a median and interquartile-range transform followed by a logistic function; the bounded metrics are used directly. These are combined with non-negative weights and a logistic function into r_c.

Third, prototypes are connected in a graph: each prototype links to its k nearest prototypes with weights from a Gaussian kernel on centroid distance. The adjacency matrix is symmetrized and row-normalized into a stochastic matrix S. At inference, a query embedding produces an initial activation over prototypes based on distance weighted by reliability. Rather than predicting from that directly, the activation is propagated with a random-walk-with-restart update — with probability α it moves along the graph, with probability 1 − α it restarts from the query activation — which converges to z = (I − αS)^(−1) z_0. Class probabilities are the sum of stationary activations over prototypes sharing a dominant label. When α = 0, the method collapses to a weighted kNN-like scheme; increasing α brings in more relational context.

For multimodal data, one graph memory is built per modality on that modality's own embeddings, each producing a posterior. These posteriors are combined at the decision level using mean prototype reliability per query as fusion weights (with optional modality weights ω_m), avoiding brittle early fusion. A consistency index measures pairwise agreement between modality posteriors.

Evaluation used frozen embeddings, shared train/test splits, and shared preprocessing across all methods. Baselines were a linear probe (multinomial logistic regression), kNN, budget-kNN (kNN on a stratified subset matching GM's prototype budget), and scikit-learn Label Spreading. Metrics were Top-1 accuracy, NLL, and smoothness via mean squared gradient (2D) or graph Dirichlet energy (higher dimensions). Hyperparameters were selected on validation data. For AURORA, WSI embeddings came from TITAN with median aggregation per patient, gene expression was filtered to remove 5510 of 58,388 extremely low-variance genes (retaining 52,878 features), and a ResNet18 was finetuned per modality for 20 epochs with a 256-D projection head; training was repeated over 10 random seeds.

Why This Matters

Impact on research. The paper reframes non-parametric inference from "store instances, look up neighbors" to "store reliable regions, diffuse evidence." It supplies a construction that generalizes kNN, nearest-centroid, and label propagation, and it makes reliability and ambiguity first-class signals rather than afterthoughts. The late-fusion scheme also offers an alternative to early fusion in multimodal learning, where scale and noise mismatches often make embedding-space concatenation fragile.

Real-world applications:

  • Digital pathology. The IDC experiment shows a 32-prototype memory achieving 0.845 accuracy on frozen ResNet18 features, which matters where storage, latency, and the need to explain a decision to a pathologist all constrain deployment.

  • Multimodal oncology. The AURORA setup pairs whole-slide images with RNA-seq to distinguish primary from metastatic breast tumors, and the fused model reached 0.971 accuracy with NLL 0.120, while also surfacing where modalities disagree.

  • Long-tail and rare-class settings. The 8:1 imbalance experiments suggest the region-level structure degrades more gracefully than instance-based methods when minority samples are scarce.

  • Privacy-aware or continual systems. Because the memory stores cluster-level statistics rather than raw instances, and because GM is inductive (unlike Label Spreading, which is transductive), it is compatible with settings where new queries arrive after training and where retaining examples is undesirable.

Industry relevance. The memory reduction the authors claim — an order-of-magnitude smaller footprint, with only about 10% of training samples needed on synthetic data — targets the serving cost of large non-parametric retrieval stores. GM is embedding-agnostic, so it can be attached as a non-parametric head on top of any frozen encoder without retraining or architectural changes, which lowers integration cost for teams already running pretrained backbones.

Future Directions

  • Specifying graph construction more rigorously. The paper itself notes that graph construction remains under-specified in prior work; open questions include how to choose K, k_graph, α, and β systematically, and how these interact with embedding dimensionality.

  • Scaling beyond the tested regimes. Evaluation covers two 4000-sample synthetic datasets, one histopathology dataset, and 52 patients in AURORA. Whether the reliability estimates remain stable at much larger K or with many more prototypes per modality is not established here.

  • Learning or calibrating the fusion weights. The modality weights ω_m were set to 1 in the reported experiments. Learning them from data, or making them query-dependent, is a natural extension the paper leaves open.

  • Understanding when edges actually help. The authors state that prototype activations alone often suffice for accuracy and that edges primarily provide contextual coherence and ambiguity quantification. Determining when the graph structure materially improves predictions — versus only interpretability — is an unresolved question, as is turning cross-modal disagreement into a downstream clinical signal.

Target Audience

Researchers and practitioners working on retrieval-augmented or non-parametric classification, prototype-based interpretability, graph-based semi-supervised learning, and multimodal biomedical ML. It is also relevant to engineers who need to serve embedding-based inference under memory or latency constraints, and to readers interested in calibration and smoothness of decision functions rather than raw accuracy alone. Readers without prior exposure to graph diffusion or calibration metrics will need to consult the cited background (Personalized PageRank, label propagation, Dirichlet energy) for full context.

Authors’ abstract

We introduce Graph Memory (GM), a structured non-parametric framework that represents an embedding space through a compact graph of reliability-annotated prototype regions. GM encodes local geometry and regional ambiguity through prototype relations and performs inference by diffusing query evidence across this structure, unifying instance retrieval, prototype-based reasoning, and graph diffusion within a single inductive and interpretable model. The framework is inherently modality-agnostic: in multimodal settings, independent prototype graphs are constructed for each modality and their calibrated predictions are combined through reliability-aware late fusion, enabling transparent integration of heterogeneous sources such as whole-slide images and gene-expression profiles. Experiments on synthetic benchmarks, breast histopathology (IDC), and the multimodal AURORA dataset show that GM matches or exceeds the accuracy of kNN and Label Spreading while providing substantially better calibration, smoother decision boundaries, and an order-of-magnitude smaller memory footprint. By explicitly modeling regional reliability and relational structure, GM offers a principled and interpretable approach to non-parametric inference across single- and multi-modal domains.

Read the original paper