Self-Specialization: Uncovering Latent Expertise within Large Language Models
Junmo Kang, Hongyin Luo, Yada Zhu, Jacob Hansen, James Glass, David Cox, Alan Ritter, Rogerio Feris, Leonid Karlinsky
TL;DR
Self-Specialization demonstrates that latent domain expertise exists within general large language models and can be carved out with minimal supervision. By seeding domain-specific demonstrations and generating domain-tailored instructions and responses, then fine-tuning with LoRA, the approach produces domain-specialized models that outperform their base counterparts and even larger, generally aligned baselines in biomedical and financial tasks. The method maintains cross-task generalization, requires only a small synthetic dataset (around 5K examples), and can optionally leverage retrieval to inject external domain knowledge. While some tasks show limitations, overall results indicate a practical, data- and compute-efficient path to domain specialization in LLMs, with implications for rapid deployment across expert domains.
Abstract
Recent works have demonstrated the effectiveness of self-alignment in which a large language model is aligned to follow general instructions using instructional data generated from the model itself starting from a handful of human-written seeds. Instead of general alignment, in this work, we focus on self-alignment for expert domain specialization (e.g., biomedicine, finance). As a preliminary, we quantitively show the marginal effect that generic instruction-following training has on downstream expert domains' performance. To remedy this, we propose self-specialization - allowing for effective model specialization while achieving cross-task generalization by leveraging only a few labeled seeds. Self-specialization offers a data- and parameter-efficient way of "carving out" an expert model out of a generalist pre-trained LLM. Exploring a variety of popular open large models as a base for specialization, our experimental results in both biomedical and financial domains show that our self-specialized models outperform their base models by a large margin, and even larger models that are generally instruction-tuned or that have been adapted to the target domain by other means.
