데이터·GPU가 부족할 때 LLM 파인튜닝 전략: DSS + LoRA/QLoRA
An efficient strategy for fine-tuning large language models
TL;DR Highlight
DSS로 데이터 만들고 GPU 사정에 맞게 LoRA·QLoRA를 고르면 된다
Who Should Read
자연어를 Query DSL로 바꾸는 기능을 만들려는데 학습 데이터와 GPU가 부족한 백엔드 개발자
Core Mechanics
- 데이터는 선생 모델이 만든다
- Distilling Step-by-Step(DSS)은 선생 모델이 정답 라벨과 풀이 과정(rationale)을 함께 만들어 준다.
- 풀이 과정은 Chain-of-Thought 프롬프팅으로 뽑는다.
- 대상 작업은 자연어→Query DSL
- 자연어 질문을 구조화된 Query DSL로 바꾸는 생성 작업에 적용했다.
- GPU가 되면 전체 파인튜닝이 최강
- 평가한 설정 중 DSS와 full-precision 파인튜닝 조합이 전체 성능이 가장 좋았다.
- 메모리가 모자라면 LoRA
- DSS+LoRA는 성능과 효율의 균형이 좋았다고 한다.
- 더 빡빡하면 QLoRA
- DSS+QLoRA는 더 작은 GPU 메모리에서도 학습이 되고 성능도 경쟁력 있게 유지됐다.
- alpha:rank는 4:1부터
- LoRA·QLoRA 설정 범위 전반에서 alpha 대 rank 비율 4:1이 성능과 연산량의 균형이 일정하게 좋았다.
Evidence
- 라벨만 vs 라벨+풀이 과정 비교
- 풀이 과정 감독을 뺀 label-only 설정과 DSS를 비교하는 ablation(요소 제거 실험)을 했다.
- 초록에는 구체적 수치가 없다.
- 세 가지 방식 하이퍼파라미터 스윕
- full-precision, LoRA, QLoRA를 각각 스윕으로 벤치마크했다.
- 초록에는 수치가 없어 정확한 차이는 알 수 없다.
How to Apply
- 선생 모델로 라벨+풀이 데이터 만들기
- 오늘 자연어→구조화 출력 샘플 20개를 골라 큰 모델에 단계별 풀이와 최종 출력을 같이 쓰게 하라.
- 아래 프롬프트를 붙여넣어 결과 품질을 확인하라.
- GPU 예산별로 방식 정하기
- 메모리가 충분하면 full-precision, 부족하면 LoRA, 더 부족하면 QLoRA를 고르라.
- LoRA 설정은 alpha=4×rank로 시작하기
- 예를 들어 rank 16이면 alpha 64로 놓고 스윕을 시작하라.
- label-only 기준선 만들기
- 같은 데이터로 풀이 과정을 뺀 학습을 돌려 DSS 효과를 직접 비교하라.
Try It
# Claude 또는 ChatGPT에 붙여넣기 (논문 방법의 간이 버전: DSS 데이터 생성 단계만 흉내)
너는 선생 모델이다. 아래 자연어 질문을 Query DSL로 변환하라.
단계별로 생각한 풀이 과정(rationale)을 먼저 쓰고, 마지막에 최종 Query DSL만 따로 출력하라.
스키마/필드 설명:
{{스키마}}
질문:
{{질문}}
출력 형식:
Rationale: ...
Label: <Query DSL>Terminology
관련 논문
Quadrillion-parameter transformer와 학습 방법: 고정 데이터에서 모델을 키우는 법
데이터가 고정이면 모델을 훨씬 키우고 weight decay와 ensembling을 쓰라는 scaling law
Astra가 Qwen 가중치를 직접 읽고 고쳐 MATH-500 48.1%로
LLM이 가중치를 직접 수정했더니 Qwen3.5-0.8B 수학 7.9%→48.1%
AI 글쓰기 버릇을 학습으로 뺀 Qwen3-4B (qwen3-4b-deslop)
Qwen3-4B를 LoRA로 증류했더니 AI 문체 점수가 121에서 12.5로 떨어졌다
Dust: 역전파 없이 Transformer를 사전학습하는 방법
활성값에 토큰별 노이즈를 줬더니 역전파 없이 Transformer 사전학습이 됐다
TurboGPT: 22KiB 트랜스포머를 13초 만에 학습시키는 CUDA 프로젝트
CUDA C++로 바이트 단위 tiny GPT를 1분 안에 학습하는 오픈소스
Gemini가 만든 라벨 $9로 자기 대체 모델 GLiNER 학습시키기
Gemini 라벨 $9로 GLiNER를 튜닝해 로컬에서 F1 0.83 달성
절대 포기하지 않기(Never Give Up): LLM RL에서 어려운 문제를 풀게 만드는 방법
쉬운 문제에 쓰는 연산을 줄이고 어려운 문제를 재시도했더니 어려운 문제 성능이 올랐다
3.8B LLM을 $998로 학습해 CORE 0.384 달성하기
B200 8장으로 43시간, $998를 들여 3.8B 모델이 CORE 0.384를 기록했다
Original Abstract (Expand)
Introduction Large Language Models (LLMs) achieve strong performance on many Natural Language Processing tasks, but adapting them to domain-specific applications is resource-intensive due to the cost of curating task-specific datasets and the compute required for fine-tuning. This work proposes an end-to-end strategy for rapidly fine-tuning LLMs for domain-specific tasks when both data and compute are limited. Methods The strategy uses Distilling Step-by-Step (DSS) for dataset development and model training, where a teacher model generates task labels and intermediate rationales via Chain-of-Thought prompting for a natural-language-to-Query-DSL structured generation task. Using the resulting supervision, we benchmark three fine-tuning modalities through hyperparameter sweeps: full-precision fine-tuning, Low-Rank Adaptation (LoRA), and Quantized LoRA (QLoRA). To isolate the effect of rationale supervision, we additionally conduct an ablation study comparing DSS training (label + rationale supervision) against a label-only configuration. Results Across the evaluated configurations, DSS combined with full-precision fine-tuning yields the strongest overall performance. Under resource constraints, DSS with LoRA provides an effective performance-efficiency tradeoff, and DSS with QLoRA enables training under tighter GPU memory budgets while maintaining competitive performance. In the parameter-efficient regimes, an alpha-to-rank ratio of 4:1 provides a consistent balance of performance and compute consumption across the explored settings. Discussion These findings support a practical process for resource-constrained domain adaptation: use DSS to efficiently construct datasets, then select the fine-tuning modality based on available compute (full-precision when feasible; LoRA or QLoRA when memory-limited). The proposed workflow offers a general guide for efficiently fine-tuning LLMs for domain-specific tasks with limited data availability.