paper-with-me

Papers

Transformers are Efficient Compilers, Provably

2024-10-07 · Xiyu Zhai, Runlong Zhou, Liao Zhang, Simon Shaolei Du

Transformer-based large language models (LLMs) have demonstrated surprisingly robust performance across a wide range of language-related tasks, including programming language understanding and generation. In this paper, we take the first steps towards a formal investigation of using transformers as compilers from an expressive power perspective. To this end, we introduce a representative programming language, Mini-Husky, which encapsulates key features of modern C-like languages. We show that if the input code sequence has a bounded depth in both the Abstract Syntax Tree (AST) and type inference (reasonable assumptions based on the clean code principle), then the number of parameters required by transformers depends only on the logarithm of the input sequence length to handle compilation tasks, such as AST construction, symbol resolution, and type analysis. A significant technical challenge stems from the fact that transformers operate at a low level, where each layer processes the input sequence as raw vectors without explicitly associating them with predefined structure or meaning. In contrast, high-level compiler tasks necessitate managing intricate relationships and structured program information. Our primary technical contribution is the development of a domain-specific language, Cybertron, which generates formal proofs of the transformer's expressive power, scaling to address compiler tasks. We further establish that recurrent neural networks (RNNs) require at least a linear number of parameters relative to the input sequence, leading to an exponential separation between transformers and RNNs. Finally, we empirically validate our theoretical results by comparing transformers and RNNs on compiler tasks within Mini-Husky.

📄 PDF Abstract BibTeX arXiv:2410.14706

Code (0)

등록된 구현이 없습니다.

Similar Papers 제목 키워드 기반

Learning to Parallelize in a Shared-Memory Environment with Transformers

2022-04-27 · Re'em Harel, Yuval Pinter, Gal Oren

In past years, the world has switched to many-core and multi-core shared memory architectures. As a result, there is a growing need to utilize these architectures by introducing shared memory parallelization schemes to s…

Management

The Deep Learning Compiler: A Comprehensive Survey

2020-02-06 · Mingzhen Li, Yi Liu, Xiaoyan Liu, Qingxiao Sun 외

The difficulty of deploying various deep learning (DL) models on diverse DL hardware has boosted the research and development of DL compilers in the community. Several DL compilers have been proposed from both industry a…

Deep LearningSurvey

Transformers Provably Learn Sparse Token Selection While Fully-Connected Nets Cannot

2024-06-11 · Zixuan Wang, Stanley Wei, Daniel Hsu, Jason D. Lee

The transformer architecture has prevailed in various deep learning settings due to its exceptional capabilities to select and compose structural information. Motivated by these capabilities, Sanford et al. proposed the …

Finding Missed Code Size Optimizations in Compilers using LLMs

2024-12-31 · Davide Italiano, Chris Cummins

Compilers are complex, and significant effort has been expended on testing them. Techniques such as random program generation and differential testing have proved highly effective and have uncovered thousands of bugs in …

Understanding the Parameter Space Geometry of Transformers Encoding Boolean Functions

2026-06-07 · Blanka Köver, Alexandra Butoi, Anej Svete, Michael Hahn 외 arxiv

Transformers consistently fail to learn certain simple functions that are provably expressible with specific parameter settings. This gap between learnability and expressivity is particularly prominent for sensitive func…