컴백부터 K-뷰티까지 — K-컬쳐의 모든 것을 메일로 받아보세요메일로 받아보기

METAL MEDIA

수학 문장을 Lean 4 코드로 바꿀 때, 정답 라이브러리를 찾아주고 컴파일러가 틀린 곳을 짚어주면 8B짜리 작은 모델도 32B급을 이긴다

arXiv:2608.142212026-08-14

MathForm: Scaling Mathematical Autoformalization with Knowledge Retrieval and Verification-Guided Refinement

수학 문장을 Lean 4 코드로 바꿀 때, 정답 라이브러리를 찾아주고 컴파일러가 틀린 곳을 짚어주면 8B짜리 작은 모델도 32B급을 이긴다

자연어로 쓰인 수학 문제를 컴퓨터가 검증할 수 있는 Lean 4 코드로 자동 변환하는 작업(오토포멀라이제이션)은 단순 번역이 아니라 Mathlib이라는 방대한 수학 라이브러리의 정의와 규칙을 정확히 매핑해야 하는 문제다. 이 논문은 생성 전에 관련 라이브러리 지식을 검색해 주고, 생성 후에는 컴파일 오류와 의미 일치 여부를 확인해 반복적으로 고쳐나가는 MathForm 파이프라인을 만들어 약 36만7천 개의 검증된 데이터셋 FormalVerse를 구축했다. 이 데이터로 학습한 MathForm-8B는 6개 벤치마크에서 평균 문법통과율 88.06%, 의미일치통과율 72.37%를 기록하며 여러 32B급 전문 모델을 앞섰다.

METAL MEDIA 해설 도표

수학 문장을 Lean 4 코드로 바꿀 때, 정답 라이브러리를 찾아주고 컴파일러가 틀린 곳을 짚어주면 8B짜리 작은 모델도 32B급을 이긴다

  1. 01기존 방식은 모델이 외운 지식에만 의존해 존재하지 않는 정리를 인용하거나 라이브러리 관례에 어긋나는 코드를 만드는 문제가 있었고, 데이터 구축도 대량 생성 후 걸러내는 방식이라 실패 원인을 알려주지 못했다
  2. 02MathForm은 생성 전 Mathlib에서 관련 정의·정리를 검색해주는 계획자와, 컴파일 진단 및 의미일치 판정(QwQ-32B가 심사)을 받아 최대 3라운드까지 고쳐나가는 반복 정제 구조를 갖췄고, 최종적으로 GPT류 판정 모델(gpt-oss-120b)로 다시 검증했다
  3. 03이렇게 만든 FormalVerse 데이터로 Qwen3-8B를 지도학습(SFT) 후 강화학습(DAPO)까지 거쳐 MathForm-8B를 학습시켰다
  4. 04결과적으로 어려운 FATE-H, FATE-X 벤치마크에서 의미일치통과율 63%, 37%를 기록해 기존 최강 전문 모델보다 각각 10, 12포인트 높았고, 추상 대수처럼 라이브러리 지식이 많이 필요한 영역일수록 격차가 커졌다
  5. 05동일 데이터 규모(10만 개)로 비교했을 때 FormalVerse로 학습한 모델이 다른 공개 Lean 4 데이터셋보다 의미일치통과율에서 최대 18.83포인트 앞섰다
METAL MEDIA이 원문을 바탕으로 재구성한 해설 도표이며, 논문 저자의 원문 figure가 아닙니다.

무엇을 했나

  1. 기존 방식은 모델이 외운 지식에만 의존해 존재하지 않는 정리를 인용하거나 라이브러리 관례에 어긋나는 코드를 만드는 문제가 있었고, 데이터 구축도 대량 생성 후 걸러내는 방식이라 실패 원인을 알려주지 못했다
  2. MathForm은 생성 전 Mathlib에서 관련 정의·정리를 검색해주는 계획자와, 컴파일 진단 및 의미일치 판정(QwQ-32B가 심사)을 받아 최대 3라운드까지 고쳐나가는 반복 정제 구조를 갖췄고, 최종적으로 GPT류 판정 모델(gpt-oss-120b)로 다시 검증했다
  3. 이렇게 만든 FormalVerse 데이터로 Qwen3-8B를 지도학습(SFT) 후 강화학습(DAPO)까지 거쳐 MathForm-8B를 학습시켰다
  4. 결과적으로 어려운 FATE-H, FATE-X 벤치마크에서 의미일치통과율 63%, 37%를 기록해 기존 최강 전문 모델보다 각각 10, 12포인트 높았고, 추상 대수처럼 라이브러리 지식이 많이 필요한 영역일수록 격차가 커졌다
  5. 동일 데이터 규모(10만 개)로 비교했을 때 FormalVerse로 학습한 모델이 다른 공개 Lean 4 데이터셋보다 의미일치통과율에서 최대 18.83포인트 앞섰다
