Collection of Basic Prompt Templates for Various Chat LLMs | Chat LLM's Basic Prompt Templates Collection
Motivation : The basic prompt template will significantly affect the effectiveness of instruction following. Models of different architectures may use different prompt templates during training. However, at present, these templates can be challenging to locate; sometimes they are embedded in example codes, hidden within GitHub issues, or occasionally found in official blogs...
Motivation : The basic prompt template will significantly affect the effect of the instruction following. Models of different architectures may use different hint templates when training. However, these templates are often hard to find at the moment; sometimes they are embedded in sample code, sometimes hidden in GitHub issues, and sometimes occasionally found in official blogs...
Note
Chat Markup Language is the mainstream, eg. HuggingFace's transformers, OpenAI's tiktoken.
Chat Markup Language is a mainstream format such as HuggingFace's transformers, OpenAI's tiktoken.
(Alphabetical order by architecture)
(Sorted by dictionary order of schema names)
template = """<reserved_195>{query}<reserved_196>""" template = """<|system|>
You are ChatGLM3, a large language model trained by Zhipu.AI. Follow the user's instructions carefully. Respond using markdown.
<|user|>
{query}
<|assistant|>
""" template = """<bos><start_of_turn>user
{query}<end_of_turn>
<start_of_turn>model""" template = """<|im_start|>system
You are a helpful assistant.<|im_end|>
<|im_start|>user
{query}<|im_end|>
<|im_start|>assistant
""" template = """<s>[INST] <<SYS>>
You are a helpful, respectful and honest assistant.
<</SYS>> {query} [/INST] Sure, I'd be happy to help. Here is the answer:"""Sure, I'd be happy to help. Here is the answer: avoids verbose model outputs. template = """Instruct: {query} n Output:"""
# or template = """Alice: {query}nBob:""" template = """<|im_start|>system
You are a helpful assistant.<|im_end|>
<|im_start|>user
{query}<|im_end|>
<|im_start|>assistant
"""<|im_end|> or <|endoftext|> , you can remove texts after them or use stop parameter like: # Using vLLM interface
payload = json . dumps ({
"prompt" : query ,
"n" : 1 ,
"stop" : [ "<|endoftext|>" , "<|im_end|>" ],
}) template = """<|im_start|>system
{system_message}<|im_end|>
<|im_start|>user
{prompt}<|im_end|>
<|im_start|>assistant""" template = """<|begin_of_text|><|start_header_id|>system<|end_header_id|>
You are a helpful AI assistant.<|eot_id|><|start_header_id|>user<|end_header_id|>
{query}<|eot_id|><|start_header_id|>assistant<|end_header_id|>
""" template =