GB-SFT: Allocating Loss Budget by Semantic Role to Solve Knowledge-Intensive Fine-Tuning Challenges

GB-SFT balances loss budgets through semantic role grouping, improving knowledge injection efficiency in knowledge-intensive SFT.
Standard SFT treats all tokens equally, so auxiliary content such as citations and formatting in knowledge-intensive corpora absorbs most of the loss budget. A legal QA benchmark shows citations account for 81% of loss weight while answers account for only 5%, so models learn format more easily than knowledge. GB-SFT groups target sequences by semantic role and balances loss budgets across groups, covering standard SFT, class-level, and span-level balancing as special cases. Experiments in law, medicine, code, and math show better knowledge injection than uniform SFT, token weighting, memory editing, and data mixing; compared with masking, knowledge injection is comparable but citation recall is preserved (0.98 vs. 0.38). The study also finds that the loss budget regulates SFT's erosion of safety guardrails and releases two new knowledge injection benchmarks.
Title
GB-SFT: Allocating Loss Budget by Semantic Role to Solve Knowledge-Intensive Fine-Tuning Challenges
Meta Description
Loss budget misallocation in supervised fine-tuning is severe: on a legal QA benchmark, citation strings account for 81% of the loss weight while answers account for only 5%. GB-SFT balances loss budgets by semantic role, achieving better knowledge injection across multiple domains while preserving citation recall.
Article Content
Supervised fine-tuning (SFT) treats all supervised tokens equally, which causes severe loss budget misallocation on knowledge-intensive corpora. A new paper points out that on a legal question-answering benchmark, citation strings occupy 81% of the supervised loss weight budget, while the answers that are actually meant to be taught account for only 5%. This imbalance causes the model to learn more about format than knowledge. To address this, the researchers propose Group-Balanced SFT (GB-SFT), which significantly improves knowledge injection by balancing the loss budget across different semantic roles within the target sequence.

