sascha-frank-ai-research/tsft-rag-gemma-3-4b-it
TSFT-RAG Gemma-3-4B-IT
Task-Specific Full Fine-Tuning for Retrieval-Augmented Generation
Part of the TSFT-RAG model family for Retrieval-Augmented Generation across Gemma, Qwen and Llama architectures.
This repository contains TSFT-RAG Gemma-3-4B-IT, a full-parameter fine-tuned derivative of Google's Gemma-3-4B-IT developed within the TSFT-RAG research project. The objective is to investigate how task-specific full fine-tuning improves Retrieval-Augmented Generation (RAG), grounded question answering, unsupported-question detection and structured information extraction.
TSFT-RAG Model Series
Abstract
Large instruction-tuned language models perform well in general dialogue but are not specifically optimized for Retrieval-Augmented Generation. TSFT-RAG investigates whether full supervised fine-tuning can specialize foundation models for RAG-oriented tasks without modifying the underlying architecture. This model represents the 4B-parameter member of the TSFT-RAG Gemma series.
Research Background
Reliable RAG systems require more than fluent text generation. They must:
- answer strictly from retrieved evidence,
- reject unsupported questions,
- produce structured outputs,
- remain deterministic and reproducible.
The TSFT-RAG project evaluates these capabilities across Gemma, Qwen and Llama model families using identical datasets and evaluation procedures.
Model Details
Training Dataset
The TSFT-RAG dataset contains supervised examples for:
- Grounded Question Answering
- Unsupported Question Detection
- Topic Extraction
- Key Message Extraction
- Argument Extraction
- Structured JSON Generation
The same dataset and benchmark are used across all TSFT-RAG models to enable reproducible comparisons.
Training Procedure
Training runtime: 61.8 minutes
Final training loss: 1.3081
Evaluation Results
Discussion
Compared with the 1B model, the 4B variant achieves a noticeably better balance between reliable abstention, grounded reasoning and structured generation. The most significant improvements are observed for unsupported-question detection, JSON validity and citation behaviour, while maintaining nearly the same performance on grounded question answering and analytical extraction tasks.
Rather than maximizing a single benchmark metric, TSFT-RAG aims to optimize the overall behaviour of language models within Retrieval-Augmented Generation pipelines.
Intended Use
Recommended for:
- Retrieval-Augmented Generation
- Enterprise knowledge assistants
- University information systems
- Research assistants
- Structured information extraction
Not intended as a general-purpose conversational model.
Example Usage
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained(
"sascha-frank-ai-research/tsft-rag-gemma-3-4b-it"
)
model = AutoModelForCausalLM.from_pretrained(
"sascha-frank-ai-research/tsft-rag-gemma-3-4b-it"
)Reproducibility
Training was performed using the Hugging Face Transformers ecosystem together with the Unsloth implementation for full-parameter supervised fine-tuning. All relevant hyperparameters, tokenizer configuration and evaluation summaries are included in this repository.
Limitations
- Optimized specifically for RAG workflows.
- General conversational performance was not the primary optimization objective.
- Evaluated primarily on German-language benchmark datasets.
- No multimodal benchmark has been conducted.
Ethical Considerations
This model should be used together with appropriate source attribution and human oversight in high-impact applications. It should not replace expert judgement in legal, medical or safety-critical domains.
License
This repository contains a modified derivative of Google's Gemma model.
Please refer to the accompanying LICENSE, NOTICE and MODIFICATIONS.md files.
Associated Publication
This model was developed and evaluated as part of the following research:
Frank, S., & Singh, R. (2026). Task-Specific Full Fine-Tuning for Retrieval-Augmented Generation: A Multi-Family Evaluation Across Open-Weight Language Models.
Zenodo. DOI: 10.5281/zenodo.21638352
If you use this model in academic work, please cite the publication above.
@misc{Frank2026TSFTRAG,
author = {Frank, Sascha and Singh, Rawel},
title = {Task-Specific Full Fine-Tuning for Retrieval-Augmented Generation:
A Multi-Family Evaluation Across Open-Weight Language Models},
year = {2026},
month = jul,
version = {v1},
publisher = {Zenodo},
doi = {10.5281/zenodo.21638352},
url = {https://doi.org/10.5281/zenodo.21638352},
note = {Preprint}
}Project
The complete TSFT-RAG research project, including training scripts, evaluation pipeline, benchmark methodology and documentation, is available at:
Project repository https://github.com/frankmst/rag-task-specific-full-finetuning
TSFT-RAG model family https://huggingface.co/sascha-frank-ai-research
Author
Sascha Frank
Independent AI Researcher
ORCID https://orcid.org/0000-0002-0588-0081
GitHub https://github.com/frankmst
Hugging Face https://huggingface.co/sascha-frank-ai-research
