📈 Financial Sentiment — FinBERT (small vs large)

Classify financial text as positive / negative / neutral, and compare a compact model against a large one on the same data mix:

  • MiniLM 33M · 13.6 ms median after warm-up on cpu-basic (HF Jobs, 2 vCPU).
  • DeBERTa-large 435M — higher accuracy than MiniLM on all seven sets, significantly after Holm correction on three (tweets, FiQA, NOSIBLE) · 367.1 ms median after warm-up on cpu-basic (HF Jobs, 2 vCPU).

Both models are loaded and warmed in a background thread at startup. Requests that arrive during loading wait for the model.

The UI abstains below 70% top-class confidence, or when the input does not look like ordinary text, rather than force a label. English only; labels one sentence's tone — not price prediction, not investment advice.

Built from the educational from-scratch project at github.com/shaikn6/nano-finbert.

Model

MiniLM 33M (fast) · 33.4M params · 13.6 ms median after warm-up on cpu-basic (HF Jobs, 2 vCPU) · calibrated (T=0.39, fitted by NLL on the pooled validation slices (never a test or fresh set))

The four older sets are tuned. Every candidate was scored on them and they decided releases. The three fresh sets were frozen by SHA-256 before any scoring.

Run history on the three frozen sets: DeBERTa-large was scored once. MiniLM, ProsusAI/finbert and finbert-tone were scored twice with the same code: the first job finished them, was cancelled by a credit outage while scoring distilroberta-fin, and its score files never left the job; its log shows only progress lines, so no number from it was seen. All four were then scored once more in one job, and that run is the one reported.

Set Status n Accuracy [95% CI] Macro-F1 [95% CI] ECE Kept at ≥70% · accuracy of kept
PhraseBank AllAgree test tuned 340 97.94% [95.8, 99.0] 0.964 [0.935, 0.988] 0.041 98% · 98.2%
Finance tweets (validation file) tuned 2388 86.43% [85.0, 87.7] 0.830 [0.812, 0.847] 0.047 77% · 92.6%
Press-release headlines tuned 267 75.28% [69.8, 80.1] 0.590 [0.484, 0.696] 0.068 64% · 86.0%
SEntFiN news headlines tuned 933 75.99% [73.1, 78.6] 0.763 [0.735, 0.791] 0.067 75% · 82.1%
FiQA 2018 posts and headlines frozen-new 1110 61.17% [58.3, 64.0] 0.557 [0.529, 0.584] 0.152 63% · 70.4%
SemEval-2017 headlines frozen-new 234 51.28% [44.9, 57.6] 0.499 [0.439, 0.555] 0.245 62% · 59.3%
NOSIBLE news snippets (machine-labelled) frozen-new 2000 77.40% [75.5, 79.2] 0.768 [0.749, 0.787] 0.036 67% · 86.2%

All models, accuracy · macro-F1

