Views
No views yet
Supervised Fine-Tuned LoRA adapter for Italian inheritance-law reasoning over kinship knowledge graphs.

google/gemma-4-E2B-it. It is part of the Sangue e Grafi project — a Hugging Face Build Small Hackathon 2026 entry demonstrating that a small 4B-parameter model, fine-tuned with SFT + GRPO and equipped with a knowledge-graph agent, outperforms frontier models (Gemini 2.5 Flash) on adversarial Italian inheritance-law scenarios.lookup_relationship, check_degree, etc.) grounded in an OWL kinship ontology.| Parameter | Value |
|---|---|
| Method | SFT (Supervised Fine-Tuning) |
| Base model | google/gemma-4-E2B-it (4B params) |
| Training data | 500 adversarial kinship scenarios with teacher traces |
| Teacher | Gemini 2.5 Flash — generated gold reasoning traces |
| LoRA rank | See adapter config |
| Format | SafeTensors LoRA adapter |
| Benchmark | KG Agent (Gemma 4B SFT+GRPO) | Gemini 2.5 Flash (no KG) |
|---|---|---|
| Easy (10 seeds) | 10/10 (100%) | 3/10 (30%) |
| Hard dev-set (10 seeds) | 5/10 (50%) | — |
| Model | Hard Dev-Set Accuracy |
|---|---|
| Gemma 4B (SFT+GRPO) | 5/10 (50%) |
| Nemotron 4B (SFT+GRPO) | 4/10 (40%) |
1from peft import PeftModel
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4base = AutoModelForCausalLM.from_pretrained("google/gemma-4-E2B-it")
5model = PeftModel.from_pretrained(base, "cyberandy/sangue-e-grafi-gemma4-e2b-sft-adversarial-v7")
6tokenizer = AutoTokenizer.from_pretrained("google/gemma-4-E2B-it")Note: This is the SFT-only checkpoint. For the full pipeline (SFT → GRPO), merge this adapter first, then apply the GRPO adapter.
| Resource | Link |
|---|---|
| 🚀 Live Demo | HF Space |
| 📦 GitHub | cyberandy/sangue-e-grafi |
| 📄 Paper | RLM-on-KG (arXiv:2604.17056) |
| 🎯 GRPO Adapter | sangue-e-grafi-gemma4-e2b-grpo-run-f-v7 |
| 📊 Agent Traces Dataset | sangue-e-grafi-agent-traces |
| 🔢 GGUF (quantized) | sangue-e-grafi-gemma4-e2b-gguf |
1@misc{sangue-e-grafi-2026,
2 title = {Sangue e Grafi: Small Models Beat Frontier LLMs on Adversarial Kinship Reasoning with Knowledge Graph Agents},
3 author = {Andrea Volpini},
4 year = {2026},
5 url = {https://github.com/cyberandy/sangue-e-grafi},
6 note = {Hugging Face Build Small Hackathon 2026}
7}