Model Merging Applications › Style Merging

Michael BrenndoerferFebruary 28, 20267 min read
Language AI HandbookAll chapters
Part 41 of 67Model Compression
Chapter 312Model Merging Applications › Style Merging
Reading section 3 of 10 · Style Merging · 7 minSection 3 of 10 · 7 min

Book contents

Section 3 of 10 · 7 min read

Model Merging Applications › Style MergingOne section · Sections in this chapter3 / 10 ↓
Reading tools Definitions & inline links

Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.

Article links

Make inline references clickable

Style merging applies model merging to a different objective: blending the stylistic or behavioral characteristics of two fine-tuned models. Rather than combining task competencies, you are combining writing styles, tones, or domain vocabularies.

What Constitutes "Style" in Model Weights?

Style is not a single, localized property of a model, and this makes style merging both interesting and challenging to reason about. Different components of the transformer architecture carry different aspects of what we perceive as writing style when reading the output.

Attention heads encode patterns about which tokens attend to which, shaping syntax and reference structure. Feed-forward layers encode knowledge and word associations, adding to vocabulary choice, domain-specific terminology, and the kinds of information the model is likely to include in a response. Layer normalization parameters affect scale and expressiveness. Even the output embedding matrix plays a role, because it determines the logit distribution over the vocabulary from which the final token is sampled.

When you fine-tune a model on formal business prose versus casual conversational text, the resulting task vectors will differ primarily in the feed-forward layers of the middle and later transformer blocks, where high-level semantic and stylistic patterns are stored. Early layers, which handle low-level syntax and token identity, change less. This has been confirmed empirically by comparing the per-layer magnitude of task vectors: the early-layer magnitudes are typically 3 to 5 times smaller than the late-layer magnitudes for style-focused fine-tunes.

This uneven distribution has a practical consequence: you can selectively merge style by applying different weights λ\lambda to different layer groups, blending more heavily in the layers that carry stylistic information. This is layer-wise merging, which is distinct from applying a single global coefficient to all parameters equally.

Layer-Wise Merging for Style

Layer-wise merging assigns a separate coefficient to each transformer layer instead of a single global λ\lambda:

θmerged(l)=θbase(l)+λlτ1(l)+(1−λl)τ2(l)\theta_{\text{merged}}^{(l)} = \theta_{\text{base}}^{(l)} + \lambda_l \tau_1^{(l)} + (1 - \lambda_l) \tau_2^{(l)}

where:

  • θ(l)\theta^{(l)}: the parameters in layer ll
  • λl\lambda_l: the per-layer blending coefficient
  • τ1(l),τ2(l)\tau_1^{(l)}, \tau_2^{(l)}: task vectors for each model at layer ll

Notice that this formulation uses λl\lambda_l and (1−λl)(1 - \lambda_l), which constrains the two models to share equal total contribution at each layer. When λl=0.5\lambda_l = 0.5, each layer is an exact midpoint between the two source models' representations of that layer. When λl=0.8\lambda_l = 0.8, the layer leans heavily toward Model 1 while still incorporating some influence from Model 2.

