논문 해설
FOAM: Blocked State Folding for Memory-Efficient LLM Training
FOAM: 메모리 효율적인 LLM 학습을 위한 블록 단위 상태 폴딩
- 연구 문제 Adam의 1차·2차 모멘트 저장이 LLM 학습의 메모리 병목을 만들며, 기존 완화 방법은 추가 계산이나 성능 저하를 동반합니다.
- 연구 방법 FOAM은 기울기를 인접 블록별로 평균하여 두 모멘트를 압축하고, 펼칠 때 생기는 잔차를 더해 블록 내 원소별 차이를 유지합니다.
- 주요 결과 LLaMA-1.3B pre-training에서 FOAM-3은 검증 perplexity 13.19로 Full-Adam의 14.51보다 낮았고, 메모리 절감과 함께 GLUE·MMLU fine-tuning에서도 비교 가능한 결과를 보였습니다.
Adam 옵티마이저의 메모리 병목
대규모 언어 모델 학습에서 Adam은 1차 모멘트와 2차 모멘트를 파라미터와 같은 크기로 저장하므로, 옵티마이저 상태가 모델 크기의 두 배만큼 메모리를 차지합니다. 원문은 7B 모델을 BF16으로 사전학습하는 데에도 매우 작은 배치 크기에서 최소 58GB가 필요하다고 설명합니다. 기존의 메모리 절감 방법은 SVD나 투영 행렬을 계산하여 추가 계산과 메모리를 쓰거나, 가중치를 동결하여 모델의 표현력을 제한하거나, 블록 단위로 학습률을 공유하여 성능을 바꾸는 방식이었습니다. FOAM은 이러한 방식과 달리 전체 파라미터 갱신을 유지하면서 두 모멘트를 함께 압축하는 것을 목표로 합니다.

Table 1 .Comparison of memory and computational complexity across methods.Let W∈R m×n with m≤n . GaLore and APOLLO use a rankr, whereasFOAMuses a levell.
원문 · CC BY 4.0 · Ziqing Wen, Jiahuan Wang, Ping Luo, Dongsheng Li, Tao Sun · FOAM: Blocked State Folding for Memory-Efficient LLM Training · 원문 그림 인용 · 원본 PDF 3쪽에서 그림 영역을 추출했습니다.
Figure 9 .Comparing FOAM with Adam employing block-wise learning rates.Block-wise Adam converges more rapidly and yields a lower final validation loss than the uniform-rate variant.FOAM’s performance remains on par with that of block-wise Adam.
원문 · CC BY 4.0 · Ziqing Wen, Jiahuan Wang, Ping Luo, Dongsheng Li, Tao Sun · FOAM: Blocked State Folding for Memory-Efficient LLM Training · 원문 그림 인용 · 원본 PDF 24쪽에서 그림 영역을 추출했습니다.블록 평균과 잔차 보정을 사용한 상태 압축
FOAM은 크기가 m×n인 가중치의 기울기 G_t를 인접한 2^l개 원소씩 묶어 평균을 취합니다. 이때 fold 연산자 A^(l)을 곱해 압축된 기울기 G̃_t를 얻고, 이 압축 값으로 1차 모멘트 M̃_t와 2차 모멘트 Ṽ_t를 갱신합니다. 펼침 연산자 E^(l)은 각 압축 원소를 해당 블록에 복제하므로, 같은 블록의 원소는 그대로 두면 동일한 갱신을 받게 됩니다. 이를 막기 위해 원문은 잔차 R_t = G_t − G̃_t E^(l)을 정의하고, 펼친 1차 모멘트에는 M_t = M̃_t E^(l) + R_t를, 2차 모멘트에는 V_t = Ṽ_t E^(l) + R_t²를 더합니다. 잔차는 현재 기울기에서만 계산되므로 따로 저장할 필요가 없습니다.
원문 Algorithm 1은 FOAM을 MLP와 Attention 모듈에 적용하고 Embedding 등 다른 모듈에는 Adam을 쓰며, 스케일 계수 α로 두 모듈의 학습률 비율을 조절한다고 밝힙니다.

