FinBERT for financial news headline sentiment (LoRA-adapted)
A three-class sentiment classifier (positive / negative / neutral) for financial news
headlines about Bitcoin and crypto, gold, and US stocks. It is
ProsusAI/finbert fine-tuned with low-rank
adapters (LoRA, rank 16) on 5,041 headlines labelled under a written rubric, with the
adapters merged back in. The model has the same size and speed as FinBERT and loads with
plain transformers; no PEFT is needed at inference.
On 826 headlines from six months after the training data (scored once), it reaches 87.0% accuracy and 0.812 macro-F1, against 50.1% and 0.436 for the original FinBERT.
The label describes the tone of the headline, not where a price will go. It is not a trading signal.
Quick start
from transformers import pipeline
clf = pipeline("text-classification", model="HuangYiYang/finbert-financial-news-sentiment", top_k=None)
clf("Bitcoin slips 6% as exchange outflows accelerate")
# [{'label': 'negative', 'score': ...}, {'label': 'neutral', ...}, {'label': 'positive', ...}]
Calibrated probabilities: the raw scores are overconfident. Divide the logits by the temperature T = 2.65 (fitted on validation data) before the softmax:
import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification
name = "HuangYiYang/finbert-financial-news-sentiment"
tok = AutoTokenizer.from_pretrained(name)
model = AutoModelForSequenceClassification.from_pretrained(name).eval()
batch = tok(["Gold hits record high as dollar weakens"], truncation=True, max_length=128,
padding=True, return_tensors="pt")
with torch.no_grad():
probs = torch.softmax(model(**batch).logits / 2.65, dim=-1)
print({model.config.id2label[i]: round(p, 3) for i, p in enumerate(probs[0].tolist())})
Labels: 0 = positive, 1 = negative, 2 = neutral (the same order as ProsusAI/finbert).
Results
Test set: 826 headlines published 1 April to 14 October 2026, after a 7-day gap following the training data. It keeps the natural class mix of the feed (74% neutral). 95% bootstrap intervals over 2,000 resamples.
| Model | Accuracy | Macro-F1 |
|---|---|---|
| Always "neutral" | 0.743 | 0.284 |
| ProsusAI/finbert (no adaptation) | 0.501 (0.467–0.534) | 0.436 (0.400–0.471) |
| This model | 0.870 (0.846–0.893) | 0.812 (0.776–0.844) |
McNemar's exact test against the original FinBERT: this model alone correct on 334 headlines, FinBERT alone on 29, p = 7.2e-67.
Per class:
| Class | Precision | Recall | F1 | Headlines |
|---|---|---|---|---|
| positive | 0.65 | 0.80 | 0.72 | 110 |
| negative | 0.79 | 0.82 | 0.81 | 102 |
| neutral | 0.94 | 0.89 | 0.91 | 614 |
Per asset:
| Asset | Headlines | Accuracy | Macro-F1 |
|---|---|---|---|
| Bitcoin | 300 | 0.860 | 0.842 |
| Gold | 226 | 0.796 | 0.774 |
| US stocks | 300 | 0.937 | 0.592 |
The US-stock macro-F1 rests on only 10 polar headlines (97% of that test set is neutral), so its interval is wide.
- Reversed polarity (positive read as negative or the reverse): 3 of 826 headlines (0.4%). Most errors are confusions with neutral.
- Calibration: temperature T = 2.65 cuts the expected calibration error from 0.113 to 0.056 on the test set.
Training
Data. English headlines from a commercial financial news feed (Benzinga articles tagged with tickers) for Bitcoin, a gold ETF and an S&P 500 ETF, January 2015 to October 2026. The archive of 263,155 stored records was deduplicated and cleaned to 103,344 unique headlines. Headline text is the property of the provider and is not redistributed.
Labels. A stratified sample of 6,820 headlines was labelled under a written rubric:
- Judge the tone for the headline's main subject, as an investor holding it would.
- Reported facts (results vs estimates, analyst upgrades/downgrades, deals, lawsuits, reported price moves) are labelled by their likely effect on price. Questions, listicles, hype and bare predictions are neutral.
- Contrast rule: with but, despite, even as, while, although, the main clause decides.
- A reported price move decides the label; scheduled notices and directionless market statistics are neutral.
- When in doubt, neutral.
Labelling used blind passes by a large language model (Claude) given only the rubric and the headline. Agreement: Cohen's κ = 0.861 (1,713 doubly labelled headlines, 93.9% raw agreement), Fleiss' κ = 0.863 (three passes on all 826 test headlines). Test labels are the majority of three passes.
Split. Strictly by time: training and validation up to 24 March 2026, a 7-day embargo, then the test period. Validation is the most recent 15% of the labelled pool for each asset.
Method.
- LoRA on the query, key, value and all dense projections of every layer; r = 16, α = 32, dropout 0.1; classification head trained in full; adapters merged after training.
- AdamW, learning rate 5e-4, weight decay 0.01, batch 32, linear schedule with 6% warm-up, gradient clipping 1.0, mixed precision, early stopping on validation macro-F1 (patience 2, up to 8 epochs). Max length 128 tokens (keeps 99.98% of headlines whole).
- Class and asset imbalance handled by a weighted sampler that draws every (asset, class) pair equally often; the loss is unweighted.
- Settings chosen among four pre-declared (rank, learning rate) pairs on validation only. Trained on one 6 GB laptop GPU (RTX 4050).
What did not help. Task-adaptive pre-training (continued masked-LM training on 91,074 unlabelled training-period headlines) cut held-out perplexity from 89.7 to 9.9 but did not raise validation macro-F1 (0.831 ± 0.014 vs 0.834 ± 0.012 without it, three seeds each), so this model is built on the original FinBERT encoder.
eval_results.json holds the full test figures.
Intended use and limitations
- Use: tagging the tone of English financial news headlines for monitoring, search, dashboards and research.
- Not for: predicting price direction, or making investment decisions on its own.
- Headlines only; long article bodies were not used in training.
- One news provider and one six-month test period; accuracy on other sources may differ.
- Labels come from a language model following a rubric, not from human experts; κ measures how consistently the rubric was applied. Macroeconomic releases reported against consensus and multi-asset market summaries were labelled less consistently.
- Positive is the weakest class (precision 0.65): about 8% of neutral headlines are read as positive.
License
CC BY-NC-SA 4.0, inherited from the base model ProsusAI/finbert: non-commercial use, with attribution, and derivatives under the same license.
Citation
If you use this model, please cite FinBERT and LoRA:
@misc{araci2019finbert,
author = {Araci, Dogu},
title = {FinBERT: Financial Sentiment Analysis with Pre-trained Language Models},
year = {2019}
}
@inproceedings{hu2022lora,
author = {Hu, Edward J. and Shen, Yelong and Wallis, Phillip and Allen-Zhu, Zeyuan and Li, Yuanzhi and Wang, Shean and Wang, Lu and Chen, Weizhu},
title = {LoRA: Low-Rank Adaptation of Large Language Models},
booktitle = {ICLR},
year = {2022}
}