Large Language Models as Realistic Microservice Trace Generators

Donghyun Kim, Sriram Ravula, Taemin Ha, Alex Dimakis, Daehyeok Kim, Aditya Akella · Submission to ICLR 2025 · Rejected

TL;DR

TraceLLM is a novel approach that adapts Large Language Models (LLMs) to generate realistic, structurally valid microservice workload traces. By employing a recursive generation strategy and instruction tuning, it produces synthetic "call graphs" accurate enough to replace scarce real-world data for training system management and anomaly detection tools.

The Challenge of Microservice Traces

In modern cloud computing, applications are built as "microservices"—hundreds of small, interconnected components. To optimize these systems, engineers rely on workload traces, which log the sequence of calls between services. However, real-world traces are notoriously difficult to obtain due to proprietary information and the high overhead of collecting them at scale.

Example of a microservice call graph and its corresponding trace data.

While synthetic data generators exist, they struggle with the complex nature of microservice traces. These traces are not just simple lists; they are Directed Acyclic Graphs (DAGs) with strict implicit constraints. For example, a "child" process cannot start before its "parent" process, and it must finish before the parent finishes. Traditional generative models (like GANs or standard LLM fine-tuning) often fail to maintain these hierarchical and temporal relationships, resulting in "hallucinated" traces that are physically impossible.

The TraceLLM Approach

To overcome these limitations, the authors introduce TraceLLM, built on a Llama-2 7B architecture, utilizing three key innovations:

  1. Textual Encoding of Graphs: Tabular trace data is converted into natural language templates (e.g., "Source is Client, Destination is Front end...").
  2. Recursive Subgraph Generation: Instead of asking the LLM to generate a massive, complex graph all at once, TraceLLM generates it layer-by-layer. It produces the edges for the current level and then generates a "condition prompt" for the next level. This "divide and conquer" approach allows the model to focus on local constraints without losing the global structure.
  3. Instruction Tuning with Intermediate Reasoning: The model is fine-tuned to follow specific user instructions (e.g., "Generate a trace with high latency"). Crucially, the authors use "intermediate instructions"—essentially a Chain-of-Thought for systems data—where the model explicitly calculates remaining edges and depths to ensure it stays within the requested parameters.
TraceLLM's recursive subgraph generation process, building the trace layer-by-layer.

Key Insights and Results

Evaluated primarily on the Alibaba v2022 Microservice Dataset (1.36 million call graph samples), TraceLLM demonstrates several significant breakthroughs:

  • Recursion Beats Complexity: The most significant insight is that LLMs are much better at maintaining graph validity when the task is recursive. By breaking the graph into parent-child steps, TraceLLM maintains ~75% structural accuracy in generating valid graphs across various depths. In contrast, non-recursive baselines see their accuracy plummet below 25% for graphs with more than 15 edges.
  • High Distributional Fidelity: Using the Earth Mover’s Distance (EMD) metric, TraceLLM's traces were 2.6x to 10x more similar to real-world distributions than those produced by probabilistic or VAE-based generators.
  • Outperforming Massive Models: In downstream tasks like "infilling" missing trace data, the fine-tuned TraceLLM (7B) significantly outperformed the massive Llama-3.1 405B. This proves that domain-specific fine-tuning and structural methodology are more important than raw model size for specialized systems tasks.
  • Synthetic Data as a "Drop-in" Replacement: The paper proves that a model trained entirely on TraceLLM’s synthetic data performs almost identically to one trained on real data when tested on real-world scenarios (like anomaly detection with TraceVAE). Furthermore, the model exhibits low memorization, with only 3-5% of its outputs being exact matches of the training set.

Limitations and Future Work

While highly effective, TraceLLM currently discards previously generated edges during its recursive process to save space in the context window, which might limit its ability to capture long-range dependencies in massive graphs. Additionally, the instruction templates are hand-crafted. Future work may explore using LLMs to self-generate more diverse instructions and testing the recursive approach on even deeper, more complex structures like Operating System (OS) traces.

Summary updated

BibTeX
@misc{kim2025large,
  author = {Donghyun Kim and Sriram Ravula and Taemin Ha and Alex 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