목록 List

Thunder-LLM Training Toolkit

개요
Overview

한국어 LLM을 개발하기 위해서는 데이터 수집, 전처리, 연속학습(continual learning), 사후학습(post-training), 평가 등 다양한 과정이 필요합니다. 특히, LLM을 개발하기 위해 필요한 데이터의 양과 연산량이 방대하기 때문에, 이를 효율적으로 처리할 수 있는 도구가 필수적입니다. Thunder-LLM Training Toolkit은 한국어 LLM 개발에 필요한 데이터 수집, 정제, 모델 학습, 사후학습, 평가 도구를 제공합니다. 먼저 데이터 수집, 정제 도구를 통해 대량의 한국어 데이터를 수집하고 정제할 수 있습니다. 이어서, 연산 효율을 극대화한 모델 학습 및 사후학습 도구를 통해 LLM을 개발할 수 있습니다. 마지막으로, 성능 평가 도구를 활용하여 이미 공개된 다양한 벤치마크는 물론, Thunder-LLM 한국어 벤치마크까지 활용하여 모델을 평가할 수 있습니다.

Developing a Korean LLM requires various processes such as data collection, refinement, continual learning, post-training, and evaluation. Given the vast amount of data and computational resources needed for LLM development, efficient tools are essential. The Thunder-LLM Training Toolkit provides tools for data collection, refinement, continual learning, post-training, and evaluation necessary for Korean LLM development. First, the data collection and refinement tools allow for the gathering and cleaning of large volumes of Korean data. Next, the continual learning and post-training tools, optimized for computational efficiency, enable the development of LLMs. Finally, the evaluation tools can be used to assess models using various benchmarks, including those already published and the Thunder-LLM Korean benchmark.

데이터 수집
Data Collection

한국어 언어모델을 개발하기 위해서는 대량의 한국어 데이터가 필요하며, 특히 웹 데이터는 다양한 주제의 대량의 텍스트를 제공하므로, 모델의 한국어 이해 능력을 향상시키는데 중요한 자원입니다. 그러나, 한국어 웹 데이터는 주요 포털 사이트의 웹 서비스에 집중되어 있어 CommonCrawl 등에서 수집된 데이터의 양이 적습니다. 본 도구를 활용하면 다양한 한국어 웹 포털 서비스의 텍스트 데이터를 수집할 수 있습니다.

Developing a Korean language model requires a large amount of Korean data, and web data, in particular, provides a vast array of text on various topics, making it a crucial resource for enhancing the model's understanding of the Korean language. However, Korean web data is primarily concentrated in the web services of major portal sites, resulting in a limited amount of data collected from sources like CommonCrawl. Thunder-LLM Crawl is a tool that allows for the collection of text data from various Korean web portal services.

데이터 전처리
Data Preprocessing

Thunder-LLM Preprocess는 수집한 데이터를 정제하고 가공하는 도구로, 쉽고 빠른 데이터 전처리를 위해 다양한 함수를 제공합니다. 현재 약 40개의 데이터 전처리 함수를 지원하고 있으며, 이 함수들은 크게 다음과 같이 분류됩니다: (1) 불필요한 데이터를 제거하기 위한 Filter, (2) 데이터를 수정하기 위한 Mapper, (3) 데이터 샘플링을 위한 Selector, (4) 중복 데이터를 제거하기 위한 Deduplicator, (5) 사후학습(Fine-tuning) 데이터셋 생성을 위한 Formatter.

연구진의 데이터 전처리 기법에 대한 지속적인 연구를 바탕으로, 앞으로도 다양한 신규 함수들이 순차적으로 개발되어 추가될 예정입니다. Thunder-LLM Preprocess는 Hugging Face의 datasets 라이브러리를 기반으로 동작하며, 이를 통해 빠른 연산 속도와 다양한 Python 코드와의 높은 호환성을 자랑합니다. 현재는 효율적인 데이터 병렬 학습을 지원하기 위해 데이터를 자동으로 분할하여 저장하는 기능을 추가로 제공하고 있으며, 향후에는 시각화, 품질 평가, 자동 전처리 파이프라인 구성 등 다양한 고급 기능들도 순차적으로 도입될 예정입니다.

