# BloombergGPT: A Large Language Model for Finance

BloombergGPT trains a large language model on financial and general text

Shijie Wu, Ozan Irsoy, Steven Lu, Vadim Dabravolski, Mark Dredze, Sebastian Gehrmann and 3 more · arXiv · 2023-3-30

- **Problem** No LLM had been built for finance, since general models cover many topics and domains. Financial NLP has its own terminology and task conventions.
- **Method** BloombergGPT is a 50 billion parameter model trained on 363 billion financial tokens and 345 billion general tokens.
- **Results** BloombergGPT reaches 62.51 on the All Tasks financial average, against 51.90 to 54.35 for three compared models.

## Why a finance-specific LLM

Most LLM work has concentrated on general models trained on text spanning many topics and domains. The domain-specific models that exist were trained only on narrow sources, or were adapted from a very large general model, so a model built for finance has been missing.

Financial NLP covers sentiment analysis, named entity recognition, news classification and question answering, which look like general NLP tasks. The authors argue that the complexity and terminology of finance justify a domain-specific system, and that a generative LLM for finance would be useful for few-shot learning, text generation and conversational use.

Bloomberg supports many tasks that a general model handles well, but most of its applications sit in the financial domain. The goal is therefore a model that reaches top results on financial benchmarks while staying competitive on general-purpose LLM benchmarks.

## Mixing financial and general training data

Public datasets that are widely used for LLM training are added to FinPile to make the corpus roughly half domain-specific and half general-purpose.

The financial portion holds 363 billion tokens and the general-purpose portion holds 345 billion tokens, from a corpus of over 700 billion tokens. Training uses 569 billion tokens from this corpus, so the run does not consume all of it.

Within the financial portion, Web is the largest source at 298B tokens, or 42.01% of training, while News, Filings, Press and Bloomberg data make up the remainder. Among public sources, The Pile contributes 184B tokens and C4 contributes 138B tokens. Each dataset is de-duplicated before training, which changes the statistics in Table 1 from those in other papers.

## Building the Unigram vocabulary

Each of the 22 domains in The Pile is split into 256 chunks of roughly equal size, giving 5,632 chunks, and a Unigram tokenizer with a vocabulary of 65,536 is trained on each chunk. The tokenizers are then merged hierarchically, first within each domain and then across the 22 domains.

Each Unigram tokenizer is a probability distribution over tokens, so merging takes a weighted average of corresponding token probabilities, with weights set by the byte sizes of the data each tokenizer was trained on. The merged vocabulary of 7 million tokens is cut down by dropping the least probable tokens and renormalizing. All 36 byte values missing from The Pile are added as tokens, along with an end-of-text token, so no out-of-vocabulary token is needed.

The vocabulary size is chosen by testing sizes from 25,000 to 550,000 on C4 and picking the one with the smallest encoded size, where each token costs log2 of the vocabulary size in bits.

## Decoder-only architecture

The model is a decoder-only causal language model based on BLOOM, with 70 transformer decoder layers.

The feed-forward network uses GELU as its non-linearity. ALiBi adds additive biases inside self-attention to encode positions, and the input embeddings are tied to the output linear mapping before the softmax. An extra layer normalization is placed after the token embeddings, so the first block contains two consecutive layer normalizations.

The shape uses 40 attention heads with a hidden dimension of 7,680, and the resulting model has 50.6B parameters. Because ALiBi is used, the trained model can be run on sequences longer than the 2,048-token training length at inference time.

## Sizing the model under a compute budget

The compute budget is 1.3M GPU hours on 40GB A100 GPUs. Activation checkpointing adds about 0.33x TFLOPs per iteration through repeated forward passes, so the Chinchilla equations are evaluated with 0.75 times 1.3M GPU hours rather than the full amount.

The authors fit regression lines to the Approach 1 and Approach 2 data from Hoffmann et al. in log-scaled form.

The scaling law itself is tokenizer-specific, and how it transfers to a different vocabulary size is left to future work.

## Training setup and optimization

Training is a left-to-right causal language modeling objective on sequences of 2,048 tokens. Documents are concatenated with an end-of-text separator and the stream is cut into 2,048-token chunks, so one sequence can contain documents from several domains.

The optimizer is AdamW with β1 of 0.9, β2 of 0.95 and weight decay of 0.1.

