JakobFehle/Fine-Tuning-LLMs-for-ABSA

Jupyter Notebook

4

29 commits

updated Jun 21, 2026

See the code

README

Leveraging Fine-Tuning of Large Language Models for Aspect-Based Sentiment Analysis in Resource-Scarce Environments

Overview

This repository contains the code and evaluation scripts for our study on fine-tuning open-source Large Language Models (LLMs) for Aspect-Based Sentiment Analysis (ABSA). Our research investigates the performance of fine-tuned LLMs compared to state-of-the-art (SOTA) methods on English and German datasets, particularly in resource-scarce scenarios.

Key Findings

  • Fine-tuned LLMs outperform current SOTA methods in data-scarce scenarios, especially for complex ABSA tasks.

  • Performance remains stable even with reduced dataset sizes (as low as 500 or 1,000 samples).

  • Few-shot prompting shows promising results, though fine-tuned LLMs typically achieve better results and are more efficient.

  • Concise prompts are generally sufficient when combined with well-optimized hyperparameters.

  • An ablation study with multiple languages, domains and pre-trained LLMs confirm that performance gains extend beyond the initial setting, supporting the robustness of fine-tuned LLMs.

  • New SOTA F1 scores:

    ACSA (82.48) and E2E (81.77) on the Rest-16 dataset

    ACSA (85.45) and TASD (75.13) on the GERestaurant dataset

Tasks and Methodology

We evaluate our fine-tuned LLMs on four commonly-used ABSA subtasks: Aspect Category Detection (ACD), Aspect Category Sentiment Analysis (ACSA), End-To-End ABSA (E2E), and Target Aspect Sentiment Detection (TASD). Our approach involves instruction fine-tuning LLaMA-3-8B using Quantized Low-Rank Adaptation (QLoRA) to efficiently adapt the model to ABSA tasks. We conduct experiments with varying dataset sizes (500, 1,000, and full dataset) to assess performance under resource constraints. Additionally, we explore the impact of different prompt formulations and hyperparameter tuning. To assess generalizability, we conduct an ablation study across multiple languages, domains, and LLM architectures.

Datasets

We use the following datasets in our evaluation:

Repository Structure

πŸ“‚ root/
β”œβ”€β”€ πŸ“‚ data/              # Preprocessed datasets
β”œβ”€β”€ πŸ“‚ src/               # Code for our instruction fine-tuned LLM approach
β”œβ”€β”€ πŸ“‚ baselines/         # Code for our baseline approaches, scripts for execution as well as files for setup and dataset-preparation
β”œβ”€β”€ πŸ“‚ scripts/           # Script files for running the evaluation of our approach, Jupyter-Notebooks for analysis of the results
β”œβ”€β”€ πŸ“‚ results/           # In-depth results and condition parameters for each evaluation run 

Running the Code (Tested on Python v3.10)

  1. Execute the setup.sh file of the approach to install all required packages (e. g. /scripts/setup.sh or /baselines/mvp/setup.sh).
  2. Run the run_APPROACH[_PHASE].py file of the approach to execute the training and evaluation (e. g. /scripts/run_train_LLM_HT.py.

Citation

If you use our work, please cite:

@ARTICLE{Fehle2026-ws,
  title        = {{Leveraging fine-tuning of large language models for
                  aspect-based sentiment analysis in resource-scarce
                  environments}},
  author       = {Fehle, Jakob and Kruschwitz, Udo and Hellwig, Nils Constantin
                  and Wolff, Christian},
  journaltitle = {Knowledge-Based Systems},
  publisher    = {Elsevier BV},
  volume       = {336},
  issue        = {115277},
  pages        = {115277},
  date         = {2026}
}

JakobFehle/Fine-Tuning-LLMs-for-ABSA

Jupyter Notebook

4

29 commits

updated Jun 21, 2026

See the code

README

Leveraging Fine-Tuning of Large Language Models for Aspect-Based Sentiment Analysis in Resource-Scarce Environments

Overview

This repository contains the code and evaluation scripts for our study on fine-tuning open-source Large Language Models (LLMs) for Aspect-Based Sentiment Analysis (ABSA). Our research investigates the performance of fine-tuned LLMs compared to state-of-the-art (SOTA) methods on English and German datasets, particularly in resource-scarce scenarios.

Key Findings

  • Fine-tuned LLMs outperform current SOTA methods in data-scarce scenarios, especially for complex ABSA tasks.

  • Performance remains stable even with reduced dataset sizes (as low as 500 or 1,000 samples).

  • Few-shot prompting shows promising results, though fine-tuned LLMs typically achieve better results and are more efficient.

  • Concise prompts are generally sufficient when combined with well-optimized hyperparameters.

  • An ablation study with multiple languages, domains and pre-trained LLMs confirm that performance gains extend beyond the initial setting, supporting the robustness of fine-tuned LLMs.

  • New SOTA F1 scores:

    ACSA (82.48) and E2E (81.77) on the Rest-16 dataset

    ACSA (85.45) and TASD (75.13) on the GERestaurant dataset

Tasks and Methodology

We evaluate our fine-tuned LLMs on four commonly-used ABSA subtasks: Aspect Category Detection (ACD), Aspect Category Sentiment Analysis (ACSA), End-To-End ABSA (E2E), and Target Aspect Sentiment Detection (TASD). Our approach involves instruction fine-tuning LLaMA-3-8B using Quantized Low-Rank Adaptation (QLoRA) to efficiently adapt the model to ABSA tasks. We conduct experiments with varying dataset sizes (500, 1,000, and full dataset) to assess performance under resource constraints. Additionally, we explore the impact of different prompt formulations and hyperparameter tuning. To assess generalizability, we conduct an ablation study across multiple languages, domains, and LLM architectures.

Datasets

We use the following datasets in our evaluation:

Repository Structure

πŸ“‚ root/
β”œβ”€β”€ πŸ“‚ data/              # Preprocessed datasets
β”œβ”€β”€ πŸ“‚ src/               # Code for our instruction fine-tuned LLM approach
β”œβ”€β”€ πŸ“‚ baselines/         # Code for our baseline approaches, scripts for execution as well as files for setup and dataset-preparation
β”œβ”€β”€ πŸ“‚ scripts/           # Script files for running the evaluation of our approach, Jupyter-Notebooks for analysis of the results
β”œβ”€β”€ πŸ“‚ results/           # In-depth results and condition parameters for each evaluation run 

Running the Code (Tested on Python v3.10)

  1. Execute the setup.sh file of the approach to install all required packages (e. g. /scripts/setup.sh or /baselines/mvp/setup.sh).
  2. Run the run_APPROACH[_PHASE].py file of the approach to execute the training and evaluation (e. g. /scripts/run_train_LLM_HT.py.

Citation

If you use our work, please cite:

@ARTICLE{Fehle2026-ws,
  title        = {{Leveraging fine-tuning of large language models for
                  aspect-based sentiment analysis in resource-scarce
                  environments}},
  author       = {Fehle, Jakob and Kruschwitz, Udo and Hellwig, Nils Constantin
                  and Wolff, Christian},
  journaltitle = {Knowledge-Based Systems},
  publisher    = {Elsevier BV},
  volume       = {336},
  issue        = {115277},
  pages        = {115277},
  date         = {2026}
}