Downloads · 30 days
11
16% of all-time downloads
YiChuanH/llama1B-finetuned
llama1B-finetuned is a machine learning model from YiChuanH. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This model is a distilled version of meta-llama/Llama-3.2-3B-Instruct, finetuned to mimic its behavior using meta-llama/Llama-3.2-1B-Instruct as the student. The distillation was performed using a subset of WikiText-2…
Downloads · 30 days
11
16% of all-time downloads
All-time downloads
67
Public
Parameters
1.2B
5 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors4.9 GB · 100%
From the Hugging Face model README
This model is a distilled version of meta-llama/Llama-3.2-3B-Instruct, finetuned to mimic its behavior using meta-llama/Llama-3.2-1B-Instruct as the student. The distillation was performed using a subset of WikiText-2 and prompt-based soft label supervision.
We used logit matching (KL divergence loss) between teacher and student models. The prompt "How to learn a new language?" was used as a simple test example, and the full WikiText-2 corpus was used for training.
LLaMA-3.2-3B-InstructLLaMA-3.2-1B-InstructKLDivLoss on logitsfrom transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("YiChuanH/llama1B-finetuned")
tokenizer = AutoTokenizer.from_pretrained("YiChuanH/llama1B-finetuned")
prompt = "How to learn a new language?"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
output = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(output[0], skip_special_tokens=True))
This model aims to preserve the output style and quality of the 3B teacher model with significantly fewer parameters (1B). Qualitatively, responses are more informative and instructive than the original base 1B model.
This model is released under the same license as the base LLaMA-3.2 models (likely Meta’s LLAMA license), with distillation code and weights under MIT.