Figure 1 .Overview ofFOAMoptimizer with a fold level ofl.
원문 · CC BY 4.0 · Ziqing Wen, Jiahuan Wang, Ping Luo, Dongsheng Li, Tao Sun · FOAM: Blocked State Folding for Memory-Efficient LLM Training · 원문 그림 인용 · 원본 PDF 1쪽에서 그림 영역을 추출했습니다.
Figure 8 .Study the effects ofαin Algorithm 1.As observed,FOAMis not sensitive to the choice ofαin our tests.
원문 · CC BY 4.0 · Ziqing Wen, Jiahuan Wang, Ping Luo, Dongsheng Li, Tao Sun · FOAM: Blocked State Folding for Memory-Efficient LLM Training · 원문 그림 인용 · 원본 PDF 23쪽에서 그림 영역을 추출했습니다.수렴률과 잔차 비율 δ_l
원문 Theorem 4.4는 η_t = η_0/√t인 조건에서 Assumption 4.1부터 4.3까지의 가정 아래 min_{1≤t≤T} E[∥∇f(W_t)∥²]가 O(log T + δ_l²)/√T + O(σ² log T/√T)로 상한된다고 주장합니다. 여기서 δ_l = max_t ∥R_t∥/∥G_t∥는 잔차가 기울기에서 차지하는 비율입니다. 원문 Lemma A.1은 P^(l) = A^(l)E^(l)이 멱등 대칭 행렬이며 δ_l ≤ 1임을 보입니다. 따라서 저자들은 δ_l이 수렴률의 차수를 바꾸지 않는다고 설명하며, 이 결과가 Adam과 같은 O(log T/√T) 수렴률을 가진다고 주장합니다. 이 결과는 L-smoothness, 유계 분산, 유계 기울기 가정에 의존하는 조건부 이론이며, 실험에서 전체 학습 경로의 수렴을 직접 증명한 것은 아닙니다.
LLaMA pre-training 결과
pre-training 실험은 C4 데이터셋에서 LLaMA 모델을 학습하고 검증 perplexity로 비교합니다. 60M부터 1.3B까지의 결과에서 FOAM-3은 LLaMA-1.3B에서 검증 perplexity 13.19를 기록하였고, 같은 표의 Full-Adam은 14.51입니다. 원문은 이때 FOAM-3의 메모리가 약 3.97GB이며 옵티마이저 메모리는 Adam 대비 79% 줄었다고 보고합니다. 3B와 7B 실험은 gradient checkpointing을 사용한 별도 표에 있으며, LLaMA-7B에서 FOAM-2의 검증 perplexity는 30k와 150k 단계에서 각각 15.78과 11.13으로 보고되어 Muon 등 기준선보다 낮습니다.
다만 이 수치들은 학습률과 α를 각 방법별로 탐색한 결과이며, 조건이 다른 두 표의 값을 하나의 통제 실험으로 합칠 수는 없습니다.

