ScaleSim: Serving Large-Scale Multi-Agent Simulation with Invocation Distance-Based Memory Management

Zaifeng Pan, Yipeng Shen, Zhengding Hu, Zhuang Wang, Aninda Manocha, Zheng Wang, Zhongkai Yu, Yue Guan, Yufei Ding

TL;DR

ScaleSim is a memory-efficient serving system designed to scale LLM-based multi-agent simulations to thousands of participants. By introducing a novel abstraction called "invocation distance," the system predicts when an agent will next need the LLM, allowing it to proactively prefetch memory and intelligently evict data to achieve up to a 1.74× speedup over state-of-the-art baselines.

What Problem Does This Paper Address?

Large Language Model (LLM) agents are being used to simulate everything from social networks to autonomous traffic. However, scaling these simulations is a nightmare for GPU memory. Each agent requires its own "private state"—including LoRA adapters, prefix caches, and action histories. As the number of agents grows, the aggregate memory demand quickly exceeds the capacity of even the beefiest GPUs (like the H100).

Existing LLM serving systems (like vLLM or SGLang) treat every request as an isolated event. They manage memory reactively: when an agent makes a request, the system frantically swaps its data from the CPU to the GPU. This creates massive I/O bottlenecks and "cold start" latencies. Furthermore, their eviction policies (like Least Recently Used) are "blind" to the simulation's logic, often deleting data that an agent will need again in just a few milliseconds.

Methods

The authors identify two key properties of agent workloads: sparse activation (only a few agents "think" at once while others "act") and estimable invocation orders (we can often guess who will speak next). To exploit this, they introduced:

  1. Invocation Distance: A unified abstraction that represents the relative "urgency" of an agent. It isn't necessarily a timestamp; it could be the remaining time in an action, the physical distance between two agents moving toward each other, or the number of "hops" in a social network graph.
  2. Proactive Prefetching: ScaleSim uses these distances to move an agent's memory from the host (CPU) to the device (GPU) before the agent actually issues an LLM request. This overlaps slow I/O transfers with the simulation's computation.
  3. Future Reuse-Aware Eviction: Instead of guessing which data is "old," ScaleSim evicts the agent with the largest invocation distance—the one least likely to need the GPU anytime soon.
  4. Preemption Support: Since simulations can be unpredictable (e.g., an unexpected interaction breaks an agent's plan), ScaleSim’s scheduler can interrupt a low-priority memory load to make room for an urgent, unexpected request.

Datasets

The researchers evaluated ScaleSim using three representative simulation patterns:

  • AgentSociety: An open-source simulator for large-scale social behavior (Independent simulation).
  • Generative Agents: A modified version of AgentSociety that adds spatial, mobility-driven interactions (Interaction-involved simulation).
  • Information Diffusion: A graph-based simulation modeling how news or rumors spread (Predefined activation paths).

They tested these using the Qwen2.5 series (7B and 32B models) on hardware ranging from a single NVIDIA H100 to an 8-GPU cluster.

Key Insights and Ideas

  • Sparsity is the Secret Sauce: In most simulations, the "active agent ratio" is only about 20%. The system doesn't need to fit everyone on the GPU at once; it just needs to be a world-class "stage manager," moving agents in and out of the spotlight just in time.
  • Relative > Absolute: You don't need a perfect crystal ball to see the future. Even if your distance estimates are slightly off (prediction errors), the system’s ability to rank agents by relative urgency still provides significant performance gains over "blind" reactive systems.
  • Modular Memory Abstraction: ScaleSim doesn't just manage KV caches. It provides a modular interface that allows it to manage any agent-specific memory type (LoRA, VectorDB indices, etc.) under the same unified distance-based logic.

Key Results

  • Throughput: ScaleSim achieved up to 1.74× speedup over SGLang.
  • Latency: It reduced the Time-to-First-Token (TTFT) by 48% to 68% under high agent concurrency. This is crucial for interactive simulations where lag ruins the "realism."
  • Scalability: The system showed near-linear execution time scaling as agent counts increased from 25 to 1,000, whereas baselines suffered from "memory churn" and I/O overhead.
  • Robustness: Even when the researchers injected 80% prediction errors into the invocation distances, ScaleSim still outperformed the vanilla SGLang baseline, proving the design is resilient to "noisy" simulations.

Limitations and Future Work

While ScaleSim provides a unified interface, it still requires the application developer to define the distance metric. While the paper provides templates for common scenarios (spatial, graph-based, etc.), a "plug-and-play" distance estimator that requires zero developer input remains a future goal.

Additionally, the current implementation focuses on memory management. The authors suggest that future work could integrate these invocation distances into compute scheduling (deciding which LLM requests to batch together) to further optimize throughput in extremely dense simulation environments.

Summary updated

BibTeX
@inproceedings{pan2026scalesim,
  author = {Zaifeng Pan and Yipeng Shen and Zhengding Hu and Zhuang Wang and Aninda Manocha and Zheng Wang and Zhongkai Yu and Yue Guan and Yufei Ding},
  title = {{ScaleSim: Serving Large-Scale Multi-Agent Simulation with Invocation Distance-Based Memory Management}},
  booktitle = {International Conference on Machine Learning},
  year = {2026},
  url = {https://openreview.net/forum?id=kpJIOi10TX},
}
Figure