Table of Contents
Fetching ...

pathsig: A GPU-Accelerated Library for Truncated and Projected Path Signatures

Tobias Nygaard

TL;DR

pathig, a PyTorch-native library that computes path signatures directly in the word basis by using CUDA kernels to update signature coefficients in parallel over prefix-closed word sets, achieves high GPU throughput and near-minimal peak memory.

Abstract

Path signatures provide a rich representation of sequential data, with strong theoretical guarantees and good performance in a variety of machine-learning tasks. While signatures have progressed from fixed feature extractors to trainable components of machine-learning models, existing libraries often lack the required scalability for large-scale, gradient-based learning. To address this gap, this paper introduces pathsig, a PyTorch-native library that computes path signatures directly in the word basis. By using CUDA kernels to update signature coefficients in parallel over prefix-closed word sets, pathsig achieves high GPU throughput and near-minimal peak memory. Compared with other libraries, pathsig achieves 10-30x speedups for computation of truncated signatures and up to 4-10x speedups in training that require backpropagation through the signature. Beyond regular truncation, pathsig supports projections of the (infinite-dimensional) signature onto user-specified sets of words and anisotropic truncation motivated by inhomogeneous path regularity, enabling more compact representations that can reduce dimensionality, redundancy, and computational cost.

pathsig: A GPU-Accelerated Library for Truncated and Projected Path Signatures

TL;DR

pathig, a PyTorch-native library that computes path signatures directly in the word basis by using CUDA kernels to update signature coefficients in parallel over prefix-closed word sets, achieves high GPU throughput and near-minimal peak memory.

Abstract

Path signatures provide a rich representation of sequential data, with strong theoretical guarantees and good performance in a variety of machine-learning tasks. While signatures have progressed from fixed feature extractors to trainable components of machine-learning models, existing libraries often lack the required scalability for large-scale, gradient-based learning. To address this gap, this paper introduces pathsig, a PyTorch-native library that computes path signatures directly in the word basis. By using CUDA kernels to update signature coefficients in parallel over prefix-closed word sets, pathsig achieves high GPU throughput and near-minimal peak memory. Compared with other libraries, pathsig achieves 10-30x speedups for computation of truncated signatures and up to 4-10x speedups in training that require backpropagation through the signature. Beyond regular truncation, pathsig supports projections of the (infinite-dimensional) signature onto user-specified sets of words and anisotropic truncation motivated by inhomogeneous path regularity, enabling more compact representations that can reduce dimensionality, redundancy, and computational cost.
Paper Structure (25 sections, 10 theorems, 61 equations, 4 figures, 3 tables, 1 algorithm)

This paper contains 25 sections, 10 theorems, 61 equations, 4 figures, 3 tables, 1 algorithm.

Key Result

Proposition 3.1

Let $0=t_0<\cdots<t_M=T$, and assume that $X:[0,T] \to \mathbb{R}^d$ is affine on each subinterval $\left[t_{j-1}, t_j\right]$. Then for every $j=1, \ldots, M$, where $\exp(a):=\sum_{n=0}^\infty \frac{a^{\otimes n}}{n!}$ denotes the tensor exponential.

Figures (4)

  • Figure 1: Speedup of pathsig relative to keras_sig and pySigLib, averaged over 27 signature configurations for each combination of batch size and sequence length.
  • Figure 2: Speedup of pathsig relative to pySigLib, averaged over 27 log-signature configurations for each combination of batch size and sequence length.
  • Figure 3: Average training time (left) and corresponding speedup (right) for windowed signature computation.
  • Figure 4: Validation MSE versus epoch (mean over 5 independent runs) for Hurst parameter estimation on $5$-dimensional fBM with independent components. We train on $8{,}000$ simulated paths of length $250$ with $H \sim U(0.25,0.75)$ sampled independently per path, and evaluate on $2{,}000$ held-out paths. We compare an FNN (Feedforward Neural Network) baseline to the Deep Signature Model using either a truncated lead--lag signature or the proposed sparse lead--lag word projection.

Theorems & Definitions (32)

  • Definition 2.1: Tensor algebra
  • Definition 2.2: Completed tensor algebra
  • Definition 2.3: Path signature
  • Definition 2.4
  • Definition 2.5: Concatenation
  • Proposition 3.1
  • proof
  • Theorem 3.2: Chen's relation friz2010multidimensional
  • Definition 3.3: Prefix-closed
  • Definition 3.4
  • ...and 22 more