In this chapter, we consider language model prompts and prompt engineering. Prompts are written in natural language, for example, English, and the only interface between the practitioner and the language model. A prompt is a bespoke, iterative piece of text that is tailored to the data and language model. The practice of prompt engineering, now a household term, is often viewed as an art rather than science where practitioners rely on tricks and nuances in the prompts to optimize the performance of the returned text. We treat prompt engineering as an iterative practice and aim to present general, practical tools for prompt engineering that are agnostic of the LLM selected. In this chapter, we will focus on the construction of prompts and cover the management and iteration of prompts in Chapter 4 . We will predominantly use prompts optimized for OpenAI's GPT models and cover specific model nuances in the section “Prompt Techniques with Different LLMs.”

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Prompt Engineering Techniques

  • Pramod Singh,
  • James McKeone

摘要

In this chapter, we consider language model prompts and prompt engineering. Prompts are written in natural language, for example, English, and the only interface between the practitioner and the language model. A prompt is a bespoke, iterative piece of text that is tailored to the data and language model. The practice of prompt engineering, now a household term, is often viewed as an art rather than science where practitioners rely on tricks and nuances in the prompts to optimize the performance of the returned text. We treat prompt engineering as an iterative practice and aim to present general, practical tools for prompt engineering that are agnostic of the LLM selected. In this chapter, we will focus on the construction of prompts and cover the management and iteration of prompts in Chapter 4 . We will predominantly use prompts optimized for OpenAI's GPT models and cover specific model nuances in the section “Prompt Techniques with Different LLMs.”