paper-with-me

Papers

AI Coders Are Among Us: Rethinking Programming Language Grammar Towards Efficient Code Generation

2024-04-25 · Zhensu Sun, Xiaoning Du, Zhou Yang, Li Li, David Lo

Artificial Intelligence (AI) models have emerged as another important audience for programming languages alongside humans and machines, as we enter the era of large language models (LLMs). LLMs can now perform well in coding competitions and even write programs like developers to solve various tasks, including mathematical problems. However, the grammar and layout of current programs are designed to cater the needs of human developers -- with many grammar tokens and formatting tokens being used to make the code easier for humans to read. While this is helpful, such a design adds unnecessary computational work for LLMs, as each token they either use or produce consumes computational resources. To improve inference efficiency and reduce computational costs, we propose the concept of AI-oriented grammar. This aims to represent code in a way that better suits the working mechanism of AI models. Code written with AI-oriented grammar discards formats and uses a minimum number of tokens to convey code semantics effectively. To demonstrate the feasibility of this concept, we explore and implement the first AI-oriented grammar for Python, named SimPy. SimPy is crafted by revising the original Python grammar through a series of heuristic rules. Programs written in SimPy maintain identical AST structures to those in standard Python. This allows for not only execution via a modified AST parser, but also seamless transformation between programs written in Python and SimPy, enabling human developers and LLMs to use Python and SimPy, respectively, when they need to collaborate. In the experiments, compared with Python, SimPy enables a reduction in token usage by 13.5% and 10.4% for CodeLlama and GPT-4, respectively, when completing the same set of code-related tasks. Additionally, these models can maintain or even improve their performance when using SimPy instead of Python for these tasks.

📄 PDF Abstract BibTeX arXiv:2404.16333

Code (1)

v587su/simpy 공식 구현

Tasks

Code GenerationMath

Methods 이 논문이 사용한 방법론

Attention 설명 없음
SET Dynamic Sparse Training method where weight mask is updated randomly periodically
Dropout Dropout is a regularization technique for neural networks that drops a unit (along with connections) at training time with a specified probability $p$ (a common value is…
Residual Connection 설명 없음
Softmax The Softmax output function transforms a previous layer's output into a vector of probabilities. It is commonly used for multiclass classification. Given an input vector $x$…
Position-Wise Feed-Forward Layer 설명 없음
BPE Byte Pair Encoding, or BPE, is a subword segmentation algorithm that encodes rare and unknown words as sequences of subword units. The intuition is that various word…
Absolute Position Encodings Absolute Position Encodings are a type of position embeddings for [Transformer-based models] where positional encodings are…

Similar Papers 제목 키워드 기반

Program Language Translation Using a Grammar-Driven Tree-to-Tree Model

2018-07-04 · Mehdi Drissi, Olivia Watkins, Aditya Khant, Vivaswat Ojha 외

The task of translating between programming languages differs from the challenge of translating natural languages in that programming languages are designed with a far more rigid set of structural and grammatical rules. …

DecoderTranslation

An implementation of a Latvian resource grammar in Grammatical Framework

2012-05-01 · LREC 2012 5 · P{\=e}teris Paikens, Normunds Gr{\=u}z{\=\i}tis

This paper describes an open-source Latvian resource grammar implemented in Grammatical Framework (GF), a programming language for multilingual grammar applications. GF differentiates between concrete grammars and abstra…

Machine TranslationSemantic ParsingText GenerationTranslation

Towards Computational Resource Grammars for Runyankore and Rukiga

2020-05-01 · LREC 2020 5 · David Bamutura, Peter Ljungl{\"o}f, Peter Nebende

In this paper, we present computational resource grammars of Runyankore and Rukiga (R{\&}R) languages. Runyankore and Rukiga are two under-resourced Bantu Languages spoken by about 6 million people indigenous to South- W…

Descriptive

Doc2Spec: Synthesizing Formal Programming Specifications from Natural Language via Grammar Induction

2026-01-30 · Shihao Xia, Mengting He, Haomin Jia, Linhai Song arxiv

Ensuring that API implementations and usage comply with natural language programming rules is critical for software correctness, security, and reliability. Formal verification can provide strong guarantees but requires p…

Ezhil: A Tamil Programming Language

2009-07-28 · Muthiah Annamalai

Ezhil is a Tamil language based interpreted procedural programming language. Tamil keywords and grammar are chosen to make the native Tamil speaker write programs in the Ezhil system. Ezhil allows easy representation of …