본문 바로가기
1일 1 AI 공부

Claude 3에 맞는 프롬프트 엔지니어링

by 구교수 2024. 3. 14.

 10 Prompt Engineering Tips for Claude 3

1. Be Clear and Direct

Provide lots of context and clearly define the desired output. Use numbered lists, have a friend verify your prompts, and leave no room for ambiguity.

2. Show, Don't Tell with Examples

The magical "few-shot"PromptingTechnique: Provide 3-5 examples demonstrating the exact output you want, especially for structured tasks. Examples improve accuracy and consistency.

3. Give Claude a Role

Assigning a role like "academic" or "friendly tutor" helps Claude adapt its personality and vernacular for that situation.

4. Use XML Tags for Better Prompting

Claude's website recommends using XML tags when prompting to help it better understand the different parts, especially for larger prompts. For example:
 
Using tags helps Claude separate instructions, context and source material, leading to more accurate results compared to unstructured prompts.

5. Chain Your Prompts

Break down complex tasks into sequential prompts, using the previous output as the next input. This improves focus and parallel processing.
Prompt 1: Extracting the quotes
 
Prompt 2: (using output from Prompt 1): Answering the question:
 

6. Let Claude Think Step-by-Step

Have Claude reason through problems incrementally by thinking out loud before giving the final answer. Guides transparency too.

7. Prefill to Set the Tone

Prefilling provides starting text to steer Claude's language, formatting, persona, and more right from the get-go.
Here's an example of how to prefill Claude's response:
 

8. Control Output Format

Use examples, direct instructions, or prefilling to specify structured formats like JSON or code.

9. Ask for Rewrites

Have Claude refine its initial response when needed based on your feedback, instructions, and prompts.

10. Maximize the Long Context Window

Structure document prompts with XML tags, put documents upfront, have Claude reference relevant passages to reduce hallucinations.
These are just the basics - Anthropic's full prompt engineering cookbook is loaded with even more advanced strategies to truly master Claude.
 

 

 

Prompt library

 

docs.anthropic.com

 

 

'1일 1 AI 공부' 카테고리의 다른 글

노트북 LM 한글에서도 가능  (0) 2024.06.09
교육자를 위한 AI 프롬프트 모음  (0) 2024.04.02
GPTs 모음  (0) 2024.01.14
Magicschool AI Certification  (0) 2023.12.26
그림 만들기에 필요한 프롬프트 정리  (0) 2023.10.10