NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Tracking Universal Features Through Fine-Tuning and Model Merging

Niels Horn, Desmond ElliottarXiv 2024 · DOI

Introduction

In mechanistic interpretability, researchers have made significant strides in identifying what static models learn. However, the evolution of these internal representations—or "features"—during model updates remains poorly understood. As fine-tuning and model merging become standard practices for creating specialized or multi-task systems, understanding "feature evolution" is critical. This paper investigates whether original features survive, dilute, or transform when a model is adapted to new domains or combined with others.

Experimental Framework

The researchers employed a controlled, reproducible setup using a one-layer, Mistral-like Transformer.

  1. Base Model: Trained on "BabyPython," a mix of English (BabyLM) and Python code.
  2. Specialization: The base model was fine-tuned into two distinct branches: one for Lua (programming) and one for TinyStories (English narratives).
  3. Merging: These specialized models were merged using Spherical Linear Interpolation (SLERP) to create "LuaStories."
  4. Analysis: Sparse Auto-Encoders (SAEs) were trained on MLP activations to decompose complex signals into interpretable features. A feature was considered "persisting" if its activation patterns on a shared dataset maintained a correlation of over 80% between parent and child models.

Feature Evolution and Persistence

The study reveals that most features are fragile; the vast majority of the base model's specialized features vanish during domain adaptation. Out of thousands of features in the "BabyPython" model, only 959 persisted into either fine-tuned version.

Sankey diagram showing feature persistence and emergence across fine-tuning and merging stages.

The final "LuaStories" model contained 1,210 traceable features. Interestingly, 729 of these emerged during the fine-tuning process, while only 481 were survivors from the original base model. This suggests that while fine-tuning creates new specialized logic, it also prunes existing features that are no longer relevant, such as Python-specific exception handlers when moving to Lua.

The Survival of Universal Features

While many features disappear, a small set of "universal" or "structural" features—handling punctuation, line breaks, and basic formatting—consistently survive. A notable example is the "variable assignment" feature (Feature #16336). Despite the syntactic differences between Python and Lua, the model utilized the same internal feature to track the = operator across both languages and into the merged model.

Visualization of a universal 'variable assignment' feature persisting across different programming languages and the merged model.

However, merging is not a lossless process. Features often undergo "dilution," where they no longer correlate as strongly with the original data as they did in the specialized parent models. This indicates a trade-off between multi-task capability and feature purity.

Conclusion and Future Directions

This research provides a foundational map of feature lifecycles in small Transformers. While the findings on "universal" features offer hope for more predictable model editing, the study's scope is limited to a one-layer model. Future work must determine if these dynamics scale to frontier models like Llama-3 and explore whether advanced merging techniques like TIES-merging can better preserve feature integrity.

Summary updated

BibTeX
@misc{horn2024tracking,
  author = {Niels Horn and Desmond Elliott},
  title = {{Tracking Universal Features Through Fine-Tuning and Model Merging}},
  year = {2024},
  eprint = {2410.12391},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.12391},
}
Figure