Proceedings

Synthesis and Verification of Transformer Programs

Download BibTeX Cite

Proceedings of the Thirty-Fifth International Joint Conference on Artificial Intelligence. Main Track. Pages 3899-3907.

https://doi.org/10.24963/ijcai.2026/434

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).

  1. [Arenas et al., 2021] Marcelo Arenas, Daniel Báez, Pablo Barceló, Jorge Pérez, and Bernardo Subercaseaux. Foun- dations of symbolic languages for model interpretability. In Marc'Aurelio Ranzato, Alina Beygelzimer, Yann N. Dauphin, Percy Liang, and Jennifer Wortman Vaughan, editors, Advances in Neural Information Processing Sys- tems 34: Annual Conference on Neural Information Pro- cessing Systems 2021, NeurIPS 2021, December 6-14, 2021, virtual, pages 11690-11701, 2021.
  2. [Barceló et al., 2020] Pablo Barceló, Mikaël Monet, Jorge Pérez, and Bernardo Subercaseaux. Model interpretabil- ity through the lens of computational complexity. In Hugo Larochelle, Marc'Aurelio Ranzato, Raia Hadsell, Maria- Florina Balcan, and Hsuan-Tien Lin, editors, Advances in Neural Information Processing Systems 33: Annual Con- ference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020.
  3. [Barceló et al., 2024] Pablo Barceló, Alexander Kozachin- skiy, Anthony Widjaja Lin, and Vladimir V. Podolskii. Logical languages accepted by transformer encoders with hard attention. In The Twelfth International Conference on Learning Representations, ICLR 2024, Vienna, Austria, May 7-11, 2024. OpenReview.net, 2024.
  4. [Brix et al., 2024] Christopher Brix, Stanley Bak, Taylor T. Johnson, and Haoze Wu. The fifth international verifica- tion of neural networks competition (VNN-COMP 2024): Summary and results. CoRR, abs/2412.19985, 2024.
  5. [Caspi et al., 1987] P. Caspi, D. Pilaud, N. Halbwachs, and J. A. Plaice. LUSTRE: a declarative language for real-time programming. In Proceedings of the 14th ACM SIGACT- SIGPLAN Symposium on Principles of Programming Lan- guages, POPL '87, page 178-188, New York, NY, USA, 1987. Association for Computing Machinery.
  6. [Champion et al., 2016] Adrien Champion, Alain Mebsout, Christoph Sticksel, and Cesare Tinelli. The Kind2 model checker. In Swarat Chaudhuri and Azadeh Farzan, edi- tors, Computer Aided Verification, pages 510-517, Cham, 2016. Springer International Publishing.
  7. [Friedman et al., 2023] Dan Friedman, Alexander Wettig, and Danqi Chen. Learning transformer programs. In Proceedings of the 37th International Conference on Neu- ral Information Processing Systems, NIPS '23, Red Hook, NY, USA, 2023.
  8. Curran Associates Inc. ‡ Views and opinions expressed are however those of the au- thor(s) only and do not necessarily reflect those of the European Union or the European Research Council Executive Agency. Nei- ther the European Union nor the granting authority can be held re- sponsible for them. [Henderson et al., 2003]
  9. Darrall Henderson, Sheldon H. Ja- cobson, and Alan W. Johnson. The theory and practice of simulated annealing. In Fred Glover and Gary A. Kochen- berger, editors, Handbook of Metaheuristics, pages 287- 319. Springer US, Boston, MA, 2003.
  10. [Hong et al., 2025] Chih-Duo Hong, Hongjian Jiang, An- thony W. Lin, Oliver Markgraf, Julian Parsert, and Tony Tan. Extracting robust register automata from neural net- works over data sequences. CoRR, abs/2511.19100, 2025.
  11. [Hongjian et al., 2026] Jiang Hongjian, Matthew Hague, Philipp Rümmer, and Anthony Widjaja Lin. (artifact) syn- thesis and verification of transformer programs. Artifact on Zenodo, May 2026.
  12. [Huang et al., 2017] Xiaowei Huang, Marta Kwiatkowska, Sen Wang, and Min Wu. Safety verification of deep neu- ral networks. In Rupak Majumdar and Viktor Kuncak, editors, Computer Aided Verification -29th International Conference, CAV 2017, Heidelberg, Germany, July 24-28, 2017, Proceedings, Part I, volume 10426 of Lecture Notes in Computer Science, pages 3-29. Springer, 2017.
  13. [Huang et al., 2020] Xiaowei Huang, Daniel Kroening, Wenjie Ruan, James Sharp, Youcheng Sun, Emese Thamo, Min Wu, and Xinping Yi. A survey of safety and trust- worthiness of deep neural networks: Verification, testing, adversarial attack and defence, and interpretability. Com- puter Science Review, 37:100270, 2020.
  14. [Huang et al., 2025] Xinting Huang, Andy Yang, Satwik Bhattamishra, Yash Raj Sarrof, Andreas Krebs, Hattie Zhou, Preetum Nakkiran, and Michael Hahn. A for- mal framework for understanding length generalization in transformers. In The Thirteenth International Confer- ence on Learning Representations, ICLR 2025, Singapore, April 24-28, 2025. OpenReview.net, 2025.
  15. [Jiang et al., 2026a] Hongjian Jiang, Matthew Hague, Philipp Rümmer, and Anthony Widjaja Lin. Synthesis and verification of transformer programs (technical report), 2026.
  16. [Jiang et al., 2026b] Hongjian Jiang, Michael Hahn, Georg Zetzsche, and Anthony Widjaja Lin. Softmax transform- ers are turing-complete. In The Fourteenth International Conference on Learning Representations, 2026.
  17. [Jiang et al., 2026c] Hongjian Jiang, Michael Hahn, Georg Zetzsche, and Anthony Widjaja Lin. Softmax transform- ers are turing-complete. In The Fourteenth International Conference on Learning Representations, 2026.
  18. [Katz et al., 2022] Guy Katz, Clark W. Barrett, David L. Dill, Kyle Julian, and Mykel J. Kochenderfer. Reluplex: a calculus for reasoning about deep neural networks. For- mal Methods Syst. Des., 60(1):87-116, 2022.
  19. [Kirkpatrick et al., 1983] S. Kirkpatrick, C. D. Gelatt, and M. P. Vecchi. Optimization by simulated annealing. Sci- ence, 220(4598):671-680, 1983.
  20. [Krishnan et al., 2024] N. M. Anoop Krishnan, Hariprasad Kodamana, and Ravinder Bhattoo. Interpretable Machine Learning, pages 159-171. Springer International Publish- ing, Cham, 2024.
  21. [Li and Cotterell, 2025] Jiaoda Li and Ryan Cotterell. Char- acterizing the expressivity of fixed-precision transformer language models. In The Thirty-ninth Annual Conference on Neural Information Processing Systems, 2025.
  22. [Liu et al., 2021] Changliu Liu, Tomer Arnon, Christopher Lazarus, Christopher A. Strong, Clark W. Barrett, and Mykel J. Kochenderfer. Algorithms for verifying deep neural networks. Found. Trends Optim., 4(3-4):244-404, 2021.
  23. [Liu et al., 2023] Bingbin Liu, Jordan T. Ash, Surbhi Goel, Akshay Krishnamurthy, and Cyril Zhang. Exposing atten- tion glitches with flip-flop language modeling. In Thirty- seventh Conference on Neural Information Processing Systems, 2023.
  24. [Marques-Silva and Ignatiev, 2023] Joao Marques-Silva and Alexey Ignatiev. No silver bullet: interpretable ml models must be explained. Frontiers in Artificial Intelligence, 6, 2023.
  25. [Merrill and Sabharwal, 2024] William Merrill and Ashish Sabharwal. The expressive power of transformers with chain of thought. In The Twelfth International Conference on Learning Representations, ICLR 2024, Vienna, Austria, May 7-11, 2024. OpenReview.net, 2024.
  26. [Okudono et al., 2020] Takamasa Okudono, Masaki Waga, Taro Sekiyama, and Ichiro Hasuo. Weighted automata ex- traction from recurrent neural networks via regression on state spaces. In The Thirty-Fourth AAAI Conference on Ar- tificial Intelligence, AAAI 2020, The Thirty-Second Inno- vative Applications of Artificial Intelligence Conference, IAAI 2020, The Tenth AAAI Symposium on Educational Advances in Artificial Intelligence, EAAI 2020, New York, NY, USA, February 7-12, 2020, pages 5306-5314. AAAI Press, 2020.
  27. [Pérez et al., 2021] Jorge Pérez, Pablo Barceló, and Javier Marinkovic. Attention is turing-complete. J. Mach. Learn. Res., 22:75:1-75:35, 2021.
  28. [Sälzer et al., 2025] Marco Sälzer, Eric Alsmann, and Mar- tin Lange. Transformer encoder satisfiability: Complexity and impact on formal reasoning. In The Thirteenth Inter- national Conference on Learning Representations, ICLR 2025, Singapore, April 24-28, 2025. OpenReview.net, 2025.
  29. [Sälzer et al., 2026] Marco Sälzer, Chris Köcher, Alexan- der Kozachinskiy, Georg Zetzsche, and Anthony Widjaja Lin. The counting power of transformers. In The Four- teenth International Conference on Learning Representa- tions, 2026.
  30. [Strobl et al., 2024] Lena Strobl, William Merrill, Gail Weiss, David Chiang, and Dana Angluin. What formal languages can transformers express? A survey. Trans. As- soc. Comput. Linguistics, 12:543-561, 2024.
  31. [Vaswani et al., 2017] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Isabelle Guyon, Ulrike von Luxburg, Samy Bengio, Hanna M. Wallach, Rob Fergus, S. V. N. Vish- wanathan, and Roman Garnett, editors, Advances in Neu- ral Information Processing Systems 30: Annual Confer- ence on Neural Information Processing Systems 2017, De- cember 4-9, 2017, Long Beach, CA, USA, pages 5998- 6008, 2017.
  32. [Weiss et al., 2021] Gail Weiss, Yoav Goldberg, and Eran Yahav. Thinking like transformers. In International Conference on Machine Learning, pages 11080-11090.
  33. PMLR, 2021.
  34. [Weiss et al., 2024] Gail Weiss, Yoav Goldberg, and Eran Yahav. Extracting automata from recurrent neural net- works using queries and counterexamples (extended ver- sion). Mach. Learn., 113(5):2877-2919, 2024.
  35. [Yang and Chiang, 2024] Andy Yang and David Chiang. Counting like transformers: Compiling temporal counting logic into softmax transformers. In First Conference on Language Modeling, 2024.
  36. [Yang et al., 2024] Andy Yang, David Chiang, and Dana An- gluin. Masked hard-attention transformers recognize ex- actly the star-free languages. In Amir Globersons, Lester Mackey, Danielle Belgrave, Angela Fan, Ulrich Paquet, Jakub M. Tomczak, and Cheng Zhang, editors, Advances in Neural Information Processing Systems 38: Annual Conference on Neural Information Processing Systems 2024, NeurIPS 2024, Vancouver, BC, Canada, December 10 -15, 2024, 2024.
  37. [Yang et al., 2025] Andy Yang, Michaël Cadilhac, and David Chiang. Knee-deep in c-RASP: A transformer depth hierarchy. In The Thirty-ninth Annual Conference on Neu- ral Information Processing Systems, 2025.
  38. [Yang et al., 2026] Andy Yang, Pascal Bergsträßer, Georg Zetzsche, David Chiang, and Anthony W. Lin. Length generalization bounds for transformers. In Forty-third In- ternational Conference on Machine Learning, 2026.
  39. [Zhou et al., 2024] Hattie Zhou, Arwen Bradley, Etai Lit- twin, Noam Razin, Omid Saremi, Joshua M. Susskind, Samy Bengio, and Preetum Nakkiran. What algorithms can transformers learn? A study in length generalization. In The Twelfth International Conference on Learning Rep- resentations, ICLR 2024, Vienna, Austria, May 7-11, 2024. OpenReview.net, 2024.

References were extracted automatically from the PDF and may contain errors.

Welcome Future Conferences AI Journal Division IJCAI Proceedings About IJCAI IJCAI Awards