TreeLoRA: Efficient Continual Learning via Layer-Wise LoRAs Guided by a Hierarchical Gradient-Similarity Tree

Yu-Yang Qian, Yuan-Ze Xu, Zhen-Yu Zhang, Peng Zhao, Zhi-Hua Zhou

Introduction: The Challenge of Scalable Continual Learning

Continual Learning (CL) aims to enable machine learning models to acquire new knowledge sequentially without suffering from "catastrophic forgetting"—the tendency of neural networks to overwrite previously learned information. While CL is essential for developing versatile, human-like AI, existing methods face significant scalability hurdles when applied to Large Pre-trained Models (LPMs) like Llama or Vision Transformers (ViTs).

Most current CL approaches scale linearly ($O(N)$) with the number of tasks. As the task count grows, the computational cost of identifying relevant prior knowledge or mitigating interference becomes prohibitive. TreeLoRA addresses this bottleneck by organizing task-specific adapters into a hierarchical structure, transforming the search for shared knowledge from a linear process into a logarithmic or near-constant one.

The TreeLoRA Framework: Hierarchical Adaptation

TreeLoRA (K-D Tree of Low-Rank Adapters) introduces a structured approach to parameter-efficient fine-tuning. The framework is built upon three core innovations:

1. Hierarchical Task-Similarity Tree

Instead of treating tasks as a flat list, TreeLoRA organizes them into a tree based on their gradient similarity. The root node represents general features shared across all tasks, while intermediate nodes capture broad category-level similarities (e.g., syntax in language or shapes in vision). Leaf nodes contain the most specific, task-unique parameters. Tasks are grouped using the $L_1$ norm of their gradient directions, ensuring that tasks requiring similar model updates are clustered together.

To navigate the tree without checking every branch, the authors employ a Multi-Armed Bandit algorithm, specifically the Lower Confidence Bound (LCB) approach. This allows the model to efficiently explore and exploit the tree structure to find the most relevant "neighborhood" for a new task. This mechanism reduces search complexity to $O(\log N)$ or even $O(1)$ per round, significantly accelerating the training process.

Overview of the TreeLoRA structure (a) and its assembly into Transformer-based models using bandit search (b).

3. Sparse Gradient Updates and Regularization

Once a path through the tree is identified, TreeLoRA performs sparse updates to the relevant nodes. An adaptive regularization term is used to prevent new updates from deviating too far from the established knowledge in shared branches, effectively balancing plasticity (learning new things) and stability (retaining old things).

Experimental Evaluation

The researchers validated TreeLoRA across diverse domains:

  • Computer Vision: Evaluated on Split CIFAR-100, Split ImageNet-R, and Split CUB-200 using Vision Transformers.
  • Natural Language Processing: Tested on the TRACE benchmark (8 tasks including stance detection and code completion) and a custom Math-LLM dataset focused on complex mathematical reasoning.

Performance and Efficiency Analysis

TreeLoRA demonstrates substantial improvements in both training speed and model accuracy.

Rapid Convergence and Accuracy

In vision tasks like Split CIFAR-100, TreeLoRA achieved an accuracy of 87.73% in just two epochs—a feat that typically requires 10 to 20 epochs for competing methods. On the TRACE benchmark for LLMs, TreeLoRA outperformed state-of-the-art methods like O-LoRA and GEM, reaching 36.14% overall performance on LLaMA-3.2-1B compared to the next best at 33.73%.

Test accuracy comparison on Split CIFAR-100, showing TreeLoRA's significantly faster convergence compared to standard LoRA.

Computational Efficiency

The most striking result is the speedup: TreeLoRA achieved a 3.2x speedup for ViTs and a 2.4x speedup for LLMs in training time. Furthermore, the method maintains constant GPU memory usage regardless of the number of tasks, making it uniquely suited for long-term, large-scale deployment.

Conclusion

TreeLoRA represents a significant step forward in making continual learning practical for large-scale models. By leveraging hierarchical structures and bandit-based optimization, it breaks the linear scaling barrier that has long hampered CL research. Future work will focus on making the tree structure dynamic to handle non-stationary data streams where task relationships may evolve over time.

Summary updated

BibTeX
@inproceedings{qian2025treelora,
  author = {Yu-Yang Qian and Yuan-Ze Xu and Zhen-Yu Zhang and Peng Zhao and Zhi-Hua Zhou},
  title = {{TreeLoRA: Efficient Continual Learning via Layer-Wise LoRAs Guided by a Hierarchical Gradient-Similarity Tree}},
  booktitle = {International Conference on Machine Learning},
  year = {2025},
  url = {https://openreview.net/forum?id=f6ibJCQfH4},
}
Figure