Published on

Scaling Laws for LLMs and Data Selection

Authors
  • avatar
    Name
    Antonio Castaldo
    Twitter

In recent years, the quest to improve machine translation (MT) has been transformed by advances in large language models (LLMs). A big question that researchers are asking is: how much data is enough data? A recent study helps answer this question by fine-tuning the Llama 3 8B model for translation tasks, using different amounts of data, and looking at how it affects translation quality (Vieira et al., 2024).

Data Selection and Translation Memories

Fine-tuning LLMs can improve translation quality by aligning them with specific topics or organizational styles. The study, "How Much Data is Enough Data?" highlights the use of translation memories (TMs) as a helpful resource for making translations more efficient and accurate. TMs are databases that contain segments of text that have already been translated by humans. These segments provide the models with important domain-specific information and help them learn a company’s unique tone and terminology.

Experiment Setup and Methodology

The researchers tested Llama 3's translation abilities with five language pairs: English to Brazilian Portuguese, Czech, German, Finnish, and Korean. The training data ranged in size from 1,000 to over 200,000 segments, allowing the researchers to see how different dataset sizes affected model performance. They used different metrics, such as BLEU, chrF++, TER, and COMET, to get a full picture of the translation quality.

The smallest datasets (1,000-2,000 segments) caused a performance drop compared to the baseline model, suggesting that the model overfitted and couldn't generalize well. Overfitting means that the model learned the training data too closely, which made it struggle to handle new, unseen examples effectively. However, with larger datasets, translation quality improved significantly across all metrics. The model trained on the largest dataset showed a 13-point increase in BLEU and a 25-point gain in COMET scores, demonstrating the clear benefits of more data.

Scaling Laws in Fine-Tuning

One key idea from the research is that of diminishing returns when fine-tuning LLMs. While larger datasets usually led to better results, the improvement became smaller after a certain point. It's like studying for an exam—initially, the more you study, the more you learn, but after a while, the extra study time doesn't help as much as before. For example, there was a big boost in translation quality when increasing from 5,000 to 10,000 segments, but after 100,000 segments, the gains became smaller. This suggests that adding more data might not always be worth the extra cost and effort.

Interestingly, the study found that gains depended on how well-resourced a language was. For lower-resource languages like Korean, performance improved significantly with larger datasets, showing the value of fine-tuning with more data for languages that don't have as much data available. This demonstrates how LLMs can adapt well if given enough domain-specific data, which can be especially helpful for supporting underrepresented languages.

Scaling Laws: Kaplan et al. and Chinchilla's Perspective

The findings from the Llama 3 study align closely with broader scaling laws for LLMs, especially those proposed by Kaplan et al. (2020) and later refined by Chinchilla's work (Hoffmann et al., 2022). Kaplan et al. introduced the idea that model performance scales predictably with more compute, larger model sizes, and bigger datasets. They suggested that adding more parameters and data was key to improving performance. However, focusing on increasing parameters often made the models computationally expensive.

Chinchilla's work built on Kaplan's ideas by emphasizing the need for balance between model size and dataset size. Chinchilla argued that many models were too large compared to the amount of training data they had, leading to inefficiencies. Instead, Chinchilla showed that a smaller model trained on much more data could outperform larger models trained on less data. This perspective highlights the importance of optimizing the ratio between data and parameters, suggesting that for a given compute budget, a balanced approach is better.

Implications for Data Selection

The Llama 3 study supports Chinchilla's findings by showing that simply adding more data beyond a certain point doesn't always give the best results. Instead, it is better to focus on the quality and domain relevance of the data. For companies looking to fine-tune LLMs, these findings show the importance of balancing the amount of data with how specific it is to the task. While large, high-quality datasets can lead to significant improvements, carefully curating data is just as important. TMs can be a great way to use existing high-quality translations without needing extremely large datasets, making it an efficient way to boost translation quality in specific situations.

The research also suggests that domain relevance often matters more than sheer volume. Smaller datasets that are carefully curated and represent the target domain can outperform larger, more generic datasets. This aligns with the idea of "smart data" over "big data," where picking the right examples has a bigger impact than just scaling the dataset without careful thought.

Conclusion

This study adds to our understanding of LLM scaling laws by showing how data selection and domain-specific fine-tuning can optimize translation results. The findings highlight the need to balance data quantity and quality, especially for in-house applications. For organizations, the takeaway is clear: using domain-specific translation memories, thoughtfully scaling datasets, and focusing on the specific needs of the target languages can lead to translation models that perform as well as or better than larger, more generic LLMs.

The insights from Kaplan et al. and Chinchilla's scaling laws further show that more data is not always better. Instead, the right balance of model size, data volume, and domain relevance is key. The research shows that with strategic data selection, smaller models like Llama 3 8B can be fine-tuned to perform very well, offering a cost-effective alternative to larger models like GPT-3.5 for specific tasks. This has promising implications for how we approach MT in the future, especially in optimizing LLMs for specific organizational needs


References

Hoffmann, J., Borgeaud, S., Mensch, A., Buchatskaya, E., Cai, T., Rutherford, E., Casas, D. de L., Hendricks, L. A., Welbl, J., Clark, A., Hennigan, T., Noland, E., Millican, K., Driessche, G. van den, Damoc, B., Guy, A., Osindero, S., Simonyan, K., Elsen, E., … Sifre, L. (2022). Training Compute-Optimal Large Language Models. arXiv. https://doi.org/10.48550/arXiv.2203.15556
Kaplan, J., McCandlish, S., Henighan, T., Brown, T. B., Chess, B., Child, R., Gray, S., Radford, A., Wu, J., & Amodei, D. (2020). Scaling Laws for Neural Language Models. arXiv. https://doi.org/10.48550/arXiv.2001.08361
Vieira, I., Allred, W., Lankford, S., Castilho, S., & Way, A. (2024). How Much Data is Enough Data? Fine-Tuning Large Language Models for In-House Translation: Performance Evaluation Across Multiple Dataset Sizes. arXiv. https://doi.org/10.48550/arXiv.2409.03454