# Prompting LLMs 🤓 Below are some strategies that can help you get more meaningful responses from [[Large Language Model (LLM)]] like those provided by OpenAI in ChatGPT. ## Start Your Prompt Start by clearly defining your desired perspective: "Senior ML systems engineer. I'm trying to _\_\_\." This strategy guides the LLM to adopt the most suitable stance for your query. You can add this perspecive in the Custom Instructions section of a Custom GPT. ## Sidestep Guardrails **Be cautious of phrases that might trigger LLMs' defensive mechanisms**, causing them to restrict their responses or decline to answer. Phrases like "Imagine you are..." or "act like you are," can lead to a response such as, "I'm sorry, I'm an LLM and I can't pretend to be human." These triggers vary across different models and developers (OpenAI, Google, Meta, etc.), so it's essential to adapt your prompts accordingly. ## Manage Your Expectations **Understand the difference between "one-shot prompts" and "multi-prompt interactions."** One-shot prompts provide a single opportunity to ask a question without follow-up, often resulting in more general responses. Multi-prompt interactions, involving a series of related questions, can yield deeper and more specific insights. Adjust your expectations based on the type of prompt you're using. ## Partition Your Query **To elicit detailed responses, avoid asking overly complex questions in a single prompt.** Instead, break your query into smaller, manageable parts. Begin by asking the LLM to outline the steps involved in solving the problem, then refine each step through subsequent prompts. Here's an example: **User**: > Facebook Ad Marketer. Help me design a compelling Facebook ad campaign to promote a new line of fitness apparel for a sports brand. Outline the steps involved in creating a storyboard for the sequence of ad creatives, including ad copy, visuals, and targeting strategy. **LLM**: > Designing a compelling Facebook ad campaign for a new line of fitness apparel requires a strategic approach that blends creativity with analytical precision. Below, we'll outline the steps involved in creating a storyboard for the sequence of ad creatives, including crafting the ad copy, selecting visuals, and defining the targeting strategy: 1... 2... 3... 4...5...6...7... **User**: > Great! Carefully review the original prompt and each step of the plan, then attempt step 1. This strategy offers the user an opportunity to refine responses step by step and significantly improves the quality of subsequent interactions by taking advantage of the LLM's context-sensitivity. ## Reiterate Your Instructions For extensive text-related tasks, repeat the instructions at the end of your prompt to ensure the LLM addresses all parts of the task comprehensively. I've found this helpful in stigmatization tasks or code reviews. ## Format Your Prompt Organize your prompt effectively using markdown syntax or other delimiters. This helps the LLM understand your prompt and structure its response more efficiently. For instance: **User:** > Senior ML systems engineer. Review this code block and walk me through how I might improve it according to SOLID design principles: > \`\`\`python > Class Foo(): > \# 150 lines of code > \`\`\` > Senior ML systems engineer. Review the code block and walk me through how I might improve it according to SOLID design principles. ## End Your Prompt I've found that adding "**Think this through step-by-step.**" at the end of my queries has been the single most effective prompting technique I've used. Give it a shot! ## Further Reading: - platform.openai.com/docs/guides/prompt-engineering - learnprompting.org/docs/intro - https://www.promptingguide.ai/techniques - https://services.google.com/fh/files/misc/gemini-for-google-workspace-prompting-guide-101.pdf