SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2310.04993 · NeurIPS · 2023

Prompt-augmented Temporal Point Process for Streaming Event Sequence

Yan Wang, Jun Zhou, Caigao Jiang, Siqiao Xue, James Zhang, Hongyan Hao, Xiaoming Shi, Xiaoyun Feng, Gangwei Jiang

arXiv · PDF · Open in the Atlas

Code that ran

6 of 11 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 3 failures of our instrument; 5 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2310.04993.json · badge: /api/ran/2310.04993.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
yanyanSann/PromptTPP canonical (classifier label)
classifier basis: census
2 ran · 0 no recorded run
yanyansann/prompttpp community
Papers with Code archive
3 ran · 5 no recorded run
yangalan123/anhp-andtt community
Papers with Code archive
1 ran · 0 no recorded run
FunctionStatusWhere it lives
ConTEncoderLayer Ran
ran on a synthesized input
yanyansann/prompttpp/model_run/neural_tpp/model/torch_model/torch_pro_anhp.py
code served (permissive licence) · get_code("4e3761095e10d6be")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 3, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from torch import nn

class SublayerConnection(nn.Module):

    def __init__(self, d_model, dropout):
        super(SublayerConnection, self).__init__()
        self.norm = nn.LayerNorm(d_model)
        self.dropout = nn.Dropout(dropout)

    def forward(self, x, sublayer):
        return x + self.dropout(sublayer(self.norm(x)))

class ConTEncoderLayer(nn.Module):

    def __init__(self, d_model, self_attn, feed_forward=None, use_residual=False, dropout=0.1):
        super(ConTEncoderLayer, self).__init__()
        self.self_attn = self_attn
        self.feed_forward = feed_forward
        self.use_residual = use_residual
        if use_residual:
            self.sublayer = nn.ModuleList([SublayerConnection(d_model, dropout) for _ in range(2)])
        self.d_model = d_model

    def forward(self, x, time_emb, est_time_emb, type_emb, mask):
        if self.use_residual:
            x = self.sublayer[0](x, lambda x: self.self_attn(x, x, x, mask))
            if self.feed_forward is not None:
                return self.sublayer[1](x, self.feed_forward)
            else:
                return x
        else:
            return self.self_attn(x, time_emb, est_time_emb, type_emb, mask)


class DummyAttention(nn.Module):
    def __init__(self, d_model):
        super().__init__()
        self.d_model = d_model
    
    def forward(self, q, k, v, mask=None):
        batch_size = q.shape[0]
        seq_len = q.shape[1]
        return torch.randn(batch_size, seq_len, self.d_model)


class DummyFeedForward(nn.Module):
    def __init__(self, d_model):
        super().__init__()
        self.linear = nn.Linear(d_model, d_model)
    
    def forward(self, x):
        return self.linear(x)


d_model = 4
batch_size = 2
seq_len = 3

self_attn = DummyAttention(d_model)
feed_forward = DummyFeedForward(d_model)

INIT_ARGS = {
    'd_model': d_model,
    'self_attn': self_attn,
    'feed_forward': feed_forward,
    'use_residual': True,
    'dropout': 0.1
}

ARGS = {
    'x': torch.randn(batch_size, seq_len, d_model),
    'time_emb': torch.randn(batch_size, seq_len, d_model),
    'est_time_emb': torch.randn(batch_size, seq_len, d_model),
    'type_emb': torch.randn(batch_size, seq_len, d_model),
    'mask': None
}