The batch starts at 1,024 sequences (2.1M tokens) for the first 7,200 steps and then moves to 2,048 sequences (4.2M tokens). Dropout is set to 0.0 in the initial run, and gradient clipping is 0.3 with 64 × 8 A100 40GB hardware at 32.5 seconds per step.

## Few-shot evaluation protocol

Evaluation covers finance-specific tasks and general-purpose tasks, the latter grouped into Big-bench Hard, knowledge assessments, reading comprehension and linguistic tasks.

Every task is run with standard prompting, without parameter changes, task descriptions or chain-of-thought prompting, so the models share one setup. For candidate-label tasks, the best of regular, calibration and normalization likelihood classification is reported per model and task, and other tasks use greedy decoding. Test sets are used where labels are public, otherwise dev sets, and a 20% test split is created when no official split exists, with few-shot examples drawn from the training data.

## Heldout loss on FinPile text

Bits per byte is measured on a heldout set drawn from all sections of FinPile, selected to lie later in time than the training data and de-duplicated against it.

BloombergGPT has the lowest bits per byte across the heldout categories shown in Figure 3, including Overall, Bloomberg, Filings, Newswires, Press and Web. The gap is largest for Filings, which the authors attribute to these PDF documents not being part of existing public datasets.

The heldout result is a sanity check on in-domain fit, and it does not by itself say how the model performs on downstream tasks.

## Financial task results

The public tasks are FPB, FiQA SA, Headline, ConvFinQA and NER, with FPB and FiQA SA scored by weighted F1 in a 5-shot setup and Headline using 5 shots with average weighted F1. The Bloomberg-internal sentiment and NER sets are included to test the model on the tasks the company cares about.

Its All Tasks win rate is 0.93, compared with 0.27, 0.33 and 0.47 for the other three models.

On ConvFinQA it scores 43.41, against 30.06, 27.88 and 36.31, and on Headline it scores 82.20, against 73.22, 79.41 and 76.51.

The NER scores were obtained after dropping sentences without entities and the MISC tags, which makes them a narrower measure than the full CoNLL-style labels.

## Qualitative examples

In a few-shot setting with three examples, the model turns natural-language requests into Bloomberg Query Language, such as getting the price and market cap for a company's ticker. The examples show that the model uses its knowledge of stock tickers and financial terms to produce valid queries.

For headline suggestions, a three-shot setting produces short headlines from news passages, which the authors present as a way to help with newsletter editing.

In the CEO recall test, run with 10 shots and up to three sampled answers, BloombergGPT returns the correct CEO in the shown examples, such as Jane Fraser for Citigroup, where GPT-NeoX and FLAN-T5-XXL do not. The authors report that they found no example where another model solved a case that BloombergGPT did not, but the model still makes mistakes on this task.

## Limitations

Financial comparisons are restricted to LLMs, because numbers for non-LLM custom models were omitted due to differences in evaluation setup. Only three open models are compared in depth, and BLOOM 176B is much larger and multilingual, while the LLaMA model was released too late for evaluation.

GPT-3 results are reported only where they were externally available, and the models with compute figures are not identical in training data, since BLOOM is only one third English and OPT repeated some training data. The model does not solve CEO recall perfectly, and the authors note that the CEO shown for Citigroup has changed since 2021.

The scaling laws used are tokenizer-specific, and the model is data-limited, so its token count is below the Chinchilla-optimal value. The ranking of factors behind the results is the authors' own attribution.

## Paper info

