Downloads · 30 days
0
Chattso-GPT/DeepSeek-R1-Distill-Qwen-32B-for-lean
DeepSeek-R1-Distill-Qwen-32B-for-lean is a text generation model from Chattso-GPT. Use it when you need the model to write or continue text. The card lists the license as apache-2.0.
Downloads · 30 days
0
Access
Public
Updated Aug 12, 2025
Repo size
29 GB
Likes
0
Public
Click a slice to open those files.
.safetensors1.1 GB · 99%
From the Hugging Face model README
✅ Training Status: COMPLETED
This model is a fine-tuned version of deepseek-ai/DeepSeek-R1-Distill-Qwen-32B, specifically optimized for mathematical reasoning and Lean theorem proving tasks.
This model has been fine-tuned using LoRA (Low-Rank Adaptation) technique on a custom dataset containing mathematical problems and Lean proofs, enhancing the base model's capabilities in formal mathematics and theorem proving.
| Metric | Value |
|---|---|
| Final Training Step | 4,200 (early stopped from 8,550) |
| Best Validation Loss | 0.516 |
| Training Epochs | ~1.0 (0.98) |
| Early Stopping | ✅ Applied (patience=2) |
| Model Selection | Best checkpoint automatically selected |
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
import torch
# Load base model and tokenizer
base_model_id = "deepseek-ai/DeepSeek-R1-Distill-Qwen-32B"
base_model = AutoModelForCausalLM.from_pretrained(
base_model_id,
torch_dtype=torch.bfloat16,
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(base_model_id)
# Load fine-tuned LoRA adapter
model = PeftModel.from_pretrained(base_model, "Chattso-GPT/DeepSeek-R1-Distill-Qwen-32B-for-lean")
# Generate response
def generate_response(prompt, max_length=512):
inputs = tokenizer(prompt, return_tensors="pt")
with torch.no_grad():
outputs = model.generate(
**inputs,
max_length=max_length,
temperature=0.7,
do_sample=True,
pad_token_id=tokenizer.eos_token_id
)
return tokenizer.decode(outputs[0], skip_special_tokens=True)
# Example usage
prompt = "Prove that the sum of two even numbers is even."
response = generate_response(prompt)
print(response)
# Lean-specific prompt format
lean_prompt = """
theorem sum_of_evens_is_even (a b : ℤ) (ha : even a) (hb : even b) : even (a + b) := by
sorry
"""
proof = generate_response(f"Complete this Lean proof:\n{lean_prompt}")
print(proof)
This model achieved optimal performance through early stopping at step 4,200, preventing overfitting while maintaining strong performance on validation data. The relatively low validation loss (0.516) indicates good generalization on mathematical reasoning tasks.
If you use this model in your research, please cite:
@misc{deepseek-r1-distill-lean-2025,
title={DeepSeek-R1-Distill-Qwen-32B-for-lean},
author={Chattso-GPT},
year={2025},
howpublished={\\url{https://huggingface.co/Chattso-GPT/DeepSeek-R1-Distill-Qwen-32B-for-lean}},
}
This model is released under the Apache 2.0 License, following the base model's licensing terms.
For questions or issues regarding this model, please open an issue in the model repository or contact the model author.
Training completed with early stopping at optimal performance. Model ready for mathematical reasoning and Lean theorem proving tasks.