arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.11104cs.CL
收藏

利用上下文动态映射增强跨分词器知识蒸馏

Enhancing Cross-Tokenizer Knowledge Distillation with Contextual Dynamical Mapping

Beijing Jiaotong University(北京交通大学);Tencent Inc(腾讯公司)

Yijie Chen, Yijin Liu, Fandong Meng, Yufeng Chen, Jinan Xu, Jie Zhou

AI总结:

针对跨分词器知识蒸馏中的序列与词汇错位问题,提出 CDM 框架,利用上下文动态对齐并映射词汇,在多类模型和基准上显著优于现有方法。

摘要:

知识蒸馏(KD)已成为模型压缩中的一项重要技术。然而,传统 KD 方法主要关注具有相同分词器的同构架构,限制了其在跨架构场景中的适用性。对于跨分词器 KD,分词器之间的差异引发了两个根本性挑战:(1)由不同分词策略导致的序列错位;(2)词汇表大小和组成不匹配。尽管现有的概率匹配方法试图解决这些问题,但由于在序列和词汇方面的对齐均不够理想,其效果仍然有限。为克服这些局限,我们提出了 Contextual Dynamic Mapping(CDM,上下文动态映射),这是一种新颖的跨分词器蒸馏框架,利用上下文信息提升序列对齐精度,并动态改进词汇映射。我们在五个先进且广泛使用的模型系列(即 LLama3、Phi3、Gemma2、OPT 和 Qwen2)上评估了方法有效性,这些模型被配置为三个不同的师生对。在包括指令遵循、代码生成和数学在内的多种基准上,我们的方法相较现有跨分词器蒸馏基线展现出显著优势。值得注意的是,分析表明,通过 CDM 将传统同分词器蒸馏与跨分词器蒸馏相结合可进一步提升性能。代码可在 https://github.com/pppa2019/ContexualDynamicMapping 获取。

英文摘要:

Knowledge Distillation (KD) has emerged as a prominent technique for model compression. However, conventional KD approaches primarily focus on homogeneous architectures with identical tokenizers, constraining their applicability in cross-architecture scenarios. As for the cross-tokenizer KD, the differences in the tokenizers give rise to two fundamental challenges: (1) sequence misalignment caused by divergent tokenization strategies, and (2) mismatched vocabulary size and composition. While existing probability-matching methods attempt to address these issues, their efficacy remains limited due to suboptimal alignment in both the sequence and vocabulary aspects. To overcome these limitations, we propose Contextual Dynamic Mapping (CDM), a novel cross-tokenizer distillation framework that employs contextual information to enhance sequence alignment precision and dynamically improves vocabulary mapping. We evaluated the effectiveness of our approach across five advanced and widely-used model families (i.e, LLama3, Phi3, Gemma2, OPT and Qwen2), which were configured into three distinct teacher-student pairs. Our method shows significant advantages over existing cross-tokenizer distillation baselines across diverse benchmarks, including instruction-following, code generation and math. Notably, our analysis reveals that combining conventional same-tokenizer distillation and cross-tokenizer distillation through CDM yields further performance improvements. The code is available at https://github.com/pppa2019/ContexualDynamicMapping

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