PML Docs

No Legal Promises

I didn't review it

📝 GENERAL PROMPT CRAFTING ADVICE:

1. 🌐 Provide Context

Include relevant information in the user/bot history to provide context for the system message. This can help guide the model's understanding and generate more accurate and coherent responses.

2. 🎯 Be Specific

Clearly specify the desired outcome or action in the system message. This helps guide the model's response towards the intended direction and ensures that the generated output is aligned with your goals.

3. 📋 Use Explicit Instructions

If you want the model to follow a specific format or provide certain information, explicitly instruct it in the system message. For example:

  • List pros and cons.
  • Provide step-by-step instructions.
  • Compare different options.

4. ⚙️ (GPT Parameters)

Experiment with Temperature and Top P Values

Adjust the temperature and top p values to control the randomness and creativity of the model's responses.

  • 🔥 Higher temperature values (e.g., 1.0) and larger top p values (e.g., 0.9) can result in more diverse outputs.
  • ❄️ Lower values can make the responses more focused and deterministic.

5. 🔄 Iterate and Refine

Generating high-quality responses often requires iteration and refinement. Experiment with:

  • Different prompts.
  • Tweak the instructions.
  • Analyze the model's outputs to improve the quality and relevance of the generated responses.

6. 🔍 Context is Everything

To gain more context, it's very helpful to have the prompt include the requirement for the AI to "show its work"...

  • 🤖 AI's generate responses from start to finish (continually referencing the beginning of their response), so when the AI needs to 'show its work', it adds more context for its final answer. This is most obvious when asking a simple math question like "2 + 2". Sometimes it'll respond with the wrong answer but if you ask it to walk through it "step by step", its accuracy increases dramatically. Experiment with this.

🌟 Remember, the quality of the generated responses depends on the prompt design (100%). Experimentation and fine-tuning are key to achieving the desired results. (which is why I made PML). Anything is possible with a little creativity! 😊

🤖 PML System:

1. Comments:

  • 📗 Use tripple backslash because I'm bad at regex
    ///
  • These are ignored in the prompt building (Expand "compiled preview" on the right panel to see this).

2. System Message:

<SYSTEM>{put prompt rules here}</SYSTEM>

  • System messages can only ever be at the beginning of a prompt.
  • This message is the most powerful tool that isn't available in regular ChatGPT.
  • I usually design most of my prompt in here, for clarity.
  • See this prompt: Prompt-Auditor.pml for an example of how to use this.

3. User & Bot paradigm:

  • When using GPT there is the concept of "roles" with only two roles, the AI and the User.
  • A conversation is conventionally: "User" -> "Bot" -> "User" -> "Bot"
  • A PML file must always end with a <USER> message
<USER> Hello </USER>
<BOT> Hello! I am butter bot! What's your name? </BOT>
<USER> You're a butter bot, you don't need my name. Anyways, <INPUT: QUESTION /> </USER>

4. Required Parameters (Input variables):

  • Input variables are required inputs when running a prompt, something you want changed every time you run the prompt.
  • Input variables have names, like "USER_NAME".
  • The pattern is
    <INPUT:(variable_name)>
    .
    • Variable names must be ALL_CAPS separated by underscores.
  • In the future, there will be more variable types besides INPUT, such as saved files or websites that can be used as sources of information.
My name is <INPUT:USER_NAME>, nice to meet you butter bot.
  • You can see here that you're able to use the same input variable in multiple places.
  • There will only be one input field per variable (e.g., USER_NAME).
  • But if you want that variable, you can use it as much as you'd like throughout the PML file.
<BOT> Hello <INPUT:USER_NAME> nice to meet you! I must ask, do you love butter? I'm fairly sure everyone loves butter! But I must know!!! </BOT> ```

5. Optional Parameters (Defaulted Variables):

  • Prompt variables are mainly used for testing your prompt.
    • Their structure is
      {$(variable_name):(default_value)}
      .
    • A prompt variable must always have a default value.
    • If desired, a prompt variable can be exposed as "optional" when running your prompt from the application page.
    • The point of prompt variables is mainly for testing.
  • Examples:
    • Researchers found a way to get good results in complex reasoning by adding "Let's take this step by step".
      • But then, it was discovered they got a 5% increase in accuracy by saying "Think about this step by step".
    • This example was one of the driving forces to build PML.
<USER> That's a {$QUESTION_ADJ:strange} question.. but to answer your question, {$USER_BUTTER_FEELINGS:I think butter is great.} Please describe your feelings towards butter. </USER>

6. Executing prompt:

  • The chat portion must always end on a <USER> because the execution of the file will respond from the Bot.
  • See "Prompt Preview" on the right side panel to see what the compiled prompt looks like.
  • You can perform a quick test there as well.

7. FORCED OUTPUT:

  • See example-functions to learn how to force output from the bot.
  • It's still a work-in-progress. It tends to error out because string-parsing a "possibly intact" JSON response is tricky.