Driving predictable outputs with prompt templates
1. Driving predictable outputs with prompt templates
Welcome back! In the last exercises, you wrote simple prompts to extract key points, data, and summaries. In this lesson, we'll build a reusable prompt pattern you can apply across companies and datasets.2. Why reusable prompts matter
One good prompt can save you from rework and keep your outputs consistent. And that consistency matters, because finance work is highly repetitive. Every quarter, the same types of analysis come up again: stock performance, KPI comparisons, and management commentary. Repetition creates efficiency opportunities. If the work is always the same, we can design one prompt pattern and apply it again and again. Instead of writing new prompts from scratch each time, you can design a prompt template. Think of it like a recipe: the steps stay the same, but you swap in new ingredients.3. Prompts as templates
In a recipe, the ingredients change but the steps stay fixed. In prompting, we call these changing parts variables and the fixed rules constraints. Variables (the inputs you'll change, like company name, date range, or file) and constraints are the guardrails that stay fixed, like bullet count, chart type, or CSV fields). By standardizing both, you save time, keep results consistent, and make comparisons across companies or months much easier.4. Structure of a reusable prompt
So how do you bring variables and constraints together? By following a simple structure: Context, why the analysis matters Task, what we want the AI to do Data, which inputs it should use Output, the format we want back This isn't the only way to design prompts, but it's a reliable starting point for financial analysis.5. Example reusable prompt
Here's an example you can use across different stock datasets. Context: You are financial analyst and need to brief leadership on recent stock performance. You can also define some persona here. Task: Describe patterns in price and trading activity. Data: Use the uploaded dataset - which we can upload at the point of prompting or before hand. Output: Provide 5 bullet-point insights and a line chart of Close prices for the last 2 quarters In this case, the context, task and output can remain same as our constraints, while the data we add is our variable.6. Run
Let's run this on Orion Technologies using a typical LLM chatbot.7. Response
The AI highlights rises and dips in Close prices, streaks of positive or negative Change values, and spikes in Volume.8. Response
Alongside the narrative bullets, it produced a simple line chart just as we asked.9. Run again
The real test of a prompt pattern is whether it works on another company. Let's try Apex Semiconductors. The only thing that changes is the dataset - the variable.10. Repeat
The output has the same structure: bullets and a chart.11. Repeat
That's the benefit of prompt engineering - one pattern, consistent results. But a quick word of caution: even when the structure looks correct, always validate key figures against your source data. In finance, accuracy matters as much as efficiency.12. The takeaway
The key takeaway is this: don't reinvent prompts. Define your structure once, then reuse it across companies and datasets. Reusable prompts save time, reduce errors, and make comparisons much easier. In the next video, we'll build on this idea by linking prompts together into workflows.13. Let's practice!
But first, let's practice!Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.