potentialpaper

AgentReplay: Token-Wise Trace Replay Is Essential for Fair Serving System Performance Benchmarking

Anonymous authors

ICLR 2027

Edit this page

Or clone it with git

Run in a terminal:

Needs Git LFS. To push, use an API key from your profile as the password.

Or let your agent set it up

It checks and sets up everything: signing in, git, the clone, credentials and an SSH key.

Abstract. LLM-based agents execute multi-turn workflows with interleaved model inference and tool calls, making efficient serving increasingly important. However, evaluating serving optimizations is challenging because identical tasks can produce different execution trajectories. Changes in generated tokens can alter subsequent prompts, tool calls, and reasoning turns, making it difficult to distinguish system improvements from workload variation. Greedy decoding does not guarantee identical outputs, while replaying only sequence lengths loses token information that affects prefix caching and mixture-of-experts (MoE) routing. To address these problems, we propose AgentReplay, a configurable trace record-and-replay framework for agent serving. AgentReplay records input/output tokens, expert selections, request dependencies, and tool durations. During replay, it forces the recorded output tokens while performing normal autoregressive computation, with optional controls for MoE expert selection and tool delays. This allows different systems to execute the same recorded workload while retaining their own batching, scheduling, and parallelization decisions. We further separate trajectory generation from performance evaluation, enabling compatible smaller models to replay long-horizon traces collected with more capable models. Our experiments show that token-wise replay in AgentReplay effectively eliminates workload variation that greedy decoding and length-wise replay cannot avoid, enabling fairer performance comparisons across serving configurations.

Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.

Claim this paper
How does this paper connect to your work? Write how you built on it, compared with it or reproduced it, or add a summary, a critique or errata.
Or make it interactive:
Start writing

edit · history

DateVersionSubmitted toPDFEvidence
15 Sep 2026ICLR 2027 (under review)submittedICLR 2027Under reviewreviews ↓[1]PDF[1]
Missing a version?

ICLR 2027

Under review · 3 reviews · OpenReview

Updated 25 Nov 2026, 10:32 UTC.

Reviewer e9i5OpenReview ↗
Rating
3/4
Confidence
3/4
Soundness
2/3
Presentation
3/3
Informativeness
2/3
Read review
Summary

This paper presents AgentReplay, a trace record-and-replay framework for agent serving. Agent serving interleaves model inferences and tool calls. AgentReplay records input/output tokens, expert selections and request dependencies for the model inference part, as well as tool durations for the tool call part. In addition, it separates trajectory generation from performance generation. This enables smaller models to replay long-horizon traces collected from more capable models. The evaluation compares AgentReplay with greedy decoding and length-wise replay, and shows the benefits of AgentReplay.

Strengths
  • AgentReplay is a record-and-replay framework for agent serving. It records both the model inference part and the tool call part. It is useful for evaluating serving optimizations.
  • The evaluation compares AgentReplay with greedy decoding and length-wise replay. The results show AgentReplay can reduce workload variation.
Weaknesses
  • The paper does not discuss and evaluate the replay overhead. It would be good to discuss and evaluate the serving performance with and without replay.
Questions for the authors
  1. The introduction says that "AgentReplay, a configurable trace record-and-replay framework for vLLM (Kwon et al., 2023)". Is the solution general? Does AgentReplay only work for vLLM? Can the design also be used for other inference engines such as SGLang?

  2. Can you clarify the difference between AgentReplay and XPerf (Wang et al., 2026)? XPerf "records input and output token IDs, invocation dependencies, and tool durations". AgentReplay "records input/output tokens, expert selections and request dependencies and tool durations for the tool call part". Is the difference only whether to record expert selections?

  3. What is the overhead of replay? Does running vLLM with replay introduce any performance overhead compared to running vLLM without replay? Does the overhead affect the evaluation of serving performance optimizations?

