Negative-aware Fine-Tuning: Bridging Supervised Learning and Reinforcement Learning in Math Reasoning
[!Warning]
🚨 NFT-7B is specifically designed for mathematical reasoning tasks. We do not recommend using this model for general conversation or non-mathematical tasks.
NFT-7B is a math reasoning model finetuned from Qwen2.5-Math-7B using the Negative-aware Fine-Tuning (NFT) algorithm. NFT is a supervised learning approach that enables LLMs to reflect on their failures and improve autonomously with no external teachers. Unlike traditional supervised methods that discard incorrect answers, NFT constructs an implicit negative policy to model and learn from these failures, achieving performance comparable to leading RL algorithms like GRPO and DAPO.
This model demonstrates that self-reflective improvement is not exclusive to RL methods—supervised learning can effectively leverage negative feedback for continuous improvement in mathematical reasoning tasks.
General mathematical reasoning (MATH500, Minerva Math)
Step-by-step mathematical solution generation
Model Architecture
Architecture Type: Transformer decoder-only language model
Network Architecture: Qwen2.5
NFT-7B is post-trained based on Qwen2.5-Math-7B and follows the same model architecture. The model has 7B parameters.
Input
Input Type(s): Text
Input Format: String
Input Parameters: One-dimensional (1D)
Other Properties Related to Input:
Context length up to 32,768 tokens
Mathematical problems should be clearly stated
Supports LaTeX notation for mathematical expressions
Output
Output Type(s): Text
Output Format: String
Output Parameters: One-dimensional (1D)
Other Properties Related to Output:
Step-by-step mathematical reasoning
Final answers should be enclosed in \boxed{}
Supports LaTeX notation for mathematical expressions
Maximum generation length: 8,192 tokens
Software Integration
Our AI models are designed and/or optimized to run on NVIDIA GPU-accelerated systems. By leveraging NVIDIA’s hardware (e.g. GPU cores) and software frameworks (e.g., CUDA libraries), the model achieves faster training and inference times compared to CPU-only solutions.
The NFT training pipeline consists of three main components:
Data Collection: The model generates answers to math questions, which are split into positive (correct) and negative (incorrect) datasets based on answer correctness.
Implicit Negative Policy: NFT constructs an implicit negative policy to model negative answers, parameterized with the same positive policy targeted for optimization, enabling direct policy optimization on all generations.
Policy Optimization: Both positive and negative answers are used to optimize the LLM policy via supervised learning with the NFT objective:
AMC 2023 (40 problems): American Mathematics Competitions
MATH500 (500 problems): A subset of the MATH dataset
OlympiadBench (675 problems): International Mathematical Olympiad problems
Minerva Math (272 problems): Google's mathematical reasoning benchmark
Data Collection Method: Human
Labeling Method by dataset: Human
Performance
Performance Comparison
NFT-7B achieves competitive performance compared to other 7B math models, with particularly strong results on competition mathematics:
Benchmark
NFT-7B
Qwen2.5-Math-7B
Improvement
AIME24 (avg@32)
32.0%
13.3%
+18.7%
AIME25 (avg@32)
18.3%
5.5%
+12.8%
MATH500
83.2%
69.0%
+14.2%
AMC23 (avg@32)
88.5%
45.8%
+42.7%
OlympiadBench
47.3%
34.7%
+12.6%
Minerva Math
40.8%
21.3%
+19.5%
Average
51.7%
31.6%
+20.1%
Validation Curves
Usage
[!Important]
NFT-7B is optimized for mathematical reasoning tasks. For best results, use clear mathematical prompts and request step-by-step reasoning.
The model can be used with the Hugging Face Transformers library:
python
1from transformers import AutoModelForCausalLM, AutoTokenizer
23model_name ="nvidia/NFT-7B"4device ="cuda"# the device to load the model onto56model = AutoModelForCausalLM.from_pretrained(7 model_name,8 torch_dtype="auto",9 device_map="auto"10)11tokenizer = AutoTokenizer.from_pretrained(model_name)1213# Example math problem14problem ="Find the value of $x$ that satisfies the equation $\\sqrt{x+7} = x-5$."1516# Format the prompt to encourage step-by-step reasoning17prompt =f"{problem}\nPlease reason step by step, and put your final answer within \\boxed{{}}."1819messages =[20{"role":"user","content": prompt}21]2223text = tokenizer.apply_chat_template(24 messages,25 tokenize=False,26 add_generation_prompt=True27)28model_inputs = tokenizer([text], return_tensors="pt").to(device)2930# Generate response31generated_ids = model.generate(32**model_inputs,33 max_new_tokens=512,34 temperature=0# Use 0 for deterministic output35)36generated_ids =[37 output_ids[len(input_ids):]for input_ids, output_ids inzip(model_inputs.input_ids, generated_ids)38]3940response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]41print(response)
Usage Recommendations
Temperature: Use temperature=0 for deterministic outputs, or 0.1-0.3 for slight variation
Sampling: For best results on competition problems, consider using multiple samples with majority voting
Format: Include instructions for step-by-step reasoning directly in the user prompt
Final Answer: Instruct the model to put the final answer in \boxed{}
Language: This model is primarily trained on English mathematical problems
Requirements
The code of Qwen2.5 has been integrated into Hugging Face transformers, and we recommend using the latest version:
transformers>=4.37.0
Citation
If you find our project helpful, please consider citing
bibtex
1@article{chen2025bridging,
2 title = {Bridging Supervised Learning and Reinforcement Learning in Math Reasoning},
3 author = {Huayu Chen, Kaiwen Zheng, Qinsheng Zhang, Ganqu Cui, Yin Cui, Haotian Ye, Tsung-Yi Lin, Ming-Yu Liu, Jun Zhu, Haoxiang Wang},
4 journal = {arXiv preprint arXiv:2505.18116},
5 year = {2025}
6}
Known Limitations
Domain Specificity: This model is specifically trained for mathematical reasoning and may not perform well on general conversation or non-mathematical tasks
Calculation Errors: While the model shows strong reasoning abilities, it may still make arithmetic errors in complex calculations
Context Understanding: The model may struggle with problems requiring real-world context or domain knowledge outside mathematics
Bias Considerations
The model is trained on mathematical problems which are inherently objective. However, the training data may reflect biases in problem selection, difficulty distribution, and mathematical notation preferences from the source datasets.
Inference:
Acceleration Engine: TensorRT-LLM, vLLM, SGLang
Test Hardware: NVIDIA H100
Ethical Considerations
NVIDIA believes Trustworthy AI is a shared responsibility and we have established policies and practices to enable development for a wide array of AI applications. When downloaded or used in accordance with our terms of service, developers should work with their internal model team to ensure this model meets requirements for the relevant industry and use case and addresses unforeseen product misuse.
Please report security vulnerabilities or NVIDIA AI Concerns here.