AI Prompt Improvement

Explore top LinkedIn content from expert professionals.

  • View profile for Andrew Ng
    Andrew Ng Andrew Ng is an Influencer

    DeepLearning.AI, AI Fund and AI Aspire

    2,593,899 followers

    Last week, I described four design patterns for AI agentic workflows that I believe will drive significant progress: Reflection, Tool use, Planning and Multi-agent collaboration. Instead of having an LLM generate its final output directly, an agentic workflow prompts the LLM multiple times, giving it opportunities to build step by step to higher-quality output. Here, I'd like to discuss Reflection. It's relatively quick to implement, and I've seen it lead to surprising performance gains. You may have had the experience of prompting ChatGPT/Claude/Gemini, receiving unsatisfactory output, delivering critical feedback to help the LLM improve its response, and then getting a better response. What if you automate the step of delivering critical feedback, so the model automatically criticizes its own output and improves its response? This is the crux of Reflection. Take the task of asking an LLM to write code. We can prompt it to generate the desired code directly to carry out some task X. Then, we can prompt it to reflect on its own output, perhaps as follows: Here’s code intended for task X: [previously generated code] Check the code carefully for correctness, style, and efficiency, and give constructive criticism for how to improve it. Sometimes this causes the LLM to spot problems and come up with constructive suggestions. Next, we can prompt the LLM with context including (i) the previously generated code and (ii) the constructive feedback, and ask it to use the feedback to rewrite the code. This can lead to a better response. Repeating the criticism/rewrite process might yield further improvements. This self-reflection process allows the LLM to spot gaps and improve its output on a variety of tasks including producing code, writing text, and answering questions. And we can go beyond self-reflection by giving the LLM tools that help evaluate its output; for example, running its code through a few unit tests to check whether it generates correct results on test cases or searching the web to double-check text output. Then it can reflect on any errors it found and come up with ideas for improvement. Further, we can implement Reflection using a multi-agent framework. I've found it convenient to create two agents, one prompted to generate good outputs and the other prompted to give constructive criticism of the first agent's output. The resulting discussion between the two agents leads to improved responses. Reflection is a relatively basic type of agentic workflow, but I've been delighted by how much it improved my applications’ results. If you’re interested in learning more about reflection, I recommend: - Self-Refine: Iterative Refinement with Self-Feedback, by Madaan et al. (2023) - Reflexion: Language Agents with Verbal Reinforcement Learning, by Shinn et al. (2023) - CRITIC: Large Language Models Can Self-Correct with Tool-Interactive Critiquing, by Gou et al. (2024) [Original text: https://lnkd.in/g4bTuWtU ]

  • View profile for Aishwarya Srinivasan
    Aishwarya Srinivasan Aishwarya Srinivasan is an Influencer
    647,654 followers

    If you’re an AI engineer trying to understand and build with GenAI, RAG (Retrieval-Augmented Generation) is one of the most essential components to master. It’s the backbone of any LLM system that needs fresh, accurate, and context-aware outputs. Let’s break down how RAG works, step by step, from an engineering lens, not a hype one: 🧠 How RAG Works (Under the Hood) 1. Embed your knowledge base → Start with unstructured sources - docs, PDFs, internal wikis, etc. → Convert them into semantic vector representations using embedding models (e.g., OpenAI, Cohere, or HuggingFace models) → Output: N-dimensional vectors that preserve meaning across contexts 2. Store in a vector database → Use a vector store like Pinecone, Weaviate, or FAISS → Index embeddings to enable fast similarity search (cosine, dot-product, etc.) 3. Query comes in - embed that too → The user prompt is embedded using the same embedding model → Perform a top-k nearest neighbor search to fetch the most relevant document chunks 4. Context injection → Combine retrieved chunks with the user query → Format this into a structured prompt for the generation model (e.g., Mistral, Claude, Llama) 5. Generate the final output → LLM uses both the query and retrieved context to generate a grounded, context-rich response → Minimizes hallucinations and improves factuality at inference time 📚 What changes with RAG? Without RAG: 🧠 “I don’t have data on that.” With RAG: 🤖 “Based on [retrieved source], here’s what’s currently known…” Same model, drastically improved quality. 🔍 Why this matters You need RAG when: → Your data changes daily (support tickets, news, policies) → You can’t afford hallucinations (legal, finance, compliance) → You want your LLMs to access your private knowledge base without retraining It’s the most flexible, production-grade approach to bridge static models with dynamic information. 🛠️ Arvind and I are kicking off a hands-on workshop on RAG This first session is designed for beginner to intermediate practitioners who want to move beyond theory and actually build. Here’s what you’ll learn: → How RAG enhances LLMs with real-time, contextual data → Core concepts: vector DBs, indexing, reranking, fusion → Build a working RAG pipeline using LangChain + Pinecone → Explore no-code/low-code setups and real-world use cases If you're serious about building with LLMs, this is where you start. 📅 Save your seat and join us live: https://lnkd.in/gS_B7_7d

  • View profile for Ruben Hassid

    Master AI before it masters you.

    918,377 followers

    STOP asking ChatGPT to "make it better". Here's how to better prompt it instead: ☑ Clearly Identify the Issue Rather than a vague “make it better,” specify the exact element that needs change. For example: "Rewrite the second paragraph so it includes three concrete examples of our product’s benefits. The tone must be formal and persuasive. Remove any informal language or redundant phrases." ☑ Divide the Task into Discrete Steps Break the overall revision into a sequence of manageable tasks. For example: "Go through my instructions, step by step. – Step 1: Summarize it in one sentence. – Step 2: Identify two specific weaknesses. – Step 3: Rewrite the text to address these weaknesses, incorporating specific data or examples." ☑ Specify the Format and Level of Detail Define exactly how the final output should look. For example: "Provide the final revised text as a numbered list where each item contains 2–3 sentences. Each item must include at least one statistical fact or concrete example, and the overall response should not exceed 250 words." ☑ Request a Chain-of-Thought Explanation Ask the model to detail its reasoning process before giving the final output. For example: "Before providing the final revised text, explain your reasoning step-by-step. Identify which parts need improvement and how your changes will enhance clarity and professionalism. Then, present the final revised version." ☑ Conditional Instructions to Enforce Compliance Add if/then conditions to ensure all requirements are met. For example: "If the revised text does not include at least two concrete examples, then add a sentence with a real-world statistic. Otherwise, finalize the response as is." ☑ Consolidate All Instructions into One Prompt Integrate all the detailed instructions into a single, comprehensive prompt. For example: "First, identify the section of the text that needs improvement and explain why it is lacking. Next, summarize the current text in one sentence and list two specific weaknesses. Then, rewrite the text to address these weaknesses, ensuring the revised version includes three concrete examples, uses a formal and persuasive tone, and is structured as a numbered list with each item containing 2–3 sentences. Each list item must include at least one statistical fact or example, and the overall response must be no longer than 250 words. Before providing the final text, explain your reasoning step-by-step. If the revised text does not include at least two concrete examples, add an additional sentence with a real-world statistic." ___ Why This Works People never give enough context. And once ChatGPT answers, they never correct it enough. Think about it like an intern. Deep prompting is all about precision: give clear instructions, context & the right corrections. PS: Don't forget to use the new o3-mini model. It's crushing any other one. Yes – even DeepSeek.

  • View profile for Sourav Verma

    Lead Applied AI Scientist at Bayer | AI | Agents | NLP | ML/DL | Engineering

    19,895 followers

    The interview is for a GenAI Engineer role at Anthropic. Interviewer: "Your prompt gives perfect answers during testing - but fails randomly in production. What’s wrong?" You: “Ah, the prompt drift problem. Identical prompts can yield different outputs due to sampling (temperature/top-p) or shift entirely under paraphrased inputs." Interviewer: "Meaning?" You: "LLMs don't understand instructions - they predict them. A single rephrased sentence, longer context, or slight temperature change can push the model into a different completion path. What looks deterministic in a 10-example test collapses under real-world input diversity." Interviewer: "So how do you fix it?" You: Treat prompts like production code: 1. Prompt templates - lock phrasing with {{placeholders}} for user input. 2. Lock sampling - fix temperature=0, top_p=1 for reproducibility. 3. System-level guardrails - e.g., "Always respond in valid JSON matching this schema: {{schema}}" 4. Fuzz-test inputs - run 1k+ paraphrased variants pre-deploy. 5. Delimiters + structure -> Prevents bleed and enforces parsing: """USER_INPUT: {{input}}""" """OUTPUT_FORMAT: {{schema}}""" Interviewer: "So prompt reliability is more about engineering than creativity?" You: "Exactly. Creative prompting gets you demos. Structured prompting gets you products." Interviewer: "What’s your golden rule for prompt design?" You: “Prompts are code. They need versioning, testing, and regression tracking - not vibes. If you can’t reproduce the output, you can’t trust it." Interviewer: "So prompt drift is basically a reliability bug?" You: "Yes - and fixing it turns GenAI from a prototype into a platform." #PromptEngineering #GenerativeAI

  • View profile for Usman Sheikh

    I co-found companies with experts ready to own outcomes, not give advice.

    56,348 followers

    Prompt engineering is the new consulting superpower. Most haven't realized it yet. Over the last couple of days, I reviewed the latest guides by Google, Anthropic and OpenAI. Some of the key recommendations to improve output: → Being very specific about expertise levels requested → Using structured instructions or meta prompts → Explicitly referencing project documents in the prompt → Asking the model to "think step by step" Based on the guides, here are four ways to immediately level up your prompting skill set as a consultant: 1. Define the expert persona precisely "You're a specialist with 15 years in retail supply chain optimization who has worked with Target and Walmart." Why it matters: The model draws from deeper technical patterns, not just general concepts. 2. Structure the deliverable explicitly "Provide 3 key insights, their implications and then support each with data-driven evidence." Why it matters: This gives me structured material that needs minimal editing. 3. Set distinctive success parameters "Focus on operational inefficiencies that competitors typically overlook." Why it matters: You push the model beyond obvious answers to genuine competitive insights. 4. Establish the decision context "This is for a CEO with a risk-averse investor applying pressure to improve their gross margins." Why it matters: The recommendations align with stakeholder realities and urgency. The above were the main takeaways I took from the guides which I found helpful. When you run these prompts versus generic statements, you will see a massive difference in quality and relevance. Bonus tips which are working for me: → Create prompt templates using the four elements → Test different expert personas against the same problem (I regularly use "Senior McKinsey partner" to counter my position detecting gaps in my thinking.) → Ask the model to identify contradictions or gaps in the data before finalizing any recommendations. We’re only scratching the surface of what these “intelligence partners” can offer. Getting better at prompting may be one of the most asymmetric skill opportunities all of us have today. Share your favourite prompting tip below! P.S Was this post helpful? Should I share one post per week on how I’m improving my AI-related skills?

  • View profile for Greg Coquillo

    AI Platform & Infrastructure Product Leader | Scaling massive AI Factories for Frontier Model providers | Azure AI & HPC | Former AWS, Amazon | Startup Investor | I deploy GPU-as-a-Service for AI customers

    234,344 followers

    Agentic AI can get expensive fast. Not because the model is always wrong. Because every agent step can add more context, more tool calls, more reasoning, and more tokens. If you want scalable agents, token efficiency becomes architecture. Here are 6 ways to save tokens in agentic workflows: → 𝗣𝗿𝗼𝗺𝗽𝘁 𝗖𝗮𝗰𝗵𝗶𝗻𝗴 Reuse repeated system prompts, instructions, and context instead of processing the same input again. Best for stable instructions, long policies, and repeated workflows. → 𝗦𝗲𝗺𝗮𝗻𝘁𝗶𝗰 𝗖𝗮𝗰𝗵𝗶𝗻𝗴 Reuse previous answers when a new query has the same meaning, even if the wording is different. Best for support, FAQs, internal knowledge, and repeated user requests. → 𝗥𝗼𝘂𝘁𝗶𝗻𝗴 Send each task to the right model, tool, or workflow based on complexity, cost, and accuracy needs. Simple tasks should not use your most expensive model. → 𝗞𝗲𝗲𝗽𝗶𝗻𝗴 𝗖𝗼𝗻𝘁𝗲𝘅𝘁 𝗖𝗹𝗲𝗮𝗻 Remove irrelevant, outdated, duplicated, or noisy information before sending context to the model. Clean context improves both cost and output quality. → 𝗖𝗼𝗻𝘁𝗲𝘅𝘁 𝗖𝗼𝗺𝗽𝗮𝗰𝘁𝗶𝗼𝗻 Compress long conversations or documents into shorter summaries while preserving critical facts. Useful when agents need memory without carrying the entire history. → 𝗟𝗮𝘇𝘆-𝗟𝗼𝗮𝗱𝗶𝗻𝗴 𝗖𝗼𝗻𝘁𝗲𝘅𝘁 Load only the information needed at the moment instead of dumping everything upfront. The lesson is simple: More context is not always better. Better context is better. Token savings come from smarter caching, cleaner context, better routing, and loading only what the agent actually needs. Save this if you are building AI agents, RAG systems, automation workflows, or production GenAI apps.

  • View profile for Allie K. Miller
    Allie K. Miller Allie K. Miller is an Influencer

    #1 Most Followed Voice in AI Business (2M) | Former Amazon, IBM | Fortune 500 AI and Startup Advisor, Public Speaker | @alliekmiller on Instagram, X, TikTok | AI-First Course with 400K+ students - Link in Bio

    1,669,082 followers

    In just a few minutes, here’s one thing you can do to make AI outputs 10x sharper. One of the most common reasons that prompts fail is not because they are too long, but because they lack personal context. And the fastest fix is to dictate your context. Speak for five to ten minutes about the problem, your audience, and the outcome you want, then paste the transcript into your prompt. Next, add your intent and your boundaries in plain language. For example: “I want to advocate for personal healthcare. Keep the tone empowering, not invasive. Do not encourage oversharing. Help people feel supported in the doctor’s office without implying that all responsibility sits on them.” Lastly, tell the model exactly what to produce. You might say: “Draft the first 400 words, include a clear call to action, and give me three title options.” Here’s a mini template: → State who you are and who this is for → Describe your stance and what to emphasize → Add guardrails for tone, privacy, and any “don’ts” → Set constraints like length, format, and voice → Specify the deliverable you want next Until AI memory reliably holds your details, you are responsible for supplying them. Feed the model your story - no need to include PII - to turn generic responses into work that sounds like you.

  • View profile for Edward Frank Morris
    Edward Frank Morris Edward Frank Morris is an Influencer

    Forbes. LinkedIn Top Voice for AI.

    37,470 followers

    A few months ago, a colleague screamed at Microsoft Copilot like he was auditioning for Bring Me The Horizon. He typed, “Make this into a presentation.” Copilot spat out something. He yelled, “NO, I SAID PROFESSIONAL!” It revised it. Still wrong. “WHY ARE YOU SO STUPID?” And that, dear reader, is when it hit me. It’s not the AI. It’s you. Or rather, your prompts. So, if you've ever felt like ChatGPT, Copilot, Gemini, or any of those AI Agents are more "artificial" than "intelligent"? Then rethink how you’re talking to them. Here are 10 prompt engineering fundamentals that’ll stop you from sounding like you're yelling into the void. 1. Lead with Intent. Start with a clear command: “You are an expert…,” “Generate a monthly report…,” “Translate this to French…" This orients the model instantly. 2. Scope & Constraints First. Define boundaries up front. Length limits, style guides, data sources, even forbidden terms. 3. Format Your Output. Specify JSON schema, markdown headers, or table columns. Models love explicit structure over free form prose. 4. Provide Minimal, High Quality Examples. Two or three exemplar Q→A pairs beat a paragraph of explanation every time. 5. Isolate Subtasks. Break complex workflows into discrete prompts (chain of thought). One prompt per action: analyze, summarize, critique, then assemble. 6. Anchor with Delimiters. Use triple backticks or XML tags to fence inputs. Cuts hallucinations in half. 7. Inject Domain Signals. Name specific frameworks (“Use SWOT analysis,” “Apply the Eisenhower Matrix,” “Leverage Porter’s Five Forces”) to nudge depth. 8. Iterate Rapidly. Version your prompts like code. A/B test variations, track which phrasing yields the cleanest output. 9. Tune the “Why.” Always ask for reasoning steps. Always. 10. Template & Automate. Build parameterized prompt templates in your repo. Still with me? Good. Bonus tips. 1. Token Economy Awareness. Place critical context in the first 200 tokens. Anything beyond 1,500 risks context drift. 2. Temperature vs. Prompt Depth. Higher temperature amplifies creativity. Only if your prompt is concise. Otherwise you get noise. 3. Use “Chain of Questions.” Instead of one long prompt, fire sequential, linked questions. You’ll maintain context and sharpen focus. 4. Mirror the LLM’s Own Language. Scan model outputs for phrasing patterns and reflect those idioms back in your prompts. 5. Treat Prompts as Living Docs. Embed metrics in comments: note output quality, error rates, hallucination frequency. Keep iterating until ROI justifies the effort. And finally, the bit no one wants to hear. You get better at using AI by using AI. Practice like you’re training a dragon. Eventually, it listens. And when it does, it’s magic. You now know more about prompt engineering than 98% of LinkedIn. Which means you should probably repost this. Just saying. ♻️

  • View profile for Aadit Sheth

    Building Nia | Real-time X narrative intelligence for comms

    98,399 followers

    Anthropic dropped the best free masterclass on prompt engineering Here’s what you’ll learn in 9 chapters: 1. Structure better prompts → Always start with the intent: “Summarize this article in 5 bullet points for a beginner” is 10x better than “Summarize this.” → Use instruction-first phrasing, the model performs best when it knows exactly what you want upfront. 2. Be clear + direct → Avoid open-ended ambiguity. Instead of “Tell me about success,” ask “List 3 traits successful startup founders share.” → Use active voice, fewer adjectives, and always define vague terms. 3. Assign the right “role” → Start with: “You are a [role]”, this frames the model’s mindset. Example: “You are a skeptical investor evaluating a pitch.” → Roles unlock tone, precision, and even memory, especially in multi-turn chats. 4. Think step by step (Precondition prompts) → Ask the model to plan before it answers: “First, list your steps. Then, perform them one by one.” → This dramatically improves accuracy and reduces hallucinations in complex tasks. 5. Avoid hallucinations → Anchor the model with clear boundaries: “Only answer if the input contains [x]. Otherwise, respond: ‘Insufficient data.’” → Reduce creativity in factual tasks. E.g., “Be concise. Don’t assume.” 6. Build complex prompts (with reusable patterns) → Use modular blocks: context → instruction → format → examples. → Build a personal prompt library by saving + refining your best-performing prompts over time. It’s not just “how to prompt better.” It’s a full-on skill upgrade. Interactive. Structured. Free. Share this with anyone still writing 1-line prompts. Image: Hesamation

  • View profile for Laura Jeffords Greenberg

    General Counsel at Worksome | Building AI-Native Legal Functions | Board Member & Speaker

    18,734 followers

    Most people don’t realize: AI can coach you on how to prompt it better. Here’s how to turn AI into your personal prompt coach, so you get better results and learn how to use AI faster. Try this two-step fix: 1. State your goal and context. 2. Ask one of these questions: ➡️ "How would you rewrite my prompt to get more [specific, creative, detailed, etc.] responses?" ➡️ "If you were trying to get [desired outcome], how would you modify this prompt?" ➡️ "If this were your prompt, what would you change to make it more effective?" ➡️ "What elements are missing from my prompt that would help you generate better responses?" ➡️ "How might you enhance this prompt to avoid common pitfalls or misinterpretations?" ➡️ Or simply: "Improve my prompt." Before: "Explain force majeure clauses." After: "Analyze how courts in California have interpreted force majeure clauses in commercial leases since COVID-19, focusing on what constitutes 'unforeseeable circumstances' and the burden of proof required to invoke these provisions." The difference? A broad, non-jx specific, superficial overview vs. actionable legal insights for commercial leases in California. Not only will you get better outcomes, but you will learn how to improve your prompting in the process. What are your go-to strategies or favorite prompts to optimize AI responses?

Explore categories