Large Language Models as Realistic Microservice Trace Generators

Donghyun Kim, Sriram Ravula, Taemin Ha, Alexandros G. Dimakis, Daehyeok Kim, Aditya Akella · DOI

Introduction

In modern cloud computing, applications are composed of hundreds of interconnected microservices. When a user initiates a request, it triggers a complex cascade of internal calls known as a "trace" or "call graph." These traces are essential for engineers to optimize resource allocation, debug performance bottlenecks, and detect anomalies. However, obtaining high-quality trace data is difficult; real-world traces are rarely public due to privacy concerns, and existing synthetic generators often produce unrealistic scenarios—such as child processes finishing before their parents start—or fail to capture the hierarchical Directed Acyclic Graph (DAG) structure of actual systems.

The TraceLLM Framework

To address these challenges, researchers have developed TraceLLM, a framework that repurposes Large Language Models (LLMs) to generate highly realistic microservice call graphs. TraceLLM treats trace generation as a structured language modeling task, leveraging the pre-trained sequential reasoning capabilities of LLMs.

Recursive Subgraph Generation

The core innovation of TraceLLM is its Recursive Subgraph Generation strategy. Rather than attempting to generate a massive, complex graph in a single pass, the model breaks the task down layer-by-layer. It starts with the root request and recursively generates the children for each node. This "divide and conquer" approach significantly reduces the reasoning burden on the model, ensuring structural coherence across deep hierarchies.

Recursive subgraph generation process in TraceLLM, showing the layer-by-layer construction of a call graph.

Instruction Tuning and Textual Encoding

TraceLLM is fine-tuned to follow specific user prompts, such as generating traces with high latency or specific service counts. The authors employ a "scratchpad" approach where the model explicitly calculates remaining edges and depth before generating the next layer. To bridge the gap between tabular data and language models, trace information (source, destination, and timing) is converted into natural language templates.

Experimental Evaluation

The study primarily utilized the Alibaba v2022 microservice trace dataset, containing over 1.3 million samples, and the Alibaba 2018 cluster dataset to test generalizability. The evaluation focused on whether the LLM could learn the "physics" of computer systems—understanding temporal constraints and service dependencies.

Key Results

TraceLLM demonstrated significant improvements over traditional probabilistic models and standard LLM baselines:

  • Structural Validity: TraceLLM maintained high accuracy (75-90%) even as graph complexity increased. While standard LLM baselines saw accuracy plummet for deep graphs, TraceLLM's recursive approach remained robust.
  • Distributional Realism: The model’s output closely mirrored real-world distributions. Its KL divergence for popular service calls was 0.16, vastly outperforming probabilistic models (3.84).
  • Downstream Utility: Synthetic traces proved to be a viable "drop-in" replacement for real data. Anomaly detection models trained on TraceLLM data achieved performance within 1.5 percentage points of those trained on real traces.
Accuracy of TraceLLM compared to baselines across varying graph depths and generation temperatures.

Conclusion and Future Work

TraceLLM successfully demonstrates that LLMs can serve as effective "world models" for complex software systems. By using recursion and instruction tuning, the framework generates synthetic data realistic enough to solve the "cold start" problem for training system-management AI. Future research will focus on capturing long-range dependencies across massive graphs and automating the creation of diverse instruction templates to further enhance synthetic variety.

Summary updated

BibTeX
@misc{kim2025large,
  author = {Donghyun Kim and Sriram Ravula and Taemin Ha and Alexandros G. Dimakis and Daehyeok Kim and Aditya Akella},
  title = {{Large Language Models as Realistic Microservice Trace Generators}},
  year = {2025},
  eprint = {2502.17439},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2502.17439},
}
Figure