---
title: Next Activity Prediction (NAP)
url: https://www.emergentmind.com/topics/next-activity-prediction-nap
type: topic
---

# Next Activity Prediction (NAP)

Next Activity Prediction (NAP) denotes the problem of predicting the immediately subsequent activity from a partial execution history. In Predictive Process Monitoring (PPM), it is typically defined over prefixes of event-log traces, with each prefix labeled by the next activity in the same case [2309.09618]. Related formulations retain the same predictive core while changing the unit of analysis: resource-centric NAP predicts the next activity in an individual resource’s timestamp-ordered activity sequence [2508.19016], object-centric NAP predicts the next activity for a primary object in an object-centric event log [2607.01785], multimodal next action prediction forecasts a user’s next computer interaction from screenshots and interaction history [2603.05923], and action-anticipation work formulates NAP over observed video clips and future action labels [2408.02769]. This suggests that NAP is better understood as a family of conditional forecasting problems whose shared abstraction is prefix-to-next-event prediction, but whose notions of context, structure, and generalization differ by domain.

## 1. Formal problem space

In the case-centric PPM formulation, an event log \(L\) is a multiset of completed traces, each trace \(t=\langle e_1,\dots,e_n\rangle\) being a finite sequence of events. Each event carries at least an activity label \(act(e)\in\mathcal{A}\), and a prefix of length \(p\) is \(t[1:p]=\langle e_1,\dots,e_p\rangle\). NAP then treats a prefix projected onto activity labels as a feature vector \(x\), the next activity \(y=act(e_{p+1})\) as its label, and learns a predictor \(f:\mathcal{X}\to\mathcal{Y}\) with \(\hat y=f(x)\) [2309.09618].

Several extensions preserve this prefix-label structure while changing the semantics of the prefix. Resource-centric NAP replaces case traces with per-resource sequences \(\sigma^r=\langle a_1^r,\dots,a_k^r\rangle\) in timestamp order and predicts \(a_{p+1}^r\) from \(\langle a_1^r,\dots,a_p^r\rangle\) [2508.19016]. Object-centric NAP operates on OCELs, where events may involve multiple business objects; for a primary object \(o_{\mathsf{pri}}\), the prefix includes observed lifecycle events, co-participating objects, and contextual events linked through those objects, with the target \(a_{t+1}=\pi_{\mathsf{act}}(e_{t+1})\) [2607.01785].

Outside process mining, the same predictive pattern recurs with different state spaces. In multimodal HCI, an interaction stream is \(\mathcal{E}=\{e_1,\dots,e_T\}\) with \(e_t=(a_t,I_t)\), where \(a_t\) is a natural-language action description and \(I_t\) an optional screenshot; the goal is to predict the next \(h\) events from a context window \(\mathcal{E}_{t-k:t}\) [2603.05923]. In smart-home prediction, the target is often a pair \((\hat a_{t+1},\hat d_{t+1})\), comprising the next activity and its duration [2602.11176]. In video action anticipation, an observed clip sequence \(V=\{C_1,\dots,C_T\}\) is encoded into feature sequence \(Z=\{z_1,\dots,z_T\}\), and a causal decoder predicts the next action label \(a_{t+1}\) from \(z_{1:t}\) [2408.02769].

## 2. Evaluation methodology and the generalization problem

A central issue in NAP research is that common evaluation protocols may not measure generalization in any robust sense. For case-centric event logs, the standard procedure randomly or temporally splits completed traces into training and test subsets, then derives prefixes from each. Abb et al. show that this induces extensive example leakage because many control-flow prefixes recur in both splits. They define leakage as
\[
\mathrm{Leakage}=\frac{|P_{\mathrm{train}}\cap P_{\mathrm{test}}|}{|P_{\mathrm{test}}|},
\]
and report leakage far above \(80\%\), often close to \(100\%\), on Helpdesk, BPIC2012, BPIC2013, BPIC2017, and MobIS. In the same study, a trivial lookup-table baseline nearly matches a state-of-the-art deep model: on Helpdesk, leakage is approximately \(99\%\), baseline accuracy \(87\), MPPN accuracy \(88\), and the control-flow accuracy limit \(89\); on MobIS the corresponding values are approximately \(98\%\), \(92\), \(93\), and \(94\); on BPIC12 they are approximately \(85\%\), \(82\), \(85\), and \(87\) [2309.09618].