Table 2 .Final validation perplexity (lower is better, 3 independent runs for 60M to 350M models) and estimated memory usage (BF16, model, gradient, and optimizer states) for pre-training LLaMA models on the C4 dataset. FOAM consistently outperforms baselines by achieving comparable or lower validation PPL while requiring significantly less memory.
원문 · CC BY 4.0 · Ziqing Wen, Jiahuan Wang, Ping Luo, Dongsheng Li, Tao Sun · FOAM: Blocked State Folding for Memory-Efficient LLM Training · 원문 그림 인용 · 원본 PDF 5쪽에서 그림 영역을 추출했습니다.
Table 3 .Pre-training LLaMA-3B and LLaMA-7B models on the C4 dataset.We report the validation PPL across training steps, wall-clock training time, and real memory consumption with gradient checkpointing during training. We train LLaMA-3B on 16 NVIDIA RTX 3090 GPUs (24GB each), and LLaMA-7B on 4 NVIDIA H100 GPUs (80GB each).
원문 · CC BY 4.0 · Ziqing Wen, Jiahuan Wang, Ping Luo, Dongsheng Li, Tao Sun · FOAM: Blocked State Folding for Memory-Efficient LLM Training · 원문 그림 인용 · 원본 PDF 6쪽에서 그림 영역을 추출했습니다.
Table 9 .Hyperparameters (lr, α) for pre-training LLaMA models.
원문 · CC BY 4.0 · Ziqing Wen, Jiahuan Wang, Ping Luo, Dongsheng Li, Tao Sun · FOAM: Blocked State Folding for Memory-Efficient LLM Training · 원문 그림 인용 · 원본 PDF 19쪽에서 그림 영역을 추출했습니다.
Table 10 .Architecture hyperparameters of LLaMA for pre-training. Batch size and training data amount are specified in tokens.
원문 · CC BY 4.0 · Ziqing Wen, Jiahuan Wang, Ping Luo, Dongsheng Li, Tao Sun · FOAM: Blocked State Folding for Memory-Efficient LLM Training · 원문 그림 인용 · 원본 PDF 20쪽에서 그림 영역을 추출했습니다.
Table 13 .Estimated model/optimizer states memory comsumption for pre-training 60M-1.3B models.
원문 · CC BY 4.0 · Ziqing Wen, Jiahuan Wang, Ping Luo, Dongsheng Li, Tao Sun · FOAM: Blocked State Folding for Memory-Efficient LLM Training · 원문 그림 인용 · 원본 PDF 21쪽에서 그림 영역을 추출했습니다.
Figure 6 .PPL learning curves of pre-training LLaMA-60M and 130M on C4
원문 · CC BY 4.0 · Ziqing Wen, Jiahuan Wang, Ping Luo, Dongsheng Li, Tao Sun · FOAM: Blocked State Folding for Memory-Efficient LLM Training · 원문 그림 인용 · 원본 PDF 22쪽에서 그림 영역을 추출했습니다.
Table 14 .Recorded memory overhead for different methods on LLaMA-1.3B with a batch size of 32. We train the LLaMA-1.3B model on 32 NVIDIA RTX 3090 (24GB) GPUs.
원문 · CC BY 4.0 · Ziqing Wen, Jiahuan Wang, Ping Luo, Dongsheng Li, Tao Sun · FOAM: Blocked State Folding for Memory-Efficient LLM Training · 원문 그림 인용 · 원본 PDF 25쪽에서 그림 영역을 추출했습니다.GLUE와 MMLU fine-tuning 결과
fine-tuning 실험에서 RoBERTa-Large는 GLUE에서 평가되었고, Gemma3-1B, LLaMA3.2-3B, Qwen2.5-7B는 MMLU에서 평가되었습니다. GLUE 평균은 FOAM이 87.64로 Full-Adam의 87.66과 거의 같고, LoRA와 GaLore, APOLLO보다는 높습니다. MMLU에서 Qwen2.5-7B의 평균 정확도는 FOAM 73.04로 기록되었고, Full-Adam은 메모리 부족으로 OOM이었습니다. 원문은 이 결과를 FOAM이 fine-tuning에서도 비교 가능한 성능을 보인다는 근거로 제시합니다. 다만 Gemma3-1B에서는 FOAM 평균이 25.99로 Full-Adam의 26.04보다 낮아, 모든 모델에서 우위가 있다고 말할 수는 없습니다.

Table 4 .Evaluating FOAM for memory-efficient fine-tuning on the MMLU benchmark(1 A100 40GB GPU). We report the best average accuracy obtained by sweeping the learning rate over the range{1e−5,2.5e−5,5e−5,1e−4,1.5e−4,2e−4}.
원문 · CC BY 4.0 · Ziqing Wen, Jiahuan Wang, Ping Luo, Dongsheng Li, Tao Sun · FOAM: Blocked State Folding for Memory-Efficient LLM Training · 원문 그림 인용 · 원본 PDF 6쪽에서 그림 영역을 추출했습니다.
Table 5 .Evaluating FOAM for memory-efficient fine-tuning on the GLUE benchmark (higher is better), using a pre-trained RoBERTa-Large model. We report overall (matched and mismatched) accuracy for MNLI, Matthew’s correlation coefficient for CoLA, Pearson correlation for STS-B, and classification accuracy for all other tasks.
원문 · CC BY 4.0 · Ziqing Wen, Jiahuan Wang, Ping Luo, Dongsheng Li, Tao Sun · FOAM: Blocked State Folding for Memory-Efficient LLM Training · 원문 그림 인용 · 원본 PDF 7쪽에서 그림 영역을 추출했습니다.
Table 12 .Hyperparameters of fine-tuning different models on the MMLU benchmark forFOAM.
원문 · CC BY 4.0 · Ziqing Wen, Jiahuan Wang, Ping Luo, Dongsheng Li, Tao Sun · FOAM: Blocked State Folding for Memory-Efficient LLM Training · 원문 그림 인용 · 원본 PDF 20쪽에서 그림 영역을 추출했습니다.fold 수준과 잔차 항의 영향
원문은 fold 수준 l을 바꾸며 FOAM의 민감도를 확인합니다. GaLore, APOLLO, GWT는 낮은 메모리에서 성능이 크게 떨어지지만, FOAM은 l 변화에 상대적으로 안정적이라고 보고합니다. 잔차 항의 절제 실험에서는 잔차를 제거하면 같은 블록 원소가 동일한 갱신을 받아 수렴이 느려지고 최종 검증 perplexity가 높아졌습니다. 한편 Appendix의 Figure 5는 l=3에서도 잔차를 포함한 갱신이 Adam 갱신과 더 높은 코사인 유사도를 보인다고 보고합니다. 이 분석들은 잔차가 블록 내 차이를 복원한다는 해석을 뒷받침하지만, 이것만으로 잔차가 모든 설정에서 필수라고 단정할 수는 없습니다.