Figure 1: Macro-average Pass@8 (%) across six benchmarks among specialized autoformalizers. MathForm-8B achieves the strongest overall performance within this category despite its smaller model size.
Figure 1: Macro-average Pass@8 (%) across six benchmarks among specialized autoformalizers. MathForm-8B achieves the strongest overall performance within this category despite its smaller model size.
Table 1: Pass@8 pass rates (%) under Syntax Check (SC) and Consistency Check (CC) for specialized autoformalizers on six benchmarks. AVG is the equally weighted macro-average across all six benchmarks. For each column, the best result is shown in bold and the second best is underlined.
AVGFormalMATHProverBenchCombiBenchFATE-MFATE-HFATE-X
ModelSCCCSCCCSCCCSCCCSCCCSCCCSCCC
Specialized Autoformalizers
Herald Translator-7B64.1227.6395.2947.7678.7437.3677.005.0070.6754.6742.0015.0021.006.00
Kimina-Autoformalizer-7B73.2034.3799.2976.2496.5556.3295.0016.0077.3344.6743.008.0028.005.00
Mathesis-HPO-7B76.2034.9699.0679.2997.1359.7796.0015.0084.0048.6750.004.0031.003.00
StepFun-Formalizer-7B58.1239.5597.4181.4189.6659.2079.0028.0060.6752.6717.0012.005.004.00
StepFun-Formalizer-32B63.6544.4799.0685.8892.5364.9486.0032.0071.3360.0023.0017.0010.007.00
Goedel-Formalizer-V2-8B78.2460.0898.8294.1298.2889.6689.0042.0087.3382.6762.0044.0034.008.00
Goedel-Formalizer-V2-32B78.2863.7499.0694.5998.2892.5391.0049.0089.3385.3363.0048.0029.0013.00
ReForm-8B81.7666.2199.0694.1298.8590.8086.0047.0094.6791.3367.0053.0045.0021.00
ReForm-32B81.6168.4199.0695.5398.2894.2593.0055.0091.3388.6769.0052.0039.0025.00
Ours
MathForm-8B-SFT84.3866.5399.2991.06100.0090.8083.0043.0098.0091.3380.0058.0046.0025.00
MathForm-8B88.0672.37100.0095.06100.0094.8393.0047.0099.3397.3382.0063.0054.0037.00
Figure 2: Overview of the MathForm data construction and training pipeline. The system combines Mathlib knowledge retrieval, compilation and semantic verification, and iterative refinement to generate reliable formal data, followed by trajectory reconstruction and training of MathForm-8B.
Figure 2: Overview of the MathForm data construction and training pipeline. The system combines Mathlib knowledge retrieval, compilation and semantic verification, and iterative refinement to generate reliable formal data, followed by trajectory reconstruction and training of MathForm-8B.
Table 2: Ablation results for SC and CC pass rates (%) of the refinement pipeline with two generators on the FATE series. Single denotes single-pass generation; BoN denotes Best-of-N; Feedback denotes feedback-only iteration; and Retrieval denotes retrieval-only single-pass generation. AVG is the equally weighted average over FATE-M, FATE-H, and FATE-X.
AVGFATE-MFATE-HFATE-X
MethodSCCCSCCCSCCCSCCC
gpt-oss-120b
Single27.3326.4352.0051.3021.0019.009.009.00
BoN42.6741.1070.0069.3040.0037.0018.0017.00
Feedback42.5740.7768.7067.3041.0038.0018.0017.00
Retrieval32.2329.0056.7052.0027.0026.0013.009.00
MathForm49.6748.0076.0074.0046.0044.0027.0026.00
Qwen3-235B-A22B-Thinking-2507
Single7.437.4313.3013.305.005.004.004.00
BoN18.7718.7733.3033.3014.0014.009.009.00
Feedback28.7728.7751.3051.3022.0022.0013.0013.00
Retrieval9.908.5716.7016.708.006.005.003.00
MathForm37.5736.2360.7058.7032.0031.0020.0019.00
Figure 3: Distribution of natural-language problem sources in FormalVerse.
Figure 3: Distribution of natural-language problem sources in FormalVerse.
Table 3: Pass@8 SC and CC pass rates (%) of models trained on different datasets across six benchmarks. All models are initialized from Qwen3-8B and trained on 100K examples under the same trajectory reconstruction and training configuration. AVG is the equally weighted macro-average across all six benchmarks. The best result in each column is shown in bold and the second best is underlined.
AVGFormalMATHProverBenchCombiBenchFATE-MFATE-HFATE-X
Training DatasetSCCCSCCCSCCCSCCCSCCCSCCCSCCC
NuminaMath-LEAN66.2441.4999.5385.1896.5572.4187.0025.0069.3349.3335.0016.0010.001.00
FineLeanCorpus78.2546.53100.0084.4798.8574.7196.0029.0090.6768.0053.0017.0031.006.00
FormalVerse77.1760.3298.8290.5998.8589.6678.0036.0095.3384.6762.0046.0030.0015.00
Figure 4: Numbers of natural-language-to-formal-language pairs accepted in successive refinement rounds. Later rounds contribute an additional 31.0% of all retained pairs.
Figure 4: Numbers of natural-language-to-formal-language pairs accepted in successive refinement rounds. Later rounds contribute an additional 31.0% of all retained pairs.
Table 4: Judge-model reliability on the human-annotated semantic-consistency test set (Mean@3).
Judge ModelAccuracyPrecisionRecallF1
gpt-oss-120b0.89170.87550.91330.8940
QwQ-32B0.85670.83670.88670.8609
gpt-oss-20b0.85000.81420.90670.8579
Figure 5: Training dynamics during reinforcement learning. The left panel shows the training reward and its exponential moving average (EMA), while the right panel reports the Mean@3 pass rate on FATE-H over the course of training.
Figure 5: Training dynamics during reinforcement learning. The left panel shows the training reward and its exponential moving average (EMA), while the right panel reports the Mean@3 pass rate on FATE-H over the course of training.
Table 5: Supervised fine-tuning hyperparameters.
HyperparameterValue
Maximum sequence length16,384
Global batch size128
Learning rate2.0×10−5
Epochs3
LR schedulerCosine
Warmup ratio0.1
Precisionbf16
Figure 6: Category distribution of the natural-language mathematical problems in FormalVerse.
Figure 6: Category distribution of the natural-language mathematical problems in FormalVerse.
Table 7: Pass@8 SC and CC pass rates (%) of general-purpose LLMs and MathForm-8B across six benchmarks. AVG is the equally weighted macro-average across all six benchmarks. The best result in each column is shown in bold and the second best is underlined.
AVGFormalMATHProverBenchCombiBenchFATE-MFATE-HFATE-X
ModelSCCCSCCCSCCCSCCCSCCCSCCCSCCC
General-Purpose LLMs
DeepSeek-V4-Pro78.3476.5497.8896.2494.8393.6885.0081.0087.3387.3370.0068.0035.0033.00
Qwen3.7-Plus86.3383.3899.2998.59100.0097.7092.0087.0094.6792.0078.0077.0054.0048.00
Qwen3-235B-A22B-Thinking-250758.9455.3791.2988.2481.0375.2959.0050.0071.3370.6732.0030.0019.0018.00
Qwen3-32B43.0736.5580.9472.9461.4950.0043.0027.0046.0043.3320.0019.007.007.00
DeepSeek-R1-0528-Qwen3-8B47.2837.6572.2461.1852.3040.2336.0015.0036.0030.004.004.004.001.00
Qwen3-8B27.2517.0661.8842.1237.9327.5929.007.0026.6722.674.003.004.000.00
Ours
MathForm-8B88.0672.37100.0095.06100.0094.8393.0047.0099.3397.3382.0063.0054.0037.00
Table 8: Human-evaluation results (%) on FATE-M and FATE-H, based on one randomly sampled candidate per problem. The best result in each column is shown in bold.
FATE-MFATE-H
ModelSCCCSCCC
StepFun-Formalizer-32B42.6736.0016.0012.00
Goedel-Formalizer-V2-32B75.3368.0038.0027.00
ReForm-32B78.6774.0050.0041.00
MathForm-8B86.6776.6754.0042.00