The implication is not merely that some benchmarks are easy, but that distinct generalization scenarios have been conflated. Abb et al. distinguish at least three broad types: unseen control-flow variants, unseen attribute-activity combinations, and truly unseen activities or values. They further argue that robust evaluation should prevent prefix overlap entirely, for example by leave-one-variant-out splitting or by prefix-level temporal separation, and should explicitly test concurrency, loops, context dependency, and unknown-value cases [2309.09618].

Subsequent work reinforces the importance of this distinction. Resource-centric NAP reports variant-to-resource ratios of approximately \(1.0\) and example leakage below \(3\%\), in contrast to case-centric variant-to-case ratios of \(0.05\)–\(0.65\) with leakage up to \(85\%\), and attributes part of its gains to the fact that resource behavior is less dominated by memorized prefixes [2508.19016]. A later benchmark comparing LSTMs, Transformers, vocabulary-adapted LLMs, and a counting-based argmax baseline across seven BPI logs finds that the argmax baseline matches or approaches billion-parameter LLMs on most datasets; differences between argmax and learned models are significant only on BPI12 and BPI17 [2606.15868].

## 3. Model families in process-monitoring NAP

A large portion of the literature studies case-centric NAP on classical event logs using supervised sequence models and tabular encodings. An empirical comparison of context-enriched NAP evaluates MLP, LSTM, and 1D CNN architectures combined with ordinal, binary, one-hot, hash, and Word2Vec encodings across five real-life event logs. Across folds, logs, architectures, and encodings, the reported averages are \(0.68\) Accuracy, \(0.56\) AUC\(_{PR}\), and \(0.65\) F1-score; Hash encoding is the best overall encoding at \(+5\%\) over the mean, while LSTM is the best architecture at \(+3\%\) over the mean, and significant differences are reported via Friedman and Nemenyi tests [2005.01194].

Interpretability-oriented work keeps the predictive architecture close to standard sequence models but augments it with explanation mechanisms. XNAP uses a one-layer bidirectional LSTM with \(d_h=100\) per direction, softmax next-activity prediction, and layer-wise relevance propagation to assign event-level relevance scores \(R_{t,a}\). On helpdesk it reports \(0.840\pm0.012\) Accuracy and \(0.798\pm0.015\) F1-score; on bpi2019 it reports \(0.755\pm0.010\) Accuracy and \(0.727\pm0.011\) F1-score. The explanatory output highlights, for example, “Resolve ticket” when predicting “End” in helpdesk traces and “Record Invoice Receipt” when predicting “Clear Invoice” in bpi2019 traces [2008.07993].