Set MiniLM DeBERTa ProsusAI/finbert finbert-tone distilroberta-fin
PhraseBank AllAgree test 97.94% · 0.964 99.41% · 0.993 96.47% · 0.956 92.06% · 0.906 100.00% · 1.000
Finance tweets (validation file) 86.43% · 0.830 90.16% · 0.879 72.53% · 0.668 74.83% · 0.661 74.96% · 0.706
Press-release headlines 75.28% · 0.590 78.28% · 0.614 71.16% · 0.559 67.04% · 0.454 72.28% · 0.506
SEntFiN news headlines 75.99% · 0.763 79.74% · 0.803 71.49% · 0.718 70.85% · 0.711 75.03% · 0.752
FiQA 2018 posts and headlines 61.17% · 0.557 67.84% · 0.620 49.55% · 0.476 39.19% · 0.394 54.05% · 0.506
SemEval-2017 headlines 51.28% · 0.499 52.56% · 0.514 59.40% · 0.543 42.74% · 0.430 57.69% · 0.551
NOSIBLE news snippets (machine-labelled) 77.40% · 0.768 80.50% · 0.801 74.25% · 0.744 69.55% · 0.683 74.70% · 0.739
Paired tests against the chosen model
Set Other model Accuracy difference, points [paired 95% CI] Only chosen right · only other right Exact McNemar p (unadjusted) Holm-adjusted p (70 tests)
PhraseBank AllAgree test DeBERTa-large 435M -1.5 [-3.2, +0.0] 2 · 7 p=0.18 1
PhraseBank AllAgree test ProsusAI/finbert +1.5 [-0.3, +3.5] 8 · 3 p=0.23 1
PhraseBank AllAgree test finbert-tone +5.9 [+2.9, +8.8] 25 · 5 p<0.001 0.014
PhraseBank AllAgree test distilroberta-fin -2.1 [-3.5, -0.6] 0 · 7 p=0.016 0.36
Finance tweets (validation file) DeBERTa-large 435M -3.7 [-5.1, -2.5] 89 · 178 p<0.001 <0.001
Finance tweets (validation file) ProsusAI/finbert +13.9 [+12.1, +15.7] 427 · 95 p<0.001 <0.001
Finance tweets (validation file) finbert-tone +11.6 [+9.8, +13.4] 410 · 133 p<0.001 <0.001
Finance tweets (validation file) distilroberta-fin +11.5 [+9.8, +13.2] 368 · 94 p<0.001 <0.001
Press-release headlines DeBERTa-large 435M -3.0 [-8.2, +2.2] 21 · 29 p=0.32 1
Press-release headlines ProsusAI/finbert +4.1 [-0.4, +8.6] 27 · 16 p=0.13 1
Press-release headlines finbert-tone +8.2 [+2.6, +14.2] 44 · 22 p=0.0092 0.28
Press-release headlines distilroberta-fin +3.0 [-2.2, +8.2] 30 · 22 p=0.33 1
SEntFiN news headlines DeBERTa-large 435M -3.8 [-6.2, -1.3] 60 · 95 p=0.0061 0.19
SEntFiN news headlines ProsusAI/finbert +4.5 [+1.8, +7.2] 101 · 59 p=0.0011 0.043
SEntFiN news headlines finbert-tone +5.1 [+2.3, +8.3] 133 · 85 p=0.0014 0.05
SEntFiN news headlines distilroberta-fin +1.0 [-1.4, +3.4] 73 · 64 p=0.49 1
FiQA 2018 posts and headlines DeBERTa-large 435M -6.7 [-9.4, -4.3] 76 · 150 p<0.001 <0.001
FiQA 2018 posts and headlines ProsusAI/finbert +11.6 [+8.6, +14.4] 207 · 78 p<0.001 <0.001
FiQA 2018 posts and headlines finbert-tone +22.0 [+19.2, +24.9] 285 · 41 p<0.001 <0.001
FiQA 2018 posts and headlines distilroberta-fin +7.1 [+4.2, +9.7] 168 · 89 p<0.001 <0.001
SemEval-2017 headlines DeBERTa-large 435M -1.3 [-6.4, +3.8] 16 · 19 p=0.74 1
SemEval-2017 headlines ProsusAI/finbert -8.1 [-14.1, -2.1] 16 · 35 p=0.011 0.31
SemEval-2017 headlines finbert-tone +8.5 [+2.1, +15.0] 41 · 21 p=0.015 0.36
SemEval-2017 headlines distilroberta-fin -6.4 [-12.0, -0.8] 17 · 32 p=0.044 0.75
NOSIBLE news snippets (machine-labelled) DeBERTa-large 435M -3.1 [-4.8, -1.3] 122 · 184 p<0.001 0.019
NOSIBLE news snippets (machine-labelled) ProsusAI/finbert +3.1 [+1.3, +4.9] 216 · 153 p=0.0012 0.045
NOSIBLE news snippets (machine-labelled) finbert-tone +7.9 [+5.8, +9.9] 310 · 153 p<0.001 <0.001
NOSIBLE news snippets (machine-labelled) distilroberta-fin +2.7 [+1.0, +4.4] 186 · 132 p=0.0029 0.096

ProsusAI/finbert and mrm8488/distilroberta-finetuned-financial-news-sentiment-analysis were fine-tuned on Financial PhraseBank. Both likely saw PhraseBank test sentences, so their PhraseBank rows are optimistic. yiyanghkust/finbert-tone was fine-tuned on 10,000 analyst-report sentences, with no known overlap. None of the five models is known to have trained on FiQA, SemEval-2017 or NOSIBLE. Fresh sets were text-checked against the app models' training data only. NOSIBLE labels are machine-made by a multi-stage LLM pipeline per its dataset card. FiQA and SemEval labels use continuous scores cut at −0.1 and 0.1.

Official benchmark split

FLARE FiQA-SA test split, n=235 (negative 76, neutral 18, positive 141); labels are the split's own. Every row is a sentence of the frozen FiQA set, so these numbers reuse its stored scores (no new model run); it is a re-slice of that already scored set, not new held-out data. The split's label differs from the FiQA set's label on 3 rows.

Model Accuracy [95% CI] Macro-F1 Weighted F1
MiniLM 33M 59.15% [52.8, 65.2] 0.536 0.660
DeBERTa-large 435M 65.96% [59.7, 71.7] 0.605 0.728
ProsusAI/finbert 55.74% [49.4, 62.0] 0.530 0.640
finbert-tone 39.57% [33.5, 45.9] 0.382 0.491
distilroberta-fin 52.34% [46.0, 58.6] 0.495 0.596

Previous temperature 0.307 was fitted on half of the tweet test file; it is replaced by T=0.39 fitted on validation slices only (old numbers in the README).

Examples