Download DeepSeekMath-V2
mainDeepSeekMath-V2 is built on top of DeepSeek-V3.2-Exp-Base. You can download the model weights from the official Hugging Face repository.
https://huggingface.co/deepseek-ai/DeepSeek-Math-V2repository·main·Indexed 23 days ago
https://github.com/deepseek-ai/deepseek-math-v2A large language model for self-verifiable mathematical reasoning and theorem proving, built on DeepSeek-V3.2-Exp-Base. It features a verifier-based reward model and a multi-round iterative pipeline for proof generation, verification, meta-verification, and refinement.
DeepSeekMath-V2 is built on top of DeepSeek-V3.2-Exp-Base. You can download the model weights from the official Hugging Face repository.
https://huggingface.co/deepseek-ai/DeepSeek-Math-V2DeepSeek-V3.2-Exp repository. Refer to that repository's documentation for specific implementation details and setup instructions.generate.py script. Once the API key is set, execute the run.sh shell script to initiate the evaluation job.Proof refinement is the core mechanism for iterative improvement. It works by:
proof_pool_dirname indexed by problem ID.n_best_proofs_to_sample based on their meanscore and self_eval_score.dep_proof_ids to maintain a lineage of how proofs evolve across rounds.This process allows the model to learn from the best available reasoning paths discovered in previous rounds.
The main.py script implements a multi-round iterative process for mathematical reasoning, consisting of proof generation, proof verification, meta-verification, and proof refinement.
--input_paths, applies a proof_generation template, and runs inference to generate initial proofs.proof_verification template.meta_verification template to rate the quality of the verification results.--max_rounds.--input_paths: Comma-separated list of paths to input data (JSON or JSONL).--output_dirname: Directory where all round results and intermediate files will be stored.--proof_pool_dirname: Directory to maintain a persistent pool of generated proofs for each problem.--batch_size: Number of items per batch (default: 160).--proof_gen_temp / --proof_verification_temp / --meta_verification_temp: Temperature for the respective inference stages.--n_agg_trials: Number of different combinations of proofs used for refinements (default: 32).--n_best_proofs_to_sample: Number of top-performing proofs to consider for refinement (default: 32).--n_proofs_to_refine: Number of proofs to include in a single refinement prompt (default: 1).--skip_meta_verification: If set, skips the meta-verification stage.The pipeline uses several templates and hyperparameters to control the behavior of the LLM during different stages. These are passed to the underlying generate.py script via system calls.
--proof_gen_template: The template used for generating proofs (default: proof_generation).--proof_gen_max_len: Maximum token length for generation (default: 128 * 1024).--proof_gen_num_processes: Number of parallel processes for generation (default: 40).--proof_verification_template: The template used for verifying proofs (default: proof_verification).--proof_verification_max_len: Maximum token length for verification (default: 64 * 1024).--n_verification_per_proof: Number of verification samples to generate per proof (default: 4).--meta_verification_template: The template used for meta-rating (default: meta_verification).--meta_verification_max_len: Maximum token length (default: 64 * 1024).--n_meta_verification_per_rating: Number of meta-verification samples per rating (default: 1).