Skip to content

Disillation-Tuning implementation for decoder based LM models (Qwen2.5) adapted for text summarization (BioASQ-2025 workshop)

License

Notifications You must be signed in to change notification settings

nicolay-r/distil-tuning-llm

Repository files navigation

Distil-Tuning for Decoder-Based Transformers

Open In Colab

This repo represent a tiny and reforged version of the original MeDistil-d2n framework and the related paper studies for the BioASQ workshop on multilingual clinical texts summarization. The original project has a major limitation of Seq2Seq trainer dependencies. The goal of the project is to bridge the gap with fine-tuning SLM LLM models (AutoModelCasualLM) on long-input context by heavily rely on decoder based models with following input Formatting Concepts.

Contribution

  1. ✅ Replacement of Seq2SeqTrainer: AutoModelCasualLM models (Qwen series in particular).
    • Support instruction tuning
  2. ✅ Refactoring and narrowing the scope, dropping dependencies.
  3. ✅ Switch dependencies to Python 3.10+

🛠️ Changeset

Setup

  • The complete list of dependencies
pip install -r requirements.txt
  • Download punkt_tab for nltk
import nltk
nltk.download('punkt_tab')

Finetuning

Open In Colab

Manual Training:

./distill_ft_qwen25_test.sh --from_pretrained "AutoModelCasualLM-from-HF" --dataset "multiclinsum" --model_type "distill"

NOTE: We use the following post-processing script for dataset preparation.

List of the parameters

  • --from_pretrained: Model from hugging face that nesting AutoModelCasualLM
  • --dataset: multiclinsum (see downloading script and post-processing)
  • --alpha: Task weight for multi-task training.
    • $Loss = alpha * pred_l + (1 - alpha) * rationale_l$
  • --model_type:
    • standard: Standard finetuning (baseline)
    • distill: Distilling step-by-step

The pretrained models are publicly available:

Model 🤗 Link
nicolay-r/qwen25-05b-multiclinsum-distil model-card
nicolay-r/qwen25-05b-multiclinsum-standard model-card

Inference

We use bulk-chain project to infer:

Datasets

Input formatting concepts

References

About

Disillation-Tuning implementation for decoder based LM models (Qwen2.5) adapted for text summarization (BioASQ-2025 workshop)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •