top of page
Leather Craftsman
  • Writer's pictureScott Ellis

What is Prompt Engineering

Prompt engineering is a technique used in natural language processing (NLP) that involves designing and optimizing the prompts or queries given to a language model to generate specific responses or outputs.

In other words, prompt engineering involves crafting the initial input or question that is given to a language model in order to elicit the desired response. This can involve selecting specific keywords or phrases, providing context or constraints, and adjusting the structure or format of the prompt.

By carefully designing the prompts used to interact with language models, researchers and developers can improve the accuracy and effectiveness of their models for a variety of tasks, such as language translation, text summarization, and question-answering. Prompt engineering can also help mitigate bias and improve fairness in language models by guiding the model towards more equitable and representative responses.


tabby cat in ultraman suit fighting godzilla, powerful, slightly injured, in space, space background with clear planet earth and stars, realistic, high resolution, sun lighting from side-back, damages, rock with rough surfaces, effects

Here are some general steps to follow when designing prompts for language models:

  1. Define the task: Start by identifying the specific task you want the language model to perform, such as text classification, question answering, or language translation.

  2. Determine the input format: Decide what type of input format your language model requires. For example, it may require a complete sentence or paragraph, a set of keywords, or a specific structure.

  3. Select the training data: Gather training data that is relevant to the task at hand. This may involve creating a dataset from scratch or using existing datasets that are already labeled for the task you are trying to accomplish.

  4. Develop a prompt: Based on the task, input format, and training data, develop a prompt that will elicit the desired response from the language model. This may involve selecting specific keywords or phrases, providing context or constraints, and adjusting the structure or format of the prompt.

  5. Evaluate the prompt: Test the prompt with your language model to evaluate its effectiveness. This may involve measuring the accuracy or performance of the model on a specific task, or testing the model's ability to generate responses that are relevant and useful.

  6. Refine the prompt: Based on your evaluation, refine the prompt to improve its effectiveness. This may involve adjusting the wording, structure, or constraints of the prompt to better guide the language model towards the desired output.

  7. Repeat the process: Iterate on steps 4-6 until you have a prompt that produces the desired output for your specific task.

Overall, prompt engineering involves an iterative process of designing, testing, and refining prompts to optimize the performance of a language model on a specific task.

bottom of page