Introduction
The performance of Large Language Models (LLMs) is heavily dependent on the composition of their training data. "Domain reweighting"—the process of determining the optimal mixture of diverse sources like Wikipedia, code, and academic papers—is a critical yet computationally expensive challenge. Existing automated solutions, such as DoReMi and DoGE, rely on training small proxy models to learn these weights. However, these methods suffer from high computational overhead and lack flexibility; adding a single new data source often necessitates retraining the proxy model from scratch.
Chameleon addresses these limitations by introducing a data-centric framework that calculates domain weights based on the intrinsic properties of the data in an embedding space. By utilizing Kernel Ridge Leverage Scores (KRLS), Chameleon achieves state-of-the-art performance while reducing compute overhead by up to 99% during data adaptation.
Methodology
Chameleon shifts the focus from optimization trajectories to data representation. The framework operates in four distinct stages:
- Domain Embedding Extraction: A sample of data from each domain is passed through an embedding model to generate representative domain vectors.
- Affinity Computation: A domain affinity matrix is constructed by calculating pairwise similarities (inner products) between these embeddings.
- KRLS Calculation: The framework computes Kernel Ridge Leverage Scores for each domain. These scores identify the uniqueness of a domain; high scores indicate "outlier" domains that are difficult to approximate, while low scores indicate "central" domains with shared characteristics.
- Phase-Specific Weighting: Chameleon applies these scores differently depending on the training stage. For pretraining, it uses the inverse of the KRLS to prioritize dense, common domains for general knowledge. For fine-tuning, it uses the direct KRLS to emphasize unique, task-specific data.
Experimental Setup
The authors evaluated Chameleon across several large-scale datasets, including SlimPajama-627B and The Pile. Performance was measured using perplexity and a suite of 13 standard reasoning benchmarks (e.g., ARC-E, HellaSwag, PIQA). For fine-tuning, the framework was tested on multilingual (Wiki40b) and code-specific (Stack-decup) datasets.
Results and Discussion
Chameleon demonstrates significant improvements in both efficiency and adaptability compared to state-of-the-art baselines.
Computational Efficiency
The most striking result is the reduction in compute requirements. On the SlimPajama dataset, Chameleon achieved competitive accuracy (39.6% average vs. 37.9% for a uniform mixture) while requiring only 0.8 GPU hours. This represents a massive reduction compared to DoReMi (7.4 hours) and DoGE (6.3 hours).
Adaptability and Fine-Tuning
Unlike previous methods, Chameleon adapts to new data without retraining. When scaling from SlimPajama to The Pile, Chameleon outperformed baselines using less than 1% of the compute typically required for proxy retraining. Furthermore, in fine-tuning scenarios, Chameleon consistently improved test perplexity across all domains, dropping the average on Wiki40b from 9.43 to 8.58.
Conclusion
Chameleon provides a robust, efficient, and flexible alternative to proxy-based domain reweighting. By leveraging the geometry of the embedding space through KRLS, it bridges the gap between pretraining and fine-tuning data strategies. Future work will focus on transitioning Chameleon to an online setting for dynamic weight optimization during training.
Summary updated