# Understanding Layer Patching in Model Size Interpolation

*Sara Kangaslahti, Jonathan Geuter, Nihal V Nayak, Marco Fumero, Francesco Locatello, David Alvarez-Melis*

[NeurIPS page](https://neurips.cc/virtual/2026/poster/152284) · [OpenReview](https://openreview.net/forum?id=UDT6ZDU0b3) · [Open on the map](../papers.html#p152284)

Category: [LLM Post-Training: RL & Distillation](../pcat/18.md) › [LLM Distillation](../pgroup/182.md) · Type: new method · Keywords: model size interpolation, layer patching, shortest-path optimization, KL divergence, zero-shot model scaling

## Summary
The paper systematically studies student-layer selection for zero-shot model size interpolation, formulates it as a shortest-path problem, and introduces KLPatch, a greedy KL-based patching algorithm that improves over simple sequential strategies.

## Explained to a 5-year-old
Imagine you have a tiny robot that can talk a little and a huge robot that can talk a lot. You want a robot that can talk a medium amount, but you don't want to teach it new tricks. The paper looks at how to take the big robot and give some of its parts to the small robot. It studies which parts (called layers) should be swapped so the new robot works well. It finds that copying from the beginning or from the end often works really well.

## Explained to a 5-year-old, longer
Imagine you have a small robot that can talk a little and a big robot that can talk a lot. You want a robot that can talk a medium amount, but you don't want to teach it new words. The paper studies how to take the big robot and give some of its parts to the small robot. It looks at which parts (called layers) should be swapped so the new robot works like both. The researchers turned this problem into a puzzle that can be solved by finding the shortest path. They tried two simple ways: copying from the start of the robot to the end, or from the end to the start. Both simple ways often gave good results, which was surprising. They also created a new rule that picks the best parts using a kind of similarity measure. This rule usually works better than just copying from the end. The study shows that how we choose the parts really changes how well the robot performs. It works for many different kinds of robots, not just one type. The result is a set of guidelines that help people make medium-sized robots quickly and efficiently.

## For a technical reader
The paper addresses zero-shot model size interpolation, where a smaller student model and a larger teacher model are combined to produce intermediate-sized models without any additional training. It formulates the selection of which contiguous teacher layers to replace in the student as an optimization problem and shows this can be reduced to a shortest-path problem on an acyclic graph. Empirical results reveal that simple sequential patching strategies (from first to last or last to first) already achieve strong interpolation performance across several model families. A greedy algorithm based on KL divergence is proposed to approximate the optimal patching sequence, improving over the naive strategies. The findings provide both a theoretical characterization and practical guidance for constructing near-optimal interpolated models.

## Problem
Given a small student model and a larger teacher model, the challenge is to select which contiguous blocks of teacher layers to replace in the student so that the resulting model size and performance interpolate between the two without any additional training.

## Method
The approach casts the selection of layer subsets as an optimization problem, shows it can be modeled as a shortest-path problem in an acyclic graph, and proposes a greedy algorithm that uses KL divergence to approximate the optimal patching sequence.

## Results
Experiments show that simple first-to-last or last-to-first patching already yields strong interpolation, and the proposed greedy approach further improves performance, approximating the optimal layer selection.

## Contributions
The work provides the first systematic analysis of student-layer selection for model size interpolation, proves its equivalence to a shortest-path problem, and introduces a practical greedy patching algorithm that outperforms naive strategies.

## Practical relevance
The findings enable practitioners to construct interpolated language models of desired sizes efficiently, without costly training.

This page was written by language models from the title and abstract of each paper, and the answers were checked by two other models. It can be wrong: check the paper itself. [Suggest a correction](../feedback/?on=p/152284)
