Lecture 12
Large language models in finance and prompt engineering
Prof. dr. Daniel Traian PELE
Bucharest University of Economic Studies (ASE), Department of Statistics and Econometrics
Romanian Academy, Institute for Economic Forecasting (IPE)
Text is the largest data set of a financial institution that is still read mostly by people: news, central-bank speeches, annual reports, loan files. Large language models (LLM) read text at scale, but they are also confident, expensive and easy to fool. This lecture treats an LLM as what it is, a next-token probability model, and measures every claim on labelled financial data with open models that run on a laptop.
We start from the language-model objective, tokens, perplexity and temperature, measured on 400 speeches of the European Central Bank (ECB). We then explain pre-training, instruction tuning and alignment. The core of the lecture is prompt engineering as a measurable activity: zero-shot, few-shot and chain-of-thought prompts on the Financial PhraseBank and on finance tweets, with bootstrap intervals, seeds, paraphrases, calibration and cost. We build retrieval-augmented generation (RAG) over the ECB speeches and measure hallucination, and we backtest a language model used for the Value-at-Risk (VaR), after the LLM-VaR framework of our group.