Distilling Knowledge for Search-based Structured Prediction

Yijia Liu, Wanxiang Che, Huaipeng Zhao, Bing Qin, Ting Liu

Abstract

Search-based structured prediction models often suffer from ambiguity and exposure bias. While ensembles can mitigate these issues, they are computationally prohibitive for real-world deployment. This paper proposes a knowledge distillation framework to transfer the robustness of an ensemble into a single student model. By training on both gold-standard reference paths and dynamically explored paths, the student model achieves significant performance gains in dependency parsing (+1.32 LAS) and machine translation (+2.65 BLEU) without increasing inference costs.

Introduction

Many core NLP tasks, such as dependency parsing and machine translation, are framed as search-based structured prediction. In this paradigm, a model learns a policy to generate complex structures step-by-step. However, standard training using Negative Log-Likelihood (NLL) loss is limited by two major factors:

  1. Ambiguity: Training data typically provides only one "correct" path, whereas many valid paths may exist. NLL penalizes all non-gold choices equally.
  2. Exposure Bias: Models trained only on gold-standard states struggle when they encounter sub-optimal states during inference, leading to cascading errors.

Ensembles of models can smooth out these ambiguities and improve robustness, but their high computational and memory requirements make them impractical for real-world deployment.

Methodology

The authors propose a two-pronged knowledge distillation strategy to transfer ensemble knowledge into a single efficient model.

Overview of the proposed knowledge distillation framework for search-based structured prediction.

Distillation from Reference

Instead of hard NLL labels, the student model is trained to match the "soft targets" (probability distributions) produced by the ensemble on gold-standard training states. This allows the student to learn about alternative valid actions that the ensemble has identified as plausible.

Distillation from Exploration

To address exposure bias, the ensemble actively explores the search space by sampling actions. The student is then trained to mimic the ensemble's behavior on these encountered states—including sub-optimal ones—effectively learning recovery strategies from the teacher's broader perspective.

For tasks with large action spaces like machine translation, the authors approximate the distillation loss using only the top-$K$ most probable actions from the ensemble to maintain computational efficiency.

Experimental Results

The approach was evaluated on the Penn Treebank (PTB) for dependency parsing and the IWSLT 2014 German-to-English dataset for machine translation.

Performance Gains

The proposed method significantly outperformed greedy baselines on both tasks:

  • Dependency Parsing: The distilled model achieved a Labeled Attachment Score (LAS) of 92.14, a +1.32 improvement over the baseline (90.83).
  • Machine Translation: The distilled model reached 25.44 BLEU, a +2.65 improvement over the baseline (22.79).

The Power of Soft Targets

A key insight is that the teacher's soft distribution contains rich structural information. In parsing experiments, increasing the weight of the distillation loss ($\alpha$) relative to the NLL loss consistently improved performance.

Impact of distillation weight $\alpha$ on LAS (top) and BLEU (bottom) scores.

As shown in the figure above, performance peaks when high weight is given to the distillation loss, suggesting that the ensemble's soft targets are more informative for the student than the original hard labels. In some cases, setting $\alpha=1.0$ (ignoring hard labels entirely) yielded near-optimal results.

Discussion and Conclusion

The results demonstrate that distillation from exploration successfully transfers recovery skills to the student model, mitigating the train/test discrepancy. Furthermore, distillation appears to stabilize training, resulting in lower variance across different random seeds compared to standard baselines. This suggests a smoother loss landscape provided by the ensemble's guidance.

While the distilled model outperforms other greedy approaches, it still lags behind non-greedy methods like beam search or global graph-based parsers. Future work could explore extending this framework to semi-supervised learning, leveraging the ensemble to generate high-quality targets for massive amounts of unlabeled data.

Summary updated

BibTeX
@inproceedings{liu2018distilling,
  author = {Yijia Liu and Wanxiang Che and Huaipeng Zhao and Bing Qin and Ting Liu},
  title = {{Distilling Knowledge for Search-based Structured Prediction}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2018},
  doi = {10.18653/v1/p18-1129},
}
Figure