为领域特定的日语小型语言模型适应方法:规模、架构和量化
Adapting Methods for Domain-Specific Japanese Small LMs: Scale, Architecture, and Quantization
AI总结:
本文提出系统方法构建日语领域特定小型语言模型,通过QLoRA微调解决训练规模、基础模型选择和架构感知量化问题,实验显示Swallow-8B在Q4_K_M量化下表现最佳,适用于低资源技术领域。
摘要:
本文提出一种系统方法,用于构建领域特定的日语小型语言模型,使用QLoRA微调。我们解决了三个核心问题:最佳训练规模、基础模型选择和架构感知量化。第一阶段(训练规模):规模学习实验(1k-5k样本)确定n=4,000为最佳,测试集NLL达到最小值(1.127)在5k样本时开始过拟合。第二阶段(比较微调SLMs):比较四个日语LLM显示,Llama-3模型通过日语持续预训练(Swallow-8B,ELYZA-JP-8B)优于多语言模型(Qwen2.5-7B)。第三阶段(量化):Llama-3架构在Q4_K_M量化下改善,而GQA架构严重退化(Qwen2.5:-0.280 points)。生产推荐:Swallow-8B Q4_K_M达到2.830/3分数,8.9秒/问题,4.9GB大小。该方法适用于低资源技术领域,并为消费者硬件上的紧凑日语专业LLM提供可行指导。
英文摘要:
This paper presents a systematic methodology for building domain-specific Japanese small language models using QLoRA fine-tuning. We address three core questions: optimal training scale, base-model selection, and architecture-aware quantization. Stage 1 (Training scale): Scale-learning experiments (1k--5k samples) identify n=4,000 as optimal, where test-set NLL reaches minimum (1.127) before overfitting at 5k samples. Stage 2 (Compare finetuned SLMs): Comparing four Japanese LLMs shows that Llama-3 models with Japanese continual pre-training (Swallow-8B, ELYZA-JP-8B) outperform multilingual models (Qwen2.5-7B). Stage 3 (Quantization): Llama-3 architectures improve under Q4_K_M quantization, while GQA architectures degrade severely (Qwen2.5: -0.280 points). Production recommendation: Swallow-8B Q4_K_M achieves 2.830/3 score, 8.9 s/question, 4.9 GB size. The methodology generalizes to low-resource technical domains and provides actionable guidance for compact Japanese specialist LMs on consumer hardware.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。