This repository gives a detailed example of prompt engineering using Chain of Thought (CoT) prompting for four common FMCG Retail challenges.
This technique where a user presents a task to an LLM (Large Language Model) without giving the model further examples. Here, the user expects the model to perform the task without a prior understanding, or shot, of the task. Modern LLMs demonstrate remarkable zero-shot performance
- The larger the LLM, the more likely zero-shot prompt will yield effective results
- Instruction tuning can improve zero-shot learning. You can adopt Reinforcement Learning from Human Feedback (RLHF) to scale instruction tuning, aligning modern LLMs to better fit human preferences
This technique where user gives the model contextual information about the required tasks. In this technique, you provide examples of both the task and output you want. Providing this context, or a few shots, in the prompt conditions the model to follow the task guidance closely
- The labels in a few-shot prompt do not need to be correct to improve model performance. Usually, applying random labels outperforms using no labels at all. However, the label space and distribution of the input text specified by the demonstrations are important. The use of term label in this context refers to the output of the prompt examples. The sentiment expressed by the statement in a "prompt example" is an example of a label
- If you have access to a large set of examples, use techniques to obey the token limits of your model and dynamically populate prompt templates. You can use an example selector that is based on semantic similarity to help
It breaks down complex reasoning tasks through intermediary reasoning steps. You can use both zero-shot and few-shot prompting techniques with CoT prompts. These are specific to a problem type. You can use the phrase "Think step by step" to invoke CoT reasoning from your ML model
Reason through root causes and purpose actionable recommendations
FMCG retailers struggle with recurring stock-outs for fast-moving products
- SKU Sales history: [Sales data]
- Inventory status: [Inventory data]
- Lead times & Reorder points: [Reorder data]
- Identify SKUs with recurring stockouts
- Assess root causes (demand fluctuations, lead times, order quantity, forecasting errors)
- Suggest actionable recommendations for SKU replenishment, safety stock policies, and supplier collaboration
- List of recurring stock-out SKUs
- Root cause of each SKU
- Specific actionable recommendations
Think clearly about surplus stock and suggest ways to reduce waste
Excess or obsolete inventory is tying up working capital and causing write-offs
- SKU Movement & Ageing: [Movement data]
- Sell-through rate: [sell through data]
- Expiry date: [expiry dates]
- Identify SKUs with low turnover or nearing expiry
- Assess the root causes (over-ordering, forecasting error, slow sales)
- Suggest targeted clearance strategies (promotions, discounts, bundles)
- Propose long-term measures (forecasting adjustments, reivew of MOQ, vendor agreements)
- List of slow-moving and obsolete SKUs
- Clearance and long-term prevention recommendations
Compare pricing and suggest competitive pricing strategies
Customers are shifting to competitors due to pricing discrepancies across key SKUs
- SKU Prices across competitors: [competitor data]
- Sales and profit margins: [sales profit data]
- Customer segments and price sensitivity: [customer data]
- Identify SKUs with significant pricing gaps vs competitors
- Evaluate the impact of pricing differences on sales and margins
- Identify SKUs where price adjustments can increase sales without compromising margins
- Suggest competitive pricing strategies for key SKUs
- SKU-wise pricing discrepancy and impact
- SKU-wise pricing recommendations
- Strategies for aligning pricing with customer expectations
Pinpoint delays and purpose actionable improvements
Frequent delays from distributors affect product availability and customer satisfaction
- Distributor Delivery times: [delivery data]
- SKU Service level agreements: [SLA data]
- Frequency and patterns of late deliveries: [late delivery data]
- Identify SKUs with recurring delays and compare actual vs SLA times
- Analyze root causes (distributor constraints, order quantity, transportation)
- Recommend actionable improvements (alternate distributors, lead-time adjustments, buffer stock policies)
- Suggest metrics and reporting measures for ongoing performance monitoring
- SKU-wise delay and root cause summary
- Recommend corrective and preventive measures
- Suggested metrics for performance monitoring
- Essentials of Prompt engineering
- Supply Chain concepts
"A well-crafted prompt is like a key that unlocks the true potential of AI"