Tiny Transformers for Financial Sentiment Analysis: Class Imbalance Resolution and CPU-Optimized Deployment

Authors

  • Beenish Fatima Faculty of Computer Science and Information Technology, The Superior University, Lahore, 54600, Pakistan Author
  • Fawad Nasim Faculty of Computer Science and Information Technology, The Superior University, Lahore, 54600, Pakistan. Author

DOI:

https://doi.org/10.63075/zyvhr606

Keywords:

Financial Sentiment Analysis; Tiny Transformers; Class Imbalance; CPU Deployment; Lightweight NLP; Macro F1 Optimization; Real-Time Inference; Class Weighting; Edge AI; Efficient Deep Learning

Abstract

This paper shows that small-scale Transformer models can successfully replace large-scale language models in financial sentiment analysis and break through essential barriers of class imbalances and CPU-alone deployability. With the 9.5M-parameter Tiny Transformer, we present a systematic enhancement pipeline: (E1) long training with better scheduling and (E2) class-weighted loss tuning. The baseline model obtains just 26.2% Macro-F1, which shows strong bias toward the dominant positive class (64.7% of samples). Our method improves performance to 61.6% Macro-F1—a 135% rel. Improvement—despite achieving just 11.5ms inference latency in one CPU core (613 samples/second rate). Ironically, we prove that large models (19M–35M params) become progressively less effective, and we achieve a better accuracy-per-parameter ratio with our compact model. Rigorous per-class analysis substantiates that minority sentiment detection significantly improves—from 0% to 43.5% for the negative class—without hurting the overall predictive stability. These results prove that if trained with domain-scholar techniques, small models can beat larger baselines at the cost of being deployable in resource-limited financial settings. The method we introduce is a reproducible roadmap for constructing real-time finance NLP systems running opportunistically without GPUs or clouds.

Downloads

Download data is not yet available.

Downloads

Published

2025-10-25

How to Cite

Tiny Transformers for Financial Sentiment Analysis: Class Imbalance Resolution and CPU-Optimized Deployment. (2025). Annual Methodological Archive Research Review, 3(10), 490-508. https://doi.org/10.63075/zyvhr606

Similar Articles

1-10 of 1907

You may also start an advanced similarity search for this article.