Transformers with Signatures: Towards Universal In-Context Learning in Path Space

Ziheng Cheng, Xin Guo, Ben Hambly
11/23/2026
cs.LGmath.OCstat.ML
transformer-attention

No confident code implementation found for this paper.

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{cheng2026transformers,
  title  = {Transformers with Signatures: Towards Universal In-Context Learning in Path Space},
  author = {Ziheng Cheng and Xin Guo and Ben Hambly},
  year   = {2026},
  eprint = {2611.31439},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2611.31439v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2611.31439.svg)](https://codeofpaper.com/paper/2611.31439)

Discussion