๐ ์์
์์ฝ (2026-01-20) ๐ฏ ๋ชฉํ BiGS์ Mamba ๋ชจ๋ธ์ CodeXGLUE line completion ํ์คํฌ๋ก fine-tuning ๐ด ๋ฐ๊ฒฌ๋ ๋ฌธ์ ๋ค
Dataset ๋ฌธ์ (Root Cause)
code_x_glue_cc_code_completion_line ๋ฐ์ดํฐ์
์ gt ํ๋๊ฐ ์์ ํ ๋น์ด์์ ๊ฒฐ๊ณผ: loss=0.0, eval_loss=NaN
Context Truncation ๋ฌธ์
๊ธด ์ฝ๋๊ฐ max_length=512๋ก ์๋ฆฌ๋ฉด์ target(gt)์ด ์ฌ๋ผ์ง 39%์ ์ํ์์ valid labels๊ฐ 0๊ฐ
API ํธํ์ฑ ๋ฌธ์
HuggingFace Trainer์ log() ๋ฉ์๋ ์๊ทธ๋์ฒ ๋ณ๊ฒฝ start_time ํ๋ผ๋ฏธํฐ ํ์ํ
โ
ํด๊ฒฐ ๋ฐฉ๋ฒ ๋ฐ์ดํฐ์
์ ํ:
code_x_glue_cc_code_completion_line (๋ฌธ์ ์์) โ code_x_glue_cc_code_completion_token (์ ์) 100K train, 50K test samples
ํ ํฐ์ผ๋ก ๋ผ์ธ ๊ตฌ๋ถ ์ ์ฒ๋ฆฌ ๋ก์ง ๊ฐ์ : python# โ
ํต์ฌ: target ๊ธธ์ด๋ฅผ ๋จผ์ ๊ณ์ฐ ํ context ์ ํ target_length = len(tokenizer(target_text)['input_ids']) max_context_length = max(50, max_length - target_length - 10) context_encoded = tokenizer(context_text, max_length=max_context_length) # โ
Validation: valid labels ์์ผ๋ฉด skip if sum(1 for l in labels if l != -100) == 0: return {'input_ids': [], 'labels': []} ๐ ์์ฑ๋ ํ์ผ๋ค BiGS: /mnt/user-data/outputs/finetune_line_bigs_fixed.py โ
/mnt/user-data/outputs/bigs-line-fixed-sbatch.sh โ
์ถ๋ ฅ ๊ฒฝ๋ก: /storage/athene/work/kim/causal/output_line_completion_fixed ๋ก๊ทธ: line_bigs_fixed_output.txt, line_bigs_fixed_error.txt Mamba: /mnt/user-data/outputs/finetune_line_mamba_fixed.py โ
/mnt/user-data/outputs/mamba-line-fixed-sbatch.sh โ
์ถ๋ ฅ ๊ฒฝ๋ก: /storage/athene/work/kim/mamba/output_line_completion_fixed ๋ก๊ทธ: line_mamba_fixed_output.txt, line_mamba_fixed_error.txt ๐ง ์ต์ข
์์ ์ฌํญ (์ค๋ ์๋ฃ) Triton Cache & WandB ์ค์ ์ถ๊ฐ (์คํฌ๋ฆฝํธ ๋งจ ์) python triton_cache = os.path.join(os.getcwd(), "triton_cache") os.environ["XDG_CACHE_HOME"] = triton_cache os.environ["TRITON_CACHE_DIR"] = triton_cache log() ๋ฉ์๋ ์๊ทธ๋์ฒ ์์ python def log(self, logs, start_time=None, **kwargs): super().log(logs, start_time=start_time, **kwargs) ๐ ๋ด์ผ ํ ์์
ํ์ผ ๋ณต์ฌ ๋ฐ ์คํ bash # BiGS cd /storage/athene/work/kim/causal cp /mnt/user-data/outputs/finetune_line_bigs_fixed.py ./ sbatch bigs-line-fixed-sbatch.sh # Mamba cd /storage/athene/work/kim/mamba cp /mnt/user-data/outputs/finetune_line_mamba_fixed.py ./ sbatch mamba-line-fixed-sbatch.sh ํ์ต ๋ชจ๋ํฐ๋ง ๋ก๊ทธ ํ์ธ: tail -f line_*_fixed_error.txt ํ์ธ์ฌํญ: โ
Loss๊ฐ ์ค์ ๊ฐ์ผ๋ก ๋์ค๋์ง โ
Eval loss๊ฐ NaN์ด ์๋์ง โ
Perplexity ๊ณ์ฐ๋๋์ง โ
Accuracy ๋ฉํธ๋ฆญ ๋์ค๋์ง ํ์ต ์๋ฃ ํ ๋ชจ๋ธ ์ ์ฅ ํ์ธ: output_line_completion_fixed/ ๋๋ ํ ๋ฆฌ ์ต์ข
์ฑ๋ฅ ๋น๊ต: BiGS vs Mamba ๐ ์ฐธ๊ณ ์ฌํญ Pretrained ๋ชจ๋ธ ๊ฒฝ๋ก: BiGS: /storage/athene/work/kim/causal/output4/fim_code Mamba: /storage/athene/work/kim/mamba/output_mamba/fim_code ๋ฐ์ดํฐ์
ํฌ๊ธฐ: 9000 train, 1000 eval ํ์ดํผํ๋ผ๋ฏธํฐ: BiGS LR: 5e-5 Mamba LR: 1e-4 Batch size: 8 (gradient accumulation: 4) Epochs: 3 Max length: 512 ์ด์ ์คํจํ ์คํ๋ค: output_line_completion (not _fixed) ๋๋ ํ ๋ฆฌ๋ ๋ฌด์ํ์
๋ ๋ฉ๋๋ค.