Searcharxiv⌕ Search

arXiv subjects

Paul Alexander Bilokon

Publications and source records attributed to Paul Alexander Bilokon.

9 recordsLinked to original sources

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

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. Moreover, the amount of financial time-series data has been significantly increasing. 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. 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. Increasingly powerful hardware, such as field-programmable gate arrays (FPGAs), have seen increasing usage in recent years due to their reconfigurability and high performance. 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

cs.LG↗

A Sieve on Rational Imbalances and the First Appearance of Denominators

We construct a sieve that enumerates rational ``imbalances'' of the form $(p-q)/(p+q)$ for integers $p\ge2$ and $1\le q<p$, ordered lexicographically by $(p,q)$. Each imbalance is reduced to lowest terms, and we record the sequence of distinct denominators as they first appear. We show that every positive integer occurs exactly once as such a denominator, and that its first appearance coincides with the unit fraction $1/d$. We then prove that the sieve, when viewed as a map from pairs $(p,q)$ to reduced fractions, enumerates all rational numbers in $(-1,1)$ without repetition, extend it symmetrically to all of $\mathbb{Q}$, and discuss its connections to hyperbolic geometry and rational enumeration theory.

math.GM↗

Computation as a Game

We present a unifying representation of computation as a two-player game between an \emph{Algorithm} and \emph{Nature}, grounded in domain theory and game theory. The Algorithm produces progressively refined approximations within a Scott domain, while Nature assigns penalties proportional to their distance from the true value. Correctness corresponds to equilibrium in the limit of refinement. This framework allows us to define complexity classes game-theoretically, characterizing $\mathbf{P}$, $\mathbf{NP}$, and related classes as sets of problems admitting particular equilibria. The open question $\mathbf{P} \stackrel{?}{=} \mathbf{NP}$ becomes a problem about the equivalence of Nash equilibria under differing informational and temporal constraints.

cs.CC↗

Simultaneous Novelty from First-Appearance Times in the Calkin-Wilf Enumeration

We study the first-appearance map $π:\mathbb{N}_{\ge2}\to\mathbb{N}_0$ that assigns to each denominator $d$ the earliest breadth-first index at which a reduced fraction of denominator $d$ occurs in the Calkin-Wilf enumeration of $\mathbb{Q}_{>0}$. In parallel, we consider the elementary denominator-first array $D=\big(U(2)\mid U(3)\mid U(4)\mid\cdots\big)$ with rows $U(a)=(1/a,2/a,\dots,(a-1)/a)$ and row-starts $i_0(a)=\frac{(a-2)(a-1)}{2}$. We say level $a$ locks if $π(a)=i_0(a)$. Our main theorem is purely combinatorial: for every $n\ge2$ there exists $i\in\{0,\dots,n-2\}$ such that the first appearances of denominators $n-i$ and $n+i$ align symmetrically around $i_0(n)$, i.e.\ $π(n\pm i)=i_0(n)\pm i$. We prove this pairing (or simultaneous novelty) theorem via a local-coherence analysis of $π$ around a level and a discrete intermediate-value argument. An equivalent group-theoretic restatement uses the free monoid $\langle L,R\rangle\subset SL_2(\mathbb{Z})$ underlying the Calkin-Wilf and Stern-Brocot trees.

math.GM↗

Imbalance Prime Sieving: Every Prime Gap Is a Result of a Möbius Imbalance Obstruction

We introduce a novel sieve for prime numbers based on detecting topological obstructions in a Möbius-transformed rational metric space. Unlike traditional sieves which rely on divisibility, our method identifies primes as those numbers which contribute new, non-colliding imbalance conjugates. This provides both an exact algorithm for prime enumeration and a new geometric interpretation of prime gaps. This sieve constructs a topological obstruction theory over rational pairs (p, q), from which we observe that every prime gap is a consequence of a collision in this transformed imbalance space. Our empirical results demonstrate that this method precisely filters the prime numbers up to a specified bound, with potential implications for new number-theoretic models and sieving algorithms.

math.GM↗

On the Density of Prime Imbalances in the Unit Interval

We prove that the set of normalized differences between primes, defined as $S = \{(p-q)/(p+q) : p > q \text{ are primes}\}$, is dense in the open unit interval $(0,1)$. Our proof provides an explicit construction algorithm with quantitative bounds, relying on elementary results from prime number theory including Bertrand's postulate and explicit bounds on prime gaps in long intervals.

math.GM↗

Evolution-Bootstrapped Simulation: Artificial or Human Intelligence: Which Came First?

Humans have created artificial intelligence (AI), not the other way around. This statement is deceptively obvious. In this note, we decided to challenge this statement as a small, lighthearted Gedankenexperiment. We ask a simple question: in a world driven by evolution by natural selection, would neural networks or humans be likely to evolve first? We compare the Solomonoff--Kolmogorov--Chaitin complexity of the two and find neural networks (even LLMs) to be significantly simpler than humans. Further, we claim that it is unnecessary for any complex human-made equipment to exist for there to be neural networks. Neural networks may have evolved as naturally occurring objects before humans did as a form of chemical reaction-based or enzyme-based computation. Now that we know that neural networks can pass the Turing test and suspect that they may be capable of superintelligence, we ask whether the natural evolution of neural networks could lead from pure evolution by natural selection to what we call evolution-bootstrapped simulation. The evolution of neural networks does not involve irreducible complexity; would easily allow irreducible complexity to exist in the evolution-bootstrapped simulation; is a falsifiable scientific hypothesis; and is independent of / orthogonal to the issue of intelligent design.

cs.NE↗

Implementing portfolio risk management and hedging in practice

In academic literature portfolio risk management and hedging are often versed in the language of stochastic control and Hamilton--Jacobi--Bellman~(HJB) equations in continuous time. In practice the continuous-time framework of stochastic control may be undesirable for various business reasons. In this work we present a straightforward approach for thinking of cross-asset portfolio risk management and hedging, providing some implementation details, while rarely venturing outside the convex optimisation setting of (approximate) quadratic programming~(QP). We pay particular attention to the correspondence between the economic concepts and their mathematical representations; the abstractions enabling us to handle multiple asset classes and risk models at once; the dimensional analysis of the resulting equations; and the assumptions inherent in our derivations. We demonstrate how to solve the resulting QPs with CVXOPT.

q-fin.PM↗

Semi-static Conditions in Low-latency C++ for High Frequency Trading: Better than Branch Prediction Hints

Conditional branches pose a challenge for code optimisation, particularly in low latency settings. For better performance, processors leverage dedicated hardware to predict the outcome of a branch and execute the following instructions speculatively, a powerful optimisation. Modern branch predictors employ sophisticated algorithms and heuristics that utilise historical data and patterns to make predictions, and often, are extremely effective at doing so. Consequently, programmers may inadvertently underestimate the cost of misprediction when benchmarking code with synthetic data that is either too short or too predictable. While eliminating branches may not always be feasible, C++20 introduced the [[likely]] and [[unlikely]] attributes that enable the compiler to perform spot optimisations on assembly code associated with likely execution paths. Can we do better than this? This work presents the development of a novel language construct, referred to as a semi-static condition, which enables programmers to dynamically modify the direction of a branch at run-time by modifying the assembly code within the underlying executable. Subsequently, we explore scenarios where the use of semi-static conditions outperforms traditional conditional branching, highlighting their potential applications in real-time machine learning and high-frequency trading. Throughout the development process, key considerations of performance, portability, syntax, and security were taken into account.

cs.PF↗