GRaSP: Latency-Aware Optimization for Geo-Distributed Retrieval-Augmented Generation
Organizations: Independent Researcher San Jose, CA, USA · The Pennsylvania State University University Park, PA, USA · Independent Researcher Sunnyvale, CA, USA
Abstract
Retrieval-Augmented Generation (RAG) is increasingly served across geo-distributed cloud and edge infrastructures, where wide-area latency, cross-region egress cost, and data-residency rules compete with retrieval quality. Conventional pipelines rank by semantic similarity alone and ignore where content lives, inflating tail latency and cost. We formalize the Geo-RAG Selection Problem (GRaSP), a drop-in re-scoring layer that decays relevance by latency and adds an optional cost penalty under a cardinality budget and per-region caps, with no retraining. We first settle its complexity: the base formulation is a linear objective over a partition matroid, solved optimally by an O(N log N) greedy algorithm, rather than NP-hard as a knapsack framing suggests, with hardness entering only under an additive egress budget. On a five-node CloudLab testbed emulating a four-region WAN over the Natural Questions corpus (2.68M passages), GRaSP's benefit is placement-dependent: under uniform placement it cuts fetch latency at negligible quality cost; under topical (residency-like) placement it traces a recall-latency Pareto frontier that dominates relevance-only, nearest-k, and a latency-budgeted baseline. At a moderate latency setting, GRaSP lowers P90 fetch latency by 41% while retaining 78% of relevance-only's recall, with sub-millisecond selection overhead, stable to 200 queries/s. Findings generalize across four public BEIR benchmarks. In end-to-end question answering, GRaSP reduces context-fetch latency by 43% while remaining within 0.062 absolute EM of relevance-only retrieval.
Figures & tables
| Policy | Gap | Lat. (ms) | Cost | Recall | nDCG | |
|---|---|---|---|---|---|---|
| 0.003 | Rel-only | 0.92 | 122.1 | 0.102 | 0.534 | 0.400 |
| 0.003 | Nearest- | 0.76 | 42.3 | 0.044 | 0.292 | 0.229 |
| 0.003 | GRaSP-greedy | 1.00 | 97.4 | 0.084 | 0.506 | 0.384 |
| 0.003 | GRaSP-rat. | 1.00 | 102.3 | 0.088 | 0.516 | 0.391 |
| 0.010 | Rel-only | 0.85 | 122.1 | 0.102 | 0.534 | 0.400 |
| 0.010 | Nearest- | 0.87 | 42.3 | 0.044 | 0.292 | 0.229 |
| (ms) | Recall | nDCG | Mean max-RTT (ms) |
|---|---|---|---|
| 1 | 0.000 | 0.000 | 0.0 |
| 90 | 0.260 | 0.198 | 52.4 |
| 115 | 0.432 | 0.324 | 79.8 |
| 210 | 0.534 | 0.400 | 122.1 |
| Setting | Policy | Gap | Lat. (ms) | Recall |
|---|---|---|---|---|
| Uncapped | Rel-only | 0.85 | 122.1 | 0.534 |
| Uncapped | GRaSP-greedy | 1.00 | 69.5 | 0.419 |
| Rel-only | 0.97 | 175.3 | 0.392 | |
| GRaSP-greedy | 1.00 | 163.3 | 0.374 |
| QPS | Policy | P50 | P90 | P99 | Sel. ( s) |
|---|---|---|---|---|---|
| 20 | Rel-only | 130.5 | 228.3 | 247.0 | 125 |
| 20 | GRaSP-greedy | 105.1 | 135.4 | 248.4 | 425 |
| 50 | Rel-only | 131.3 | 228.4 | 426.9 | 125 |
| 50 | GRaSP-greedy | 105.8 | 139.7 | 290.9 | 426 |
| 100 | Rel-only | 132.9 | 229.7 | 433.4 | 118 |
| 100 | GRaSP-greedy | 106.6 | 146.7 | 425.8 | 419 |
| Latency (ms) | Cost ( USD) | Recall | |
|---|---|---|---|
| 0.0 | 69.5 | 0.095 | 0.419 |
| 0.5 | 70.2 | 0.051 | 0.339 |
| 1.0 | 70.8 | 0.036 | 0.279 |
| 2.0 | 74.3 | 0.024 | 0.210 |
| Dataset | Policy | Gap | Lat. (ms) | Recall | nDCG |
|---|---|---|---|---|---|
| NQ | Rel-only | 0.85 | 122.1 | 0.534 | 0.400 |
| GRaSP-greedy | 1.00 | 69.5 | 0.419 | 0.323 | |
| Nearest- | 0.87 | 42.3 | 0.292 | 0.229 | |
| SciFact | Rel-only | 0.82 | 119.6 | 0.738 | 0.629 |
| GRaSP-greedy | 1.00 | 61.6 | 0.560 | 0.489 | |
| Nearest- | 0.85 | 13.3 | 0.276 | 0.240 |
| Policy | EM | F1 | Context lat. (ms) |
|---|---|---|---|
| Relevance-only | 0.320 | 0.415 | 122.1 |
| GRaSP-greedy | 0.258 | 0.362 | 69.5 |
| Nearest- | 0.180 | 0.257 | 42.3 |
Retrieval-Augmented Generation
Retrieval-augmented generation connects language models to external knowledge so answers can use current, domain-specific evidence.
See all 796 papers