ترقية الحساب

TOWARDSAI.NET
WHY‑Us: A Simple Prompt Framework for High Impact and Consistent Results from LLMs
Author(s): Kaushik Holla Originally published on Towards AI. Source: By the Author; Generated using GPT 4o Its been little over two years now since I started integrating LLMs into business applications to achieve product KPI’s and goals — and it’s been one wild ride. Over these years, I have been in situations where I have tried almost every prompting technique out there like Zero-shot, few-shot, role-based, step-by-step etc. I kept experimenting, still found myself regularly frustrated with what I got back. Sometimes the output was close, but not quite useful. Other times it completely missed the point. After hitting walls again and again, it finally clicked: prompting isn’t just about “talking to the AI” better — it’s a skill. Giving the right prompt is the difference between guesswork and a reliable workflow. This can be confirmed with the rise of companies that have built entire products around efficient, well-crafted prompts. In many cases, they are essentially wrappers around LLMs that work so well because the prompts behind the scenes are sharp, structured, and repeatable. Why we need this framework? Now that LLMs have become a part of our daily workflow, whether through ChatGPT, Cursor, Perplexity, or a dozen other tools — we can’t afford to rely on generic, hit-or-miss prompts. I have spent months iterating, testing, and refining my own approach, and out of all that trial and error overtime i came up with something I now call the W-H-Y-Us framework. It’s not perfect, but it consistently gives me better results compared to just winging it. The W‑H‑Y‑Us framework is a repeatable structure, just four blocks — to turn any fuzzy request into a clear, reusable playbook that an AI can follow every single time. Lets dive into each block of the framework and understand how to leverage it. I will talk about each block and how to apply it using Amazon Product Review Dataset as example. Amazon Product Reviews Dataset from Kaggle, which contains over 500,000 customer reviews across a wide range of products. Each entry includes key fields like product_id, review_text, rating, and timestamp, offering a rich source for sentiment analysis, trend detection, and product feedback insights. The Framework: Source: By the Author W — What are the facts/truth? Guiding Question: This block sets the foundation, i.e“What facts or constraints never change?” It establishes the unchanging truths about the task. For our dataset: Dataset Structure: Each entry includes product_id, review_text, rating, and timestamp. Rating Scale: Ratings range from 1 to 5 stars. Language: All reviews are in English. Sentiment Mapping: For analysis purposes, ratings are categorized as: 1. Positive: 4–5 stars 2. Neutral: 3 stars 3. Negative: 1–2 stars These constants set the foundation for any analysis or modeling. These are non-negotiables — the kind of things the AI needs to know and respect if it’s going to do the job right. H — How to Do It Guiding Question: “What’s the exact sequence of steps?” i.e we define the step-by-step procedure. Data Cleaning: Remove null or duplicate entries. Normalize text by converting to lowercase and removing special characters. Sentiment Analysis: Apply a pre-trained sentiment analysis model to classify review_text into positive, neutral, or negative categories. Aggregation: Group reviews by product_id. Calculate: Average rating per product and Count of reviews per sentiment category. Visualization: Generate bar charts showing the distribution of sentiments per product. Create word clouds for the most frequent terms in positive and negative reviews. Reporting: Compile findings into a Markdown report for stakeholders. This structured approach ensures consistency and reproducibility. Y — Why It Matters Guiding Question: “What success criteria, goals or mindset guides choices?” basically understanding the purpose behind the task: Business Objective: Identify customer satisfaction trends to inform product improvements and marketing strategies. Quality Metrics: Accuracy of sentiment classification. Clarity and readability of visualizations. Stakeholder Needs: Insights should be actionable and easily interpretable by non-technical team members. Keeping these goals in mind ensures that the analysis delivers value. U — Us Together (When working with Agents) Guiding Question: “How do agents hand off or collaborate?” i.e Defining roles and collaboration points: #DataEngineer: Prepares and cleans the dataset. #DataAnalyst: Performs sentiment analysis and generates visualizations. #MarketingTeam: Reviews the report to derive actionable insights. Collaboration Tools: Use Slack for communication. Store reports in a shared Google Drive folder. Schedule bi-weekly meetings to discuss findings. Clear delineation of responsibilities facilitates smooth collaboration. Putting them all together: An Example Prompt Using W-H-Y-U I'm analyzing the [Amazon Product Reviews Dataset](https://www.kaggle.com/datasets/arhamrumi/amazon-product-reviews) to extract customer sentiment insights.**W — What’s True:**- Dataset includes `product_id`, `review_text`, `rating`, and `timestamp`.- Ratings range from 1 to 5 stars.- Reviews are in English.**H — How to Do It:**- Clean the data by removing nulls and duplicates.- Normalize `review_text`.- Classify sentiments using a pre-trained model.- Aggregate data by `product_id` to compute average ratings and sentiment counts.- Visualize results with bar charts and word clouds.- Compile findings into a Markdown report.**Y — Why It Matters:**- Aim to uncover customer satisfaction trends.- Provide actionable insights for product and marketing teams.- Ensure clarity and accuracy in reporting.**U — Us Together:**- #DataEngineer handles data preparation.- #DataAnalyst conducts analysis and visualization.- #MarketingTeam reviews and acts on insights.- Utilize Slack and Google Drive for collaboration. Note: If multiple roles are involved, add a quick hashtag — #DataEngineer, #DataAnalyst, #MarketingTeam—in front of a bullet. If you’re solo, skip the tags. Remember when filling the framework, Brain‑dump bullets under each heading, don’t worry about perfect wording. Keep only points that must be true for consistent results. Read the four blocks top‑to‑bottom; a stranger should understand the task. Paste as your first prompt (or “system” prompt) in ChatGPT, Cursor, LangChain, etc. If the model slips, tighten the bullet that was vague. This structured prompt delivers consistent and valuable outputs than one off prompts. Common Pitfalls: Even with a simple framework like W‑H‑Y‑Us, it’s easy to stumble. I have made all these mistakes myself — so here are the most common ones, and how to avoid them: Stuffing everything into “What” It’s tempting to cram all your instructions and context into the “What’s True” block. But if it’s about steps or actions, it belongs in “How.” If it involves collaboration or who does what, move it to “Us.”Being vague in “Why” A generic “this is important” won’t help guide decisions. Instead, add clear success criteria like: “Response time should be under 3 seconds.” “Summary must score at least 80% on accuracy checks.” “Target is 99% uptime across all modules.” Overusing role tags Only use tags like #Reviewer or #Engineer when a bullet truly changes based on who’s doing it. Otherwise, skip the tags—they add clutter more than clarity.Final Takeaway The W‑H‑Y‑Us framework helps you breaking any task, big or small into four clear, repeatable building blocks: What’s True.How to Do It.Why It Matters.Us Together. Whether you are delegating it to an AI or collaborating with a teammate, this framework gives you a structured, reusable way to turn fuzzy requests into clear, dependable playbooks. Write once, reuse forever — and stop relying on prompt “magic.” Links: Amazon Product Reviews 568K + consumer reviews on different amazon products www.kaggle.com Join thousands of data leaders on the AI newsletter. Join over 80,000 subscribers and keep up to date with the latest developments in AI. From research to projects and ideas. If you are building an AI startup, an AI-related product, or a service, we invite you to consider becoming a sponsor. Published via Towards AI
·32 مشاهدة