English

Synthesis and Verification of Transformer Programs (Technical Report)

Machine Learning 2026-05-19 v2 Formal Languages and Automata Theory Logic in Computer Science

Abstract

C-RASP is a simple programming language that was recently shown to capture concepts expressible by transformers. In this paper, we develop new algorithmic techniques for automatically verifying C-RASPs. To this end, we establish a connection to the verification of synchronous dataflow programs in Lustre, which enables us to exploit state-of-the-art model checkers utilizing highly optimized SMT-solvers. Our second contribution addresses learning a C-RASP program in the first place. To this end, we provide a new algorithm for learning a C-RASP from examples using local search. We demonstrate efficacy of our implementation for benchmarks of C-RASPs in the literature, in particular in connection to the following applications: (1) transformer program optimization, and (2) constrained learning of transformer programs (based on a partial specification).

Keywords

Cite

@article{arxiv.2602.16473,
  title  = {Synthesis and Verification of Transformer Programs (Technical Report)},
  author = {Hongjian Jiang and Matthew Hague and Philipp Rümmer and Anthony Widjaja Lin},
  journal= {arXiv preprint arXiv:2602.16473},
  year   = {2026}
}
R2 v1 2026-07-01T10:41:21.558Z