The Prompt Engineering Process

Published on December 2, 2024

By ML Brei

I would like to propose that prompt engineering is distinct from prompt crafting. Let’s discuss how and why the two differ.

I consider prompt crafting to be one of those spontaneous, on-the-fly creations consisting of a direct instruction or query to an LLM for immediate results. An example of prompt crafting is: “Please give me an executive summary of the following text”. This prompt would likely yield a usable summary of some indeterminate length that may or may not include bullet-points. In prompt crafting, you expect useful results, however, they may not be reliable or repeatable or exactly what you want.

Prompt engineering, on the other hand, is a process that effectively “programs” LLMs to produce content that aims to be both repeatable and reliable while fulfilling a specific function. As a process, it is both iterative and results-focused. Let’s look closer at what this process entails.

An Iterative Process

Firstly, we must understand that prompt engineering is not a linear process with a defined start and finish, but rather a continuous cycle of improvement. The goal is to refine the instructions given to an LLM to achieve a desired outcome. This refinement requires continuous adjustments based on the LLM's output, feedback from experts, and analysis of performance metrics.

Secondly, we can identify six main steps in the process:

What the Process Looks Like

Diagram of Prompt Engineering Process

This diagram is a simplified representation as the process typically involves a dynamic interplay between different stages.

For instance, evaluating the LLM output might highlight the need to revisit the problem definition or the data analysis stage. Similarly, expert feedback could prompt changes in both prompt design and technique selection.

This continuous feedback loop and the iterative nature of refinement are crucial aspects of prompt engineering, enabling the development of increasingly effective prompts that harness the full potential of LLMs.

Prompt crafting—everyone is doing this. Prompt engineering—this takes expertise.