arXiv:2607.22786cs.LGJul 2026

Manuscript Offprint

arXiv:2607.22786

Optimizing Transformer Neural Network for Real-Time Outlier Detection on FPGAs

Ilia Sobakinskikh, Paul Alexander Bilokon

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

In this work, we explore how the inference time of a Transformer Neural Network can be efficiently optimized with applications to real-time anomaly detection in financial time series. The financial time series are price series such as asset prices. Unfortunately, the data is often with errors or outliers that make the downstream data processing tasks useless, unstable or even harmful [1] [2]. Moreover, the amount of financial time-series data has been significantly increasing [3]. Hence, there is a need for better data-cleaning methods in terms of accuracy and in terms of processing speed.

Transformers as a neural network architecture have achieved superior performances in many tasks such as Natural Language Processing and Computer Vision [4]. Time series modelling and especially anomaly detection tasks can benefit from the features of transformers architecture in multiple ways, including the capacity to capture long-range dependencies and interactions [5].

Increasingly powerful hardware, such as field-programmable gate arrays (FPGAs), have seen increasing usage in recent years due to their reconfigurability and high performance [6]. They can be efficiently utilized to speed up the computations of the Transformer architecture.

We explore different Transformer architectures for time series modelling and how they can be efficiently implemented on an FPGA board (PYNQ-Z2). In particular, we examine the application of Transformers to detect anomalies in time series and we show how they can be efficiently implemented on an FPGA board to minimize latency.

The code is available at https://github.com/thxi/icl_thesis

1 Introduction

The rapid growth of financial time series data has given rise to significant challenges in maintaining data quality and processing speed. In this study, we address these challenges by proposing an implementation of Transformer-based Neural Networks which achieve good performance in anomaly detection tasks while having a low inference time.

Financial time series data often suffer from data inaccuracies, errors, and outliers, rendering downstream data processing tasks ineffective or even detrimental to decision-making processes. The urgency of this issue is underscored by the ever-increasing volume of financial time-series data available. Consequently, there is a pressing demand for more accurate and faster data-cleaning methods.

Transformers, as a powerful neural network architecture, have consistently demonstrated exceptional performance across various domains, including Natural Language Processing (NLP) and Computer Vision. Leveraging the capabilities of Transformer architectures for time series modeling, especially in the realm of anomaly detection, offers numerous advantages, including the ability to capture long-range dependencies and intricate interactions within the data.

The evolution of hardware, for example, the growing utilization of field-programmable gate arrays (FPGAs), has brought about increased computational capabilities due to their reconfigurability, high performance and deterministic latency. These FPGAs can be effectively used to accelerate computations associated with Transformer architectures.

References (26)