CoT2Align: Cross-Chain of Thought Distillation via Optimal Transport Alignment for Language Models with Different Tokenizers

Anh Duc Le, Tu Vu, Nam Le Hai, Nguyen Thi Ngoc Diep, Linh Ngo Van, Trung Le, Thien Huu NguyenarXiv 2025

Abstract

Large Language Models (LLMs) achieve state-of-the-art performance across various NLP tasks but face deployment challenges due to high computational costs and memory constraints. Knowledge distillation (KD) is a promising solution, transferring knowledge from large teacher models to smaller student models. However, existing KD methods often assume shared vocabularies and tokenizers, limiting their flexibility. While approaches like Universal Logit Distillation (ULD) and Dual-Space Knowledge Distillation (DSKD) address vocabulary mismatches, they overlook the critical reasoning-aware distillation aspect. To bridge this gap, we propose CoT2Align, a universal KD framework that integrates Chain-of-Thought (CoT) augmentation and introduces Cross-CoT Alignment to enhance reasoning transfer. Additionally, we extend Optimal Transport beyond token-wise alignment to a sequence-level and layer-wise alignment approach that adapts to varying sequence lengths while preserving contextual integrity. Comprehensive experiments demonstrate that CoT2Align outperforms existing KD methods across different vocabulary settings, improving reasoning capabilities and robustness in domain-specific tasks.

Introduction

The rapid advancement of Large Language Models (LLMs) has revolutionized natural language processing, yet their massive scale remains a barrier for deployment on resource-constrained devices. Knowledge Distillation (KD) serves as a vital technique to compress these models by training a smaller "student" model to emulate a larger "teacher." However, standard KD techniques often falter when the teacher and student utilize different tokenizers—a common scenario in heterogeneous model ecosystems. Furthermore, most distillation focuses on final outputs, neglecting the intermediate reasoning steps (Chain-of-Thought) that underpin an LLM's problem-solving ability.

Addressing the Tokenizer and Reasoning Gaps

Current distillation research faces two primary hurdles:

  1. Tokenizer Mismatch: Most state-of-the-art KD methods require identical vocabularies. Existing "universal" solutions often rely on rigid token-wise alignment, which breaks down when models produce sequences of varying lengths or tokenize text differently.
  2. Reasoning Neglect: Mimicking the final answer is insufficient for complex tasks. Students must capture the teacher's multi-step reasoning process. Previous attempts to include reasoning data often led to "hallucinations" due to a lack of structural alignment between the student's logic and the teacher's.

The CoT2Align Framework

To overcome these challenges, CoT2Align introduces two core innovations:

Cross-Chain-of-Thought (CCoT) Alignment

CoT2Align employs a "cross-alignment" strategy that prompts the teacher to generate rationales (e.g., "Let's think step by step"). The student is then trained using two distinct loss functions:

  • Cross Student-Teacher Loss: Directly aligns the student’s reasoning output with the teacher’s.
  • Cross Standard-CoT Loss: Aligns the student’s standard response with the teacher’s reasoning-augmented response, forcing the student to internalize underlying logic even when not explicitly prompted to show its work.

Sequence-Level Optimal Transport (OT)

To handle disparate tokenizers, CoT2Align utilizes Optimal Transport (OT) to find the most efficient mapping between the teacher's and student's internal representations. By treating sentences as distributions of embeddings, OT enables sequence-level alignment that is invariant to token count or vocabulary differences. This alignment is applied to the embedding layer and the final hidden layer, ensuring a high-fidelity transfer of semantic knowledge.

Experimental Results

The framework was evaluated on four diverse benchmarks: Dolly (general instruction), Alpaca (task-oriented), S-NI (diverse NLP tasks), and DialogSum (summarization).

Performance and Universal Applicability

CoT2Align consistently outperforms previous state-of-the-art methods like DSKD. Notably, it acts as a "booster" that can be integrated into existing KD frameworks to provide consistent performance gains across various model architectures and tokenizer settings.

Table showing performance gains when adding CoT2Align to existing distillation methods across different model pairs.

Human-Centric Evaluation

Using GPT-4 as an automated judge, the researchers found that models trained with CoT2Align were significantly preferred over those trained with baseline methods. The models demonstrated higher win rates in terms of helpfulness, relevance, and depth across all tested domains.

Win rate comparison between CoT2Align and DSKD across four datasets, showing a clear preference for CoT2Align.

Conclusion

CoT2Align represents a significant step toward flexible and reasoning-aware knowledge distillation. By leveraging Optimal Transport and Cross-CoT alignment, it enables small models to effectively learn from larger teachers regardless of tokenizer differences. Future work will explore adaptive layer-wise distillation to further optimize the transfer of knowledge across intermediate model layers.

Summary updated

BibTeX
@misc{le2025cot,
  author = {Anh Duc Le and Tu Vu and Nam Le Hai and Nguyen Thi Ngoc Diep and Linh Ngo Van and Trung Le and Thien Huu Nguyen},
  title = {{CoT2Align: Cross-Chain of Thought Distillation via Optimal Transport Alignment for Language Models with Different Tokenizers}},
  year = {2025},
  eprint = {2502.16806},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2502.16806},
}
Figure