Thunder-LLM Preprocess is a tool for refining and processing collected data, offering various functions for easy and fast data preprocessing. Currently, it supports approximately 40 data preprocessing functions, which can be broadly categorized into: (1) Filters for removing unnecessary data, (2) Mappers for modifying data, (3) Selectors for sampling data, (4) Deduplicators for removing duplicate data, and (5) Formatters for creating post-training (fine-tuning) datasets.

Based on ongoing research by the team on data preprocessing techniques, new functions will be developed and added sequentially in the future. Thunder-LLM Preprocess operates on the Hugging Face datasets library, boasting fast computation speeds and high compatibility with various Python codes. It currently provides an additional feature that automatically splits and saves data to support efficient data parallel training. In the future, advanced features such as visualization, quality assessment, and automatic preprocessing pipeline configuration will be introduced sequentially.

패턴 기반 라인 필터링(Pattern-Aware Line Filtering) 기법은 웹 데이터 내의 라인 단위 품질 신호를 문서 전체의 맥락에서 해석하여 의미 있는 텍스트만을 추출하는 데이터 정제 도구입니다. 기존의 라인 단위 중복 제거(Line-Level Deduplication)나 문장부호 필터링(Trailing-Punctuation Filtering)과 같은 기법들은 각 라인을 독립적으로 평가하는 반면, 패턴 기반 라인 필터링은 품질 신호가 문서 전체에 걸쳐 어떻게 분포하는지를 고려합니다. 이러한 분포 패턴을 고려함으로써, 패턴 기반 라인 필터링은 텍스트의 구조적 및 의미적 완전성을 유지하면서도 노이즈가 많거나 품질이 낮은 콘텐츠를 효과적으로 제거합니다. 기존 기법 대비 패턴 기반 라인 필터링은 데이터의 구조적 형태를 해치지 않아 한국어와 영어 데이터의 품질을 개선하고, 각 언어로 학습된 LLM의 벤치마크 성능을 향상시킵니다. 패턴 기반 라인 필터링은 패턴 기반 라인 중복 제거(Pattern-Aware Line-Level Deduplication)패턴 기반 문장부호 필터링(Pattern-Aware Trailing-Punctuation Filtering)으로 구성되어 있습니다. 패턴 기반 라인 필터링 기법은 공개된 데이터인 CommonCrawl WET 데이터를 대상으로 설계되었습니다. 따라서 누구나 공식 CommonCrawl 홈페이지에서 원시 데이터를 다운로드하여 패턴 기반 라인 필터링 기법을 적용할 수 있습니다. 패턴 기반 라인 필터링 기법의 구현은 별도의 오픈소스 코드로 공개되어 있으며, 향후 Thunder-LLM Preprocess 파이프라인에 통합되어 배포될 예정입니다.

The Pattern-Aware Line Filtering method is a data cleaning tool that interprets line-level quality signals in web data within the broader context of each document, allowing it to extract only meaningful text. Unlike conventional approaches such as Line-Level Deduplication or Trailing-Punctuation Filtering, which evaluate each line independently, Pattern-Aware Line Filtering considers how quality signals are distributed across the entire document. By considering these distributional patterns, Pattern-Aware Line Filtering preserves the structural and semantic integrity of the text while effectively removing noisy or low-quality content. Compared to existing filtering techniques, Pattern-Aware Line Filtering retains the structure of each data instance, improving both Korean and English corpora and enhancing the benchmark performance of LLMs trained on them. Pattern-Aware Line Filtering consists of Pattern-Aware Line-Level Deduplication and Pattern-Aware Trailing-Punctuation Filtering. The Pattern-Aware Line Filtering method is designed for use with publicly available CommonCrawl WET data, allowing anyone to download the raw data from the official CommonCrawl website and apply the Pattern-Aware Line Filtering technique. The implementation of the Pattern-Aware Line Filtering method is publicly available as open-source code and will be integrated into the Thunder-LLM Preprocess pipeline for future distribution.

