Chameleon: A Flexible Data-mixing Framework for Language Model Pretraining and Finetuning

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Xie, Wanyun, Tonin, Francesco, Cevher, Volkan
Format: Preprint
Publié: 2025
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866913868041682944
author Xie, Wanyun
Tonin, Francesco
Cevher, Volkan
author_facet Xie, Wanyun
Tonin, Francesco
Cevher, Volkan
contents Training data mixtures greatly impact the generalization performance of large language models. Existing domain reweighting methods often rely on costly weight computations and require retraining when new data is introduced. To this end, we introduce a flexible and efficient data mixing framework, Chameleon, that employs leverage scores to quantify domain importance within a learned embedding space. We first construct a domain affinity matrix over domain embeddings. The induced leverage scores determine a mixture that upweights domains sharing common representations in embedding space. This formulation allows direct transfer to new data by computing the new domain embeddings. In experiments, we demonstrate improvements over three key scenarios: (i) our computed weights improve performance on pretraining domains with a fraction of the compute of existing methods; (ii) Chameleon can adapt to data changes without proxy retraining, boosting few-shot reasoning accuracies when transferred to new data; (iii) our method enables efficient domain reweighting in finetuning, consistently improving test perplexity on all finetuning domains over uniform mixture. Our code is available at https://github.com/LIONS-EPFL/Chameleon.
format Preprint
id arxiv_https___arxiv_org_abs_2505_24844
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Chameleon: A Flexible Data-mixing Framework for Language Model Pretraining and Finetuning
Xie, Wanyun
Tonin, Francesco
Cevher, Volkan
Machine Learning
Computation and Language
Training data mixtures greatly impact the generalization performance of large language models. Existing domain reweighting methods often rely on costly weight computations and require retraining when new data is introduced. To this end, we introduce a flexible and efficient data mixing framework, Chameleon, that employs leverage scores to quantify domain importance within a learned embedding space. We first construct a domain affinity matrix over domain embeddings. The induced leverage scores determine a mixture that upweights domains sharing common representations in embedding space. This formulation allows direct transfer to new data by computing the new domain embeddings. In experiments, we demonstrate improvements over three key scenarios: (i) our computed weights improve performance on pretraining domains with a fraction of the compute of existing methods; (ii) Chameleon can adapt to data changes without proxy retraining, boosting few-shot reasoning accuracies when transferred to new data; (iii) our method enables efficient domain reweighting in finetuning, consistently improving test perplexity on all finetuning domains over uniform mixture. Our code is available at https://github.com/LIONS-EPFL/Chameleon.
title Chameleon: A Flexible Data-mixing Framework for Language Model Pretraining and Finetuning
topic Machine Learning
Computation and Language
url https://arxiv.org/abs/2505.24844