The Shape of a Program: Path Signatures for Trace-to-Program Induction
Abstract
Synthesizing programs from execution traces is a fundamental challenge in algorithmic interpretability and the reverse engineering of complex systems. We bring a rough-path-theoretic perspective to program induction, treating execution traces as high-dimensional rough paths and encoding them with the path signature transform, a tool from stochastic analysis whose expectation provably characterizes the distribution of traces a program induces. On three program-induction domains, Karel, List, and RASP, our log-signature trace encoder outperforms LSTM, Transformer, and Fourier baselines in almost every setting, with its largest margins when training data is scarce. We further observe that the trace-to-program pipeline is naturally contractive: it often produces valid programs that are shorter than the ground truth. We turn this into a bootstrapping procedure that exposes redundancy in the ground-truth supervision without any external oracle, which we demonstrate on redundancy-injected versions of our datasets. Finally, the log-signature encoder induces a markedly more interpretable latent geometry than the baselines, in which the nearest neighbors of every state lie on its own execution trace.
Create a lesson
Metadata
- Categories
- cs.LG, cs.AI
Related papers
Transformers with Signatures: Towards Universal In-Context Learning in Path Space
Shared title terminologycs.LGZiheng Cheng, Xin Guo, Ben Hambly
Task presentation and execution paths shape LLM mathematical performance
Shared title terminologycs.LGMin Huang, Mingyan Liu
SOTS: Signature-based Optimal Transport Selection
Shared title terminologycs.LGKhalid Akhmouch, Eric Jauer
Can Latent Reasoning Drive LLM Outputs Without a Trace?
Shared title terminologycs.LGTomer Ashuach, Zorik Gekhman, Avi Caciularu et al.
Policy Invariance Is Not Learning Invariance: Potential-Based Reward Shaping for Navigation with a Limited View
Shared title terminologycs.LGNodirjon Khabibullaev, Rajat Dandekar
IP-GNO: An Inductive Physics-Informed Graph Neural Operator for Automated Distribution System State Estimation
Shared title terminologycs.LGSakshi Kumar, Chhavi Jhari, Ajay Singh et al.