Transformers with Signatures: Towards Universal In-Context Learning in Path Space
Abstract
In-context learning (ICL) enables transformers to adapt to new tasks from demonstrations without updating their parameters. However, theoretical guarantees for transformers remain limited in general, and elusive in particular when target responses depend nonlinearly on the evolution of observed paths. We establish an ICL framework for path space, using path signature features. Building on the universal linear approximation property of signatures, we construct explicitly a causal softmax transformer with two attention heads per layer that emulates in-context Lasso. Under sparse signature approximation and suitable moment and concentration conditions, we establish finite-sample prediction error bounds. Our analysis goes beyond the IID data setting in the existing ICL theory, allowing dependence among demonstrations and the query. Experiments on in-context sparse recovery, nonlinear path regression, execution-cost prediction, and financial payoff inference demonstrate robustness to changes in observation grids and adaptation to unseen market environments. Across these prediction tasks, transformers with signatures match or outperform vanilla transformer baselines with substantially fewer trainable parameters, highlighting the effectiveness and efficiency of signature-based ICL.
Create a lesson
Metadata
- Categories
- cs.LG, math.OC, stat.ML
Related papers
Toward a Theoretical Understanding of Transformer Attention: Bayesian Estimation and Predictive Sufficiency
Shared title terminologycs.LGFouad B. Chedid
Tokenization and Architecture Jointly Allocate Component Roles in Time Series Transformers
Shared title terminologycs.LGMingyu Kim, Doguk Kim
Boundary Representation-Driven Graph Transformer Modeling for Machining Operation Sequencing
Shared title terminologycs.LGFatemeh Elhambakhsh, Gaurav Ameta, Aditi Roy et al.
SOTS: Signature-based Optimal Transport Selection
Shared title terminologycs.LGKhalid Akhmouch, Eric Jauer
CHORD: Learning Latent Spaces for Constrained Stellarator Design
Shared title terminologycs.LGSantiago A. Cadena, Andrea Merlo
SwiftLoop: Selective Refinement for Adaptive Implicit Reasoning in Looped Transformers
Shared title terminologycs.LGTianyi Zhao, Ke Wan, Chen Chen