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

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.

Authors

Publication Details

Published
2024-11-26
DOI
https://doi.org/10.1109/fllm63129.2024.10852434
Citations
3
Primary Topic
Formal Methods in Verification
Type
article
Field-Weighted Citation Impact
1.08
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

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

Simon Pietro Romano, Gaetano Perrone
3 citations
Formal Methods in Verification
1.08
article

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

Simon Pietro Romano, Gaetano Perrone
article en
3 citations

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.

Openalex Percentile: Top 19%
Formal Methods in Verification
1.08
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.