Setting λl=0.5\lambda_l = 0.5 for all layers gives equal blending throughout the network. Setting λl\lambda_l close to 1.0 for early layers (preserving the first model's syntax handling) and λl=0.5\lambda_l = 0.5 for later layers (blending style) is a common practical choice. A ramp profile, where λl\lambda_l transitions from 1.0 in the first few layers to 0.5 in the later layers, has been found effective across several published experiments.

The key intuition behind layer-wise merging for style is that you want syntactic competence from one source (to ensure grammatically coherent output) while blending the high-level behavioral tendencies of both sources (to achieve the desired style mixture). Applying a single global λ\lambda to the entire network ignores this natural separation of function between early and late layers.

SLERP: Spherical Linear Interpolation

Standard linear interpolation (LERP) blends weights on a straight line between two points in parameter space. Spherical linear interpolation (SLERP) instead interpolates along the surface of a hypersphere, which respects the angular structure of weight space. For style merging, SLERP often produces smoother transitions that avoid the "average" feel of direct interpolation.

Given two weight vectors w1\mathbf{w}_1 and w2\mathbf{w}_2 and a coefficient t∈[0,1]t \in [0, 1]:

SLERP(w1,w2,t)=sin⁡((1−t)Ω)sin⁡Ωw1+sin⁡(tΩ)sin⁡Ωw2\text{SLERP}(\mathbf{w}_1, \mathbf{w}_2, t) = \frac{\sin((1-t)\Omega)}{\sin \Omega} \mathbf{w}_1 + \frac{\sin(t\Omega)}{\sin \Omega} \mathbf{w}_2

where Ω=arccos⁡(w1⋅w2∥w1∥∥w2∥)\Omega = \arccos\left(\frac{\mathbf{w}_1 \cdot \mathbf{w}_2}{\|\mathbf{w}_1\| \|\mathbf{w}_2\|}\right) is the angle between the two weight vectors.

The key difference from LERP is that SLERP preserves the magnitude of the weight vectors at all intermediate points, while LERP produces shorter vectors near the midpoint. In high-dimensional weight spaces, the LERP midpoint has a norm approximately 12\frac{1}{\sqrt{2}} times the original (since two orthogonal unit vectors sum to a vector of magnitude 2\sqrt{2}, and the midpoint is half of that). This norm reduction can cause the merged model to underfit both styles, producing outputs that feel "flat" or "averaged" rather than a coherent stylistic mixture.

SLERP is most beneficial when the weight vectors differ substantially in direction. When they are nearly parallel, SLERP and LERP converge to the same result because the arc of the hypersphere between two nearby points is nearly straight.

Applications of Style Merging

Style merging has found practical application in several scenarios that illustrate its distinctive value. One prominent use case is persona blending in conversational AI. A company might have a formal customer service assistant fine-tuned on professional support interactions and a friendly chatbot fine-tuned on casual dialogue. Rather than maintaining both separately or training a new persona from scratch, a style merge between the two can produce a model that is professionally competent but conversationally approachable. The λ\lambda coefficient becomes a dial that the product team can adjust to find the right balance between formal and casual.

Another application is domain vocabulary injection. A model fine-tuned on medical literature develops a vocabulary and reasoning style specific to clinical contexts. A model fine-tuned on patient-facing health education materials develops an accessible, simplified style. Merging them with appropriate layer-wise coefficients can produce a model that understands medical concepts at a clinical level but communicates them in patient-friendly language. This is difficult to achieve through joint fine-tuning because the two corpora pull the model in different stylistic directions simultaneously.

Evaluating Style Merges

Style evaluation is inherently subjective, which makes it harder than task performance evaluation. Practical approaches include:

Automated style classifiers can measure the degree to which merged model outputs match the style of each source model. If you fine-tuned on formal and informal corpora, a text classifier trained on those same corpora can quantify the style blend ratio in generated outputs. A well-calibrated classifier gives you a scalar "formality score" for each generated sample, letting you track how the score distribution shifts as you vary the merge coefficient.

Perplexity on held-out examples from each style provides a proxy for whether the model has retained each style's characteristics. A well-merged style model should have lower perplexity on both style corpora than a model trained only on one. If the merged model has higher perplexity than either source model on both corpora, the merge has degraded both styles rather than blending them, which usually signals that the task vectors were interfering heavily.

Distributional metrics from the natural language generation literature can also be useful here. MAUVE, for example, measures the divergence between the distribution of generated text and a reference distribution. You can compute MAUVE separately against each source style corpus to quantify how well the merged model covers each style's distributional characteristics.

Human evaluation remains the gold standard for style, but it is expensive. A practical shortcut is to generate completions of the same prompts with the source models and the merged model, then present them side-by-side to evaluators who rate which model each output most resembles. A well-calibrated style merge should produce outputs that evaluators consistently rate as intermediate between the two source styles, rather than clearly belonging to one or the other.