Manuscript Offprint
arXiv:2610.39477Topology Survives Shuffling: Robust Long-Context Memory Access Prediction for Graph Analytics
Dongyan Sun , Neelesh Gupta , Rajgopal Kannan , Viktor K. Prasanna
University of Southern California, USA
DEVCOM Army Research Office, USA
Email: {dongyans, neeleshg, prasanna}@usc.edu, rajgopal.kannan.civ@army.mil
Abstract—Graph analytics over structured complex networks generates irregular, topology-dependent memory-access streams via indirect traversals, limiting the effectiveness of data prefetching. Accurate prediction enables timely prefetches that hide memory latency. However, existing machine-learning predictors couple short histories with fixed horizons, fitting the training trace's node layout rather than learning transferable graph patterns. We propose LoCoMAP, a long-context representation-learning framework for memory-access prediction with independently controlled observation history and prediction horizon. We evaluate Connected Components (CC), PageRank (PR), and Single-Source Shortest Paths (SSSP) on six synthetic graph families, with Erdős–Rényi (ER) and Grid as random and deterministic controls. We test two interventions: same-family regeneration changes connectivity, while node shuffling disrupts layout but preserves connectivity. Across 18 graph–workload pairs, extending history from 8 to 128 accesses improves F1 by 7.8%, while extending prediction horizon from 8 to 512 improves F1 by 88.3%. For CC, regeneration is less disruptive than shuffling: without retraining, long context retains 95.4% of original F1 and outperforms short context in six families. Under full shuffle, long context improves CC F1 by 33.6% across ER, Barabási–Albert, Copying Model, and Stochastic Block Model (SBM), with a gain on SBM, but not on Watts–Strogatz or Grid, where near-zero delta mass shifts into heavy tails beyond the predictor's range. Long context outperforms short context on six real-world CC graphs. At full shuffle, long-context PR retains 57.6% of original F1 and averages 11.0% above short context. Both SSSP models retain about 30% of original F1 under full shuffle as distance updates access vertex data in a new order. Within these bounds, long-context predictors are robust across related graphs and layouts without retraining, enabling a generalizable graph prefetcher.
Index Terms—data prefetching, graph analytics, graph topology, memory access prediction, long-context modeling
I. INTRODUCTION
Data prefetching hides memory latency by predicting future memory accesses and fetching data into the cache hierarchy before the processor requests it [1]–[3]. Its effectiveness rests on accurate memory access prediction: correct and timely predictions overlap latency with computation, while incorrect ones waste bandwidth and pollute caches [4]. Rule-based hardware prefetchers exploit simple regularities such as streams and strides but fail when accesses become irregular [5]–[8]. Machine learning (ML) prefetchers instead learn access patterns as sequence models and achieve substantially higher accuracy.
on irregular workloads [9]–[11], yet graph analytics remain among the hardest applications to predict [12], [13].
Graph analytics underpin web search, recommendation systems, and social networks [14], [15], but they execute through indirect memory accesses (e.g., row[col[i]] whose targets depend on previously loaded values [16], [17], producing sparse access streams with poor locality that leave graph processing memory-bound [12], [18], [19]. This irregularity, however, is not arbitrary [20], [21]: real-world networks exhibit well-understood structure, such as power-law degree distributions [22], [23], small-world connectivity [24], and community organization [25], all of which can be reproduced under controlled conditions by synthetic graph models [22], [24], [26]–[28]. A predictor that captures this structure can use topology as an exploitable prior for memory access prediction.
Existing ML predictors do not exploit this prior. State-of-the-art approaches such as TransFetch [11], SHARP [29], and MPGraph [13] apply a single short-context configuration, with fewer than ten accesses of history, uniformly to all graph workloads, implicitly assuming that all predictive signal lies within a short window and that one configuration fits every graph structure. Neither assumption holds: different topologies induce fundamentally different delta distributions and temporal dependencies. Scale-free graphs [22] revisit hubs at long, irregular intervals; community-structured graphs [25], [28] produce clustered access bursts that exceed any short window; small-world graphs [24] interleave local traversal with long-range jumps; and spatial grids [30] are nearly deterministic. A short-context predictor cannot distinguish these regimes and instead memorizes the vertex layout of its training trace.
Hence, we propose LoCoMAP, a long-context memory access prediction framework for graph analytics. LoCoMAP executes Single-Source Shortest Paths, PageRank, and Connected Components from the GAP benchmark suite [19] on six synthetic graph families: Erdős–Rényi graphs and spatial grids as controls at the extremes of pure randomness and perfect regularity, and Barabási–Albert, Copying Model, stochastic block model, and Watts–Strogatz graphs as representatives of the major structural classes of real-world networks. LoCoMAP formulates prediction as a long-context representation learning problem in which the look-back length , the look-forward window , and the delta range are independent parameters, separating how much history a predictor needs from how far its predictions should reach. Because longer
These authors contributed equally.
Corresponding author.
© 2026 IEEE. Personal use of this material is permitted. Permission from IEEE must be obtained for all other uses, in any current or future media, including reprinting/republishing this material for advertising or promotional purposes, creating new collective works, for resale or redistribution to servers or lists, or reuse of any copyrighted component of this work in other works.
contexts raise inference cost under the strict latency budgets of ML prefetching [10], [31]–[33], we characterize the latency and FLOPs cost of extending context alongside its accuracy gains. Finally, we test whether the learned signal is genuinely topological by evaluating trained predictors under progressively shuffled node orderings, which destroy memory locality while preserving connectivity [34], [35]. We summarize our main contributions as follows:
We propose LoCoMAP, a long-context memory-access prediction framework that maps access histories to multi-hot bitmaps of future address deltas. Independently controlling observation history, prediction horizon, and delta range separates the context used to form the representation from the temporal and spatial scope of its predictions.
-
We construct a topology-controlled evaluation of CC, PR, and SSSP across six synthetic graph families. Erdős–Rényi and Grid provide random and deterministic controls; Barabási–Albert, Copying Model, stochastic block model, and Watts–Strogatz capture hub-dominated growth, link copying, community organization, and small-world connectivity across biological, web, social, and infrastructure networks. Same-family regeneration tests unseen connectivity, while progressive node shuffling tests disrupted layouts. Gnutella peer-to-peer, Skitter Internet, Google web, DBLP collaboration, FlyWire connectome, and roadCA networks extend the CC evaluation to real graphs.
-
We quantify the accuracy–cost tradeoff of long context. At fixed prediction horizon, increasing history from 8 to 128 accesses improves geometric-mean F1 by 7.8% across 18 graph–workload pairs and by up to 36.8%, while requiring the per-inference FLOPs and the latency. At fixed history, increasing the prediction horizon from 8 to 512 accesses improves geometric-mean F1 by 88.3%.
-
We identify the limits of predictor reuse without retraining. Long-context CC outperforms short-context on all held-out same-family instances and six fully shuffled real graphs, improving mean F1 on the latter by 10.2%. Under full shuffle, it improves geometric-mean F1 by 33.6% on ER, BA, CM, and SBM and reaches short-context F1 on SBM, but loses its advantage on WS and Grid, where delta mass moves beyond the output range. PR retains a long-context advantage on average, but SSSP does not.
A. Graph Analytics and Synthetic Graph Topologies
Graph analytics computes structural properties, such as shortest-path distances, vertex importance, and connectivity, by traversing a graph according to its connectivity [36], [37]. Because traversal order is determined by topology rather than memory layout, the resulting access streams are indirect, with locality that varies across applications and graph structures [12], [16], [19]. Synthetic graph models isolate the influence of topology on memory behavior while avoiding the confounding factors of real-world datasets [20], [38]. As illustrated in Fig. 1, we consider six families, ordered from independent random connectivity to deterministic spatial regularity:

Fig. 1. Graph Topologies of Synthetic Network Models.
Erdős–Rényi (ER): Erdős–Rényi graphs serve as baseline models for random communication networks and randomized distributed systems [3]. The model includes each possible edge independently with probability p [26], yielding a binomial degree distribution:
where n is the number of vertices and p is the edge inclusion probability. The result is homogeneous random connectivity with no hubs and no community structure.
Barabási–Albert (BA): Barabási–Albert graphs model scale-free networks with hub-dominated connectivity, including protein interaction networks, citation networks, and Internet autonomous systems [15]. New vertices attach to existing vertices with probability proportional to their degree [22]:
where is the probability that a new vertex connects to vertex of current degree . Preferential attachment yields a power-law degree distribution dominated by a small number of high-degree hubs [22].
Copying Model (CM): Copying Model graphs capture the hyperlink structure of the World Wide Web and related information networks, including citation graphs and online document collections [27]. Each arriving vertex selects a random prototype u and forms its i-th out-link either uniformly at random or by copying the prototype's i-th link:
where is the destination of the new vertex's -th link, is the -th neighbor of the prototype , is the current number of vertices, and is the probability of selecting a destination uniformly at random, while is the probability of copying . The indicator function equals one when and zero otherwise. Copying yields power-law degrees and locally dense link patterns that emerge stochastically rather than from an explicit global partition [27].
Stochastic Block Model (SBM): Stochastic Block Model graphs model community-structured networks such as online social communities, scientific collaboration networks, and protein interaction networks [25]. Vertices are partitioned into communities by an assignment , and each edge is included independently with probability determined by the community memberships of its endpoints:
where is the probability of an edge between vertices and , and is the block connection probability for their communities and . Setting for produces densely connected clusters joined by sparse inter-community bridges [28], [39].
Watts–Strogatz (WS): Watts–Strogatz graphs model small-world networks, including power grids, neuronal networks, and social networks [24]. Starting from a ring lattice, edges are rewired with probability p; for intermediate p, the graph combines short paths of a random graph with local clustering:
where and denote the path length and clustering coefficient at rewiring probability , and and the corresponding quantities for an equivalent random graph.
Spatial Grid: Grid graphs represent spatially structured systems such as image pixels, sensor arrays, road networks, and integrated circuit layouts [12]. Vertices lie on a two-dimensional lattice with coordinates and are adjacent exactly at unit Manhattan distance:
where denotes an edge between vertices and . The result has uniform degree and strong spatial locality [30].
Together, these families span the structural spectrum relevant to our evaluation, from independent randomness to increasingly explicit local and mesoscopic organization [20], [21].
B. Memory Access Prediction
Memory access prediction estimates future memory references from execution history [9], [29]. Following recent ML-based prefetching work [10], [11], we represent each access by its program counter (PC), memory block address, and address delta relative to previous accesses: the PC identifies the referencing instruction, block addresses reduce granularity to cache-line resolution, and deltas encode relative movement that exposes recurring patterns less apparent in absolute addresses [9], [31]. Together, these features provide spatial and program-semantic cues for learning irregular access behavior.
Graph-processing frameworks improve locality through graph partitioning, vertex reordering, and cache-aware data layouts [34], [35], [40]–[44], but largely ignore the access-pattern differences induced by graph topology. We instead use topology-controlled graph families to study whether long context captures topology-induced regularities.
III. RELATED WORK
A. Rule-Based and ML-Based Data Prefetching
Data prefetching hides memory latency by predicting future memory accesses and bringing data into the cache hierarchy before it is requested by the processor [2], [3], [5]. Effective prefetching therefore depends on accurate memory access prediction [4]. For graph analytics, sparse graph structures and indirect memory references generate irregular access patterns that significantly reduce the effectiveness of conventional hardware prefetchers [12], [17], [45].
-
Rule-Based Prefetchers: Existing data prefetching approaches can be broadly divided into rule-based and machine learning (ML)-based methods. Rule-based prefetchers, including stride, stream, and Best-Offset (BO) [6], [8], [46], exploit spatial or temporal locality using predefined heuristics [7], [47] and achieve good performance on regular workloads. However, graph analytics generate sparse and indirect memory accesses that exhibit little predictable locality, limiting the effectiveness of these rule-based designs [12], [19]. To address this challenge, graph-aware prefetchers such as the Indirect Memory Prefetcher (IMP) exploit pointer-based memory references to improve prediction accuracy for graph workloads [48], [49]. However, IMP is primarily designed for L1 cache prefetching and does not address memory access prediction for last-level cache (LLC) prefetching, where accurate prediction matters most: LLC prefetching hides DRAM accesses costing hundreds of cycles, whereas L1/L2 prefetching hides comparatively fast L2/LLC accesses. Consequently, rule-based approaches remain limited in capturing the complex long-context memory access behavior of irregular graph analytics.
-
ML-Based Prefetchers: Recently, ML-based prefetchers formulate memory access prediction as a sequence modeling problem [9]. Representative approaches include Voyager [10], TransFetch [11], and MPGraph [13], which learn memory access patterns directly from execution traces instead of relying on fixed heuristics. These methods have demonstrated significantly higher prediction accuracy than traditional prefetchers on irregular workloads [13], [29]. However, their inference latency and storage requirements exceed the strict timeliness constraints of hardware prefetching, especially at the LLC; recent efforts such as Net2Tab narrow this gap by distilling attention-based predictors into compact hierarchies of tables [31], [33].
Existing ML-based approaches, however, fix one short-context model for all workloads and do not examine how topology shapes access behavior. In this work, we treat execution history as a controllable parameter, evaluated across topology-controlled graph families, and use node shuffling to separate learned structure from memorized layout.
IV. APPROACH
LoCoMAP formulates memory access prediction as a long-context sequence-learning problem and evaluates how much information longer context provides across graph topologies.

Fig. 2. Overall Architecture of LoCoMAP.
A. Problem Formulation
Let be the sequence of history block addresses at time , where discards the -bit block offset from the raw address . Let be the sequence of history program counters at time , and let be the input of the prediction model. Let be the multi-hot label over the future block deltas within range occurring across the next accesses. Our goal is to learn a meaningful mapping from to for data prefetching; final address predictions are the addition of current block address and predicted deltas. Unlike prior work that fixes a short history, we treat look-back length as a long context to expose long-range dependencies in the access stream.
B. Overall Design
Fig. 2 illustrates the overall workflow of LoCoMAP. A synthetic graph is executed using a GAP workload to generate an LLC memory-access trace. Each memory access is converted to a cache block address and represented using fine-grained address segmentation and execution context. An attention-based predictor takes the previous accesses as input and predicts a bitmap of future address deltas within a look-forward window and delta bound . The predicted deltas are then added to the current block address to recover multiple future memory accesses. The history block addresses are processed by fine grained address segmentation, and the program counters are hashed and embedded as context. The segmented addresses are mapped by a linear projection, combined with position and context embeddings, and encoded by Transformer layers [50], whose self attention relates every access to the entire -access history in a single step. A classification head with sigmoid activation outputs the probability of each of the deltas, trained with binary cross entropy over the independent labels:
At inference, the output probabilities are binarized with a validation selected threshold that maximizes F1-score, each
predicted delta yields the prefetch address plus that delta, so a single inference produces multiple prefetch candidates.
(a) ER

(b) BA
(d) SBM
(c) CM
(e) WS
(f) Grid

Fig. 3. Visualization of memory access patterns in the benchmark applications.
V. EVALUATION
A. Experimental Setup
-
Datasets: We evaluate LoCoMAP using six synthetic graph families that capture structural properties observed in real-world complex networks as well as six real-world graphs as summarized in Table I. The graphs are represented in compressed sparse row (CSR) format for algorithm processing.
-
Algorithms: We implemented three widely used graph processing algorithms based on GPOP framework [51].
-
Single-Source Shortest Paths (SSSP) computes the shortest-path distance from a source vertex to all other vertices by propagating tentative distances along edges until convergence [52].
-
PageRank (PR) iteratively computes a vertex-importance score by distributing rank mass from each vertex to its neighbors until the scores converge [36].
• Connected Components (CC) labels each vertex by its component using label propagation, where each vertex adopts the minimum label among its neighbors [53].
TABLE I GRAPH STATISTICS.
| Topology | # Vertices | # Edges | Avg. Degree | |
|---|---|---|---|---|
| ER | 1,000,000 | 2,400,000 | 4.8 | 0.0007 |
| BA | 1,000,000 | 4,999,985 | 10.0 | 0.0016 |
| CM | 1,000,000 | 2,952,366 | 5.9 | 0.2088 |
| SBM | 1,000,000 | 2,500,000 | 5.0 | 0.5188 |
| WS | 1,000,000 | 2,000,000 | 4.0 | 0.9002 |
| Grid | 1,000,000 | 1,998,000 | 4.0 | 0.9985 |
| FlyWire | 134,013 | 2,313,472 | 34.53 | 0.0083 |
| 875,713 | 4,322,051 | 9.87 | 0.0100 | |
| DBLP | 317,080 | 1,049,866 | 6.62 | 0.3632 |
| Gnutella | 62,586 | 147,892 | 4.73 | 0.4644 |
| Skitter | 1,696,415 | 11,095,298 | 13.08 | 0.4730 |
| roadCA | 1,965,206 | 2,766,607 | 2.82 | 0.9937 |
B. Metrics
We report F1 = 2PR/(P + R), the harmonic mean of precision P and recall R [54].
Unless stated otherwise, aggregate improvements are geometric means of per-topology-workload F1 ratios, and “up to” refers to the maximum single-pair ratio.
To quantify the organization of the native vertex ordering, we first compute the normalized mean edge span
We then compare the native edge span with its randomly relabeled value and compute the ordering score as
Here, and denote the normalized mean edge spans before and after complete random relabeling. An near zero indicates a random-like assignment, whereas a value closer to one indicates organization in the CSR layout.
C. Controlled Graph and Trace Generation
We generate all graphs synthetically using the standard generative model of each family, with a fixed target size and comparable average degree, so families differ in structure rather than scale; each graph is stored in CSR format for processing.
To obtain memory-access traces, we develop a Pintool using Intel Pin [55] that detects the memory-access operations executed by each graph workload and records the corresponding context information, including the accessed virtual address and program counter. We then replay the collected accesses through a four-core ChampSim [56] model with a shared last-level cache (LLC) and record the resulting per-core LLC access stream, which forms the input to memory-access prediction.
Across the 18 graph-workload traces, we observe 14.1K-5.19M LLC accesses, 276-131.0k unique block addresses, 600-4.1K pages, and 1.8k-613.5K unique deltas.
TABLE II MODEL CONFIGURATION.
| Configuration | Value | Configuration | Value | |
|---|---|---|---|---|
| Input/output | Delta bound | Delta bitmap B | 256 | |
| History N | 9 | Look-forward W | 256 | |
| Attention | Dimension D | 64 | MLP head layer | 1 |
| Head number | 4 | Layer L | 1 |
D. Long-Context Configuration and Cost
We investigate long-context memory access prediction by varying the look-back length L and the look-forward window W. Increasing the look-back length L lengthens the input sequence, regularities at any temporal distance within the window, such as hub revisitation and community dwell intervals, become directly reachable by attention. Increasing the look-forward window W aggregates deltas over a longer future horizon, so the bitmap becomes denser and long-range predictive information is converted into additional coverage.
However, the representation gains of long context are not free. Fig. 4 reports inference FLOPs and latency as the look-back length scales from L=8 to L=128. FLOPs per inference grow from 8M to 169.6M, a 21× increase, and latency grows from 11,357 to 71,345 [cycles], a 6.3× increase, reflecting the quadratic cost of self attention at large L. Setting these costs against Table III yields the practical tradeoff: for several topology and workload pairs the accuracy gains largely arrive by L=64, while cost continues to grow quadratically beyond it, so intermediate context lengths capture much of the benefit at a fraction of the cost. Established deployment techniques for ML prefetchers, including model compression and distance prefetching [13], [31]–[33], [57], apply directly to our models and can offset the remaining latency.

Fig. 4. Latency, FLOPs and memory cost as the look-back length L scales from 8 to 128.
E. Training and Evaluation
For each graph–workload pair, we split the collected memory trace into training and testing sets and train a delta predictor to map the access history to a bitmap of future address deltas.
VI. RESULTS
A. Ablation Study
We conduct ablation studies on the two long-context parameters, the look-back length L and the look-forward window W, and report the results in Table III.
- Effectiveness of look-back Length: Increasing L from 8 to 128 consistently improves prediction accuracy across all workloads. Averaged over the six topologies, the F1-score improves by 5.0% for CC, 3.6% for PR, and 15.0% for SSSP.
TABLE III ABLATION OF LOOK-BACK LENGTH AND LOOK-FORWARD WINDOW ACROSS GRAPH TOPOLOGIES AND APPLICATIONS (F1-SCORE)
| Parameter | Value | Applications | |||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| CC | PR | SSSP | |||||||||||||||||
| ER | BA | CM | SBM | WS | Grid | ER | BA | CM | SBM | WS | Grid | ER | BA | CM | SBM | WS | Grid | ||
| Look-back () | 8 | 0.466 | 0.561 | 0.660 | 0.590 | 0.690 | 0.641 | 0.472 | 0.658 | 0.684 | 0.609 | 0.733 | 0.668 | 0.075 | 0.256 | 0.683 | 0.057 | 0.363 | 0.639 |
| 16 | 0.468 | 0.574 | 0.661 | 0.592 | 0.691 | 0.642 | 0.475 | 0.669 | 0.688 | 0.613 | 0.738 | 0.671 | 0.083 | 0.273 | 0.684 | 0.065 | 0.354 | 0.646 | |
| 32 | 0.503 | 0.568 | 0.664 | 0.593 | 0.714 | 0.645 | 0.492 | 0.661 | 0.690 | 0.616 | 0.740 | 0.665 | 0.086 | 0.303 | 0.696 | 0.066 | 0.365 | 0.653 | |
| 64 | 0.515 | 0.620 | 0.669 | 0.596 | 0.731 | 0.650 | 0.503 | 0.670 | 0.691 | 0.622 | 0.748 | 0.679 | 0.093 | 0.311 | 0.704 | 0.074 | 0.358 | 0.655 | |
| 128 | 0.514 | 0.635 | 0.674 | 0.587 | 0.722 | 0.648 | 0.520 | 0.682 | 0.693 | 0.619 | 0.757 | 0.681 | 0.094 | 0.312 | 0.716 | 0.078 | 0.369 | 0.663 | |
| Look-forward () | 8 | 0.375 | 0.209 | 0.369 | 0.255 | 0.150 | 0.263 | 0.355 | 0.435 | 0.372 | 0.394 | 0.325 | 0.373 | 0.049 | 0.235 | 0.594 | 0.066 | 0.170 | 0.537 |
| 32 | 0.361 | 0.391 | 0.486 | 0.428 | 0.350 | 0.402 | 0.389 | 0.572 | 0.464 | 0.513 | 0.551 | 0.527 | 0.065 | 0.243 | 0.600 | 0.057 | 0.339 | 0.621 | |
| 128 | 0.431 | 0.514 | 0.589 | 0.549 | 0.607 | 0.581 | 0.432 | 0.619 | 0.601 | 0.582 | 0.694 | 0.605 | 0.092 | 0.251 | 0.648 | 0.075 | 0.369 | 0.625 | |
| 256 | 0.466 | 0.561 | 0.660 | 0.590 | 0.690 | 0.641 | 0.472 | 0.658 | 0.684 | 0.609 | 0.733 | 0.668 | 0.075 | 0.256 | 0.683 | 0.057 | 0.363 | 0.639 | |
| 512 | 0.507 | 0.606 | 0.710 | 0.623 | 0.735 | 0.696 | 0.501 | 0.693 | 0.736 | 0.620 | 0.740 | 0.713 | 0.095 | 0.259 | 0.682 | 0.118 | 0.388 | 0.654 | |
This shows that additional execution history exposes topology-induced regularities that are not visible within a short context window, motivating long-context prediction for graph analytics.
- Effectiveness of look-forward Window: The look-forward window is the dominant factor: extending from 8 to 512 improves the F1-score by for CC, for PR, and for SSSP. Because a larger output range converts predictive information into additional coverage, this result confirms that much of the exploitable structure in graph access streams lies beyond a short prediction horizon.
B. Cross-Instance Generalization
To evaluate if learned access patterns transfer beyond a single graph instance, we apply each trained CC predictor to a held-out graph from the same family; Table IV reports the results. The long-context model generalizes without retraining to graphs with unseen connectivity, retaining an average of 94.9% of its original-graph F1-score across the five stochastic families. Across all six families, it achieves higher held-out F1-score and raises mean retention from 92.5% to 95.4%. Retention improves for five families, with BA as the sole exception.
TABLE IV CROSS-INSTANCE CC GENERALIZATION WITHOUT RETRAINING. EACH ENTRY REPORTS INSTANCE A F1/HELD-OUT SAME-FAMILY INSTANCE B F1
| Family | Original () | Long () |
|---|---|---|
| A/B (ret.) | A/B (ret.) | |
| ER | .466/.393 (84.3%) | .514/.481 (93.6%) |
| BA | .561/.546 (97.3%) | .635/.589 (92.8%) |
| CM | .660/.560 (84.8%) | .674/.622 (92.3%) |
| SBM | .590/.569 (96.4%) | .587/.576 (98.1%) |
| WS | .690/.656 (95.1%) | .722/.705 (97.6%) |
| Grid | .641/.622 (97.0%) | .648/.634 (97.8%) |
| Mean | .601/.558 (92.5%) | .630/.601 (95.4%) |
C. Generalization Under Node Shuffling
To test whether long context enables the predictor to learn graph topology rather than a particular vertex ordering, we evaluate each trained predictor, without retraining, on CC traces generated after permitting a controlled fraction of vertex identifiers, comparing a short context model () against a long context model (); results are shown in Table V.
Fig. 5 shows that shuffling reshapes each family's delta distribution in a different way: CM and SBM are nearly unchanged; ER sharpens toward small deltas; BA lowers its peak while staying in the same band; and for WS and Grid, the narrow peak of layout induced locality collapses. Because the changes in distribution span from invariant, centralized to decentralized, long context is needed since our delta ranges are wide and differ across families. A short window of eight accesses exposes too few deltas to characterize a family's range, whereas a long history samples the distribution broadly enough.
Under complete (100%) shuffling, the long context model retains higher accuracy on all four families representing real-world network classes, with the largest gap on community-structured SBM graphs, and ER remains the most robust overall, consistent with its homogeneous random connectivity. These are exactly the families whose delta distributions survive shuffling in Fig. 5: structure that persists after the layout is destroyed is carried by connectivity, and long context gives the model enough history to exploit it. In contrast, for WS and Grid, whose accuracy derives from layout-induced neighborhood locality, both models collapse and long context confers no advantage. The robustness benefit of long context is therefore specifically a benefit of learning topology structure.
TABLE V F1-SCORE RETAINED UNDER FULL NODE SHUFFLING
| Graph | Original Model | Long Context Model |
|---|---|---|
| ER | 92.5% | 93.8% |
| BA | 62.4% | 63.9% |
| CM | 57.7% | 67.5% |
| SBM | 34.2% | 70.7% |
| WS | 31.6% | 25.6% |
| Grid | 40.9% | 24.5% |
D. When Long Context Improves Robustness
Long-context robustness under node shuffling depends on how each workload's memory accesses change. CC robustness requires deltas to stay within the predictor's output range. PR remains predictable as shuffling preserves its full-graph sweep, whereas SSSP loses its data-dependent visited-set access order. Figs. 5–10 compare delta distributions and F1 retention.

Fig. 5. Memory-access delta distributions per graph family, before (blue) and after (orange) node shuffling for Connected Components (CC) workload.

Fig. 7. Memory-access delta distributions per graph family, before (blue) and after (orange) node shuffling for PageRank (PR) workload.

Fig. 6. F1-score under node shuffling (L=8 vs. L=128, CC workload).
Connected Components: CC propagates minimum component labels across adjacent vertices. Relabeling preserves connectivity but remaps vertex and adjacency addresses, so retention tracks whether deltas remain within the predictor's output range. Long context achieves higher retention than short context on ER, BA, CM, and SBM, with ER retaining 93.8% of its F1-score. On WS and Grid, near-zero delta mass shifts into heavier tails, reducing long-context retention to 25.6% and 24.5%.
PageRank: PR processes every vertex and edge in each iteration. Relabeling changes vertex and neighbor addresses but preserves this full-graph execution schedule. Under complete shuffling, long context retains 57.6% of its baseline F1-score and improves mean F1-score by 11.0% over short context.
Single-Source Shortest Paths: SSSP advances through a frontier generated by conditional distance relaxations. Relabeling remaps temporal address order of frontier accesses, which the marginal delta distribution does not capture. Both context
lengths retain only about 30% of their baseline F1, showing that longer history cannot recover the lost temporal predictability.
E. Real-Graph Validation
The synthetic results show that random-like native vertex orderings are more robust to shuffling, and the same trend holds across the six real-world graphs in Fig. 12. For CC, the synthetic results further show that F1 retention decreases as shuffling moves more deltas outside the prediction range. The real-graph delta distributions reproduce this relationship. FlyWire's memory-access delta distribution remains largely unchanged, whereas the more strongly ordered Skitter and roadCA graphs lose near-zero concentration and shift more delta mass outside the prediction range, corresponding to larger F1 degradation. Under complete shuffling, the long-context model outperforms the short-context model on all six graphs and improves mean F1-score by 10.2%.

Fig. 8. F1-score under node shuffling (L=8 vs. L=128, PR workload).

Fig. 9. Memory-access delta distributions per graph family, before (blue) and after (orange) node shuffling for Single-Source Shortest Paths (SSSP) workload.

Fig. 11. Memory-access delta distributions for CC on six real-world graphs under progressive node shuffling.

Fig. 10. F1-score under node shuffling (L=8 vs. L=128, SSSP workload).
For CC, long-context F1 retention decreases as approaches one on both synthetic and real graphs, showing that structured vertex orderings are more sensitive to shuffling. FlyWire has a random-like native ordering with and retains 96.2% of its long-context F1-score, whereas roadCA has a strongly ordered layout with and retains only 72.5%. Together, these results show that the relationship among random-like ordering, range of delta preservation, and F1 robustness transfers from synthetic to real graphs.
VII. CONCLUSION
LoCoMAP decouples look-back length from prediction horizon to study topology-dependent memory-access prediction across three GAP workloads and six graph families. Increasing from 8 to 128 improves F1 by 7.8% and by up to 36.8%, while increasing from 8 to 512 raises F1 by 88.3%. Under

Fig. 12. F1-score on six real-world graphs under node shuffling (L=8 vs. L=128, CC workload).
complete relabeling, long context improves F1 by 33.6% across ER, BA, CM, and SBM—including a gain on SBM—but not WS or Grid. Same-family and real-graph results show that robustness emerges when relabeling preserves characteristic delta ranges, indicating connectivity learning rather than layout memorization. In future work, we plan to reduce the cost of long context prediction with subquadratic sequence architectures to enable low-latency ML-based prefetchers.
ACKNOWLEDGMENT
This work was supported by the National Science Foundation (NSF) under Award Nos. CSSI-2311870 and OAC-2411446, and by the NSF IDEAS IUCRC under Award No. ASUB00001781.
Distribution Statement A: Approved for public release. Distribution is unlimited.
REFERENCES
[1] M. Dubois, M. Annavaram, and P. Stenström, Parallel computer organization and design. Cambridge University Press, 2012.
[2] S. P. Vanderwiel and D. J. Lilja, “Data prefetch mechanisms,” ACM Computing Surveys (CSUR), vol. 32, no. 2, pp. 174–199, 2000.
[3] S. Byna, Y. Chen, and X.-H. Sun, “A taxonomy of data prefetching mechanisms,” in 2008 International Symposium on Parallel Architectures, Algorithms, and Computers (i-span 2008). IEEE, 2008, pp. 19–24.
[4] S. Srinath, O. Mutlu, H. Kim, and Y. N. Patt, “Feedback directed prefetching: Improving the performance and bandwidth-efficiency of hardware prefetchers,” in 2007 IEEE 13th International Symposium on High Performance Computer Architecture (HPCA). IEEE, 2007, pp. 63–74.
[5] A. J. Smith, “Sequential program prefetching in memory hierarchies,” Computer, vol. 11, no. 12, pp. 7–21, 1978.
[6] N. P. Jouppi, “Improving direct-mapped cache performance by the addition of a small fully-associative cache and prefetch buffers,” ACM SIGARCH Computer Architecture News, vol. 18, no. 2SI, pp. 364–373, 1990.
[7] S. Somogyi, T. F. Wenisch, A. Ailamaki, B. Falsafi, and A. Moshovos, “Spatial memory streaming,” ACM SIGARCH Computer Architecture News, vol. 34, no. 2, pp. 252–263, 2006.
[8] P. Michaud, “Best-offset hardware prefetching,” in 2016 IEEE International Symposium on High Performance Computer Architecture (HPCA). IEEE, 2016, pp. 469–480.
[9] M. Hashemi, K. Swersky, J. R. Smith, G. Ayers, H. Litz, J. Chang, C. Kozyrakis, and P. Ranganathan, “Learning memory access patterns,” arXiv preprint arXiv:1803.02329, 2018. [Online]. Available: https://arxiv.org/abs/1803.02329
[10] Z. Shi, A. Jain, K. Swersky, M. Hashemi, P. Ranganathan, and C. Lin, “A hierarchical neural model of data prefetching,” in Proceedings of the 26th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, 2021, pp. 861–873.
[11] P. Zhang, A. Srivastava, A. V. Nori, R. Kannan, and V. K. Prasanna, “Fine-grained address segmentation for attention-based variable-degree prefetching,” in Proceedings of the 19th ACM International Conference on Computing Frontiers, ser. CF '22. New York, NY, USA: Association for Computing Machinery, 2022, pp. 103–112. [Online]. Available: https://doi.org.libproxy1.usc.edu/10.1145/3528416.3530236
[12] A. Basak, S. Li, X. Hu, S. M. Oh, X. Xie, L. Zhao, X. Jiang, and Y. Xie, “Analysis and optimization of the memory hierarchy for graph processing workloads,” in 2019 IEEE International Symposium on High Performance Computer Architecture (HPCA). IEEE, 2019, pp. 373–386.
[13] P. Zhang, R. Kannan, and V. K. Prasanna, “Phases, modalities, spatial and temporal locality: Domain specific ml prefetcher for accelerating graph analytics,” in Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis, 2023, pp. 1–15.
[14] A. Drosou, I. Kalamaras, S. Papadopoulos, and D. Tzovaras, “An enhanced graph analytics platform (gap) providing insight in big network data,” Journal of Innovation in Digital Ecosystems, vol. 3, no. 2, pp. 83–97, 2016.
[15] R. Meusel, S. Vigna, O. Lehmberg, and C. Bizer, “The graph structure in the web-analyzed on different aggregation levels,” The Journal of Web Science, vol. 1, 2015.
[16] A. Lumsdaine, D. Gregor, B. Hendrickson, and J. Berry, “Challenges in parallel graph processing,” Parallel Processing Letters, vol. 17, no. 01, pp. 5–20, 2007.
[17] S. Ainsworth and T. M. Jones, “Graph prefetching using data structure knowledge,” in Proceedings of the 2016 International Conference on Supercomputing, 2016, pp. 1–11.
[18] W. A. Wulf and S. A. McKee, “Hitting the memory wall: Implications of the obvious,” ACM SIGARCH Computer Architecture News, vol. 23, no. 1, pp. 20–24, 1995.
[19] S. Beamer, K. Asanović, and D. Patterson, “The gap benchmark suite,” arXiv preprint arXiv:1508.03619, 2017.
[20] M. E. J. Newman, “The structure and function of complex networks,” SIAM Review, vol. 45, no. 2, pp. 167–256, 2003.
[21] R. Albert and A.-L. Barabási, “Statistical mechanics of complex networks,” Reviews of Modern Physics, vol. 74, no. 1, pp. 47–97, 2002.
[22] A.-L. Barabási and R. Albert, “Emergence of scaling in random networks,” Science, vol. 286, no. 5439, pp. 509–512, 1999.
[23] A. Broder, R. Kumar, F. Maghoul, P. Raghavan, S. Rajagopalan, R. Stata, A. Tomkins, and J. Wiener, “Graph structure in the web,” Computer Networks, vol. 33, no. 1–6, pp. 309–320, 2000.
[24] D. J. Watts and S. H. Strogatz, “Collective dynamics of ‘small-world’ networks,” Nature, vol. 393, no. 6684, pp. 440–442, 1998.
[25] M. Girvan and M. E. J. Newman, “Community structure in social and biological networks,” Proceedings of the National Academy of Sciences, vol. 99, no. 12, pp. 7821–7826, 2002.
[26] P. Erdős and A. Rényi, “On random graphs. i,” Publications Mathematicae Debrecen, vol. 6, no. 3–4, pp. 290–297, 1959.
[27] R. Kumar, P. Raghavan, S. Rajagopalan, D. Sivakumar, A. Tomkins, and E. Upfal, “Stochastic models for the web graph,” in Proceedings of the 41st Annual Symposium on Foundations of Computer Science (FOCS), 2000, pp. 57–65.
[28] E. Abbe, “Community detection and stochastic block models: recent developments,” The Journal of Machine Learning Research, vol. 18, no. 1, pp. 6446–6531, 2017. [Online]. Available: https://arxiv.org/abs/1703.10146
[29] P. Zhang, R. Kannan, X. Tong, A. V. Nori, and V. K. Prasanna, “Sharp: Software hint-assisted memory access prediction for graph analytics,” in 2022 IEEE High Performance Extreme Computing Conference (HPEC), 2022, pp. 1–8.
[30] M. Barthélemy, “Spatial networks,” Physics Reports, vol. 499, no. 1–3, pp. 1–101, 2011.
[31] P. Zhang, N. Gupta, R. Kannan, and V. K. Prasanna, “Attention, distillation, and tabularization: Towards practical neural network-based prefetching,” arXiv preprint arXiv:2401.06362, 2024.
[32] N. Gupta, P. Zhang, R. Kannan, and V. K. Prasanna, “PaCKD: Pattern-clustered knowledge distillation for compressing memory access prediction models,” in 2023 IEEE High Performance Extreme Computing Conference (HPEC). IEEE, 2023, pp. 1–7.
[33] P. Zhang, N. Gupta, R. Kannan, and V. K. Prasanna, “Net2Tab: Tabularizing neural networks with applications to data prefetching,” Journal of Parallel and Distributed Computing, 2026, to appear.
[34] H. Wei, J. X. Yu, C. Lu, and X. Lin, “Speedup graph processing by graph ordering,” in Proceedings of the 2016 International Conference on Management of Data (SIGMOD), 2016, pp. 1803–1818.
[35] V. Balaji and B. Lucia, “When is graph reordering an optimization? Studying the effect of lightweight graph reordering,” in 2018 IEEE International Symposium on Workload Characterization (IISWC). IEEE, 2018, pp. 203–214.
[36] L. Page, S. Brin, R. Motwani, and T. Winograd, “The PageRank citation ranking: Bringing order to the web,” Stanford InfoLab, Tech. Rep. 1999-66, 1999.
[37] G. Malewicz, M. H. Austern, A. J. C. Bik, J. C. Dehnert, I. Horn, N. Leiser, and G. Czajkowski, “Pregel: A system for large-scale graph processing,” in Proceedings of the 2010 ACM SIGMOD International Conference on Management of Data, 2010, pp. 135–146.
[38] D. Chakrabarti, Y. Zhan, and C. Faloutsos, “R-MAT: A recursive model for graph mining,” in Proceedings of the 2004 SIAM International Conference on Data Mining (SDM), 2004, pp. 442–446.
[39] P. W. Holland, K. B. Laskey, and S. Leinhardt, “Stochastic blockmodels: First steps,” Social Networks, vol. 5, no. 2, pp. 109–137, 1983.
[40] J. E. Gonzalez, Y. Low, H. Gu, D. Dickson, and C. Guestrin, “Powergraph: Distributed graph-parallel computation on natural graphs,” in 10th USENIX Symposium on Operating Systems Design and Implementation (OSDI 12), 2012, pp. 17–30.
[41] J. Shun and G. E. Blelloch, “Ligra: A lightweight graph processing framework for shared memory,” in Proceedings of the 18th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPOpp), 2013, pp. 135–146.
[42] A. Kyrola, G. Blelloch, and C. Guestrin, “Graphchi: Large-scale graph computation on just a pc,” in 10th USENIX Symposium on Operating Systems Design and Implementation (OSDI 12), 2012, pp. 31–46.
[43] S. Beamer, K. Asanović, and D. Patterson, “Locality exists in graph processing: Workload characterization on an ivy bridge server,” in 2015 IEEE International Symposium on Workload Characterization (IISWC). IEEE, 2015, pp. 56–65.
[44] A. Mukkara, N. Beckmann, M. Abeydeera, X. Ma, and D. Sanchez, “Exploiting locality in graph analytics through hardware-accelerated traversal scheduling,” in 2018 51st Annual IEEE/ACM International Symposium on Microarchitecture (MICRO). IEEE, 2018, pp. 1–14.
[45] S. Ainsworth and T. M. Jones, “Software prefetching for indirect memory accesses: A microarchitectural perspective,” ACM Transactions on Computer Systems (TOCS), vol. 36, no. 3, pp. 1–34, 2018.
[46] T.-F. Chen and J.-L. Baer, “Effective hardware-based data prefetching for high-performance processors,” IEEE Transactions on Computers, vol. 44, no. 5, pp. 609–623, 1995.
[47] A. Jain and C. Lin, “Linearizing irregular memory accesses for improved correlated prefetching,” in Proceedings of the 46th Annual IEEE/ACM International Symposium on Microarchitecture (MICRO), 2013, pp. 247–259.
[48] J. Yu, H. Lu, C. Ding, and C. Dwyer, “Imp: Indirect memory prefetcher,” in Proceedings of the 50th Annual IEEE/ACM International Symposium on Microarchitecture, 2017, pp. 178–190.
[49] P. Zhang, R. Kannan, and V. K. Prasanna, “GraFetch: Accelerating graph applications through domain-specific hierarchical hybrid prefetching,” IEEE Transactions on Parallel and Distributed Systems, vol. 36, no. 8, pp. 1542–1559, 2025.
[50] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, E. Kaiser, and I. Polosukhin, “Attention is all you need,” in Advances in Neural Information Processing Systems (NeurIPS), 2017.
[51] K. Lakhotia, R. Kannan, S. Pati, and V. Prasanna, “Gpop: A scalable cache-and memory-efficient framework for graph processing over parts,” ACM Transactions on Parallel Computing (TOPC), vol. 7, no. 1, pp.
1–24, 2020.
[52] E. W. Dijkstra, “A note on two problems in connexion with graphs,” Numerische Mathematik, vol. 1, no. 1, pp. 269–271, 1959.
[53] Y. Shiloach and U. Vishkin, “An parallel connectivity algorithm,” Journal of Algorithms, vol. 3, no. 1, pp. 57–67, 1982.
[54] D. M. W. Powers, “Evaluation: from precision, recall and f-measure to roc, informedness, markedness and correlation,” arXiv preprint arXiv:2010.16061, 2020. [Online]. Available: https://arxiv.org/abs/2010.16061
[55] C.-K. Luk, R. Cohn, R. Muth, H. Patil, A. Klauser, G. Lowney, S. Wallace, V. J. Reddi, and K. Hazelwood, “Pin: Building customized program analysis tools with dynamic instrumentation,” in Proceedings of the 2005 ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), 2005, pp. 190–200.
[56] N. Gober, G. Chacon, L. Wang, P. V. Gratz, D. A. Jiménez, E. Teran, S. Pugsley, and J. Kim, “The championship simulator: Architectural simulation for education and competition,” 2022. [Online]. Available: https://arxiv.org/abs/2210.14324
[57] N. Gupta, N. Kannan, P. Zhang, and V. K. Prasanna, “TabConv: Low-computation CNN inference via table lookups,” in Proceedings of the 21st ACM International Conference on Computing Frontiers, ser. CF '24. New York, NY, USA: Association for Computing Machinery, 2024.