Run this model with HF Jobs
Run purewhite42/rautoformalizer_ra_internlm on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/purewhite42/rautoformalizer_ra_internlm. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/purewhite42/rautoformalizer_ra_internlm on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/purewhite42/rautoformalizer_ra_internlm. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/purewhite42/rautoformalizer_ra_internlm. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use purewhite42/rautoformalizer_ra_internlm with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use purewhite42/rautoformalizer_ra_internlm with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="purewhite42/rautoformalizer_ra_internlm", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("purewhite42/rautoformalizer_ra_internlm", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use purewhite42/rautoformalizer_ra_internlm with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "purewhite42/rautoformalizer_ra_internlm" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "purewhite42/rautoformalizer_ra_internlm", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/purewhite42/rautoformalizer_ra_internlm
- SGLang
How to use purewhite42/rautoformalizer_ra_internlm with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "purewhite42/rautoformalizer_ra_internlm" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "purewhite42/rautoformalizer_ra_internlm", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "purewhite42/rautoformalizer_ra_internlm" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "purewhite42/rautoformalizer_ra_internlm", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use purewhite42/rautoformalizer_ra_internlm with Docker Model Runner:
docker model run hf.co/purewhite42/rautoformalizer_ra_internlm
[ICLR'25 Spotlight] Rethinking and Improving Autoformalization: Towards a Faithful Metric and a Dependency Retrieval-based Approach
Qi Liu, Xinhao Zheng, Xudong Lu, Qinxiang Cao*, Junchi Yan* (* indicates Correspondence author)
Sch. of Computer Science & Sch. of Artificial Intelligence, Shanghai Jiao Tong University
Please refer to the πΊGitHub repo and πPaper for more details.
π Performance
| Benchmark | ProofNet | Con-NF | |
|---|---|---|---|
| InternLM2-Math-Base 7B | Rautoformalizer (-R) | 16.58% | 4.58% |
| RAutoformalizer | 18.18% | 16.86% | |
| Rautoformalizer (+R) | 31.28% | 55.36% | |
| DeepseekMath 7B | Rautoformalizer (-R) | 15.24% | 4.27% |
| RAutoformalizer | 17.91% | 15.30% | |
| Rautoformalizer (+R) | 32.62% | 59.00% |
βοΈ Usage
w/o Dependency Retrieval
- π€
purewhite42/rautoformalizer_nora_deepseek: w/o dependency retrieval, SFTed from π€deepseek-ai/deepseek-math-7b-base - π€
purewhite42/rautoformalizer_nora_internlm: w/o dependency retrieval, SFTed from π€internlm/internlm2-math-base-7b
python -m autoformalizer.autoformalize_vllm_passk \
--port ... \ # Can be arbitrarily set (should avoid conflict)
--trust-remote-code \
--enable-prefix-caching \
--model /path/to/model \
--mathlib_root ... \ # Path to Mathlib 4 or path to Con(NF)
--eval_set ... \ # {proofnet, connf}
--working_root /path/to/output/results \
--dataset_root ./data/ \
--repl_root /path/to/repl \
--try_num 8 \
--num_concurrency 8 \
--temperature 0.0;
RAutofromalizer (w/ Dependency Retrieval)
- π€
purewhite42/rautoformalizer_ra_deepseek: w/ dependency retrieval (dependency_retriever_f), SFTed from π€deepseek-ai/deepseek-math-7b-base - π€
purewhite42/rautoformalizer_ra_internlm: w/ dependency retrieval (dependency_retriever_f), SFTed from π€internlm/internlm2-math-base-7b
python -m autoformalizer.autoformalize_vllm_w_ra_passk \
--port ... \ # Can be arbitrarily set (should avoid conflict)
--trust-remote-code \
--enable-prefix-caching \
--model /path/to/model \
--retrieval_result_path /path/to/retrieval/result \
--mathlib_root ... \ # Path to Mathlib 4 or path to Con(NF)
--eval_set ... \ # {proofnet, connf}
--working_root /path/to/output/results \
--dataset_root ./data/ \
--repl_root /path/to/repl \
--try_num 8 \
--num_concurrency 8 \
--temperature 0.0;
Oracle RAutoformalizer (w/ Ground-truth Dependencies)
- π€
purewhite42/rautoformalizer_gtra_deepseek: w/ oracle dependency retrieval, SFTed from π€deepseek-ai/deepseek-math-7b-base - π€
purewhite42/rautoformalizer_gtra_internlm: w/ oracle dependency retrieval, SFTed from π€internlm/internlm2-math-base-7b
python -m autoformalizer.autoformalize_vllm_w_gt_passk \
--port ... \ # Can be arbitrarily set (should avoid conflict)
--trust-remote-code \
--enable-prefix-caching \
--model /path/to/model \
--mathlib_root ... \ # Path to Mathlib 4 or path to Con(NF)
--eval_set ... \ # {proofnet, connf}
--working_root /path/to/output/results \
--dataset_root ./data/ \
--repl_root /path/to/repl \
--try_num 8 \
--num_concurrency 8 \
--temperature 0.0;
π Citation
If you find our work useful in your research, please cite
@inproceedings{
liu2025rethinking,
title={Rethinking and improving autoformalization: towards a faithful metric and a Dependency Retrieval-based approach},
author={Qi Liu and Xinhao Zheng and Xudong Lu and Qinxiang Cao and Junchi Yan},
booktitle={The Thirteenth International Conference on Learning Representations},
year={2025},
url={https://openreview.net/forum?id=hUb2At2DsQ}
}
License
This project is released under the Apache 2.0 license. Please see the LICENSE file for more information.
Contact
Feel free to discuss the paper/data/code with us through issues/emails!
- Qi Liu: purewhite@sjtu.edu.cn
- Downloads last month
- 21
Model tree for purewhite42/rautoformalizer_ra_internlm
Base model
deepseek-ai/deepseek-math-7b-base