TPP-SD: Accelerating Transformer Point Process Sampling with Speculative Decoding

Shukai Gong, Yiyang Fu, Fengyuan Ran, Quyu Kong, Feng Zhou

Temporal Point Processes (TPPs) are the mathematical workhorses behind modeling events that happen in continuous time—think of high-frequency stock trades, user clicks on a website, or the sudden cluster of aftershocks following an earthquake. While Transformer-based TPPs have set new records for accuracy and expressiveness, they have a major Achilles' heel: they are incredibly slow to sample from.

A new paper introduces TPP-SD, a framework that borrows a clever trick from Large Language Models (LLMs) to speed up TPP sampling by 2 to 6 times without losing a shred of accuracy.

TL;DR

TPP-SD adapts "speculative decoding" to temporal point processes, using a tiny "draft" model to propose multiple future events that a large "target" model verifies in parallel. This breaks the sequential bottleneck of traditional sampling, achieving significant speedups while guaranteed to produce the exact same statistical distribution as the original, slower method.

The Sequential Bottleneck in TPP Sampling

In the world of TPPs, "sampling" means generating a synthetic sequence of future events based on past history. This is vital for making predictions, stress-testing systems, or understanding complex dynamics.

The standard way to do this is the thinning algorithm. It works by proposing a potential time for the next event and then "rolling the dice" to accept or reject it based on the model's intensity function. The problem? With modern Transformer TPPs, every single "roll of the dice" requires a full forward pass through a massive neural network. Because this process is strictly sequential (you cannot sample event #10 until you have confirmed event #9), it becomes a massive computational bottleneck.

Methods: Borrowing from LLMs

The authors realized that the thinning algorithm for TPPs looks a lot like the autoregressive decoding used in LLMs. To fix the bottleneck, they implemented Speculative Decoding (SD).

The TPP-SD workflow consists of three main steps:

  1. Drafting: A lightweight "draft" model (e.g., a 1-layer Transformer) quickly guesses a sequence of $\gamma$ future events.
  2. Verification: The large "target" model (e.g., a 20-layer Transformer) looks at all $\gamma$ guesses simultaneously. Because Transformers are designed for parallel computation, checking ten guesses takes roughly the same time as checking one.
  3. Adjustment: If the target model rejects a guess, the system discards the remaining guesses and samples a "correction" event from an adjusted distribution. This mathematical correction ensures the final output is indistinguishable from the target model's true distribution.
The TPP-SD framework uses a small draft model to propose candidates that the target model verifies in parallel.

Datasets

The researchers tested TPP-SD across a wide variety of scenarios:

  • Synthetic Data: Inhomogeneous Poisson processes, univariate Hawkes processes, and multivariate Hawkes processes. These allow for "ground truth" verification.
  • Real-World Data:
    • Taobao: User behavior on an e-commerce platform.
  • Amazon: Chronological shopping activities.
  • Taxi: NYC taxi pickup and drop-off incidents.
  • StackOverflow: Sequential badge-earning events by users.

Key Insights and Exactness

  • The Hidden Similarity: The "aha moment" of the paper is identifying that the traditional thinning algorithm is essentially a special, restricted case of speculative decoding.
  • Parallelism is Free (Mostly): The target model's ability to process multiple events in parallel is the engine of the speedup. As long as the draft model is "good enough" to get several guesses right in a row, the system skips multiple sequential steps.
  • Exact, Not Approximate: Many acceleration techniques trade off accuracy for speed. TPP-SD is an exact method. The Kolmogorov-Smirnov (KS) plots in the paper show that the "Speculative" samples track the "Standard" and "Real" distributions perfectly.
KS plots demonstrate that TPP-SD (Speculative) maintains the same distributional fidelity as standard sampling.

Key Results

  • Substantial Speedups: TPP-SD achieved a 2–6× speedup across all datasets. The most complex models saw the greatest benefits, with speedups reaching up to 5.7×.
  • Optimal Draft Size: Interestingly, the smallest draft model (1-head, 1-layer) often performed best. While a larger draft model might be more accurate, the extra time it takes to run it outweighs the benefit of having fewer rejections.
  • Draft Length: The optimal number of guesses ($\gamma$) is typically between 5 and 15. Proposing too many events leads to diminishing returns as the probability of a rejection early in the sequence increases.

Limitations and Future Work

While TPP-SD is a major step forward, the authors note a few limitations:

  • Data Requirements: You need enough data to train both a high-quality target model and a useful draft model. In "data-scarce" scenarios, the draft model might be too inaccurate to provide a speedup.
  • Deployment Overhead: Running two models at once is more memory-intensive than running one.
  • Future Directions: The authors suggest moving toward "feature-level" speculative decoding or integrating the draft mechanism directly into the target model's architecture to further reduce overhead.

By bridging the gap between the high-performance world of LLM optimization and the continuous-time modeling of TPPs, TPP-SD makes powerful Transformer models practical for real-time applications where every millisecond counts.

Summary updated

BibTeX
@inproceedings{gong2025tpp,
  author = {Shukai Gong and YIYANG FU and Fengyuan Ran and Quyu Kong and Feng Zhou},
  title = {{TPP-SD: Accelerating Transformer Point Process Sampling with Speculative Decoding}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=LkqK19tqgx},
}
Figure