Introduction to Prompt Formats

Introduction: Why Structuring Your Prompts Matters

Welcome to the first lesson of the course! This lesson will teach you why structuring your prompts is essential when working with large language models.

When you write a prompt, you are giving instructions to the LLM. If your instructions are clear and well-organized, the model is much more likely to provide you with a helpful and accurate response. On the other hand, if your prompt is messy or hard to follow, the model might misunderstand what you want.

Structuring your prompts is not just about making them look nice. It helps the LLM:

  • Understand the context and the specific question or task.
  • Separate different parts of your request, such as background information and the actual question.
  • Focus on the most critical details.

Throughout this lesson, you will see how simple structuring choices can make a big difference in the quality of the responses you get.

What Does It Mean to Structure a Prompt?

Structuring a prompt means organizing your prompt in a way that is easy for both you and the LLM to read and understand. This often involves using clear sections, lists, or other visual cues to separate different parts of your request.

For example, you might:

  • Use headings or labels to separate context from your main question.
  • Break down complex requests into bullet points or numbered lists.
  • Highlight important words or phrases using capitalization, symbols, or spacing.

The key is to present your prompt clearly, so the LLM can easily identify what you want.

Let's look at a few examples to see how structuring helps.

Example 1: Research Summary Request

Unstructured:

Summarize the main findings from the following research article and list any open questions.

Structured (using headings and bullet points):

CONTEXT:
I have a research article and I want to understand its key points.

ASK:
- Summarize the main findings from the article.
- List any open questions or areas for further research.

Example 2: Email Drafting

Unstructured:

Write an email to my manager asking for a day off next Friday and mention that I have completed my current project.

Structured (using different style of headings and a numbered list):

task: Write an email to my manager.

context:
1. Request a day off next Friday.
2. Mention that I have completed my current project.
Sign up

Join the 1M+ learners on CodeSignal

Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal