HT-Transformer: Event Sequences Classification by Accumulating Prefix Information with History Tokens

Read full text
Authors: Ivan Karpukhin, Maksim Polesskii, Andrey V. Savchenko
Cited by: 0

Abstract

Deep learning has achieved strong results in modeling sequential data, including event sequences, temporal point processes, and irregular time series. Recently, transformers have largely replaced recurrent networks in these tasks. However, transformers often underperform recurrent networks in classification tasks that aim to predict future targets, such as churn, user reactions, or treatment response. The reason behind this performance gap remains largely underexplored. In this paper, we identify a key limitation of transformers: the lack of a single vector representation that compactly summarizes the evolving state of a sequence. We further show that commonly used contrastive embeddings are poorly suited to capturing the local context needed for accurate forward-looking prediction. To address these challenges, we introduce history tokens, a novel concept that enables the accumulation of historical information during next-token prediction pretraining. Our approach significantly improves transformer-based models, achieving impressive results in finance, e-commerce, and healthcare tasks. The code is publicly available: https://github.com/ivan-chai/pretpp.

Fields of Study & Subjects

Machine Learning in Healthcare Time Series Analysis and Forecasting Data Quality and Management

Publication details

Pages
6462–6470
Publication date
1 September 2026
Language
EN