Transformer-based and language-model-based variants extend NAP beyond symbolic activity sequences. A Symbolic[Neuro] system combines a Transformer encoder with a Petri-net compliance score that modulates beam-search suffix generation at inference time. The neural model is trained purely by categorical cross-entropy, while process knowledge enters through a fuzzy fitness term \(\mathcal{C}(\sigma',N)\) used to reweight candidate extensions. Reported micro-averaged Damerau–Levenshtein similarity improvements include \(0.540\to0.814\) on a synthetic exceptional-branch setting and \(0.119\to0.481\) on BPIC2012, with smaller gains on several other logs [2312.08847].

SNAP transfers NAP into a text-classification setting by transforming event-log prefixes into semantic contextual stories and fine-tuning language foundation models on the resulting narratives. On six benchmark logs, SNAP-G reports \(0.696\) Accuracy on BPI13cp, \(0.890\) on EnvPermit, \(0.655\) on Sepsis, and \(0.459\) on the semantically rich MIP dataset; ablations show that story inputs outperform “list of values” inputs on most logs, and that omitting user utterances on MIP reduces Accuracy from \(0.437\) to \(0.373\) and F1 from \(0.428\) to \(0.358\) [2401.15621].

Two recent lines directly question whether larger models are inherently preferable. “David vs. Goliath” reports no consistent benefit from pretraining, little effect of model size, and competitiveness of a first-order argmax baseline across seven logs [2606.15868]. An entropy-driven selection framework instead proposes choosing the model class from the process entropy: on the high-entropy Sepsis log, DAW-Transformer achieves \(70.14\%\) Accuracy versus \(65.45\%\) for Limited window Multi-Transformers and approximately \(67.07\%\) for CNN-LSTM-SAtt, while on the low-entropy Road Traffic Fine log Random Forest reaches \(99.71\%\) versus \(92.36\%\) for DAW-Transformer [2502.10573]. This line of work makes the complexity–interpretability trade-off explicit rather than assuming a monotonic benefit from more expressive architectures.

Graph-based structure preservation is another major trend. RLHGNN converts prefixes into heterogeneous process graphs with forward, backward, and repeat edges, uses a DQN to select one of four graph structures per prefix, and then applies heterogeneous graph convolution for next-activity prediction. Averaged over six logs, it reports \(0.782\) Accuracy versus \(0.767\) for the best static baseline, \(0.578\) F1-score versus \(0.554\), and approximately \(1.02\) ms inference latency per instance [2507.02690].

## 4. Alternative units of prediction and prescriptive extensions

Resource-centric NAP shifts attention from case progression to the behavior of individual resources. The formulation extracts, for each resource, a timestamp-ordered activity sequence and applies classifiers to feature encodings such as capability, 2-gram transitions, repetition statistics, and their concatenation. Across four BPIC logs, LightGBM and Transformer perform best with 2-gram transition encoding, while Random Forest benefits most from the combined \(T+R\) encoding; the best average accuracies are \(0.74\pm0.09\) for BPIC2013 with RF+\(T+R\), \(0.65\pm0.05\) for BPIC2017 with RF+\(T+R\), \(0.65\pm0.05\) for BPIC2018 with RF+\(T+R\), and \(0.92\pm0.02\) for BPIC2019 with Transformer+\(T\) [2508.19016].

Object-centric NAP addresses logs where events are shared by multiple typed business objects. EHHN represents each prefix as a heterogeneous hypergraph whose event–object hyperedges bind co-participating objects and whose lifecycle hyperedge groups the primary object’s observed events. A dual-stream architecture combines a micro-spatial stream for event-driven object-state evolution with a macro-evolution stream for temporal dynamics using retrieved global prototypes. Across four OCEL benchmarks, EHHN reports the best Accuracy and macro F1-score on all datasets, with gains of up to \(8.1\) and \(12.4\) percentage points over the strongest baselines; relative to the strongest OCEL-native graph baseline, peak GPU memory on BPI 2017 drops from \(4.6\) GB to \(0.19\) GB, a \(\times24\) reduction [2607.01785].

Clinical NAP introduces domain knowledge directly into similarity computation. TS4NAP uses ICD-10-CM and ICD-10-PCS taxonomies, Sánchez information content, Sánchez–Lin semantic similarity, and bipartite matching over diagnosis lists and procedure sequences derived from MIMIC-IV. Over 36 event logs defined by primary-diagnosis categories with at least 500 cases, the taxonomy-aware variant TS4NAP\(_T\) outperforms the Boolean baseline TS4NAP\(_B\) in 34 of 36 logs at \(p<0.05\), with AverageSimilarity ranging from about \(0.56\)–\(0.97\) for TS4NAP\(_T\) versus \(0.43\)–\(0.97\) for TS4NAP\(_B\) [2503.07638].

A distinct but adjacent line turns NAP from predictive into prescriptive analytics. Goal-oriented next best activity recommendation formulates suffix recommendation as an MDP whose valid actions are constrained by a Directly-Follows Graph, predicts KPI consequences with a GAN-LSTM model, and uses Maskable-PPO to explore conformant suffixes that satisfy completion-time or outcome goals. Reported results include \(90\)–\(99\%\) rescue rates for goal-violating cases, GS\(_{pred}\) of approximately \(90\)–\(100\%\), \(100\%\) conformance by construction, and \(10\)–\(70\) percentage-point improvements in GS\(_{pred}\) over a state-of-the-art next-best-action baseline [2205.03219]. This suggests a boundary case in which NAP becomes one component of a longer-horizon decision problem.

## 5. NAP beyond process mining

The same predictive pattern appears in video understanding, smart environments, and human-computer interaction, often under the names next action prediction or action anticipation. Time Perception Machine combines a hierarchical RNN with temporal point processes to predict when, where, and what the next activity will be in streaming video or trajectory data. On NBA it reports timing mAE \(=282\) ms and mDR \(=52.0\%\) for TPM\(_B\), compared with Hawkes at approximately \(364\) ms and \(541\%\); on NBA category prediction it reports \(67.2\%\) mAP versus \(57.3\%\) for the best \(k\)-order Markov baseline [1808.04063].

Graphing the Future represents partially observed videos as semantic–motion graphs and matches them to fully observed references with normalized Graph Edit Distance. On MSR Daily Activities, early activity prediction accuracy rises from \(59\%\) at \(10\%\) observation to \(98\%\) at full observation; on CAD-120, next-active-object prediction reaches \(87.0\%\) at a 2.00 s horizon and \(97.0\%\) at a 0.25 s horizon [2209.05194].

ARR explicitly decomposes action anticipation into action recognition and sequence reasoning. A video encoder produces clip-level action features, and a causal Transformer decoder is trained with a shifted-label NAP objective to learn statistical correlations among actions. Reported results include class-mean Top-5 recall of \(16.3\) on Epic-Kitchens-100, Top-1 Accuracy of \(49.2\) on 50Salads, and consistent gains from unsupervised decoder pretraining on unlabeled videos [2408.02769].

Human-computer interaction introduces an unbounded action space and long multimodal histories. LongNAP uses a vision-language policy, a memory bank of past reasoning traces, and a lexical retriever combining BM25, temporal decay, and MMR. On one month of phone-use data from 20 users, it reports mean similarity \(0.38\) versus \(0.21\) for supervised finetuning and \(0.27\) for the best prompted baseline, human win-rate \(79\%\), cross-user generalization \(0.26\) versus \(0.23\), pass@1@0.5 \(=17.1\%\), and pass@20@0.5 \(=36.3\%\) [2603.05923].

In smart-home forecasting, retrieval-augmented prompting with temporal, spatial, behavioral-history, and persona context is used to query a pre-trained LLM. On CASAS Aruba, zero-shot, one-shot, and two-shot settings yield Accuracy \(0.494\), \(0.519\), and \(0.528\), with MAE \(39.6\), \(34.9\), and \(36.1\) minutes respectively; normalized DTW for the LLM remains \(0.12\)–\(0.15\), compared with \(0.27\) for a time-aware Markov baseline [2602.11176].

## 6. Robustness, explainability, and open research directions

Current research identifies three recurring pressure points for NAP: whether models genuinely generalize, whether their predictions can be interpreted, and whether they remain reliable under distributional change. The generalization critique is strongest in the leakage literature: evaluation must distinguish unseen control-flow variants, unseen attribute–activity combinations, and truly unseen activities or values; principled systems for the last case may emit an UNKNOWN token or return a probability distribution with a confidence measure such as entropy [2309.09618].

Explainability has been pursued both intrinsically and post hoc. XNAP provides per-event relevance scores through layer-wise relevance propagation, making the influence of specific historical events inspectable by process analysts [2008.07993]. TS4NAP is explicitly case-based and exposes similar historical traces, code matches, and taxonomic similarities for each clinical recommendation [2503.07638]. Knowledge-driven modulation integrates a Petri-net compliance score into suffix decoding, so that rare but procedurally admissible continuations can be boosted even when they are under-sampled in the training data [2312.08847].

Concept drift and recurring tasks require additional machinery beyond static train-test evaluation. CNAPwP adapts DualPrompt to continual next activity prediction by combining a shared model with global prompts and bucket-specific expert prompts, plus task recognition based on prefix-tree dissimilarity. On synthetic RandomTasks and RecurrentTasks it reports the best average accuracies, \(0.813\pm0.004\) and \(0.789\pm0.002\), while remaining below \(30\) ms per event even on real logs such as BPIC2015rec and BPIC2017 [2604.00653]. The paper also introduces a task-specific forgetting metric defined as the accuracy gap between the first and later occurrences of the same task, targeting recurrent drift rather than one-off adaptation [2604.00653].

A broad methodological tension remains unresolved. On one side are increasingly elaborate architectures—semantic story models, graph and hypergraph encoders, retrieval-augmented vision-language systems, and continual-learning prompt frameworks. On the other side are repeated findings that simple baselines can be remarkably competitive when evaluation protocols leak examples or when the transition structure is low-entropy [2309.09618]. Benchmark work on LSTMs, Transformers, and LLMs concludes that pretraining confers no consistent improvement, model size shows little effect, and a first-order argmax baseline matches or approaches large LLMs on most event logs [2606.15868]. A plausible implication is that future progress in NAP depends as much on leakage-free evaluation design and scenario-specific benchmark construction as on architectural novelty itself.

Source: https://www.emergentmind.com/topics/next-activity-prediction-nap