Improve model card: Add title, paper link, project page, library name, pipeline tag and citation
#1
by
nielsr
HF Staff
- opened
README.md
CHANGED
|
@@ -1,12 +1,24 @@
|
|
| 1 |
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
base_model:
|
| 4 |
- Qwen/Qwen3-32B
|
|
|
|
|
|
|
|
|
|
| 5 |
---
|
| 6 |
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
| Model | Formalization Success Rate |
|
| 12 |
|----------|----------|
|
|
@@ -15,7 +27,7 @@ In our internal evaluation, we test the performance of formalizers on a eval set
|
|
| 15 |
|
| 16 |
Here is an example code to use this formalizer:
|
| 17 |
|
| 18 |
-
```
|
| 19 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 20 |
import torch
|
| 21 |
import re
|
|
@@ -33,8 +45,10 @@ informal_statement_content = "Prove that 3 cannot be written as the sum of two c
|
|
| 33 |
# Construct the prompt for the model
|
| 34 |
user_prompt_content = (
|
| 35 |
f"Please autoformalize the following natural language problem statement in Lean 4. "
|
| 36 |
-
f"Use the following theorem name: {problem_name}
|
| 37 |
-
|
|
|
|
|
|
|
| 38 |
f"{informal_statement_content}"
|
| 39 |
f"Think before you provide the lean statement."
|
| 40 |
)
|
|
@@ -57,7 +71,9 @@ model_output_text = tokenizer.batch_decode(outputs)[0]
|
|
| 57 |
def extract_code(text_input):
|
| 58 |
"""Extracts the last Lean 4 code block from the model's output."""
|
| 59 |
try:
|
| 60 |
-
matches = re.findall(r'```lean4
|
|
|
|
|
|
|
| 61 |
return matches[-1].strip() if matches else "No Lean 4 code block found."
|
| 62 |
except Exception:
|
| 63 |
return "Error during code extraction."
|
|
@@ -66,8 +82,23 @@ def extract_code(text_input):
|
|
| 66 |
extracted_code = extract_code(model_output_text)
|
| 67 |
|
| 68 |
print(time.time() - start)
|
| 69 |
-
print("output
|
| 70 |
-
|
| 71 |
-
|
|
|
|
|
|
|
| 72 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
```
|
|
|
|
| 1 |
---
|
|
|
|
| 2 |
base_model:
|
| 3 |
- Qwen/Qwen3-32B
|
| 4 |
+
license: apache-2.0
|
| 5 |
+
library_name: transformers
|
| 6 |
+
pipeline_tag: text-generation
|
| 7 |
---
|
| 8 |
|
| 9 |
+
# Goedel-Formalizer-V2-32B
|
| 10 |
+
|
| 11 |
+
This repository contains the **Goedel-Formalizer-V2-32B** model, a key component of the automated theorem proving system presented in the paper [G\u00f6del's Poetry](https://huggingface.co/papers/2512.14252).
|
| 12 |
+
|
| 13 |
+
G\u00f6del's Poetry employs specialized language models for Lean4 proof generation, combined with recursive decomposition of difficult theorems. This formalizer model is designed for translating informal math problems into formal statements in Lean 4.
|
| 14 |
+
|
| 15 |
+
Project Page: https://KellyJDavis.github.io/goedels-poetry/
|
| 16 |
+
Code: https://github.com/KellyJDavis/goedels-poetry
|
| 17 |
+
|
| 18 |
+
## Model Description
|
| 19 |
+
|
| 20 |
+
Different from all previous open-source formalizers, this formalizer has the ability to think before generating the lean4 statements, which significantly increases the accuracy of the translation.
|
| 21 |
+
In our internal evaluation, we test the performance of formalizers on an eval set containing 300 informal statements from Omni-MATH. Kimina-formalizer-8B successfully translates 161/300 statements, while Goedel-Formalizer-V2-32B succeeds in 228 statements.
|
| 22 |
|
| 23 |
| Model | Formalization Success Rate |
|
| 24 |
|----------|----------|
|
|
|
|
| 27 |
|
| 28 |
Here is an example code to use this formalizer:
|
| 29 |
|
| 30 |
+
```python
|
| 31 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 32 |
import torch
|
| 33 |
import re
|
|
|
|
| 45 |
# Construct the prompt for the model
|
| 46 |
user_prompt_content = (
|
| 47 |
f"Please autoformalize the following natural language problem statement in Lean 4. "
|
| 48 |
+
f"Use the following theorem name: {problem_name}
|
| 49 |
+
"
|
| 50 |
+
f"The natural language statement is:
|
| 51 |
+
"
|
| 52 |
f"{informal_statement_content}"
|
| 53 |
f"Think before you provide the lean statement."
|
| 54 |
)
|
|
|
|
| 71 |
def extract_code(text_input):
|
| 72 |
"""Extracts the last Lean 4 code block from the model's output."""
|
| 73 |
try:
|
| 74 |
+
matches = re.findall(r'```lean4
|
| 75 |
+
(.*?)
|
| 76 |
+
```', text_input, re.DOTALL)
|
| 77 |
return matches[-1].strip() if matches else "No Lean 4 code block found."
|
| 78 |
except Exception:
|
| 79 |
return "Error during code extraction."
|
|
|
|
| 82 |
extracted_code = extract_code(model_output_text)
|
| 83 |
|
| 84 |
print(time.time() - start)
|
| 85 |
+
print("output:
|
| 86 |
+
", model_output_text)
|
| 87 |
+
print("lean4 statement:
|
| 88 |
+
", extracted_code)
|
| 89 |
+
```
|
| 90 |
|
| 91 |
+
## Citation
|
| 92 |
+
If you use G\u00f6del's Poetry in your research, please cite:
|
| 93 |
+
|
| 94 |
+
```bibtex
|
| 95 |
+
@misc{davis2025godelspoetry,
|
| 96 |
+
title={G\"odel's Poetry},
|
| 97 |
+
author={Kelly J. Davis},
|
| 98 |
+
year={2025},
|
| 99 |
+
eprint={2512.14252},
|
| 100 |
+
archivePrefix={arXiv},
|
| 101 |
+
primaryClass={cs.AI},
|
| 102 |
+
url={https://arxiv.org/abs/2512.14252},
|
| 103 |
+
}
|
| 104 |
```
|