Prompt Engineering
The practice of designing inputs to an AI language model to reliably get better, more accurate, or more useful outputs — a practical skill for researchers using LLMs in their work.
Prompt engineering is the practice of crafting inputs (prompts) to a large language model in ways that reliably produce better outputs. Because LLMs are sensitive to how questions are framed, small changes in wording, structure, or context can substantially change the quality, accuracy, and format of responses.
Core techniques for research use:
Role and context setting Telling the model who it’s speaking to and what domain you’re in improves specificity:
“You are helping a molecular biologist evaluate a retrosynthesis route. Explain the following reaction mechanism in terms a chemist would find useful…”
Few-shot examples Showing the model examples of the input-output format you want before your actual query:
“Here are three examples of how to extract method information from a paper abstract: [examples]. Now extract the same information from this abstract: [your abstract]”
Chain-of-thought prompting Asking the model to reason step by step before giving an answer, which improves accuracy on complex tasks:
“Think through this step by step before giving your final answer.”
Output format specification Asking for structured output (tables, JSON, bullet lists) makes responses easier to use downstream:
“Return your answer as a table with columns: Tool name, Access type, Best for.”
Limitations:
- Results are non-deterministic — the same prompt can produce different outputs across runs. This matters for reproducibility.
- Prompt engineering doesn’t fix fundamental model limitations (hallucination, knowledge cutoffs, reasoning errors on complex quantitative tasks) — it just helps the model perform closer to its ceiling.
- Prompts that work well on one model may not transfer to another.
For reproducible research use: Document the exact prompts used, the model name and version, the date, and any temperature or parameter settings. This is increasingly expected in methods sections.
Related terms: Hallucination (AI), Retrieval-Augmented Generation (RAG)