Figure 3 .Additional Investigation of FOAM.(a)Impact of the FOAM level l: FOAM exhibits strong robustness across varying memory constraints.(b)Extended training of LLaMA-130M on 39B tokens.(c)Integration ofFOAMwith Adam-Mini and Muon.
원문 · CC BY 4.0 · Ziqing Wen, Jiahuan Wang, Ping Luo, Dongsheng Li, Tao Sun · FOAM: Blocked State Folding for Memory-Efficient LLM Training · 원문 그림 인용 · 원본 PDF 8쪽에서 그림 영역을 추출했습니다.
Figure 5 .Cosine Similarities between the Update Matrices of FOAM with or without Residual and Adam.We report the average similarity across all modules within each layer. As observed, the update matrices including the residual term exhibit a higher cosine similarity with Adam’s updates compared to those without the residual. Specifically, for the setting l= 3 , FOAM updates maintain a cosine similarity greater than0.5with standard Adam, despite retaining only1/8of the original Adam optimizer state.
원문 · CC BY 4.0 · Ziqing Wen, Jiahuan Wang, Ping Luo, Dongsheng Li, Tao Sun · FOAM: Blocked State Folding for Memory-Efficient LLM Training · 원문 그림 인용 · 원본 PDF 22쪽에서 그림 영역을 추출했습니다.적용 범위와 남은 질문
원문은 자원 제약 때문에 최대 모델 크기를 7B까지만 검증했으며, 더 큰 모델과 많은 GPU 환경에서의 잠재력은 아직 확인하지 않았다고 밝힙니다. 또한 블록 기반 압축을 Vision Transformer나 확산 모델처럼 2차원을 넘는 기울기에 확장하는 문제와, GPU 간 통신 비용에 미치는 영향은 향후 과제로 남겨 둡니다. 실험의 많은 비교는 여러 시드 또는 특정 설정으로 수행되었으므로, 결과를 다른 데이터·모델·하드웨어로 그대로 옮겨서는 안 됩니다.
논문 정보
- 저자
- Ziqing Wen, Jiahuan Wang, Ping Luo, Dongsheng Li, Tao Sun
- 학회·저널
- arXiv · 프리프린트
- 최초 공개일
- 2025년 12월 8일
- 등록일
- 2026년 10월 29일
- 수정일
- 2026년 5월 13일
- 버전
- v2
- arXiv
- 2512.07112
- 분류
- cs.LG · cs.AI
- 원문 이용 조건
- CC BY 4.0
- 제공 범위
- 논문 정보, 해설, 허용된 원문 그림
AI 해설은 논문 원문과 별개의 설명이며 오류가 있을 수 있습니다. 원문과 그림은 각 출처의 이용 조건과 따로 표시된 권리를 따릅니다.
초록
Large language models (LLMs) have demonstrated remarkable performance due to their large parameter counts and extensive training data. However, their scale leads to significant memory bottlenecks during training, especially when using memory-intensive optimizers like Adam. Existing memory-efficient approaches often rely on techniques such as singular value decomposition (SVD), projections, or weight freezing, which can introduce substantial computational overhead, require additional memory for projections, or degrade model performance. In this paper, we propose Folded Optimizer with Approximate Moment (FOAM), a method that compresses optimizer states by computing block-wise gradient means and incorporates a residual correction to recover lost information. Theoretically, FOAM achieves convergence rates equivalent to vanilla Adam under standard non-convex optimization settings. Empirically, FOAM eliminates up to 90\% of the memory overhead of optimizer states and accelerates convergence. Furthermore, FOAM is compatible with other memory-efficient optimizers, delivering performance and throughput that match or surpass both full-rank and existing memory-efficient baselines. Code is available at https://github.com/zqOuO/FOAM.
원문 인용
Ziqing Wen, Jiahuan Wang, Ping Luo, Dongsheng Li, Tao Sun (2025). FOAM: Blocked State Folding for Memory-Efficient LLM Training. arXiv:2512.07112v2. https://arxiv.org/abs/2512.07112v2
BibTeX
@misc{wen2025foam,
title = {{FOAM: Blocked State Folding for Memory-Efficient LLM Training}},
author = {Ziqing Wen and Jiahuan Wang and Ping Luo and Dongsheng Li and Tao Sun},
year = {2025},
eprint = {2512.07112},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2512.07112v2}
}