모델 학습
Model Training

Thunder-LLM Training Toolkit은 다양한 최적화 기법을 적용해 모델을 효율적으로 학습하는 코드를 제공합니다. FP8 혼합 정밀도(FP8 mixed precision) 학습을 지원해 최신의 GPU에서 모델을 학습할 때 성능을 크게 향상시킵니다. 학습 과정에서 데이터를 관리하는 데 필요한 Dataloader는 불필요한 I/O를 줄이는 최적화를 적용해 I/O로 인한 병목 현상을 최소화합니다.

The continual learning tools in the Thunder-LLM Training Toolkit provide various optimization techniques to improve training speed. First, it supports FP8 mixed precision training, significantly enhancing computational speed during model training. Additionally, it can utilize all Llama models implemented with the Hugging Face Transformer Engine library. When using models implemented with the Transformer Engine library, computational efficiency on NVIDIA GPUs is improved. Finally, the improved Dataloader minimizes bottlenecks caused by I/O by reducing unnecessary I/O operations.

사후 학습
Post-Training

Thunder-LLM Training Toolkit의 사후 학습(post-training) 도구는 이미 학습된 모델의 성능을 더욱 개선하기 위한 학습도구입니다. 현재 SFT(Supervised Fine-Tuning), DPO(Direct Preference Optimization) 기법을 지원하며, 다양한 기법을 지속적으로 추가 개발해 나갈 것입니다.

The post-training tools in the Thunder-LLM Training Toolkit are designed to enhance the performance of already trained models. Currently, it supports SFT (Supervised Fine-Tuning) and DPO (Direct Preference Optimization) techniques, and can utilize all Llama models implemented with the Hugging Face Transformer Engine library. Notably, using NVIDIA's Transformer Engine library can improve computational efficiency on NVIDIA GPUs.

평가 도구
Evaluation Tools

Thunder-LLM Training Toolkit의 평가 도구는 모델의 성능을 평가하는 도구를 제공합니다. 보편적으로 사용되는 한국어 및 영어 벤치마크들 뿐만 아니라 Thunder-LLM 한국어 벤치마크를 활용한 모델 평가 기능도 제공합니다.

The evaluation tools in the Thunder-LLM Training Toolkit provide capabilities for assessing model performance. Built on the LM Evaluation Harness, it allows for the evaluation of models using a wide range of benchmarks provided by the LM Evaluation Harness. Additionally, it offers functionality for evaluating models using the Thunder-LLM Korean benchmark, enabling performance assessment specifically for Korean language models.

Acknowledgements
Acknowledgements

본 연구는 과학기술정보통신부 선도연구센터사업(ERC)의 지원을 받아 수행된 연구입니다 (과제번호: RS-2023-00222663, 초거대 AI 모델 및 플랫폼 최적화 센터). 또한, GPU 장비는 과학기술정보통신부·광주광역시가 공동 지원한 '인공지능 중심 산업융합 집적단지 조성사업'의 지원을 받았습니다.

This work was supported by the National Research Foundation of Korea (NRF) under Grant No. RS-2023-00222663 (Center for Optimizing Hyperscale AI Models and Platforms, ERC). This research was also supported by Artificial intelligence industrial convergence cluster development project funded by the Ministry of Science and ICT(MSIT, Korea)&Gwangju Metropolitan City.

Contributors
Contributors

박종원*, 김진표*, 박찬우*, 조경제+, 이상민*, 강민규*, 김한별*, 김종민+, 박수영+, 안예림+, 박종연+, 이재진*+

* 서울대학교 컴퓨터공학부
+ 서울대학교 데이터사이언스대학원

Jongwon Park*, Jinpyo Kim*, Chanwoo Park*, Gyeongje Cho+, Sangmin Lee*, Mingyu Kang*, Hanbeul Kim*, Jongmin Kim+, Suyoung Park+, Yerim Ahn+, Jongyeon Park+, Jaejin Lee*+

*Department of Computer Science and Engineering, Seoul National University
+Graduate School of Data Science, Seoul National University