News for hackers. Stuff that matters.
Re:I made an app that runs Mistral 7B 0.2 LLM locally on iPh... by sp332 on Sunday January 07, 2024 @09:40PM (#38907647)
So the system prompt is just part of the first prompt in a conversation? How is that different from not having a system prompt?
Re:I made an app that runs Mistral 7B 0.2 LLM locally on iPh... by nl on Sunday January 07, 2024 @11:55PM (#38908434)
No, system prompts are surrounded by [INST] [/INST]
Re:I made an app that runs Mistral 7B 0.2 LLM locally on iPh... by sp332 on Monday January 08, 2024 @12:36AM (#38908685)
No, every user input is surrounded by those tags. Scroll down from that link you posted and read the next two example prompts.
Re:I made an app that runs Mistral 7B 0.2 LLM locally on iPh... by nl on Monday January 08, 2024 @04:49AM (#38909947)
No this isn't the case.

Here's the example from https://www.promptingguide.ai/models/mistral-7b#chat-templat...

<s>[INST] What is your favorite condiment? [/INST] "Well, I'm quite partial to a good squeeze of fresh lemon juice. It adds just the right amount of zesty flavour to whatever I'm cooking up in the kitchen!"</s> [INST] The right amount of what? [/INST]

Note that the sentence starting "Well, I'm quite partial isn't inside the tag.

This example comes from the official system card created by MistralAI available here: https://huggingface.co/mistralai/Mistral-7B-Instruct-v0.1

You can try it:

   ollama run Mistral "<s>[INST] What is your favorite condiment? [/INST] Well, I'm quite partial to a good squeeze of fresh lemon juice. It adds just the right amount of zesty flavour to whatever I'm cooking up in the kitchen</s> [INST] The right amount of what? [/INST]"
Re:I made an app that runs Mistral 7B 0.2 LLM locally on iPh... by sp332 on Monday January 08, 2024 @08:55AM (#38911924)
That's the whole context with two user inputs in the INST tags, and one assistant output between/outside of the tags. They're just simulating the beginning of a conversation. You can see this very clearly in the JSON version in the next code block:

  messages = [
    {"role": "user", "content": "What is your favourite condiment?"},
    {"role": "assistant", "content": "Well, I'm quite partial to a good squeeze of fresh lemon juice. It adds just the right amount of zesty flavour to whatever I'm cooking up in the kitchen!"},
    {"role": "user", "content": "Do you have mayonnaise recipes?"}
  ]
Re:I made an app that runs Mistral 7B 0.2 LLM locally on iPh... by nl on Monday January 08, 2024 @04:47PM (#38918657)
Yes, but this whole block of text gets passed to the LLM on each call as the conversation history. The [INST] tags tell the LLM which parts were inputs (system instructions) as opposed to outputs.
Re:I made an app that runs Mistral 7B 0.2 LLM locally on iPh... by sp332 on Monday January 08, 2024 @05:43PM (#38919406)
Well, that's not what a system prompt is. There is a difference between system prompts and regular conversational inputs. https://platform.openai.com/docs/guides/prompt-engineering/t...
Re:I made an app that runs Mistral 7B 0.2 LLM locally on iPh... by nl on Monday January 08, 2024 @08:09PM (#38920928)
In actual fact system prompts are just the instruction tuning prompts that provide instructions formatted in the correct way (ie, with [INST]). It's just text all the way down.