LM-Cocktail: Resilient Tuning of Language Models via Model Merging

Shitao Xiao, Zheng Liu, Peitian Zhang, Xingrun Xing
11/22/2023
59 citations
cs.CLcs.AIcs.IR
lora-peft-merging

Official code: FlagOpen/FlagEmbedding (12,349 stars, Python, MIT, last commit 2026-04-22).

Abstract

The pre-trained language models are continually fine-tuned to better support downstream applications. However, this operation may result in significant performance degeneration on general tasks beyond the targeted domain.

Show full abstract

To overcome this problem, we propose LM-Cocktail which enables the fine-tuned model to stay resilient in general perspectives. Our method is conducted in the form of model merging, where the fine-tuned language model is merged with the pre-trained base model or the peer models from other domains through weighted average. Despite simplicity, LM-Cocktail is surprisingly effective: the resulted model is able to achieve a strong empirical performance in the whole scope of general tasks while preserving a superior capacity in its targeted domain. We conduct comprehensive experiments with LLama and BGE model on popular benchmarks, including FLAN, MMLU, MTEB, whose results validate the efficacy of our proposed method. The code and checkpoints are available at https://github.com/FlagOpen/FlagEmbedding/tree/master/LM_Cocktail.

View on arXivView PDF

Code Implementations(1)

MIT

Retrieval and Retrieval-augmented LLMs

12,349952Python, Jupyter NotebookAug 2, 20237 months agoMIT
embeddingsinformation-retrievalllmretrieval-augmented-generationsentence-embeddings+1 more

Similar Papers

Cite this paper

@article{xiao2023lmcocktail,
  title  = {LM-Cocktail: Resilient Tuning of Language Models via Model Merging},
  author = {Shitao Xiao and Zheng Liu and Peitian Zhang and Xingrun Xing},
  year   = {2023},
  eprint = {2311.13534},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2311.13534v4}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2311.13534.svg)](https://codeofpaper.com/paper/2311.13534)

Discussion