Downloads · 30 days
8
10% of all-time downloads
cyberandy/sangue-e-grafi-nemotron-nano-grpo
sangue-e-grafi-nemotron-nano-grpo is a text generation model from cyberandy. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
GRPO-reinforced LoRA adapter for Nemotron — the RL stage that aligns tool-use with ontology constraints.
Downloads · 30 days
8
10% of all-time downloads
All-time downloads
82
Public
Repo size
127 MB
Likes
0
Public
Click a slice to open those files.
.safetensors92.3 MB · 73%
From the Hugging Face model README
<p align="center"> <img src="https://huggingface.co/spaces/cyberandy/sangue-e-grafi/resolve/main/banner.png" alt="Sangue e Grafi banner" width="700"/> </p>GRPO-reinforced LoRA adapter for Nemotron — the RL stage that aligns tool-use with ontology constraints.
This is a LoRA (PEFT) adapter trained via Group Relative Policy Optimization (GRPO) on top of the Nemotron SFT adapter (already merged into nvidia/Nemotron-Mini-4B-Instruct). It is the second training stage for the Nemotron-based pipeline in the Sangue e Grafi project.
nvidia/Nemotron-Mini-4B-Instruct (4B)
│
▼
┌─────────┐ 500 adversarial scenarios
│ SFT │◄─── teacher traces (Gemini 2.5 Flash)
└────┬────┘
│ merge adapter
▼
┌─────────┐ reward: correct answer + valid tool use
│ GRPO │◄─── ontology constraint checking
└────┬────┘
│
▼
THIS ADAPTER (apply on merged SFT base)
| Parameter | Value |
|---|---|
| Method | GRPO (Group Relative Policy Optimization) |
| Base | nvidia/Nemotron-Mini-4B-Instruct + merged SFT adapter |
| Reward signals | Answer correctness + ontology-valid tool usage |
| Format | SafeTensors LoRA adapter |
| Model | Hard Dev-Set Accuracy |
|---|---|
| Gemma 4B (SFT+GRPO) | 5/10 (50%) |
| Nemotron 4B (SFT+GRPO) | 4/10 (40%) |
| Gemini 2.5 Flash (no KG) | 3/10 (30%) — easy set |
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
# Step 1: Load base + merge SFT
base = AutoModelForCausalLM.from_pretrained("nvidia/Nemotron-Mini-4B-Instruct")
sft_model = PeftModel.from_pretrained(base, "cyberandy/sangue-e-grafi-nemotron-nano-sft-v7")
merged = sft_model.merge_and_unload()
# Step 2: Apply GRPO adapter
model = PeftModel.from_pretrained(merged, "cyberandy/sangue-e-grafi-nemotron-nano-grpo")
tokenizer = AutoTokenizer.from_pretrained("nvidia/Nemotron-Mini-4B-Instruct")
Intended uses:
Limitations:
| Resource | Link |
|---|---|
| 🚀 Live Demo | HF Space |
| 📦 GitHub | cyberandy/sangue-e-grafi |
| 📄 Paper | RLM-on-KG (arXiv:2604.17056) |
| 🎓 SFT Adapter | sangue-e-grafi-nemotron-nano-sft-v7 |
| 📊 Agent Traces Dataset | sangue-e-grafi-agent-traces |
@misc{sangue-e-grafi-2026,
title = {Sangue e Grafi: Small Models Beat Frontier LLMs on Adversarial Kinship Reasoning with Knowledge Graph Agents},
author = {Andrea Volpini},
year = {2026},
url = {https://github.com/cyberandy/sangue-e-grafi},
note = {Hugging Face Build Small Hackathon 2026}
}