Dynamic Adaptive Rank Space Exploration for Efficient Sentiment Analysis with Large Language Models

Hongcheng Ding, Fuzhen Hu, Xuanze Zhao, Zixiao Jiang, Shamsul Nahar Abdullah, Deshinta Arrova DewiarXiv 2024 · DOI

Abstract

Low-Rank Adaptation (LoRA) is a widely used technique for parameter-efficient fine-tuning of Large Language Models (LLMs). However, the common practice of applying uniform ranks across all layers often leads to suboptimal performance and inefficient parameter use. This paper introduces Dynamic Adaptive Rank Space Exploration (DARSE), a framework that treats rank allocation as an optimization problem. Using a two-stage greedy search, DARSE identifies critical layers for specific tasks, such as financial sentiment analysis. Experimental results on a RoBERTa-Large backbone demonstrate that DARSE achieves a 15.1% improvement in Mean Squared Error and a 4.3% boost in accuracy over uniform rank baselines, while maintaining high computational efficiency.

Introduction

Fine-tuning LLMs for domain-specific tasks, such as financial sentiment analysis, is computationally intensive. Parameter-Efficient Fine-Tuning (PEFT) methods like LoRA mitigate these costs by injecting small, trainable matrices into the model. Despite its popularity, standard LoRA typically assigns the same rank ($r$) to every layer. This "one-size-fits-all" approach ignores the hierarchical nature of transformer models, where different layers capture varying levels of linguistic abstraction. DARSE addresses this by dynamically allocating parameters to the most "important" layers based on task requirements.

The DARSE Framework

The DARSE framework automates the search for the optimal rank configuration through a structured, coarse-to-fine optimization process. It consists of three primary phases:

  1. Coarse-Grained Greedy Search: The algorithm explores the rank space in large increments (e.g., multiples of 128) to identify high-performing regions within the model's layer groups.
  2. Fine-Grained Exploration: Promising configurations are refined using smaller increments, ensuring the model is not over-parameterized in layers where lower ranks suffice.
  3. Dynamic Rank Allocation: During training, the framework monitors the importance of weight matrices using Singular Value Decomposition (SVD), allowing for final adjustments to the rank distribution.
The DARSE framework workflow, illustrating the iterative search and update process for rank optimization.

Multi-task Learning Architecture

To enhance sentiment analysis performance, the researchers implemented a multi-task learning objective. Instead of only predicting a continuous sentiment score (regression), the model simultaneously learns to categorize text into five discrete sentiment classes. This dual objective helps the model capture both the intensity and the category of the emotion, which is particularly useful in the nuanced context of financial news.

The architecture utilizes a RoBERTa-Large backbone. The output from the final transformer encoder block is fed into a specialized Task Module. The regression head utilizes linear layers and a sigmoid activation function to produce MSE-optimized scores, while the classification head employs cross-entropy loss to refine sentiment categorization.

Architectural overview of the multi-task learning module, showing the integration of regression and classification heads with the RoBERTa-Large backbone.

Key Results and Insights

The framework was evaluated on a financial sentiment dataset of 22,341 text samples, with labels generated and explained by ChatGPT-4.0. Compared to a baseline LoRA configuration with a uniform rank of 8, the DARSE-optimized model achieved:

  • MSE Improvement: Reduced from 0.0224 to 0.0186 (a 15.1% drop in error).
  • Accuracy Boost: A 4.3% increase in classification accuracy.
  • Efficiency: The best-performing configuration increased GPU memory usage by only 2.1% compared to the simplest baseline.

An essential finding was the "Middle Layer" Importance: ablation studies showed that configurations allocating higher ranks (e.g., $r=512$) to middle layers consistently outperformed those with uniform distributions. This suggests that middle layers play a critical role in capturing the complex semantic patterns necessary for domain-specific sentiment analysis.

Conclusion

DARSE demonstrates that intelligent, non-uniform rank allocation significantly improves the efficiency and performance of LLM fine-tuning. By automating the search for optimal rank configurations, DARSE provides a scalable solution for adapting large models to specialized tasks without the prohibitive costs of manual hyperparameter tuning. Future work will explore real-time rank adaptation and the application of DARSE to other specialized domains such as legal and medical NLP.

Summary updated

BibTeX
@misc{ding2024dynamic,
  author = {Hongcheng Ding and Fuzhen Hu and Xuanze Zhao and Zixiao Jiang and Shamsul Nahar Abdullah and Deshinta Arrova Dewi},
  title = {{Dynamic Adaptive Rank Space Exploration for Efficient Sentiment Analysis with Large Language Models}},
  year = {2024},
  eprint = {2410.16589},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.16589},
}
Figure