Enhancing Cross-Tokenizer Knowledge Distillation with Contextual Dynamical Mapping

Yijie Chen, Yijin Liu, Fandong Meng, Yufeng Chen, Jinan Xu +1 more
2/16/2025
cs.CL

Official code: pppa2019/ContexualDynamicMapping (12 stars, last commit 2025-02-21).

Abstract

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

View on arXivView PDF

Code Implementations(1)

Offical code for "Enhancing Cross-Tokenizer Knowledge Distillation with Contextual Dynamical Mapping"

121Shell, PythonFeb 16, 20251 years ago

Similar Papers

Cite this paper

@article{chen2025enhancing,
  title  = {Enhancing Cross-Tokenizer Knowledge Distillation with Contextual Dynamical Mapping},
  author = {Yijie Chen and Yijin Liu and Fandong Meng and Yufeng Chen and Jinan Xu and Jie Zhou},
  year   = {2025},
  eprint = {2502.11104},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2502.11104v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2502.11104.svg)](https://codeofpaper.com/paper/2502.11104)

Discussion