Reviewer kpvPOpenReview ↗
Rating
3/4
Confidence
3/4(+1)
Soundness
2/3
Presentation
2/3
Informativeness
2/3
Read review
Summary

AgentReplay addresses a measurement problem in agent serving. Changes in generated tokens can alter later requests, tool calls, and termination, so two executions may perform different amounts of work even when their initial prompts and decoding settings match. The framework records token sequences, invocation dependencies, optional MoE expert selections, and tool durations, then replays that workload under different serving configurations. It retains autoregressive model computation and releases each request when its recorded predecessors finish. Experiments examine variation across repeated coding-agent runs and show how replacing real content with equal-length random tokens changes expert access and execution cost. A further example replays a stronger model's long trajectory on a smaller model. The intended contribution is controlled performance measurement under a fixed workload, with explicit limits when tool contention or changes in generated behavior are part of the system being evaluated.

Strengths
  • The problem is well motivated. Different generated tokens can alter subsequent requests, tool calls, and termination, making a faster run an unreliable indicator of a faster serving system. Section 4.1 supports this concern with 50 repeated executions per task. The large variation on SymPy makes the need for workload control concrete.

  • The replay design respects several details that a simpler implementation could miss. Recorded tokens are substituted before updating token-dependent state, and the model still performs its forward pass and native sampling computation. The driver follows invocation dependencies instead of retaining absolute request timestamps. This allows a faster system to release dependent requests earlier while preserving the recorded workflow.

  • The MoE experiments identify useful mechanisms behind benchmark distortion. Section 4.2 connects token content to expert concentration, rank imbalance, and the number of distinct experts accessed. It also distinguishes kernel measurements from full-phase timing. For example, the 1.54 ratio for the slowest prefill rank corresponds to a smaller 1.18 ratio for the full prefill phase.

Weaknesses
  • The reduction in time variation is expected when tokens and tool delays are fixed. It does not establish that replay preserves the relative performance of the serving configurations being compared. The paper does not quantify the overhead of token substitution, route restoration, or reading the trace. Such overhead could affect configurations differently, especially at small batch sizes. A matched execution check and an overhead breakdown are important for a tool whose central purpose is trustworthy measurement.

  • The main evaluation uses one target MoE model and two coding tasks. The cross-model experiment uses one completed 132-turn SymPy trajectory. This is enough to demonstrate that the problem exists, but it gives limited evidence about the framework's usefulness across workloads. In particular, prefix caching is a major motivation in Sections 1 and 2, yet the paper does not present a cache-policy comparison showing how token replay changes the estimated benefit of an optimization.

  • Section 4.2 replaces content with random tokens. Some experiments then deliberately place the experts favored by those tokens on one rank or offload those hot experts. These are informative stress cases, and the random-placement result adds useful evidence. However, they do not establish the typical error of replay that retains real prompts and generates meaningful continuations of a fixed length. A comparison with that intermediate control would clarify when full token replay provides a substantial additional benefit.

Questions for the authors

Plz see the weakness section.

Reviewer j6CQOpenReview ↗
Rating
2/4
Confidence
2/4
Soundness
2/3
Presentation
2/3
Informativeness
2/3
Read review
Summary

This paper studies a confounding factor in benchmarking LLM serving systems for multi-turn agents: identical initial tasks do not necessarily produce identical execution workloads. Differences in generated tokens can change subsequent prompts, tool calls, dependencies, and termination behavior. AgentReplay records input/output tokens, invocation dependencies, optional logical expert selections, and tool durations, then replays the recorded trajectory while retaining normal autoregressive model computation. Its configurable controls enforce output tokens, optionally restore MoE expert IDs, and emulate tool delays, while leaving batching, scheduling, caching, and physical expert placement to the system under evaluation. The paper also demonstrates replaying a trajectory collected with a more capable model on a smaller target model. Experiments show workload variation under greedy decoding, differences in MoE access patterns and execution costs between random-token length-wise replay and token-wise replay, and improved timing repeatability under fixed-trace replay.

