## 3 Proposed Method  
The proposed LFEAR architecture, illustrated in Figure 1, is an open-source model specifically developed for sentiment analysis with an emphasis on domain adaptation, for instance, for the sentiment analysis of financial reviews from Hellopeter. All these features are incorporated in a four-tiered system where RAG, conversational fine-tuning, and continuous learning are employed as cutting-edge technologies. The input layer handles a variety of data formats, while the preprocessing layer prepares data through cleaning, embedding, and feature selection. The adaptable behavioural layer, which is the core of the proposed architecture, combines RAG and fine-tuned LLMs such as Llama-2, Llama-3, GPT-3.5 Turbo, and GPT-4o Mini to improve contextual relevance. Finally, the model inference interface generates sentiment analysis findings and strategic insights, making this architecture resilient and adaptable to a variety of datasets and user requirements.  
\begin{table}
\begin{tabular}{c c c c c c} \hline
**Reference** & **Embedding** & **Tasks** & **Method** & **Metric** & **Dataset** \\ \hline
[90] & LLMs, Privacy & GPT-4, BERT & Privacy-Preserving & Accuracy, F1 Score & Sensitive datasets \\ \hline
[91] & LLMs, Healthcare & GPT-4, MedGPT & Medical Diagnosis & Accuracy, Recall & Medical records \\ \hline
[92] & User Behavior, AI & \
\begin{tabular}{c} User Model, AI \\ Systems \\ \end{tabular} & User Study &
\begin{tabular}{c} User Satisfaction, \\ Accuracy \\ \end{tabular} & User data \\ \hline
[93] & Sentiment Analysis & \
\begin{tabular}{c} SVM, Neural \\ Networks \\ \end{tabular} & Comparative Study &
\begin{tabular}{c} Accuracy, Precision, \\ Recall \\ \end{tabular} & Movie reviews \\ \hline
[94] & Edge Computing, AI & Edge AI Models & Edge Computing & Latency, Accuracy & IoT datasets \\ \hline
**Proposed Method** & **LLMs, Conversational Fine-Tuning, RAG** & \
\begin{tabular}{c} **Llama-2, Llama-3**, \\ **GPT-3.5 Turbo,** \\ **GPT-4o-Mini** \\ \end{tabular} &
\begin{tabular}{c} **Sentiment Analysis** \\ **S  
To thoroughly verify the proposed LFEAR model, we derive a fundamental mathematical equation that represents the model's essential elements: data ingestion, retrieval-augmented generation, fine-tuning, inference, and ensemble voting. This equation unifies the architectural parts of the model, showing how it generates and combines predictions. Let:  
* \(\mathcal{D}_{\text{input}}\): Initial input data, including prompts and queries, ingested from both Hel-lopeter and cross-domain datasets.
* \(V\): The vector database containing embeddings generated from the input data.
* \(\text{RAG}(\cdot)\): Function that produces a context-aware representation by retrieving relevant embeddings from \(V\).
* \(\mathcal{M}_{i}\): Each individual model within the ensemble, where \(i=1,2,\ldots,N\) (models such as Llama-2, Llama-3, GPT-3.5 Turbo, etc.).
* \(w_{i}\): Weight for model \(\mathcal{M}_{i}\), optimised based on its cross-domain performance.
* \(f_{i}(r)\): Sentiment output (positive or negative) from model \(\mathcal{M}_{i}\) for review \(r\).
* \(S(r)\): The aggregated sentiment score derived from ensemble predictions. The overall sentiment prediction for the LFEAR model is then defined as \[S(r)=\arg\max_{s\in\{\text{positive},\text{negative}\}}\sum_{i=1}^{N}w_{i}\cdot \delta\big{(}f_{i}(\text{RAG}(\mathcal{D}_{\text{input}}))=s\big{)}\] (1) where \(S(r)\) is the final sentiment label for a given review \(r\).
* \(\delta(\cdot)\) is an indicator function that returns 1 if the condition inside is true (i.e., if the model \(\mathcal{M}_{i}\) predicts sentiment \(s\) after being fine-tuned on context from RAG), and 0 otherwise.
* The RAG component \(\text{RAG}(\mathcal{D}_{\text{input}})\) serves as the contextualised input for each model in the ensemble, enhancing relevance and accuracy.  
This equation combines the output from each model in the ensemble, weighted by its relevance and accuracy, to produce a robust final sentiment classification \(S(r)\).