Instructions to use gabriellarson/NFT-7B-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use gabriellarson/NFT-7B-GGUF with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="gabriellarson/NFT-7B-GGUF") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("gabriellarson/NFT-7B-GGUF", dtype="auto") - llama-cpp-python
How to use gabriellarson/NFT-7B-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="gabriellarson/NFT-7B-GGUF", filename="NFT-7B-IQ1_M.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": "What is the capital of France?" } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use gabriellarson/NFT-7B-GGUF with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf gabriellarson/NFT-7B-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf gabriellarson/NFT-7B-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf gabriellarson/NFT-7B-GGUF:Q4_K_M # Run inference directly in the terminal: llama-cli -hf gabriellarson/NFT-7B-GGUF:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf gabriellarson/NFT-7B-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf gabriellarson/NFT-7B-GGUF:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf gabriellarson/NFT-7B-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf gabriellarson/NFT-7B-GGUF:Q4_K_M
Use Docker
docker model run hf.co/gabriellarson/NFT-7B-GGUF:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use gabriellarson/NFT-7B-GGUF with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "gabriellarson/NFT-7B-GGUF" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gabriellarson/NFT-7B-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/gabriellarson/NFT-7B-GGUF:Q4_K_M
- SGLang
How to use gabriellarson/NFT-7B-GGUF 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 "gabriellarson/NFT-7B-GGUF" \ --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": "gabriellarson/NFT-7B-GGUF", "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 "gabriellarson/NFT-7B-GGUF" \ --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": "gabriellarson/NFT-7B-GGUF", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Ollama
How to use gabriellarson/NFT-7B-GGUF with Ollama:
ollama run hf.co/gabriellarson/NFT-7B-GGUF:Q4_K_M
- Unsloth Studio new
How to use gabriellarson/NFT-7B-GGUF with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for gabriellarson/NFT-7B-GGUF to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for gabriellarson/NFT-7B-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for gabriellarson/NFT-7B-GGUF to start chatting
- Pi new
How to use gabriellarson/NFT-7B-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf gabriellarson/NFT-7B-GGUF:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "gabriellarson/NFT-7B-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use gabriellarson/NFT-7B-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf gabriellarson/NFT-7B-GGUF:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default gabriellarson/NFT-7B-GGUF:Q4_K_M
Run Hermes
hermes
- Docker Model Runner
How to use gabriellarson/NFT-7B-GGUF with Docker Model Runner:
docker model run hf.co/gabriellarson/NFT-7B-GGUF:Q4_K_M
- Lemonade
How to use gabriellarson/NFT-7B-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull gabriellarson/NFT-7B-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.NFT-7B-GGUF-Q4_K_M
List all available models
lemonade list
- Negative-aware Fine-Tuning: Bridging Supervised Learning and Reinforcement Learning in Math Reasoning
Negative-aware Fine-Tuning: Bridging Supervised Learning and Reinforcement Learning in Math Reasoning
🚨 NFT-7B is specifically designed for mathematical reasoning tasks. We do not recommend using this model for general conversation or non-mathematical tasks.
Tsinghua University, NVIDIA, Stanford University
Huayu Chen, Kaiwen Zheng, Qinsheng Zhang, Ganqu Cui, Yin Cui, Haotian Ye, Tsung-Yi Lin, Ming-Yu Liu, Jun Zhu, Haoxiang Wang
[Paper] | [Blog] | [Code] | [Dataset] | [Models] | [Citation]
Model Overview
Description
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.
This model is for research and development only.
Model Developer
NVIDIA, Tsinghua University, Stanford University
License
This model is released under the NVIDIA Non-Commercial License. The model is for research and development only.
Deployment Geography
Global
Release Date
Huggingface 06/27/2025
Use Case
Mathematical reasoning and problem-solving, including:
- Competition-level mathematics (AIME, AMC, Olympiad)
- 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.
Runtime Engine(s):
- Transformers
- vLLM
- TensorRT-LLM
Supported Hardware Microarchitecture Compatibility:
- NVIDIA Ampere
- NVIDIA Hopper
- NVIDIA Blackwell
Operating System(s):
- Linux
Model version: v1.0
Training Method
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:
L_NFT(θ) = r[-log(π_θ⁺(a|q) / π(a|q))] + (1-r)[-log((1 - r_q * (π_θ⁺(a|q) / π(a|q))) / (1-r_q))]
Training Datasets
Dataset: DAPO-Math-17k
Dataset Size: 17k (math problems)
Data Collection Method: Automated
Labeling Method by dataset: Automated
The whole dataset is used for training. We directly evaluate the model on several other math evaluation datasets.
Evaluation Datasets
NFT-7B is evaluated on 6 mathematical reasoning benchmarks:
- AIME 2024 (30 problems) & 2025 (30 problems): American Invitational Mathematics Examination
- 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
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% |
Usage
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:
from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "nvidia/NFT-7B"
device = "cuda" # the device to load the model onto
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(model_name)
# Example math problem
problem = "Find the value of $x$ that satisfies the equation $\\sqrt{x+7} = x-5$."
# Format the prompt to encourage step-by-step reasoning
prompt = f"{problem}\nPlease reason step by step, and put your final answer within \\boxed{{}}."
messages = [
{"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(device)
# Generate response
generated_ids = model.generate(
**model_inputs,
max_new_tokens=512,
temperature=0 # Use 0 for deterministic output
)
generated_ids = [
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]
response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(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
@article{chen2025bridging,
title = {Bridging Supervised Learning and Reinforcement Learning in Math Reasoning},
author = {Huayu Chen, Kaiwen Zheng, Qinsheng Zhang, Ganqu Cui, Yin Cui, Haotian Ye, Tsung-Yi Lin, Ming-Yu Liu, Jun Zhu, Haoxiang Wang},
journal = {arXiv preprint arXiv:2505.18116},
year = {2025}
}
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.
- Downloads last month
- 72
1-bit
2-bit
3-bit
4-bit
5-bit
6-bit
8-bit