Strengths
  1. The paper addresses a meaningful benchmarking problem and separates system efficiency from changes in agent behavior. Section 4.1 shows substantial variation in token counts, turns, and tool calls despite greedy decoding. AgentReplay fixes the recorded trajectory without replacing model execution with stored responses. It also appropriately preserves scheduling, cache-management, and physical-placement decisions as outcomes of the system being evaluated. The authors explicitly distinguish improved repeatability from speedup, avoiding the misleading interpretation that executing a different workload more quickly demonstrates a system improvement.

  2. The MoE experiments provide informative mechanistic evidence. Section 4.2 connects token content to expert concentration and then examines its interaction with expert parallelism, tensor parallelism, and offloading. The observed bias can have different directions: at batch size 32, length-wise replay yields a full EP prefill-phase time of 1.18 times the token-wise reference, but a TP decode MoE-kernel time of 0.84 times the reference. These results substantiate the narrower, important claim that equal sequence lengths do not imply equivalent MoE execution workloads.

Weaknesses
  1. Replay fidelity and measurement overhead are not sufficiently validated for a benchmarking framework. Section 3.2 describes a sensible token-replacement point, but the paper does not show implementation-level tests establishing that replay maintains the intended token state and prefix/cache keys across batch reordering and turn boundaries. This does not require different cache policies to achieve identical hit rates; rather, it requires the supplied token history and legal reuse opportunities to match the trace definition. Router replay is presented as a separate contribution, yet Figures 4–6 do not clearly specify whether it is enabled or report recorded-versus-enforced expert-ID agreement and an on/off comparison across configurations. The handling of gate weights after expert IDs are forced is also insufficiently specified. Finally, the overhead of trace lookup and token/router injection is not reported. These omissions do not demonstrate an incorrect implementation, but they limit confidence that the framework controls the intended workload without materially perturbing the measured execution.

  2. The experiments establish useful counterexamples more convincingly than they establish reliable practical serving-system comparisons. The length-wise baseline in Section 4.2 replaces content with random tokens. This proves that length matching alone is insufficient in that setting, but it does not quantify the bias of a more realistic baseline that retains recorded inputs and allows natural generation while enforcing output lengths. Some placement and offloading configurations are also deliberately constructed around the random-token hotspots; these are useful diagnostic cases, but their effect sizes should not be generalized without further evidence. In Figure 3(c), output tokens and tool durations are fixed together, so the reduction in cumulative-time CV cannot be attributed to token replay alone. Fixed tool delays can reduce CV both by removing tool-time variability and by adding a constant to its denominator, as the authors acknowledge. Although Figures 5–6 include full-phase measurements, the paper does not demonstrate how replay changes a paired comparison between actual serving configurations under the same agent trace and arrival policy. Missing hardware/software specifications and repeat counts for Figures 4–6 further limit reproducibility.

Questions for the authors

1.Can you provide replay-consistency tests covering batch reordering, turn boundaries, and prefix/cache-key updates, together with token/router injection overhead measurements, especially for small-batch decoding? The objective is to verify the intended reuse opportunities, not to require identical cache-hit outcomes across different policies.

2.Was router replay enabled in Figures 4–6? How are gate weights handled after expert IDs are forced, and how are routing events aligned across prefill and decode? Please report recorded-versus-enforced ID agreement and one on/off comparison using the existing TP/EP configurations.

3.With the recorded graph and inputs held fixed, what are the model-only and model-plus-tool timing means, standard deviations, and CVs when output-token replay and tool-duration replay are enabled separately and together? This would distinguish their contributions to repeatability.

4.Can you supplement the existing trace with a length-wise baseline that retains real inputs and enforces only output length, and report one paired phase-level or end-to-end cost comparison between actual serving configurations? Please also specify the hardware, software versions, and measurement repeat counts.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Missing a submission?

Loading the discussion…

This paper is under review