Synthesizing programs from their step-by-step execution traces is important for reverse-engineering software and understanding AI agents. Standard sequence models struggle to capture the information in these traces, especially when training data is limited.
This work treats execution traces as paths and encodes them using a tool from stochastic analysis called the path signature transform. The signature compactly represents the trace's shape regardless of its length.
The log-signature encoder outperformed standard models in almost every test, with the largest gains when data was scarce. It also produced shorter valid programs than the ground truth and revealed a clear structure where each trace's states form a separate chain. This makes program induction more data-efficient and interpretable.
