paper-with-me

Papers

Automatic Generation of Python Programs Using Context-Free Grammars

2024-03-11 · Kamel Yamani, Marwa Naïr, Riyadh Baghdadi

In recent years, data has emerged as the new gold, serving as a powerful tool for creating intelligent systems. However, procuring high-quality data remains challenging, especially for code. To address this, we developed TinyPy Generator, a tool that generates random Python programs using a context-free grammar. The generated programs are guaranteed to be correct by construction. Our system uses custom production rules (in the Backus-Naur Form (BNF) format) to recursively generate code. This allows us to generate code with different levels of complexity, ranging from code containing only assignments to more complex code containing conditionals and loops. Our proposed tool enables effortless large-scale Python code generation, beneficial for a wide range of applications. TinyPy Generator is particularly useful in the field of machine learning, where it can generate substantial amounts of Python code for training Python language models. Additionally, researchers who are studying programming languages can utilize this tool to create datasets for their experiments, which can help validate the robustness of code interpreters or compilers. Unlike existing research, we have open-sourced our implementation. This allows customization according to user needs and extends potential usage to other languages.

📄 PDF Abstract BibTeX arXiv:2403.06503

Code (1)

marwanair/tinypy-generator 공식 구현

Tasks

Code Generation

Similar Papers 제목 키워드 기반

De-fine: Decomposing and Refining Visual Programs with Auto-Feedback

2023-11-21 · Minghe Gao, Juncheng Li, Hao Fei, Liang Pang 외

Visual programming, a modular and generalizable paradigm, integrates different modules and Python operators to solve various vision-language tasks. Unlike end-to-end models that need task-specific data, it advances in pe…

Logical Reasoning

SpecPylot: Python Specification Generation using Large Language Models

2026-04-17 · Ragib Shahariar Ayon, Shibbir Ahmed arxiv

Automatically generating formal specifications could reduce the effort needed to improve program correctness, but in practice, this is still challenging. Many developers avoid writing contracts by hand, which limits the …

Learning Transformer Programs

2023-06-01 · NeurIPS 2023 11 · Dan Friedman, Alexander Wettig, Danqi Chen

Recent research in mechanistic interpretability has attempted to reverse-engineer Transformer models by carefully inspecting network weights and activations. However, these approaches require considerable manual effort a…

In-Context LearningInterpretable Machine Learningnamed-entity-recognitionNamed Entity Recognition+2

Synthesizing Programmatic Reinforcement Learning Policies with Large Language Model Guided Search

2024-05-26 · Max Liu, Chan-Hung Yu, Wei-Hsu Lee, Cheng-Wei Hung 외

Programmatic reinforcement learning (PRL) has been explored for representing policies through programs as a means to achieve interpretability and generalization. Despite promising outcomes, current state-of-the-art PRL m…

Common Sense ReasoningLanguage ModelingLanguage ModellingLarge Language Model

Automatic Assessment of the Design Quality of Python Programs with Personalized Feedback

2021-06-02 · J. Walker Orr, Nathaniel Russell

The assessment of program functionality can generally be accomplished with straight-forward unit tests. However, assessing the design quality of a program is a much more difficult and nuanced problem. Design quality is a…