왜 중요한가

수학 정리증명 AI를 키우려면 사람이 손으로 만들기 힘든 대량의 검증된 형식 언어 데이터가 필요한데, 이 연구는 그 데이터를 자동으로, 더 정확하게 만드는 방법을 보여준다. 작은 모델도 좋은 데이터와 검증 파이프라인만 있으면 훨씬 큰 모델을 능가할 수 있다는 점은 비용 효율적인 AI 개발에 시사하는 바가 크다.

이 논문의 용어

  • 오토포멀라이제이션(Autoformalization) · 자연어로 된 수학 문장을 Lean 같은 컴퓨터 검증 가능한 형식 언어로 자동 변환하는 작업
  • Lean 4 / Mathlib · 수학 정리를 컴퓨터가 검증할 수 있게 코드로 표현하는 증명 보조 언어(Lean)와 그 안의 방대한 정의·정리 라이브러리(Mathlib)
  • Syntax Check / Consistency Check · 생성된 코드가 문법적으로 컴파일되는지 확인하는 검사(SC)와, 원래 자연어 문장의 의미를 제대로 담고 있는지 확인하는 검사(CC)
  • Pass@8 · 한 문제당 8번 시도해서 몇 번이나 성공하는지를 비율로 나타낸 평가 지표
  • DAPO / 강화학습(RL) · 모델이 만든 여러 후보 답을 비교해 더 나은 답을 만들도록 보상 신호로 학습을 조정하는 방법

저자 · Lushi Pu

arXiv에서 원문 보기

최신 논문

논문 전체 보기 →

METAL MEDIA 최신 기사

그림 출처: Lushi Pu et al., arXiv:2608.14221, CC BY 4.0