- **Authors**: Shijie Wu, Ozan Irsoy, Steven Lu, Vadim Dabravolski, Mark Dredze, Sebastian Gehrmann, Prabhanjan Kambadur, David Rosenberg, Gideon Mann
- **Venue**: arXiv · Preprint
- **First published**: 2023-3-30
- **Added**: 2026-11-12
- **Updated**: 2023-12-21
- **Version**: v3
- **arXiv**: 2303.17564
- **Category**: cs.LG · cs.AI · cs.CL · q-fin.GN
- **Original paper terms**: [arXiv non-exclusive 1.0](https://arxiv.org/licenses/nonexclusive-distrib/1.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/2303.17564v3) · [PDF ↗](https://arxiv.org/pdf/2303.17564v3)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Quote from the paper

Shijie Wu, Ozan Irsoy, Steven Lu, Vadim Dabravolski, Mark Dredze, Sebastian Gehrmann, Prabhanjan Kambadur, David Rosenberg, Gideon Mann (2023). BloombergGPT: A Large Language Model for Finance. arXiv:2303.17564v3. https://arxiv.org/abs/2303.17564v3

**BibTeX**

```
@misc{wu2023bloomberggpt,
  title = {{BloombergGPT: A Large Language Model for Finance}},
  author = {Shijie Wu and Ozan Irsoy and Steven Lu and Vadim Dabravolski and Mark Dredze and Sebastian Gehrmann and Prabhanjan Kambadur and David Rosenberg and Gideon Mann},
  year = {2023},
  eprint = {2303.17564},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2303.17564v3}
}
```

## Other paper commentary

- [Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection](https://refivu.com/en/papers/8c7ef054-dbb9-4dbc-aa5f-7f764d2b0d6b-not-what-you-ve-signed-up-for-compromising.md)
- [Making Pre-trained Language Models Better Few-shot Learners](https://refivu.com/en/papers/58cbc07a-35f5-4401-ada0-4d09082241d1-making-pre-trained-language-models-better-few-shot.md)
- [Evaluating Object Hallucination in Large Vision-Language Models](https://refivu.com/en/papers/994f787c-7b50-4945-8065-0d6a2ea146e6-evaluating-object-hallucination-in-large-vision-language.md)
- [Instruction-Following Evaluation for Large Language Models](https://refivu.com/en/papers/87d7b3e4-5def-4a0c-ac6d-4f0204c38402-instruction-following-evaluation-for-large-language-models.md)
- [Large Language Models: A Survey](https://refivu.com/en/papers/d8a3f692-1bfe-4a26-b530-c20397434b3c-large-language-models-a-survey.md)
- [What Does BERT Look At? An Analysis of BERT's Attention](https://refivu.com/en/papers/8f682775-2bc4-4c36-a7e8-6afc56d2aeae-what-does-bert-look-at-an-analysis-of.md)
- [Exploiting Unintended Feature Leakage in Collaborative Learning](https://refivu.com/en/papers/422f8c4a-b03f-4b77-a90a-48be0d614527-exploiting-unintended-feature-leakage-in-collaborative.md)
- [Learning from Simulated and Unsupervised Images through Adversarial Training](https://refivu.com/en/papers/932cb1b6-f4a0-43ce-8dda-320fa18f82a5-learning-from-simulated-and-unsupervised-images-through.md)
- [Libra R-CNN: Towards Balanced Learning for Object Detection](https://refivu.com/en/papers/c37a17a8-6ca9-466b-8cf2-8b63070f36bc-libra-r-cnn-towards-balanced-learning-for-object.md)
- [Continual Learning Through Synaptic Intelligence](https://refivu.com/en/papers/443ed68e-4775-416a-b80f-35ef15c63f40-continual-learning-through-synaptic-intelligence.md)
- [BiSeNet V2: Bilateral Network with Guided Aggregation for Real-time Semantic Segmentation](https://refivu.com/en/papers/fe62be3d-2187-471e-93af-db527c65a4a6-bisenet-v2-bilateral-network-with-guided-aggregation-for.md)

## Terms in this paper

- [GPT-3](https://refivu.com/en/terms/d95e818ac9ce-gpt-3)
- [C4](https://refivu.com/en/terms/87725552ed79-c4)
- [win rate](https://refivu.com/en/terms/14de48f4526a-win-rate)
- [few-shot prompting](https://refivu.com/en/terms/92ad53fb3cd1-few-shot-prompting)
- [GELU](https://refivu.com/en/terms/8897c492bcfe-gelu)
- [bits per byte](https://refivu.com/en/terms/3092bcd2a2f1-bits-per-byte)
- [The Pile](https://refivu.com/en/terms/fd2fd47693ec-the-pile)
- [ALiBi](https://refivu.com/en/terms/39fd00702695-alibi)
- [Big-bench Hard](https://refivu.com/en/terms/b9192cc54214-big-bench-hard)
- [FLAN-T5-XXL](https://refivu.com/en/terms/573bf1a6cd4b-flan-t5-xxl)
- [weighted F1](https://refivu.com/en/terms/dd4e89ccfc08-weighted-f1)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/2dae70a1-3c88-432c-b934-14abfe8cc431-bloomberggpt-a-large-language-model-for-finance)
