Update tech_docs/llm/random.md
This commit is contained in:
@@ -1,68 +1,88 @@
|
|||||||
# 📘 Comprehensive Prompt Crafting Guide for LLMs
|
Here's a revised version of your "Comprehensive Prompt Crafting Guide for LLMs" with improvements for clarity, engagement, and overall impact:
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
# 🚀 The Art of Prompt Crafting: Unleashing the Power of LLMs
|
||||||
|
|
||||||
## 🎯 Overview
|
## 🎯 Overview
|
||||||
|
|
||||||
This guide is crafted for those who aspire to perfect their interaction with Language Learning Models (LLMs). It aims to transform prompt crafting into an art, ensuring that each interaction is meaningful and productive.
|
This guide is designed for anyone looking to **master their interactions with Large Language Models (LLMs)**. It transforms prompt crafting from a simple task into a sophisticated art form, ensuring every interaction is impactful, precise, and productive. By following these principles, you'll unlock the full potential of LLMs and consistently achieve high-quality results.
|
||||||
|
|
||||||
## 🛠 Best Practices
|
---
|
||||||
|
|
||||||
### ✏️ Grammar Excellence
|
## 🛠 Core Principles for Effective Prompts
|
||||||
|
|
||||||
- **Subject-Verb Synchrony**: Maintain a consistent tense and ensure your subjects and verbs agree.
|
### ✍️ Precision in Language
|
||||||
- **Pronoun Precision**: Select pronouns with clear antecedents to avoid ambiguity.
|
|
||||||
- **Modifier Proximity**: Position modifiers close to their subjects to preserve meaning.
|
|
||||||
|
|
||||||
### 📍 Punctuating with Purpose
|
* **Grammar & Syntax:**
|
||||||
|
* **Subject-Verb Agreement:** Ensure your subjects and verbs consistently match in number and person (e.g., "The team **is** working," not "The team **are** working").
|
||||||
|
* **Pronoun Clarity:** Use pronouns with unambiguous antecedents to prevent confusion (e.g., "John told **Sarah** that **she** should go," not "John told Sarah that she should go" if it's unclear who "she" refers to).
|
||||||
|
* **Modifier Placement:** Position modifiers directly next to the words they describe to maintain clear meaning (e.g., "She only ate **one** apple," not "She only ate an apple").
|
||||||
|
* **Punctuation with Purpose:**
|
||||||
|
* **Definitive Endings:** Use periods, question marks, or exclamation points to clearly convey the intended tone and conclusion of your sentences.
|
||||||
|
* **Clarity with Commas:** Employ commas to separate items in a list (including the **Oxford comma** for clarity), set off introductory phrases, and enclose parenthetical information that supports but isn't essential to the main text.
|
||||||
|
|
||||||
- **Sentence Closure**: Use periods, question marks, or exclamation points to reflect the tone of your sentence.
|
### 📝 Style & Substance
|
||||||
- **Comma Clarity**: Employ the Oxford comma for list clarity and parentheses for asides that support the main text.
|
|
||||||
|
|
||||||
### 📝 Style and Substance
|
* **Active Voice for Impact:** Generally, prefer **active voice** ("The LLM generated the response") for more direct and dynamic sentences. Use passive voice sparingly, typically when the action's recipient is more important than the performer ("The response was generated by the LLM").
|
||||||
|
* **Conciseness & Detail:** Strive for **economy of language**, providing all necessary details without being verbose. Every word should serve a purpose.
|
||||||
|
* **Seamless Transitions:** Use a variety of **transitional words and phrases** (e.g., "furthermore," "however," "consequently") to elegantly connect ideas and ensure a logical flow between sentences and paragraphs.
|
||||||
|
* **Rich Vocabulary:** Balance **simple, clear language** with specialized terms where precision is paramount. Employ **synonyms** and specific vocabulary to add depth and avoid repetition, enriching the output without resorting to jargon.
|
||||||
|
|
||||||
- **Voice and Tone**: Leverage active voice for dynamism while employing passive voice strategically for emphasis.
|
---
|
||||||
- **Brevity and Depth**: Strive for economy of language without sacrificing necessary details.
|
|
||||||
- **Transitional Techniques**: Employ a range of transitions to connect complex ideas elegantly.
|
|
||||||
|
|
||||||
### 📚 Vocabulary Enrichment
|
## 🤔 Crafting Different Prompt Types
|
||||||
|
|
||||||
- **Balanced Language**: Integrate simple language with specialized terms where needed.
|
### 💡 Instructional Prompts
|
||||||
- **Precision and Variety**: Utilize specific vocabulary and synonyms to add richness and avoid redundancy.
|
|
||||||
|
|
||||||
## 🤔 Types of Prompts
|
* **Define the Task Clearly:** Use strong **action verbs** (e.g., "Summarize," "Analyze," "Generate") to specify what the LLM should do.
|
||||||
|
* **Specify Format & Structure:** If needed, explicitly state the desired output format (e.g., "bullet points," "a JSON object," "a 500-word essay") and any structural requirements.
|
||||||
### 🛠 Instructional Prompts
|
|
||||||
|
|
||||||
- Clearly define the task with action verbs and specify the format or structure if needed.
|
|
||||||
|
|
||||||
### 🎨 Creative Prompts
|
### 🎨 Creative Prompts
|
||||||
|
|
||||||
- Encourage creativity by setting broad parameters while leaving room for interpretation.
|
* **Set Broad Parameters:** Encourage imaginative outputs by providing a general framework but allowing ample room for the LLM's interpretation and originality.
|
||||||
|
* **Inspire with Constraints:** Sometimes, a few well-chosen constraints can spark creativity rather than stifle it.
|
||||||
|
|
||||||
### 🗣 Conversational Prompts
|
### 🗣 Conversational Prompts
|
||||||
|
|
||||||
- Mimic natural language to engage in a dialogue or simulate a particular conversational style.
|
* **Mimic Natural Dialogue:** Phrase your prompts to resemble a natural conversation, fostering a more engaging and fluid interaction with the LLM.
|
||||||
|
* **Define a Persona/Style:** If desired, instruct the LLM to adopt a specific conversational style or persona (e.g., "Act as a helpful tutor," "Respond as a skeptical journalist").
|
||||||
|
|
||||||
## 🔄 Feedback Iteration for LLMs
|
---
|
||||||
|
|
||||||
|
## 🔄 Iterative Feedback for LLM Refinement
|
||||||
|
|
||||||
### 🔍 Evaluating LLM Outputs
|
### 🔍 Evaluating LLM Outputs
|
||||||
|
|
||||||
- **Relevance**: Does the output directly address the prompt?
|
Before providing feedback, objectively assess the LLM's response based on these criteria:
|
||||||
- **Completeness**: Are all components of the prompt accounted for?
|
|
||||||
- **Coherence**: Is the output logically structured and easy to follow?
|
|
||||||
|
|
||||||
### 💡 Perfecting Feedback
|
* **Relevance:** Does the output directly and fully address all aspects of your prompt?
|
||||||
|
* **Completeness:** Are all the requested components or information present in the response?
|
||||||
|
* **Coherence:** Is the output logically structured, easy to understand, and free of contradictions?
|
||||||
|
|
||||||
- Offer specific, actionable feedback to refine LLM outputs.
|
### 💡 Perfecting Your Feedback
|
||||||
- Use examples to clarify your expectations for the LLM's performance.
|
|
||||||
|
|
||||||
## 📌 Diverse Examples
|
* **Be Specific & Actionable:** Instead of vague statements like "This isn't right," provide precise feedback on what needs to change and how (e.g., "The tone is too formal; please rewrite this section to be more casual and friendly").
|
||||||
|
* **Use Examples:** Whenever possible, offer concrete examples to illustrate your expectations for the LLM's revised performance.
|
||||||
|
|
||||||
- ❌ "Draft a message."
|
---
|
||||||
- ✅ "Compose a professional email to a client discussing project updates, ensuring a polite tone and clear presentation of the progress."
|
|
||||||
|
|
||||||
- ❌ "Describe a scene."
|
## 📌 Examples of Effective vs. Ineffective Prompts
|
||||||
- ✅ "Depict a bustling, diverse urban street market at sunset, with detailed descriptions of the senses—sight, sound, smell, and touch."
|
|
||||||
|
Here's how to elevate your prompts:
|
||||||
|
|
||||||
|
* **❌ Ineffective:** "Draft a message."
|
||||||
|
* **✅ Effective:** "Compose a professional email to a client providing an update on the project's progress. Ensure a polite and confident tone, clearly outlining the completed milestones and the next steps, aiming for a length of approximately 150-200 words."
|
||||||
|
|
||||||
|
* **❌ Ineffective:** "Describe a scene."
|
||||||
|
* **✅ Effective:** "Depict a bustling, diverse urban street market at sunset. Focus on sensory details: describe the vibrant colors of the stalls, the cacophony of vendor calls and street musicians, the mingled aromas of exotic spices and street food, and the texture of the cobblestone streets underfoot. Aim for a vivid and immersive description."
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## 🔚 Conclusion
|
## 🔚 Conclusion
|
||||||
|
|
||||||
Adopting these comprehensive strategies will refine your prompts, leading to higher-quality interactions and outputs from LLMs.
|
By consistently applying these comprehensive strategies, you will significantly refine your prompt-crafting abilities. This will lead to remarkably higher-quality interactions and outputs from LLMs, transforming your experience and maximizing their utility.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Ready to start crafting your next perfect prompt? What kind of task are you hoping to accomplish with an LLM today?**
|
||||||
Reference in New Issue
Block a user