Views
No views yet
build_intermediate_model function from our github repository:1import torch
2from patching.patch import build_intermediate_model
3
4intermediate_model = build_intermediate_model(
5 teacher_name_or_path = "EleutherAI/pythia-6.9b",
6 student_name_or_path = "Harvard-DCML/boomerang-pythia-3.8B",
7 num_layers_to_patch = 2,
8 patch_first_k_layers = False,
9 dtype = torch.bfloat16,
10)num_layers_to_patch changes the size of the intermediate model by patching different numbers of student layers.patch_first_k_layers should be set to False for this model for optimal interpolation performance.@article{kangaslahti2025boomerang,
title={Boomerang Distillation Enables Zero-Shot Model Size Interpolation},
author={Kangaslahti, Sara and Nayak, Nihal V and Geuter, Jonathan and Fumero, Marco and Locatello, Francesco and Alvarez-Melis, David},
journal={arXiv preprint arXiv:2510.05064},
year={2025},
url={https://arxiv.org/abs/2510.05064}
}