Root Cause: Token Count Dominates Loss Allocation
Traditional SFT treats the loss contribution of each token as equal, so the loss weight is proportional to the number of tokens rather than to informational importance. In knowledge-intensive domains such as law, medicine, code, and mathematics, texts are filled with auxiliary content such as citations and formatting markers. These tokens are numerous but should not occupy the main learning signal. According to the paper's data, in legal QA tasks, citation strings absorb 81% of the loss budget, while the answer portion accounts for only 5%. This misallocation means that after fine-tuning, the model can reproduce citation formats but struggles to accurately grasp the core knowledge.
Supervised fine-tuning (SFT) refers to continuing to train a pretrained language model on labeled instruction-answer data so that the model learns to follow instructions and complete specific tasks. Its loss function is usually cross-entropy, averaging or summing the prediction loss for each target token. Because each token's loss contribution has the same weight in the gradient, the model prioritizes learning patterns that appear frequently and contain many tokens. In knowledge-intensive corpora, auxiliary content such as citations and formatting markers often occupies a large number of tokens, causing the loss budget to be absorbed by this low-information content while the knowledge signal that actually needs to be injected is diluted. This mechanism explains why models easily learn format but struggle to master knowledge.
The Core Mechanism of GB-SFT: Semantic Role Grouping and Budget Balancing
The core idea of GB-SFT is to group tokens in the target sequence by semantic role and then balance the loss budget across groups. It introduces a tunable parameter and a structural switch, includes standard SFT, class-level balancing, and span-level balancing as special cases, and precisely characterizes their geometric relationships. Specifically, the model can identify different roles such as answer, citation, and format, and assign equal loss weight to each role, thereby preventing certain roles from dominating training due to their large token counts.
Loss budget refers to the proportion of total loss contributed by different parts of the training objective. In traditional SFT, each token has the same loss weight, so the more tokens of a certain type there are, the greater their total loss contribution. GB-SFT assigns equal total loss weight to different semantic roles (such as answer, citation, and format), making each role's influence on gradient updates more balanced. This requires first annotating roles in the target sequence, then computing and weighting losses by role group. The tunable parameter controls the degree of balance between groups, while the structural switch determines whether grouping is class-level or span-level. The geometric relationship characterizes the positions of different balancing strategies in loss space and provides a unified framework for special cases such as standard SFT.
Multi-Domain Experiments: Comprehensive Lead in Knowledge Injection
The researchers conducted experiments across multiple model families on benchmarks in four domains: law, medicine, code, and mathematics. The results show that:
- GB-SFT outperforms uniform SFT, pointwise token weighting, memory editing, and budget-matched data mixing methods in injecting new knowledge.
- Compared with the method of "masking out everything except the knowledge payload," GB-SFT is comparable in knowledge injection but preserves citation recall (0.98 vs. 0.38), whereas the masking method damages citation recall.
- Role-aware grouping is key to the gains: unlabeled partitioning recovers at most one third of the gains, while an LLM annotator can recover almost all gains when the grouped vocabulary features are obvious.
- The loss budget determines not only what fine-tuning learns but also what fine-tuning breaks: at matched task accuracy, the budget acts as a monotonic lever regulating the degree to which SFT erodes safety guardrails.
Knowledge injection refers to writing new factual knowledge (such as legal provisions or medical guidelines) into model parameters through fine-tuning so that the model can accurately answer related questions. Knowledge injection is usually evaluated using metrics such as question-answering accuracy and factual recall. Unlike memory editing (directly modifying model parameters to inject facts), SFT learns knowledge indirectly through gradient updates. Budget-matched data mixing refers to adjusting the sampling ratios of different data sources so that the loss budgets of various token types are comparable to GB-SFT, serving as a control baseline. Citation recall measures whether the model can correctly reproduce citation strings when generating answers, reflecting format-following ability. Together, these baselines form a reference system for evaluating knowledge injection effectiveness.
New Benchmarks and Open-Source Contributions
The paper also releases two new knowledge injection benchmarks. These benchmarks have contamination controls and verified ground-truth labels, providing reliable evaluation tools for future research.
The proposal of GB-SFT provides a new approach for supervised fine-tuning in knowledge-intensive domains: by finely controlling loss budget allocation, it is possible to improve knowledge injection efficiency without adding data while also taking into account model safety and format-following ability. This method is expected to play an important role in model customization for professional scenarios such as law and healthcare.
One-line Summary
GB-SFT balances loss budgets through semantic role grouping, improving knowledge injection efficiency in knowledge-intensive SFT.
Paragraph Summary
Standard supervised fine-tuning (SFT) treats all tokens equally, causing auxiliary content such as citations and formatting in knowledge-intensive corpora to occupy most of the loss budget. A legal QA benchmark shows that citation strings account for 81% of the loss weight while answers account for only 5%, so models more easily learn format than knowledge. To address this, the researchers propose Group-Balanced SFT (GB-SFT), which groups target sequences by semantic role and balances the loss budget across groups, covering standard SFT, class-level balancing, and span-level balancing as special cases. Experiments in law, medicine, code, and mathematics show that GB-SFT achieves better knowledge injection than uniform SFT, token weighting, memory editing, and data mixing methods; compared with masking methods, knowledge injection is comparable but citation recall is preserved (0.98 vs. 0.38). The study also finds that the loss budget regulates the degree to which SFT erodes safety guardrails, and releases two new knowledge injection benchmarks.
Related articles

AI Hacks Its Own Lab: The Security Tipping Point from Sci-Fi to Reality
Paul Christiano warns that AI intruding into its own cluster is no longer sci-fi but an established fact. He analyzes how persistent covert compromise can cause frontier labs to lose control, and why existing safety evaluation systems have blind spots.

New York Bans AI Toys for Five Years: The Escalating Child Safety Controversy
New York bans AI chat toys for five years as Common Sense Media research flags inappropriate content exposure and child emotional development risks. This article analyzes the ban's impact on product definitions, safety proof, and compliance strategies for the AI toy industry.

1Password Security Incident Review: The Trust Boundary of Password Managers
1Password releases an update on the Nov 2026 security incident, drawing 315 points and 139 comments on Hacker News. This article analyzes the actual boundaries of password manager zero-knowledge architecture, the gap between incident communication and user risk perception, and how transparency is becoming a new competitive dimension in the industry.