llama3 icon indicating copy to clipboard operation
llama3 copied to clipboard

Clarification on prompt format?

Open CrossPr0duct opened this issue 9 months ago • 2 comments

Newlines (0x0A) are part of the prompt format, for clarity in the examples, they have been represented as actual new lines. The model expects the assistant header at the end of the prompt to start completing it.

<|begin_of_text|><|start_header_id|>system<|end_header_id|>

{{ system_prompt }}<|eot_id|><|start_header_id|>user<|end_header_id|>

{{ user_message }}<|eot_id|><|start_header_id|>assistant<|end_header_id|>

Do you mean this?

<|begin_of_text|><|start_header_id|>system<|end_header_id|>\n\n{{ system_prompt }}<|eot_id|\n\n<|start_header_id|>user<|end_header_id|>\n\n{{ user_message }}<|eot_id|><|start_header_id|>assistant<|end_header_id|>

Or this ( this one would make sense )

<|begin_of_text|><|start_header_id|>system<|end_header_id|>\n{{ system_prompt }}<|eot_id|<|start_header_id|>user<|end_header_id|>\n{{ user_message }}<|eot_id|><|start_header_id|>assistant<|end_header_id|>\n

CrossPr0duct avatar May 04 '24 07:05 CrossPr0duct

@jspisak

CrossPr0duct avatar May 04 '24 16:05 CrossPr0duct

Both are fine, in the first one you're letting the LLM determine what the first output token should be, whereas in the second one you are enforcing the first output token to be a newline and have the LLM complete it from there

subramen avatar May 08 '24 17:05 subramen