feat: add BitNet Distillation (BitDistill) pipeline code#382
Open
yushuiwx wants to merge 2 commits intomicrosoft:mainfrom
Open
feat: add BitNet Distillation (BitDistill) pipeline code#382yushuiwx wants to merge 2 commits intomicrosoft:mainfrom
yushuiwx wants to merge 2 commits intomicrosoft:mainfrom
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”),
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🚀 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.