If you want to learn about LLMs first, see our blog post Introduction to Large Language Models.
Writing good prompts is both an art and a science that has given rise to an entire field called prompt engineering.If you want to learn more, see our crash course on prompt engineering:
Anatomy of a prompt[
Through a learning process called instruction fine-tuning, modern LLMs are now capable of performing specific tasks based on explicit instructions, also called prompts. A prompt is a piece of text that guides the LLM to generate a response. It can be as simple as a single sentence:- Instruction: The instruction, or question, that you want the LLM to help you with.
- Context: Additional information that help the LLM understand the instruction.
- Format: The format of the response that you want the LLM to generate.
<YOUR_INSTRUCTION>
, <YOUR_CONTEXT>
, and <YOUR_FORMAT>
with your own text.
In the following sections, you’ll learn about each part in more detail.
Instruction
A good instruction is clear and concise. It should tell the LLM exactly what you want it to generate. It should also be short enough that the LLM can understand it.Prefer instructions over questions
Questions can often be ambiguous and may lead to unexpected results. Instead, use instructions starting with an imperative verb to tell the LLM what you want.- Recommended:
List the key features of the product.
- Not recommended:
What are the features of the product?
Avoid compound instructions
Focus on one task at a time. Including multiple instructions in a single prompt may confuse the LLM and lead to less accurate results.- Recommended:
Identify action items from the meeting.
- Not recommended:
Identify action items from the meeting and list highlights from each speaker.
Context
Add aContext:
section to your prompt to provide additional information to the LLM. This can help the LLM generate more accurate results.
LeMUR adds the transcription text as context to your prompt by default. You don’t need to include it in your prompt.
Provide definitions
You can use context to define any terms that the LLM may not understand.Provide examples
Rather than telling the LLM what to generate, you can show it examples of the output you want to generate.Format
You can tell LeMUR how the format should look like by adding aAnswer Format:
section to your prompt.
Use tags to define placeholders
Use tags to insert dynamic content into your prompt. A tag is a description of a piece of information, surrounded by angle brackets,<...>
.
In the format section of your prompt, place the tag where you want to insert the value.