Keep up to date with the trending topics
from our industry experts

Prompt engineering – make sure you’re asking AI the right questions

Written by Bryn Morgan

Thursday, 6 June, 2024

Webinar: This is your Microsoft Copilot speaking, we’re ready for financial services take off

On demand

Learn how this powerful AI tool can help you create, analyse and communicate better with your data.

Microsoft Copilot Webinar

A few years back, people would have been confused or joked about the job title “Prompt Engineer” and its connection to being punctual. But in the contemporary world of Artificial Intelligence (AI) and Large Language Models (LLM), prompt engineering is the newest role of technology that is generating a lot of debate. Prompt engineering doesn’t have to be a job however, it is a practice that when used correctly can increase the power of outputs from LLMs.

What does prompt engineering do?

An LLM is a platform that generates output from any given input based on natural language. In essence, you ask a question, and it will be answered based on knowledge gathered from specific sources (either defined private sources or often public domain documents such as website content and news articles). Prompt engineering is the process of designing and optimising natural language inputs to generate desired outputs from LLMs. Using this process delivers efficiency and allows users to build complex queries or simply request a desired output rather than have to articulate and type the requirement in natural language.

Putting prompt engineering into context for financial services

Here are some examples of prompts and how these could be useful in Financial Services:

1. Querying

Querying when using an LLM, is asking a specific question or providing a partial statement that the model can complete, or answer based on its knowledge and context. Querying can help elicit more precise and relevant responses from the LLM by narrowing down the scope and focus of the task. For example, querying the LLM with “Who is the CEO of Microsoft?” or “Microsoft’s CEO is” can help the model generate the correct answer “Satya Nadella”, rather than a generic or unrelated response. Another example of querying is providing the LLM with the beginning of a sentence, such as “The capital of the UK is”, and letting the model fill in the rest, such as “London”.

Examples of queries in financial services are:

  • Generate a brief report on the current trends and outlook of the global oil market based on the following data: [Input]
  • Recommend an optimal allocation of assets for a given risk profile and investment horizon based on the following criteria: [Input]
  • Predict the probability of default for a loan applicant based on the following information: [Input]

2. Reformulating

Reformulating means rewriting a given text or task in a different way that preserves the meaning and intention but uses different words or syntax. Reformulating can help improve the performance and robustness of LLMs by reducing ambiguity, increasing diversity, and enhancing clarity. For example, reformulating the task “Stock price prediction” as “Forecasting the value of a stock” can help the LLM understand the goal better and generate more accurate results. Another example of reformulating is changing the sentence “The dog chased the cat” to “The cat was chased by the dog”, they both mean the same thing but may produce varied results when using an LLM.

3. Prefixing

Prefixing is a technique of adding a fixed text at the beginning of an input to guide the model towards a specific task or domain. Prefixing can help improve the performance and accuracy of LLMs by providing additional context, constraints, or instructions, for example, “Summarise: [text]”

Some examples of prefixes that could be used in financial services could be as follows:

  • Fraud detection: Identify any suspicious or fraudulent transactions from the following list: [Input]
  • Financial summarisation: Summarize the main points of the following financial report in a few sentences: [Input]

Taking an example from querying, we could change our original query from:

  • Recommend an optimal allocation of assets for a given risk profile and investment horizon based on the following criteria: [Input]

to

  • Portfolio Optimisation: Recommend an allocation of assets for a given risk profile and investment horizon based on the following criteria: [Input]

4. Templating

Templating is a method of creating structured queries for natural language generation tasks, where the input and output formats are predefined. Like prefixing, templating can be used to simplify inputs and outputs and remove any ambiguity. Templating can have some limitations, such as requiring domain knowledge and linguistic expertise, being prone to errors and inconsistencies, and lacking flexibility and creativity.

For example, in the following prompt, the LLM could be set to take only stock tickers as input and the template or rules of the investment are clearly defined. You will also notice that this example combines templates and prefixes.

  • Portfolio optimization: Given the following assets and constraints, generate a portfolio allocation that maximizes the expected return and minimizes the risk: [Input]

A possible input for this prompt could be:

  • Assets: AAPL, MSFT, AMZN, GOOG, FB
  • Constraints: Total budget = $100,000; Maximum weight per asset = 25%; Minimum weight per asset = 5%

Taking you to the next level in AI

If you have had success using LLMs in the past, understanding prompts may not seem worth it, however as AI starts to become more omnipresent in our daily work life and applications, knowing key prompts and ways to use native LLMs could take you to the next level of AI use.

Microsoft copilot for example, is an integrated LLM across the Office suite of applications and its usage has taken off since its launch late last year. Understanding how to use the system more efficiently allows you to get to the result much quicker and helps you find a balance between where copilot is useful and where it’s not. Also, these systems can help you understand native application functionality better by performing a task in an application, such as using functions in Excel or slide effects in PowerPoint.

Need help utilising AI with your financial service business?

Our services

Our 4 pillars for a complete choice of managed IT services - all tailored to the needs of financial services firms in London and the UK.

Finance Forward 365 - Microsoft 365 cloud services supported by experts

Finance Forward 365

Microsoft modern workplace & cloud technology for digital transformation.

Compliant Teams -  Microsoft Teams phone system with call recording and archiving

Compliant Teams

Increased productivity & collaboration with call recording whilst reducing costs.
Cyber security solutions for financial services

Cyber Security

Keep your data secured against rapidly changing threats within Financial Services.

Responsive IT managed services for financial services

Power BI

Business Intelligence transformation and support tailored for Financial Services.

Follow us:

Pin It on Pinterest

Share This