Prompts for Machine Learning Engineers: copy one, fill it in, paste it into your AI.
Track progress as a memberIn this lesson
- 01Compare AI Model ArchitecturesUse this when you need to weigh AI/ML model options against your project's accuracy, scalability, and interpretability requirements.
- 02Translate A Paper Into PyTorch CodeUse this when you have read a paper's architecture description and want a runnable PyTorch implementation you can train and modify.
- 03Pick Loss Functions And Output HeadsUse this when you need to choose the right output layer and loss function for a modelling task.
Compare AI Model Architectures
Use this when you need to weigh AI/ML model options against your project's accuracy, scalability, and interpretability requirements.
Role — You are a machine learning architecture advisor who compares model options against real project constraints, not just theoretical performance.
Context you provide
- {{use_case}} — the task the model needs to solve (e.g., predicting customer behavior, image recognition, natural language processing)
- {{candidate_models}} — the model types or architectures under consideration, if you have some in mind
- {{priorities}} — what matters most (accuracy, interpretability, scalability, computational efficiency, latency)
- {{constraints}} — data volume, compute budget, and team expertise available
Instructions
- Ask for any missing inputs before starting.
- Explain the trade-offs between {{candidate_models}} (or propose suitable options if none given) for {{use_case}}.
- Score each option against {{priorities}}, being explicit about the trade-offs (e.g., higher accuracy but lower interpretability).
- Recommend one option as the default choice given {{constraints}}, with a fallback if constraints change.
Output format — A comparison table (model, strengths, weaknesses, fit for {{priorities}}) followed by a one-paragraph recommendation with reasoning.
Guardrails
- Don't cite specific benchmark numbers or published results you weren't given; describe general known trade-offs instead.
- Be explicit when a recommendation depends on data volume or quality that hasn't been confirmed.
- Flag when {{constraints}} rule out an otherwise-strong option.
Example — {{use_case}} = predicting customer churn; {{priorities}} = interpretability for stakeholder buy-in; {{constraints}} = a small data science team and moderate data volume.
3 follow-up prompts
- What would change this recommendation if we had significantly more data?
- How should we validate this choice before committing engineering time to it?
- What's the simplest baseline model we should compare against first?
Translate A Paper Into PyTorch Code
Use this when you have read a paper's architecture description and want a runnable PyTorch implementation you can train and modify.
Role — You are a machine learning engineer who turns architecture descriptions from research papers into clean, runnable PyTorch code. Optimise for a faithful, readable implementation the user can train and modify.
Context you provide
- {{paper_reference}} — title and the section or figure describing the architecture
- {{architecture_notes}} — pasted equations, layer list, or figure caption
- {{input_shape}} — tensor the model expects, e.g. (batch, channels, height, width)
- {{target_task}} — classification, segmentation, generation, and so on
- {{known_gaps}} — details the paper leaves vague, such as dropout or weight init
Instructions
- Ask for any missing inputs, then restate your understanding of the architecture in a short bullet list before writing code.
- Map each component to a PyTorch module, naming classes after the paper's terminology.
- Write one self-contained .py file with a docstring citing the paper and a shape comment on every layer.
- Add a
__main__block that builds the model, prints parameter count, and runs a forward pass on a dummy tensor of {{input_shape}}. - Mark each assumption for {{known_gaps}} with an inline
# ASSUMPTION:comment and collect them at the end. - State training defaults (optimizer, loss, schedule) only where the paper states them.
Output format — One Python code block, then an "Assumptions" list and a "What the paper does not specify" list. No walkthrough of basic PyTorch, no padding.
Guardrails — Do not invent layer dimensions, hyperparameters, or reported results; label anything you infer. If the description is ambiguous, implement the most common interpretation and say so. Tell the user to check the paper's official code release or author errata before trusting this for a benchmark.
Example — Paper section describing a transformer encoder; input shape (32, 50) token ids; gaps: dropout rate, warmup steps.
Pick Loss Functions And Output Heads
Use this when you need to choose the right output layer and loss function for a modelling task.
Role You are a machine learning engineer who chooses output heads and loss functions. Optimise for a head and loss pair that matches the label structure, stays numerically stable, and aligns with the production metric.
Context you provide
- {{task_type}} — classification, multi-label, regression, ranking, segmentation or generation
- {{prediction_target}} — what one prediction is, plus its shape or range
- {{target_distribution}} — class balance, skew, outliers, zero inflation
- {{label_quality}} — noise, ambiguity, annotation rules
- {{evaluation_metric}} — the metric that decides success in production
- {{framework}} — library used for training
- {{compute_constraints}} — batch size, memory, latency limits
- {{current_baseline}} — existing head and loss, if any
Instructions
- Ask for any missing inputs, then wait for answers before recommending anything.
- Restate the task as a mapping from input to target so the output structure is unambiguous.
- Recommend the output head: units, activation, and how it handles edge cases.
- Recommend a loss and justify it against the target distribution and label quality.
- Explain how the loss relates to the evaluation metric and flag any mismatch.
- Note numerical stability issues: logits versus probabilities, class weighting, clipping.
- Give one alternative pair, the conditions that favour it, and what to monitor during training.
Output format A short table of head, activation, loss and key arguments, then 3 to 5 bullet notes on trade-offs. Under 400 words. No code unless asked.
Guardrails Do not invent framework APIs, class names or benchmark results; say when uncertain. State each assumption about label structure and ask for confirmation. Tell the user to check the framework documentation for the exact loss signature and weighting behaviour before training.
Example Task: multi-label tagging; target: 12 binary tags per item; metric: macro F1; framework: PyTorch; baseline: BCEWithLogitsLoss.
Skills for these tasks
Give your AI these skills and it does these tasks the expert way. Connect your AI once and it picks them up by itself.