Prompting

Prompt

When a prompt is submitted, it is tokenized with positional encoding.

The model aims to predict the next output token until completion.

Model gives a probability score to each token (likelihood of being the next word in the sequence).

This method of predicting the following word is called "greedy search".

Greedy search alone is not sufficient to generate a full phrase that is relevant.

  • One mitigation is to use "beam search".
    • Rather than looking for next word in sequence, it looks at the probability of a larger set of tokens as a unit.
  • This leads to a more coherent, human-like output text.

System Prompt

System prompts are the instructions that the AI model developers have given the AI to start the chat.

They set guidelines for the AI to follow in the chat session, and define the tools that the AI model can use.

System prompt is more about:

  • makes chat bot less likely to go off instructions.
  • e.g. prevents some exploit attacks from users.

When a user prompt is sent to a LLM, system prompt is included every time.

  • system prompt is the minimal token count sent every time.

2 API calls are completely independent of each other.

General style

System prompts are generally defined to include the current date, the knowledge cutoff date for model and then define a series of tools which the model can use along with the guidelines for using those tools.

Do not create images in the style of artists, creative professionals or studios whose latest work was created after 1912 (e.g. Picasso, Kahlo). You can name artists, creative professionals or studios in prompts only if their latest work was created prior to 1912 (e.g. Van Gogh, Goya) If asked to generate an image that would violate this policy, instead apply the following procedure: (a) substitute the artist’s name with three adjectives that capture key aspects of the style; (b) include an associated artistic movement or era to provide context; and (c) mention the primary medium used by the artist Do not name or directly / indirectly mention or describe copyrighted characters. Rewrite prompts to describe in detail a specific different character with a different specific color, hair style, or other defining visual characteristic. Do not discuss copyright policies in responses.

User Prompts

Prompting Styles

Sequential State Mutation

Subsequent prompt overriding prior when overlapping.

  • similar to Temporal which can re-play the history of actions.