Prompt engineering is an emerging skill associated with improving the way we interact with Large Language Models (LLMs). However, natural language lacks key features such as modularity, reusability, and portability, which are essential for creating efficient, scalable prompt systems. In programming, these features are managed through Infrastructure as Code (IaC), where developers use modular code to manage infrastructure. This work aims to show how it is possible to achieve the same objective in the prompt engineering sector, too. Prompt Engineering as Code (PEaC) is a novel approach that organizes prompts through a human-readable data serialization language, in order to realize modular, reusable, and portable prompts. We design a syntax language in which prompts can be assembled as modular components, akin to importing functions or defining reusable variables in conventional programming languages. We assess the methodology by showcasing its implementation to multiple LLM-driven applications and evaluating enhancements in prompt management and adaptability. Preliminary findings suggest that PEaC increases prompt reusability, reduces redundancy, and promotes the adaptability of prompt systems across many applications. This method represents progress in the establishment of standardized and scalable engineered prompts.

Prompt Engineering as Code (PEaC): an approach for building modular, reusable, and portable prompts / Perrone, G.; Romano, S. P.. - (2024), pp. 289-294. ( 2nd International Conference on Foundation and Large Language Models, FLLM 2024 are 2024) [10.1109/FLLM63129.2024.10852434].

Prompt Engineering as Code (PEaC): an approach for building modular, reusable, and portable prompts

Perrone G.;Romano S. P.
2024

Abstract

Prompt engineering is an emerging skill associated with improving the way we interact with Large Language Models (LLMs). However, natural language lacks key features such as modularity, reusability, and portability, which are essential for creating efficient, scalable prompt systems. In programming, these features are managed through Infrastructure as Code (IaC), where developers use modular code to manage infrastructure. This work aims to show how it is possible to achieve the same objective in the prompt engineering sector, too. Prompt Engineering as Code (PEaC) is a novel approach that organizes prompts through a human-readable data serialization language, in order to realize modular, reusable, and portable prompts. We design a syntax language in which prompts can be assembled as modular components, akin to importing functions or defining reusable variables in conventional programming languages. We assess the methodology by showcasing its implementation to multiple LLM-driven applications and evaluating enhancements in prompt management and adaptability. Preliminary findings suggest that PEaC increases prompt reusability, reduces redundancy, and promotes the adaptability of prompt systems across many applications. This method represents progress in the establishment of standardized and scalable engineered prompts.
2024
Prompt Engineering as Code (PEaC): an approach for building modular, reusable, and portable prompts / Perrone, G.; Romano, S. P.. - (2024), pp. 289-294. ( 2nd International Conference on Foundation and Large Language Models, FLLM 2024 are 2024) [10.1109/FLLM63129.2024.10852434].
File in questo prodotto:
File Dimensione Formato  
Prompt_Engineering_as_Code_PEaC_an_approach_for_building_modular_reusable_and_portable_prompts.pdf

solo utenti autorizzati

Licenza: Copyright dell'editore
Dimensione 1.11 MB
Formato Adobe PDF
1.11 MB Adobe PDF   Visualizza/Apri   Richiedi una copia

I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/11588/1050002
Citazioni
  • ???jsp.display-item.citation.pmc??? ND
  • Scopus ND
  • ???jsp.display-item.citation.isi??? ND
social impact