← Data Science
Data Science
Prompt Engineering Is a Real Skill — Here's How to Get Good at It
✍ ManhithaJune 3, 20259 min read
🔬
Prompt engineering has attracted mockery — it sounds like "talking to computers nicely." But the gap between a basic prompt and a well-crafted one is genuinely enormous, and understanding why reveals something deep about how language models work.
Why prompts matter so much
Language models don't understand your intent — they predict what text should follow your input. A vague prompt activates a vague region of the model's learned patterns. A precise prompt activates a much narrower, more relevant region. This isn't metaphorical; the mathematical mechanics of transformer attention make specificity literally more constraining on the output distribution.
Technique 1: Role and context setting
Instead of "write me a summary," try "You are a senior product manager preparing a briefing for a non-technical executive audience. Summarize the following in 3 bullet points, focusing on business impact, not technical details." The role constrains tone and vocabulary; the audience constrains complexity; the format constrains length.
Technique 2: Chain of thought
For reasoning tasks, asking the model to "think step by step" before giving an answer measurably improves accuracy on complex problems. This works because it forces the model to generate intermediate reasoning tokens before reaching a conclusion, rather than pattern-matching directly to an answer.
Technique 3: Few-shot examples
Providing 2–3 examples of the input-output format you want is often more effective than describing the format in words. If you want a specific JSON structure, show an example JSON. If you want a particular writing style, include a paragraph written that way. Models learn from examples even within a single context window.
Technique 4: Constraints and negative space
Telling the model what NOT to do is often as important as telling it what to do. "Don't use bullet points. Don't include introductory sentences. Don't exceed 200 words." Explicit constraints dramatically reduce the chance of generic or padded output.
Supervised vs unsupervised: the fundamental divide
Most ML is either supervised (learning from labelled examples) or unsupervised (finding patterns in unlabelled data). Supervised learning powers email spam filters, medical image diagnosis, and fraud detection — tasks where you have thousands of examples of correct answers to learn from. Unsupervised learning powers recommendation systems, customer segmentation, and anomaly detection, where the goal is to find structure that wasn't defined in advance.
The labelling requirement of supervised learning is often the bottleneck in real-world ML projects. Labelling medical imaging data requires radiologists; labelling legal documents requires lawyers. The cost and scarcity of expertise to create labelled training data is frequently the binding constraint on deploying ML in specialised domains.
Feature engineering: the hidden craft
Before you can train a model on raw data, you typically need to transform it into a form the model can use effectively. This process — feature engineering — is often where the real skill in applied ML lives. Should you represent a date as a raw timestamp, or decompose it into hour of day, day of week, month, and distance from a holiday? The answer significantly affects model performance, and getting it right requires domain knowledge as much as technical skill.
Deep learning has reduced the need for manual feature engineering in domains like image and text processing, where neural networks learn representations directly from raw data. But in tabular data — the kind that fills business databases — feature engineering remains essential, and practitioners who do it well consistently outperform those who treat ML as an automated black box.
Model evaluation: why accuracy is almost never enough
A spam filter that classifies every email as "not spam" achieves 99%+ accuracy if spam is 1% of email volume — and is completely useless. This is why evaluating ML models requires understanding the specific business context and choosing metrics accordingly. Precision, recall, F1 score, AUC-ROC, and domain-specific metrics each capture different aspects of model performance.
For high-stakes applications — medical diagnosis, credit decisions, content moderation — models must also be evaluated for fairness across demographic groups. A model that performs well on average may systematically underperform for minority groups in training data, with real-world consequences that require deliberate measurement and mitigation.
From notebook to production: the hard part
Building a model that works in a Jupyter notebook is the starting point, not the goal. Deploying that model so it can serve predictions to real users, handle unexpected input, degrade gracefully, and be monitored for performance drift over time is a fundamentally different engineering challenge — one that requires robust infrastructure, careful versioning, and ongoing vigilance.
The field of MLOps has emerged specifically to address this gap, bringing software engineering discipline to the ML lifecycle: automated training pipelines, model registries, A/B testing infrastructure, and monitoring dashboards that alert when a model's real-world performance diverges from its test-set performance. Getting this right is the difference between an impressive demo and a reliable product.