Synthetic Programming Elicitation for Text-to-Code in Very Low-Resource Programming and Formal Languages

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Mora, Federico, Wong, Justin, Lepe, Haley, Bhatia, Sahil, Elmaaroufi, Karim, Varghese, George, Gonzalez, Joseph E., Polgreen, Elizabeth, Seshia, Sanjit A.
Formato: Preprint
Publicado: 2024
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866910679183654912
author Mora, Federico
Wong, Justin
Lepe, Haley
Bhatia, Sahil
Elmaaroufi, Karim
Varghese, George
Gonzalez, Joseph E.
Polgreen, Elizabeth
Seshia, Sanjit A.
author_facet Mora, Federico
Wong, Justin
Lepe, Haley
Bhatia, Sahil
Elmaaroufi, Karim
Varghese, George
Gonzalez, Joseph E.
Polgreen, Elizabeth
Seshia, Sanjit A.
contents Recent advances in large language models (LLMs) for code applications have demonstrated remarkable zero-shot fluency and instruction following on challenging code related tasks ranging from test case generation to self-repair. Unsurprisingly, however, models struggle to compose syntactically valid programs in programming languages unrepresented in pre-training, referred to as very low-resource Programming Languages (VLPLs). VLPLs appear in crucial settings, including domain-specific languages for internal tools, tool-chains for legacy languages, and formal verification frameworks. Inspired by a technique called natural programming elicitation, we propose designing an intermediate language that LLMs "naturally" know how to use and which can be automatically compiled to a target VLPL. When LLMs generate code that lies outside of this intermediate language, we use compiler techniques to repair the code into programs in the intermediate language. Overall, we introduce \emph{synthetic programming elicitation and compilation} (SPEAC), an approach that enables LLMs to generate syntactically valid code even for VLPLs. We empirically evaluate the performance of SPEAC in a case study for the UCLID5 formal verification language and find that, compared to existing retrieval and fine-tuning baselines, SPEAC produces syntactically correct programs more frequently and without sacrificing semantic correctness.
format Preprint
id arxiv_https___arxiv_org_abs_2406_03636
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Synthetic Programming Elicitation for Text-to-Code in Very Low-Resource Programming and Formal Languages
Mora, Federico
Wong, Justin
Lepe, Haley
Bhatia, Sahil
Elmaaroufi, Karim
Varghese, George
Gonzalez, Joseph E.
Polgreen, Elizabeth
Seshia, Sanjit A.
Programming Languages
Machine Learning
Recent advances in large language models (LLMs) for code applications have demonstrated remarkable zero-shot fluency and instruction following on challenging code related tasks ranging from test case generation to self-repair. Unsurprisingly, however, models struggle to compose syntactically valid programs in programming languages unrepresented in pre-training, referred to as very low-resource Programming Languages (VLPLs). VLPLs appear in crucial settings, including domain-specific languages for internal tools, tool-chains for legacy languages, and formal verification frameworks. Inspired by a technique called natural programming elicitation, we propose designing an intermediate language that LLMs "naturally" know how to use and which can be automatically compiled to a target VLPL. When LLMs generate code that lies outside of this intermediate language, we use compiler techniques to repair the code into programs in the intermediate language. Overall, we introduce \emph{synthetic programming elicitation and compilation} (SPEAC), an approach that enables LLMs to generate syntactically valid code even for VLPLs. We empirically evaluate the performance of SPEAC in a case study for the UCLID5 formal verification language and find that, compared to existing retrieval and fine-tuning baselines, SPEAC produces syntactically correct programs more frequently and without sacrificing semantic correctness.
title Synthetic Programming Elicitation for Text-to-Code in Very Low-Resource Programming and Formal Languages
topic Programming Languages
Machine Learning
url https://arxiv.org/abs/2406.03636