Thanos Konstantinidis, Giorgos Iacovides, Mingxue Xu, Tony G. Constantinides, Danilo Mandic
{"title":"FinLlama: Financial Sentiment Classification for Algorithmic Trading Applications","authors":"Thanos Konstantinidis, Giorgos Iacovides, Mingxue Xu, Tony G. Constantinides, Danilo Mandic","doi":"arxiv-2403.12285","DOIUrl":null,"url":null,"abstract":"There are multiple sources of financial news online which influence market\nmovements and trader's decisions. This highlights the need for accurate\nsentiment analysis, in addition to having appropriate algorithmic trading\ntechniques, to arrive at better informed trading decisions. Standard lexicon\nbased sentiment approaches have demonstrated their power in aiding financial\ndecisions. However, they are known to suffer from issues related to context\nsensitivity and word ordering. Large Language Models (LLMs) can also be used in\nthis context, but they are not finance-specific and tend to require significant\ncomputational resources. To facilitate a finance specific LLM framework, we\nintroduce a novel approach based on the Llama 2 7B foundational model, in order\nto benefit from its generative nature and comprehensive language manipulation.\nThis is achieved by fine-tuning the Llama2 7B model on a small portion of\nsupervised financial sentiment analysis data, so as to jointly handle the\ncomplexities of financial lexicon and context, and further equipping it with a\nneural network based decision mechanism. Such a generator-classifier scheme,\nreferred to as FinLlama, is trained not only to classify the sentiment valence\nbut also quantify its strength, thus offering traders a nuanced insight into\nfinancial news articles. Complementing this, the implementation of\nparameter-efficient fine-tuning through LoRA optimises trainable parameters,\nthus minimising computational and memory requirements, without sacrificing\naccuracy. Simulation results demonstrate the ability of the proposed FinLlama\nto provide a framework for enhanced portfolio management decisions and\nincreased market returns. These results underpin the ability of FinLlama to\nconstruct high-return portfolios which exhibit enhanced resilience, even during\nvolatile periods and unpredictable market events.","PeriodicalId":501478,"journal":{"name":"arXiv - QuantFin - Trading and Market Microstructure","volume":"122 1","pages":""},"PeriodicalIF":0.0000,"publicationDate":"2024-03-18","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"arXiv - QuantFin - Trading and Market Microstructure","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/arxiv-2403.12285","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0
Abstract
There are multiple sources of financial news online which influence market
movements and trader's decisions. This highlights the need for accurate
sentiment analysis, in addition to having appropriate algorithmic trading
techniques, to arrive at better informed trading decisions. Standard lexicon
based sentiment approaches have demonstrated their power in aiding financial
decisions. However, they are known to suffer from issues related to context
sensitivity and word ordering. Large Language Models (LLMs) can also be used in
this context, but they are not finance-specific and tend to require significant
computational resources. To facilitate a finance specific LLM framework, we
introduce a novel approach based on the Llama 2 7B foundational model, in order
to benefit from its generative nature and comprehensive language manipulation.
This is achieved by fine-tuning the Llama2 7B model on a small portion of
supervised financial sentiment analysis data, so as to jointly handle the
complexities of financial lexicon and context, and further equipping it with a
neural network based decision mechanism. Such a generator-classifier scheme,
referred to as FinLlama, is trained not only to classify the sentiment valence
but also quantify its strength, thus offering traders a nuanced insight into
financial news articles. Complementing this, the implementation of
parameter-efficient fine-tuning through LoRA optimises trainable parameters,
thus minimising computational and memory requirements, without sacrificing
accuracy. Simulation results demonstrate the ability of the proposed FinLlama
to provide a framework for enhanced portfolio management decisions and
increased market returns. These results underpin the ability of FinLlama to
construct high-return portfolios which exhibit enhanced resilience, even during
volatile periods and unpredictable market events.