Prompt Patterns

Understanding prompt patterns and CTS

Establishing a pattern for prompts when using language models is a prerequisite to efficiently using the knowledge areas whenbuilding an application. Understanding this pattern allows you to clearly define your request and ultimately control the output received from a LLM.

Do not put too much of a focus on the syntax of a prompt, the key takeaway here is to expand how we think of prompts.

Let’s look at a prompt we may use during the ideation process:

how many Americans own bikes?

Looking at the prompt, it follows the command-target-specifier (CTS) pattern.

COMMANDTARGETSPECIFIER

HOW MANY

AMERICANS

OWN BIKES

What is the CTS Pattern?

COMMANDTARGETSPECIFIER

What is to be done or gathered

Who or what is the command to be applied

How or what target information should be returned

This pattern is not unique to the ideation knowledge area and can be applied universally. However, different domains will have different commands, targets, and specifiers. Industries will have their own commands, targets, and specifiers as well.

A command and target will always be required for a valuable response where specifiers are optional, but allow you to provide more specific context to your request to get a desired response.

Let’s look at a prompt from the Generation knowledge area:

create a navigation bar in react using chakra ui

COMMANDTARGETSPECIFIER

CREATE

NAVIGATION BAR

IN REACT USING CHAKRA UI

We can see how the pattern can be leveraged across domains and their processes.

The above examples are simple prompts. In the next sections, we will dive deeper into prompt context and prompt chaining to get even more out of your prompts.

Last updated