Skip to content

Commit b5bb427

Browse files
committed
feat: add new documentation for Few-Shot Prompting and update Prompt Engineering overview
- Created a new page for Few-Shot Prompting, detailing its overview, how it works, best practices, and related techniques. - Updated the Prompt Engineering page to include an overview and key techniques, linking to the new Few-Shot Prompting documentation.
1 parent 0bd7d5c commit b5bb427

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed

journals/2025_09_23.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- [[Prompt Engineering]]
2+
-

pages/AI___Prompt___Engineering.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,15 @@
11
alias:: [[Prompt Engineering]]
2+
3+
- # Prompt Engineering
4+
- ## Overview
5+
- Prompt engineering is the practice of designing and optimizing prompts to effectively communicate with [[AI/LLM]]s
6+
- It involves crafting input text that guides the model to produce desired outputs
7+
- ## Key Techniques
8+
- ### [[AI/Prompt Engineering/Technique/Few-Shot Prompting]]
9+
- Providing examples to demonstrate the desired input-output pattern
10+
- ### [[Zero-Shot Prompting]]
11+
- Providing instructions without examples
12+
- ### [[Chain-of-Thought Prompting]]
13+
- Encouraging step-by-step reasoning
14+
- ## Related Concepts
15+
- [[Context Engineering]] - Broader approach to providing appropriate context to LLMs
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
alias:: [[AI/Prompt Engineering/Technique/Few-Shot Prompting]], [[Few-Shot Prompting]]
2+
3+
- # Few-Shot Prompting
4+
- ## Overview
5+
- Few-shot prompting is a technique in [[Prompt Engineering]] where you provide the [[AI/LLM]] with a small number of examples (typically 2-5) to demonstrate the desired input-output pattern before asking it to perform the same task on new inputs
6+
- This technique helps the model understand the task format, style, and expected behavior without requiring extensive fine-tuning
7+
- ## How It Works
8+
- ### Pattern Recognition
9+
- The model learns from the provided examples to identify patterns in input-output relationships
10+
- It uses these patterns to generate appropriate responses for new, similar inputs
11+
- ### Context Learning
12+
- Examples serve as context that guides the model's understanding of the task
13+
- The model infers the underlying rules and constraints from the examples
14+
- ## Best Practices
15+
- ### Example Selection
16+
- Choose diverse examples that represent the range of inputs you expect
17+
- Ensure examples are high-quality and demonstrate the desired output format
18+
- Include edge cases when relevant
19+
- ### Format Consistency
20+
- Maintain consistent formatting across all examples
21+
- Use clear separators between examples and the actual prompt
22+
- ### Example Order
23+
- Place examples in logical order (e.g., simple to complex)
24+
- Consider the order's impact on the model's learning
25+
- ## Resources
26+
- ### Tutorials and Examples
27+
- [Using Examples & Few-Shot Prompting](https://github.com/anthropics/prompt-eng-interactive-tutorial/blob/master/AmazonBedrock/anthropic/07_Using_Examples%20_Few-Shot_Prompting.ipynb) - Interactive tutorial from Anthropic's prompt engineering series
28+
- ## Related Techniques
29+
- [[Zero-Shot Prompting]] - Providing no examples, just instructions
30+
- [[One-Shot Prompting]] - Providing a single example
31+
- [[Chain-of-Thought Prompting]] - Breaking down complex reasoning
32+
- ## See Also
33+
- [[Prompt Engineering]] - Main page for prompt engineering techniques
34+
- [[Context Engineering]] - Broader concept of providing appropriate context to LLMs
35+

0 commit comments

Comments
 (0)