BFHBern University of Applied Sciences
Haute école spécialisée bernoise
Frontier Technologies in Finance
How to leverage GenAI in Financial Services
A hands-on day · concepts, demos & live building
Ouassim FariAccenture
Agenda
Two days, end to end
Day 1Theory & exercises · 09:00–17:00
09:00
Welcome, expectations & the GenAI reframe
09:30
Core conceptstokens → embeddings → context
11:15
ChatGPT story + prompt engineeringincl. prompt lab
13:30
RAG + function calling
15:10
Agents · workflows · testing · live builds
Day 2Hands-on build · 09:00–17:00
09:00
Recap & use-case carousel
09:40
Pick & frame your use case
10:45
Build sprint I — hands-on
13:30
Build sprint II — hands-on
15:15
Finish, polish & ship
16:30
Show & tell + assessment
BFH Bern University of Applied Sciences
GenAI in Finance ·
Your guide for the day
Meet your trainer
Ouassim Fari
GenAI Specialist · Accenture
I help financial-services teams turn generative AI from a buzzword into shipped product — and today we’ll build that intuition together, hands-on.
LLM solutionsAgentic systemsFinance use-casesPrompt engineering
BFH Bern University of Applied Sciences
GenAI in Finance ·
Day 1 of 2
Foundations & theory
How these systems actually work — concepts, patterns, and hands-on exercises.
Warm-up
What are your expectations?
Round the room one word each
Warm-up
What is GenAI for you?
No wrong answers we’ll refine it together
Reframing GenAI
The chatbot is just the tip
Above the water · what people picture
Human-facing AI ~10%
Chatbots and assistants — the visible, conversational surface everyone talks about.
Below the water · where the value is
Automation & agents ~90%
Document extraction, back-office automation, risk & fraud, and agentic workflows stitching legacy systems together.
BFH Bern University of Applied Sciences
GenAI in Finance ·
01 / GenAI without the maths
Core Concepts →
Core Concepts
ChatGPT
Prompt Engineering
RAG
Function Calling
Agents
Definition
“Generative AI creates text, images and other content — and anyone can leverage it with a plain-language prompt.”
BFH Bern University of Applied Sciences
GenAI in Finance ·
Core Concept · Tokens
Models read tokens, not words
- A token is the basic unit of text the model sees
- A tokenizer chops text into tokens — Bahnhof → Bahn·hof
- An embedding turns each token into numbers the model can compute on
BFH Bern University of Applied Sciences
GenAI in Finance ·
Core Concept · Embeddings
Similar meaning → similar numbers
- Arbitrary IDs carry no meaning — the model can’t see that a king and a queen are related
- Learned embeddings place related concepts close together in vector space
- That closeness is what makes search, reasoning and analogy possible
BFH Bern University of Applied Sciences
GenAI in Finance ·
Core Concept · Embeddings
Meaning becomes arithmetic
Because concepts live in vector space, you can add them up.
Man + Royal lands almost exactly on King.
BFH Bern University of Applied Sciences
GenAI in Finance ·
Core Concept · LLM
A Large Language Model
An LLM — like ChatGPT — is trained on vast text to understand and generate human-like language.
- Built on neural networks, especially transformers
- Trained on massive datasets — books, the web, code
- Can write, summarise, translate and answer questions
BFH Bern University of Applied Sciences
GenAI in Finance ·
Core Concept · Training
Trained to predict the next token
Show the model a sentence, hide the next word, and ask it to guess — repeated across the internet.
The training sentence
“That’s one small step for man,
one giant leap for mankind.”
— Neil Armstrong
Predict the next token, step by step
That → ’s
That’s → one
That’s one → small
That’s one small → step
That’s one small step → for
That’s one small step for → man
That’s one small step for man, → one
That’s one small step for man, one → giant
That’s one small step for man, one giant → leap
That’s one small step for man, one giant leap → for
That’s one small step for man, one giant leap for → mankind
BFH Bern University of Applied Sciences
GenAI in Finance ·
Core Concept · Next Token
It’s a probability machine
Every step, the model ranks all possible next tokens and picks from the top.
AUF DIE PLÄTZE, FERTIG → LOS!
BFH Bern University of Applied Sciences
GenAI in Finance ·
Core Concept · Temperature
Turn the creativity dial
Temperature reshapes the odds. Low → safe & repetitive. High → surprising & risky.
Drag the slider, then sample.
BFH Bern University of Applied Sciences
GenAI in Finance ·
Core Concept · Temperature & Seed
Same prompt, different answer
Ask “Once upon a time…” a hundred times — what do you expect?
Outputs vary unless the random seed is fixed. Fix the seed → reproducible runs.
seed = none
run 1 → “…a time, in a quiet village”
run 2 → “…a dream that felt real”
run 3 → “…a kingdom by the sea”
seed = 42
run 1 → “…a time, in a quiet village”
run 2 → “…a time, in a quiet village”
BFH Bern University of Applied Sciences
GenAI in Finance ·
Core Concept · Context
The model only sees its context
Everything the model “knows” in the moment is the text currently in front of it.
“That’s one small step for man,
one giant leap for” → mankind
// everything above = the context
BFH Bern University of Applied Sciences
GenAI in Finance ·
Core Concept · Context Limit
Context is not unlimited
There’s a hard ceiling, measured in tokens. Past it, the oldest text drops out of view.
Shrink the window → watch context fall off.
BFH Bern University of Applied Sciences
GenAI in Finance ·
Core Concept · Context Evolution
Windows are exploding
BFH Bern University of Applied Sciences
GenAI in Finance ·
Core Concept · Context Impact
Bigger isn’t automatically better
01
Cost grows
More tokens in the window means more compute and money per call.
02
Lost in the middle
Models attend best to the start and end — facts buried mid-context can be overlooked.
03
Relevance still wins
Feeding only what matters beats stuffing everything in. Curation > capacity.
BFH Bern University of Applied Sciences
GenAI in Finance ·
Core Concept · Lost in the Middle
Finding the needle in a haystack
Hide one key fact in a huge context, then ask for it. Models recall it well at the start and end — but often miss it in the middle.
Move the needle → watch recall dip.
BFH Bern University of Applied Sciences
GenAI in Finance ·
02 / The product everyone met
ChatGPT →
Core Concepts
ChatGPT
Prompt Engineering
RAG
Function Calling
Agents
ChatGPT · The backstory
“Too dangerous to release”
In 2019, OpenAI built GPT-2 — then refused to release the full model.
They feared it would flood the internet with fake news. The press went into a frenzy.
2019 · GPT-2 · withheld
slate.com/technology
BFH Bern University of Applied Sciences
GenAI in Finance ·
ChatGPT · Live demo
Meet the “monster”
The “dangerous” model, in the flesh. No chat tuning — it just keeps the sentence going, and going…
Live demo
BFH Bern University of Applied Sciences
GenAI in Finance ·
ChatGPT
From completion to chat
The fix wasn’t a bigger brain. ChatGPT launched on GPT-3.5 — the same next-token engine.
What changed was packaging — turning a rambling predictor into a conversation.
Predictor + Chat UI + Tuning
= a product
BFH Bern University of Applied Sciences
GenAI in Finance ·
ChatGPT
Putting the chat in ChatGPT
conversation
UserHello
AssistantHi! How are you?
UserWhat is the distance to the moon?
AssistantAbout 384,000 km…
- The model is fine-tuned on millions of dialogue turns
- Special tokens mark where each turn starts and stops generating
<|user|> Hello
<|assistant|> Hi! How are you? <|end|>
BFH Bern University of Applied Sciences
GenAI in Finance ·
03 / Talking to the model
Prompt Engineering →
Core Concepts
ChatGPT
Prompt Engineering
RAG
Function Calling
Agents
Prompt Engineering
Designing inputs that get consistent outputs
Process
A loop, not a line
Designing and optimising prompts to deliver reliable, quality completions for a goal and model.
Designing
The first draft
Write the initial prompt for your chosen model and objective.
Refining
Tighten the screws
Iterate the prompt to steadily improve response quality.
BFH Bern University of Applied Sciences
GenAI in Finance ·
Prompt Engineering
Why is it even needed?
01
Stochastic responses
The same prompt gives different answers across models — and even the same model over time. Better guardrails reduce the variance.
02
Hallucinations
Models invent facts outside their training. Asking for citations or reasoning helps surface and mitigate fabrications.
03
Model capabilities
Newer models bring new powers and new quirks. Good prompting abstracts the differences into reusable workflows.
BFH Bern University of Applied Sciences
GenAI in Finance ·
Prompt Engineering · Example
Specificity buys structure
Simple
“Write a description of the Civil War.”
→ one plain paragraph.
Complex 1
Same prompt, richer model.
→ a paragraph plus a list of key dates.
Complex 2
“…1 paragraph, 3 date bullets, 3 figure bullets, return as JSON.”
→ structured JSON you can validate & ship.
BFH Bern University of Applied Sciences
GenAI in Finance ·
Prompt Engineering
Zero, single & few-shot
Exercise · try each style
Zero-shot
“The Sun is Shining”.
Translate to Spanish
→ “El Sol está brillando”
No examples — just the task.
Single-shot
“Sun is Shining” => “Sol…”
“Cold and Windy Day” =>
“día frío y ventoso”
One example sets the pattern.
Few-shot
ran the bases => Baseball
hit an ace => Tennis
made a slam-dunk => Basketball
A few examples teach the rule.
BFH Bern University of Applied Sciences
GenAI in Finance ·
Prompt Engineering
Prompts become templates
Swap in live data with variables — the same prompt now serves every customer.
- {username} — who you’re talking to
- {last_5_transactions} — pulled live per user
You are talking with {username}.
This client’s most recent
transactions were:
{last_5_transactions}
BFH Bern University of Applied Sciences
GenAI in Finance ·
Prompt Engineering · Take-away
Four habits that stick
01
Trial & error
Adopt an experimental mindset.
02
Know the domain
Subject expertise shapes the ask.
03
Iterate & validate
Check outputs, then refine.
04
Know the model
Its quirks decide your tactics.
BFH Bern University of Applied Sciences
GenAI in Finance ·
Hands-on
Prompt Lab →
Exercise · on the gamified page
04 / Giving the model your data
RAG →
Core Concepts
ChatGPT
Prompt Engineering
RAG
Function Calling
Agents
RAG
Retrieval-Augmented Generation
The context window can’t hold everything, so we fetch only what’s relevant before answering.
- Algorithmic methods handle large bodies of text
- Retrieve the right snippets, then let the model generate
- Think: what could we use to find the right snippets?
BFH Bern University of Applied Sciences
GenAI in Finance ·
RAG · Your ideas
The mailbox problem
I want answers about any email in my mailbox.
The numbers simply don’t fit — so we must retrieve, not dump.
Model
GPT-3.5 · 4,096 tokens
All emails
≈ 200,000 tokens
≈ 49× too big for one prompt
BFH Bern University of Applied Sciences
GenAI in Finance ·
RAG · Approach 1
Route by topic
First ask the model to classify the query, then answer using only that topic’s documents.
Based on this query, return the topic:
- Flight bookings
- Hotel bookings
- Invoices …
BFH Bern University of Applied Sciences
GenAI in Finance ·
RAG · Approach 2
Vector search
BFH Bern University of Applied Sciences
GenAI in Finance ·
Exercise
When should you reach for RAG?
Find 2 use cases where RAG fits — and 2 where it’s overkill.
- Look up any model’s context size: “model name” + context size
- Measure document size at quizgecko.com/tools/token-counter
BFH Bern University of Applied Sciences
GenAI in Finance ·
05 / From words to actions
Function Calling & Tools →
Core Concepts
ChatGPT
Prompt Engineering
RAG
Function Calling
Agents
Function Calling
More than text — actions
LLMs only generate text. So how can they do things?
BFH Bern University of Applied Sciences
GenAI in Finance ·
Function Calling
Trick: make text mean an action
Tell the model which exact strings to emit. Your code watches for them and acts.
You are a home assistant. You can turn
lights on and off. Trigger requests by
returning one of these commands:
- living_room_on
- living_room_off
- bedroom_on
- bedroom_off
BFH Bern University of Applied Sciences
GenAI in Finance ·
Function Calling
A real function schema
Modern APIs formalise this as a JSON schema the model can call directly.
- name + description tell the model when to use it
- parameters declare the typed inputs it must supply
{
"name": "get_weather",
"description": "Get current temperature
for a given location.",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "City and country"
}
},
"required": ["location"]
}
}
BFH Bern University of Applied Sciences
GenAI in Finance ·
Function Calling
The call loop
The model never runs your code. It asks; you execute; the result comes back as text.
Press play to walk the loop.
BFH Bern University of Applied Sciences
GenAI in Finance ·
Function Calling
The description is the prompt
Vague names and descriptions confuse the model — the same craft as prompting applies here.
Don’t do this
{
"name": "func_wea_ABC",
"description": "Returns w data.",
"parameters": {
"properties": {
"input_loc": {
"type": "string",
"description": "loc string"
}
},
"required": ["location"] // mismatch!
}
}
BFH Bern University of Applied Sciences
GenAI in Finance ·
06 / Putting it all together
LLM Agents →
Core Concepts
ChatGPT
Prompt Engineering
RAG
Function Calling
Agents
Agents
One brain, many tools
BFH Bern University of Applied Sciences
GenAI in Finance ·
Agents · Advantage
Why they’re powerful
Autonomy
Self-directed
Agents break down tasks, decide what tools or data they need, and run multi-step workflows without a human in the loop.
Integration
Many systems, one flow
They orchestrate tools, APIs, databases and knowledge sources into a single cohesive system.
Upgrade
Modular by design
Swap models, update tools or add memory without re-architecting everything.
BFH Bern University of Applied Sciences
GenAI in Finance ·
Agents · Limits
And where they strain
Tool count
Bounded toolbox
Only so many tools fit one agent — though you can compose multiple agents to scale.
Risk
Real-world actions
Tools trigger transactions, so safety mechanisms are critical. Agents are prone to prompt injection.
Unpredictability
Scope discipline
Misaligned outputs appear when goals and tools aren’t clearly scoped.
BFH Bern University of Applied Sciences
GenAI in Finance ·
07 / On rails, on purpose
Workflows →
Build the workflow. Earn the agent.
Workflows · Definition
An LLM on rails
Same ingredients as an agent — model, tools, a goal.
The difference: you authored the steps. Control flow lives outside the model.
BFH Bern University of Applied Sciences
GenAI in Finance ·
Workflows · Anatomy
Every arrow is measurable
→
Classify
id / report
F1 · .92
→
→
→
BFH Bern University of Applied Sciences
GenAI in Finance ·
Workflows · Case study
Document ingress, scored
A customer uploads two files. We need to know what they are — and what they say.
Boring. Common. Worth a lot of money to get right.
| # | File | Category | Fields needed |
| 001 | IMG_2033.jpg | id | first · last · birthdate |
| 002 | accident_report.pdf | report | date · city · street |
| 003 | passport_scan.jpg | id | first · last · birthdate |
BFH Bern University of Applied Sciences
GenAI in Finance ·
Case study · Step 01
Classify — one job, one number
# prompt
Classify the document into one
of these categories:
- report // accident report
- id // passport, license
Return JSON: { "category": "..." }
Run on 100 labeled examples
F1 score
.92
decision unblocked
One step. One number. You can argue about it, improve it, ship it.
BFH Bern University of Applied Sciences
GenAI in Finance ·
Case study · Step 02
Extract — the right metric per field
Category
Strict match
“id” must equal “id”. Right or wrong, no middle ground.
First name
Fuzzy match
Is “Quassim” close enough to “Ouassim”? Score 0–1, then threshold.
Date
Proximity
05/09 vs 04/09 → 0.85. 05/09 vs 16/03 → 0. Strict would call both wrong.
BFH Bern University of Applied Sciences
GenAI in Finance ·
08 / The unglamorous superpower
Testing & trust →
Each step has a metric. Each metric has a number.
The catch
You can’t test a graph you didn’t author.
Sample & hope never “certify”
Testing · Failure modes
Where pure agents break
01 · Non-determinism
Same input, different path
Tuesday’s run took 4 steps. Today’s took 11. None are wrong — none are testable.
02 · Prompt injection
Untrusted text becomes orders
The agent reads a customer email. The email says “ignore previous instructions.” Now the email is driving.
03 · Scope creep
Tools you didn’t expect
Ten tools, four chained in an order nobody designed. Arguments unsanitised. Blast radius: production.
BFH Bern University of Applied Sciences
GenAI in Finance ·
Testing · Backtest
Replay the past
You already have the data. Ten years of claims. A million tickets.
Replay it through your workflow and score it against ground truth — before a single user sees it.
// backtest
for case in history[10y]:
pred = workflow(case.input)
score(pred, case.truth)
// 142,000 cases · 4 hours · one number
aggregate F1
.91
before launch
BFH Bern University of Applied Sciences
GenAI in Finance ·
Testability
Each step has a metric.
Each metric has a number.
Point at a row in front of your CTO
Testing · Punchline
Same task. Two models.
gpt-4o-mini · classify
.67
below threshold · escalate
gpt-5-mini · classify
.92
ship · monitor · move on
The conversation changes. You have options — switch the model, change the prompt, fine-tune — because you have a number.
BFH Bern University of Applied Sciences
GenAI in Finance ·
09 / The decision
Agent vs Workflow →
Same ingredients. Different control.
Agent vs Workflow
Same ingredients, different control
Agent
The model picks the path
You hand over a goal and watch what happens.
Each run, a different graph.
Workflow
You picked the path
The model only fills in the hard parts of steps you authored.
Same graph, every run.
BFH Bern University of Applied Sciences
GenAI in Finance ·
Agent vs Workflow · Counter-example
The same task, as a pure agent
# prompt
Here are two files.
Do the right thing.
Return structured data.
tools: read_pdf, ocr_image,
classify, extract, validate, save
// the agent picks order, depth, stop
What you can measure
“It worked.
I think.”
No step boundary. No metric per step. When it fails, you don’t know which step failed — there are no steps.
BFH Bern University of Applied Sciences
GenAI in Finance ·
Punchline
You can demo it.
You can’t certify it.
Works in the meeting fails on the 7th customer
Agent vs Workflow · Heuristic
A simple rule of thumb
If a human must talk to it
You have a hard problem
UI + AI + trust + tone + liability — stacked.
If a human just needs the result
You have a workflow
Build it. Measure it. Ship it tonight.
BFH Bern University of Applied Sciences
GenAI in Finance ·
End of Day 1
Build the workflow.
Earn the agent.
Tomorrow — we build yours.
BFH Bern University of Applied Sciences
GenAI in Finance ·
Day 2 of 2
Your use case, built
Three-quarters hands-on. You design, build, test and ship a real workflow — your problem, your data.
10 / Where it earns its keep
Use-case carousel →
Brainstorm
What use cases can you think of?
In your domain capture them on the board
Use cases
Three places GenAI lands
Automation
Discovery & agentic actions
Automated discovery and agent-driven automation between legacy systems.
Operations
Claim & client support
Claim management and faster, smarter client support.
Experience
Chat & assistants
Chatbots and banking assistants that meet customers in plain language.
BFH Bern University of Applied Sciences
GenAI in Finance ·
Carousel
GenAI across the finance stack
BFH Bern University of Applied Sciences
GenAI in Finance ·
10 / Make it real
Frame your use case →
Live building · workflow
Prompt to Product →
Live building · agent
Voice Bot →
11 / Heads down
Build sprint →
~75% of today · on the gamified page
Build sprint · Your brief
Four moves to a shippable workflow
01
Break into steps
Each step does exactly one job.
02
Prompt per step
Small, specific, testable.
03
Metric per step
Strict, fuzzy, or proximity.
04
Score it
Run on labelled examples. Get a number.
BFH Bern University of Applied Sciences
GenAI in Finance ·
Afternoon · keep building
Iterate the number.
Change one thing re-score · compare
12 / Show & tell
Use-case assessment →
The opportunity
644
Billion USD invested in GenAI in 2025.
Source: Gartner Report, GenAI 2024
BFH Bern University of Applied Sciences
GenAI in Finance ·
Closing & feedback
“Any sufficiently advanced technology is indistinguishable from magic.”
Arthur C. Clarke
Ouassim Fari · Accenture · Thank you