-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat: add BitNet Distillation (BitDistill) pipeline code #382
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…fine-tuning This commit introduces BitDistill, a lightweight distillation framework that fine-tunes full-precision LLMs into 1.58-bit BitNet models for task-specific applications. Key components include: - SubLN module for training stability - Multi-head attention distillation inspired by MiniLM - Continual pre-training warm-up to reduce performance gap Based on the paper: https://arxiv.org/abs/2510.13998
…fine-tuning This commit introduces BitDistill, a lightweight distillation framework that fine-tunes full-precision LLMs into 1.58-bit BitNet models for task-specific applications. Key components include: - SubLN module for training stability - Multi-head attention distillation inspired by MiniLM - Continual pre-training warm-up to reduce performance gap Based on the paper: https://arxiv.org/abs/2510.13998
|
@yushuiwx please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
🚀 What does this PR do?
This PR introduces BitNet Distillation (BitDistill), a lightweight distillation and fine-tuning pipeline that converts off-the-shelf full-precision LLMs (e.g., Qwen) into 1.58-bit (ternary) BitNet models for specific downstream tasks.
BitDistill enables task-specific adaptation of BitNet models while preserving strong performance and significantly reducing memory and inference cost.
Background & Motivation
While BitNet demonstrates strong efficiency advantages with 1.58-bit weights, directly fine-tuning low-bit models often leads to a noticeable performance gap compared to full-precision counterparts, especially on downstream tasks.
BitDistill addresses this issue by combining:
to improve scalability and downstream task performance of low-bit models.
This PR is based on the paper:
Key Techniques Implemented
This implementation includes the following core components:
SubLN module
Continual pre-training warm-up
Multi-head attention distillation
Results & Benefits
Note: This PR replaces a previous one that mistakenly added BitDistill as a submodule. The code is now fully included.