if __name__ == '__main__':
    model = ConTEncoderLayer(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Expected shape: ({batch_size}, {seq_len}, {d_model})")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
TransformerCell Ran
ran on a synthesized input · constructed an object; no result was computed
yangalan123/anhp-andtt/andtt/neural/cell.py
code served (permissive licence) · get_code("2781387a8f9bc90d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, TransformerCell: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

ARGS = {
    'name': 'test_cell',
    'cell_dim': 4,
    'cell_zero': [0, 2],
    'time_created': 0.0,
    'device': 'cpu',
    'memory_size': 50
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type TransformerCell — the run constructed an instance of its own class and did not call it; no shape is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
create_torch_dataloader Ran
ran on a synthesized input
yanyanSann/PromptTPP/model_run/neural_tpp/preprocess/torch_dataset.py
code served (permissive licence) · get_code("9d00011dad2cc74b")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned DataLoader. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
from torch.utils.data import Dataset, DataLoader

torch.manual_seed(0)

class TorchTPPDataset(Dataset):
    """Stand-in TorchTPPDataset with collate_fn method"""
    
    def __init__(self, num_samples=2):
        self.num_samples = num_samples
    
    def __len__(self):
        return self.num_samples
    
    def __getitem__(self, idx):
        # Return a simple tuple of tensors
        x = torch.randn(4)
        y = torch.randn(3)
        return (x, y)
    
    def collate_fn(self, batch):
        """Collate function to stack batch items"""
        xs = torch.stack([item[0] for item in batch])
        ys = torch.stack([item[1] for item in batch])
        return (xs, ys)

# Create dataset instance
dataset = TorchTPPDataset(num_samples=2)

# Define ARGS dictionary with all parameters
ARGS = {
    'dataset': dataset,
    'batch_size': 2,
    'shuffle': True,
    'num_workers': 0
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataLoader — a DataLoader output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataLoader output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
load_experiment_ids Ran
ran; our contract draft was wrong, not the code
yanyanSann/PromptTPP/model_run/neural_tpp/autotuner.py
code served (permissive licence) · get_code("10d4c062b41c0f97")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tempfile
import os
import yaml

# Create a temporary directory with model config files
temp_dir = tempfile.mkdtemp()

# Create a model_config.yaml file with experiment IDs
config_data = {
    'experiment_001': {'param1': 'value1'},
    'experiment_002': {'param2': 'value2'},
    'experiment_003': {'param3': 'value3'}
}

config_file = os.path.join(temp_dir, 'model_config.yaml')
with open(config_file, 'w') as f:
    yaml.dump(config_data, f)

ARGS = {
    'config_dir': temp_dir
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
yaml — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
prefix_attention Ran
ran; our contract draft was wrong, not the code
yanyansann/prompttpp/model_run/neural_tpp/model/torch_model/torch_pro_anhp.py
code served (permissive licence) · get_code("adbbd76b3e0b6ad1")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import math

torch.manual_seed(0)

# Construct tiny tensors for query, key, value
# Batch size: 2, Num heads: 1, Seq len: 3, d_k: 4
batch_size = 2
num_heads = 1
seq_len = 3
d_k = 4

query = torch.randn(batch_size, num_heads, seq_len, d_k)
key = torch.randn(batch_size, num_heads, seq_len, d_k)
value = torch.randn(batch_size, num_heads, seq_len, d_k)

# Construct mask - shape (1, seq_len, seq_len)
# Values > 0 will be masked out
mask = torch.triu(torch.ones(1, seq_len, seq_len), diagonal=1)

# Construct dropout layer
dropout = nn.Dropout(p=0.1)

ARGS = {
    "query": query,
    "key": key,
    "value": value,
    "mask": mask,
    "dropout": dropout
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
set_device Ran
ran; our contract draft was wrong, not the code
yanyansann/prompttpp/model_run/neural_tpp/model/torch_model/torch_pro_anhp.py
code served (permissive licence) · get_code("2e7ad66f463619d1")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned device. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

ARGS = {
    "gpu": -1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type device — a device output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a device output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
ContTPromptPool Not yet run
unverified (harvested, no recorded run)
yanyansann/prompttpp/model_run/neural_tpp/model/torch_model/torch_pro_anhp.py
code served (permissive licence) · get_code("feb2e19c667683f4")
How it ran

no invocation recorded.

ContTPrxfixPromptLayer Not yet run
unverified (harvested, no recorded run)
yanyansann/prompttpp/model_run/neural_tpp/model/torch_model/torch_pro_anhp.py
code served (permissive licence) · get_code("052117f1ee931d5c")
How it ran

no invocation recorded.

EventSampler Not yet run
unverified (harvested, no recorded run)
yanyansann/prompttpp/model_run/neural_tpp/model/torch_model/torch_pro_anhp.py
code served (permissive licence) · get_code("2f83d36760ee9645")
How it ran

no invocation recorded.

PromptAttNHP Not yet run
unverified (harvested, no recorded run)
yanyansann/prompttpp/model_run/neural_tpp/model/torch_model/torch_pro_anhp.py
code served (permissive licence) · get_code("b56a6348507bdaf9")
How it ran

no invocation recorded.

TorchBaseModel Not yet run
unverified (harvested, no recorded run)
yanyansann/prompttpp/model_run/neural_tpp/model/torch_model/torch_pro_anhp.py
code served (permissive licence) · get_code("c02945e70ba3b094")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 10 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
load_experiment_ids 1 other paper
1 later
aaai_28749 (2024 (year only))
STEM: Unleashing the Power of Embeddings for Multi-Task Recommendation

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Neural Temporal Point Processes (TPPs) are the prevalent paradigm for modeling continuous-time event sequences, such as user activities on the web and financial transactions. In real-world applications, event data is typically received in a streaming manner, where the distribution of patterns may shift over time. Additionally, privacy and memory constraints are commonly observed in practical scenarios, further compounding the challenges. Therefore, the continuous monitoring of a TPP to learn the streaming event sequence is an important yet under-explored problem. Our work paper addresses this challenge by adopting Continual Learning (CL), which makes the model capable of continuously learning a sequence of tasks without catastrophic forgetting under realistic constraints. Correspondingly, we propose a simple yet effective framework, PromptTPP 1 , by integrating the base TPP with a continuous-time retrieval prompt pool. The prompts, small learnable parameters, are stored in a memory space and jointly optimized with the base TPP, ensuring that the model learns event streams sequentially without buffering past examples or task-specific attributes. We present a novel and realistic experimental setup for modeling event streams, where PromptTPP consistently achieves state-of-the-art performance across three real user behavior datasets.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2310.04993")
get_code_for_paper("2310.04993")
have("2310.04993")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2310.04993.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2310.04993.svg)](https://syntology.ai/paper/2310.04993)

Connect an agent — have() is free.