Temporal Point Processes (TPPs) are essential for modeling event sequences in various domains, but their autoregressive nature imposes a significant computational bottleneck during generation. This paper introduces a model-agnostic speculative sampling algorithm that enables parallel generation of future events. By leveraging a rejection sampling framework with efficiently computed piecewise linear bounds, the proposed method achieves substantial wall-clock speedups while maintaining the exact statistical properties of the underlying model.
The Challenge of Autoregressive TPPs
Temporal Point Processes (TPPs) are widely used to model discrete events occurring in continuous time, such as financial transactions, social media activity, and seismic events. State-of-the-art TPP models are typically autoregressive, meaning the distribution of the next event depends on the entire history of previous events. While expressive, this dependency necessitates sequential sampling, which is prohibitively slow for large-scale or real-time applications.
In an autoregressive TPP, generating $N$ events requires $N$ sequential model evaluations. For a sequence of length $N$, the time complexity is $O(N)$. In high-frequency environments, this "one-at-a-time" approach cannot keep pace with the data generation rate. Previous attempts to address this have often involved non-autoregressive architectures, which typically require retraining and may sacrifice the modeling flexibility of standard autoregressive frameworks.
Proposed Method: Speculative Sampling
The authors propose a "speculative sampling" approach, drawing inspiration from speculative decoding in Large Language Models. The core idea is to generate multiple candidate future events in parallel and then verify them against the true model distributions.
- Proposal: The model's current prediction for the next step is used as a proposal distribution for several subsequent steps.
- Parallel Verification: The proposed sequence is fed into the model's encoder in a single parallel batch to compute the true target distributions.
- Rejection Sampling: A modified rejection sampling test determines the number of accepted events. Events are accepted sequentially until one fails the test.
Efficient Rejection Sampling with Piecewise Bounds
A critical component of rejection sampling is finding a rejection constant $M$ such that $M \cdot q(x) \geq p(x)$, where $q$ is the proposal and $p$ is the target distribution. To make this efficient for complex parametric distributions (e.g., Log-normal, Weibull, Gamma), the authors utilize piecewise linear approximations. By identifying inflection points and regions of convexity/concavity, they can rapidly construct tight upper and lower bounds for the probability density functions (PDFs).
Experimental Evaluation and Results
The method was tested on seven standard TPP benchmarks (Amazon, Taobao, Earthquake, Reddit, Retweet, Stack Overflow, Taxi) and a high-frequency Limit Order Book (LOB) dataset. The evaluation focused on wall-clock speedup and statistical fidelity.
The speculative sampling method demonstrated significant performance gains. For instance, on the Retweet dataset, an average of 12 events were accepted per iteration from a window of 15, leading to substantial speedups. In the LOB financial application, the method achieved an average speculative step size of 2.82 for exact sampling and 5.19 for an approximate "top-k" variant.
Importantly, the method is model-agnostic and requires no retraining. It exploits the "slow drift" property of many real-world processes, where the conditional distribution does not change drastically with a single new observation. Statistical tests (KL-divergence and MMD) confirmed that the generated sequences are indistinguishable from those produced by standard sequential sampling.
Conclusion
Speculative sampling offers a robust, "plug-and-play" solution for accelerating autoregressive TPPs. By parallelizing the verification step and using efficient bounding techniques, it bridges the gap between high-fidelity modeling and high-speed generation requirements in real-world applications.
Summary updated