Prompt Engineering
Craft of designing and optimizing inputs to AI language models to reliably produce desired outputs.
FAQs
What is chain-of-thought prompting and why does it improve AI performance?
Chain-of-thought (CoT) prompting instructs an LLM to show its reasoning process step by step before providing a final answer, rather than jumping directly to a conclusion. CoT dramatically improves performance on tasks requiring multi-step reasoning—math problems, financial calculations, logical deductions. The mechanism: by generating intermediate reasoning steps, the model builds a coherent path to the answer, catching errors that direct answering might miss. For financial applications, CoT is valuable for: calculating complex interest scenarios, performing multi-step financial ratio analysis, evaluating complex contract conditions, and working through tax calculations. The improvement from CoT is most pronounced in larger, more capable models.
What is a system prompt and how is it used in financial AI applications?
A system prompt is an instruction provided to an LLM at the beginning of a conversation context, setting the model's role, behavioral guidelines, constraints, and relevant background information for all subsequent interactions. In financial AI applications, system prompts define: the AI's persona (financial analyst, compliance assistant, customer service agent), the scope of questions it should answer, formatting requirements for outputs (always show calculations, always cite sources), compliance constraints (never provide specific investment advice, always include relevant disclaimers), and domain-specific knowledge (company-specific terminology, product catalog, regulatory framework). Well-designed system prompts reduce hallucination rates, improve output consistency, and help ensure AI-assisted workflows comply with regulatory requirements.
How does prompt engineering differ from fine-tuning a model?
Prompt engineering changes how you instruct an existing model at inference time—no model weights are modified, results are immediate, no training data or compute is required, and changes can be iterated rapidly. Fine-tuning updates the model's weights by training on domain-specific examples, changing the model's underlying knowledge and behavioral tendencies. Fine-tuning produces more consistent, efficient results for high-volume specific tasks (a model fine-tuned on financial documents extracts data more reliably with shorter prompts), but requires labeled training data, compute budget, and machine learning expertise. In practice, prompt engineering is tried first (faster, cheaper, lower barrier); fine-tuning is considered when prompt engineering reaches its accuracy ceiling or when inference efficiency matters at scale.
Related Terms
Large Language Model
AI system trained on vast text data to understand and generate human language across many tasks.
Retrieval-Augmented Generation
AI technique grounding language model responses in specific retrieved documents to improve accuracy.
Generative AI
AI systems capable of creating new content—text, images, code, or data—based on patterns learned from training.
AI Hallucination
AI model generating confident but factually incorrect or fabricated information not grounded in reality.