In-Distribution Finetuning (IDFT)
- In-Distribution Finetuning (IDFT) is a fine-tuning strategy that aligns optimization with a defined in-distribution reference to preserve pre-trained structures.
- It employs adaptive token weighting based on model-induced next-token distributions to balance in-distribution accuracy and out-of-distribution robustness.
- IDFT integrates techniques like feature-preserving adaptation and data reweighting, demonstrating performance gains (e.g., 5–10 pp improvement over standard fine-tuning).
Searching arXiv for the cited papers to ground the article in current records. In-Distribution Finetuning (IDFT) denotes a family of finetuning strategies that attempt to align optimization with an explicitly defined “in-distribution” reference rather than treating all training tokens, samples, or domains as equally reliable. In the most explicit formulation, introduced for LLM supervised fine-tuning, IDFT is a loss-level method derived from Distribution Discriminant Theory (DDT): it down-weights tokens that are unlikely under the model’s own next-token distribution and thereby seeks to improve generalization while preserving pre-trained structure (Zhang et al., 12 Feb 2026). In adjacent literatures, closely related ideas appear as target-distribution matching, feature-preserving finetuning, data reweighting, and quality-aligned adaptation, all motivated by the same empirical observation: naive full fine-tuning often improves in-distribution accuracy while degrading robustness or out-of-distribution behavior (Kumar et al., 2022).
1. Terminological scope and motivating problem
The literature uses the label “in-distribution” in more than one sense. In standard supervised fine-tuning (SFT) for LLMs, the relevant distribution is the model-induced next-token distribution ; IDFT then means suppressing gradients from tokens that behave as out-of-distribution relative to that distribution (Zhang et al., 12 Feb 2026). In transfer learning for vision, the relevant distribution is typically the target-domain data distribution , and the problem is to adapt a pre-trained feature extractor and head while preserving the generalization of the pre-trained representation (Ha et al., 2023). In data-centric settings, the distributional question is whether the finetuning corpus matches the intended deployment distribution, whether defined by a small representative query set, by image-quality ratios, or by an inverse-density reweighting scheme (Liu et al., 2024).
The common motivation is that full fine-tuning can distort pre-trained features. One influential empirical study compared linear probing (LP), full fine-tuning (FT), and linear probing followed by full fine-tuning (LP-FT) across 10 distribution shift datasets and reported that fine-tuning obtained on average higher accuracy ID but lower accuracy OOD than linear probing; LP-FT was reported as better ID and better OOD than full fine-tuning (Kumar et al., 2022). This establishes the central tension that IDFT addresses across domains: optimization should adapt the model to the target task without overwriting the structures that support transfer and robustness.
2. Distribution Discriminant Theory and the canonical IDFT objective
The DDT formulation begins from the standard SFT loss
with , vocabulary 0, and next-token distribution
1
The paper contrasts this with an external data distribution 2 and frames “is this token in-distribution or out-of-distribution?” as the hypothesis test
3
The statistic is optimized through a signal-to-noise ratio
4
Within statistics of the form 5, Theorem 3.1 identifies the Centralized Log-Likelihood
6
as the SNR-maximizing choice, where
7
is the Shannon entropy (Zhang et al., 12 Feb 2026).
The sequential properties of 8 are central to the method. With 9, the cumulative statistic is a martingale under 0,
1
while under 2 it has negative drift,
3
A Freedman-inequality concentration bound is also given: 4 where 5 and 6. The practical implication is that strongly negative 7 values signal tokens that are misaligned with the model-induced distribution.
IDFT turns this statistic into an adaptive multiplier
8
and defines the loss
9
The paper states the role of the weighting explicitly: strongly OOD tokens with 0 yield 1 and 2, while high-confidence tokens with 3 are up-scaled. In implementation, 4 is clipped, for example with 5, before applying 6, and the resulting procedure adds only a small constant-factor overhead above SFT (Zhang et al., 12 Feb 2026).
3. Empirical profile in on-policy-style supervised finetuning
The LLM experiments position IDFT as a computationally efficient alternative to offline RL-style training. The base models are Phi-4-mini-instruct (3.8B) and Qwen2.5-7B-instruct; training uses 333K problems from Numina-Math; benchmarks are Math-C 7AIME24, AMC23, OlympiadBench8, Math-G 9College-math, Math-OAI, Minerva-math0, and General-R 1MMLU-stem, ARC-challenge2. Baselines include SFT, DFT, EAFT, and offline RL methods such as Rej@2, Rej@4, DPO, SimPO, RPO, and CPO (Zhang et al., 12 Feb 2026).
The reported aggregate effect is that IDFT yields 3 pp relative gain over SFT and outperforms DFT and EAFT by 4 pp, thereby closing most of the gap to RL methods. A table excerpt for Phi4-mini gives the following values under the stated FLOPs budgets: Origin 5 / 6 / 7 on Math-C / Math-G / General-R; SFT 8 / 9 / 0; DPO 1 / 2 / 3; SimPO 4 / 5 / 6; HD+SFT 7 / 8 / 9; and HD+IDFT 0 / 1 / 2. Here HD denotes Hinted Decoding, the companion data-level technique that re-aligns the training corpus to the model’s distribution (Zhang et al., 12 Feb 2026).
The ablation evidence is also structurally important. Replacing the soft modulation 3 with a hard mask 4 produces an inverted-U curve as 5 varies, which the paper uses to argue that a continuous, self-tuning gate is superior to fixed truncation. This places IDFT in a broader class of adaptive-risk objectives: rather than rejecting entire examples, it modulates token contributions continuously according to model-relative in-distribution evidence.
4. Feature distortion, head alignment, and representation-preserving finetuning
A closely related line of work studies in-distribution adaptation through the lens of representation drift. In an overparameterized two-layer linear network
6
full fine-tuning updates the head 7 and feature extractor 8 simultaneously. The analysis shows that when the head is initialized poorly, feature updates occur along directions spanned by the in-distribution data, leaving orthogonal directions almost unchanged; the resulting distorted features fit the training distribution but can perform poorly OOD. The same study reports that on 10 distribution shift benchmarks FT achieved 9 ID and 0 OOD accuracy on average, LP achieved 1 ID and 2 OOD, and LP-FT achieved 3 ID and 4 OOD (Kumar et al., 2022).
Domain-Aware Fine-Tuning (DAFT) operationalizes this concern in a target-domain setting with pre-trained feature extractor 5, head 6, and objective
7
Its contribution is twofold: a batch-normalization conversion that replaces source-domain running statistics 8 with target-domain-adapted parameters 9, and an integrated LP+FT procedure with zero-initialized head and separate learning rates 0. The converted BatchNorm parameters are
1
and feature distortion is quantified by
2
On the MoCo-v2 CIFAR-10 series, DAFT reports 3 ID, 4 on CIFAR-10.1, and 5 on STL, compared with LP 6, FT 7, and LP-FT 8; on CIFAR-10-C mean Corruption Error, lower is better, DAFT gives 9 versus LP 0, FT 1, and LP-FT 2 (Ha et al., 2023).
FD-Align addresses the same problem from a feature-alignment perspective. It is introduced as “Feature Discrimination Alignment,” a fine-tuning approach that aims to bolster generalizability by preserving the consistency of spurious features across the fine-tuning process. The available summary states that it decouples features into category-related and category-independent information, imposes an alignment constraint that penalizes changes in label-independent feature channels or subspaces, and demonstrates efficacy for both ID and OOD tasks; once fine-tuned, the model can seamlessly integrate with existing methods, leading to performance improvements (Song et al., 2023). Taken together, these methods suggest that a substantial portion of what is called IDFT in transfer learning is better understood as controlled adaptation: align the head, constrain the backbone, and preserve useful pre-trained structure.
5. Data-centric forms of IDFT: selection, quality matching, and deployment alignment
Another line of work treats IDFT as a data selection or data composition problem. TSDS (Task-Specific Data Selection) begins from a small representative set 3 from the target task distribution and a large candidate repository 4. It formulates data selection for task-specific model finetuning as an optimal-transport problem with a distribution alignment loss
5
followed by marginalization 6. To discourage near-duplicates, TSDS adds a kernel-density-based regularizer with
7
yielding a KDE-aware transport objective. The framework is evaluated for continued pretraining and instruction tuning and is reported to show that instruction tuning using data selected with a 8 selection ratio often outperforms using the full dataset and beats the baseline selection methods by 9 points in F1 score on average (Liu et al., 2024).
In medical imaging, the same distribution-matching principle appears in the relation between finetuning and deployment quality distributions. For prostate multiparametric MRI, the study defines high-quality and low-quality exams through PI-QUAL, with 00 denoting the finetuning distribution and 01 the test distribution, where
02
and
03
The ideal in-distribution regime is 04. The experiments vary 05 and show systematic degradation under mismatch. For PI-RADS 5-class, the HQ-only model’s T1-ACC falls from approximately 06 at 07 to approximately 08 at 09, while the Mixed model declines more gracefully. Against training from scratch under identical conditions, HQ-only finetuning yields average ACC gains of 10 and AUC gains 11, Mixed finetuning yields 12 ACC gain, and LQ-only yields 13 ACC change. The study therefore recommends aligning quality distributions and notes that a minimum HQ proportion of approximately 14 in finetuning is advised for tasks where scratch accuracy gains are critical (Tang et al., 16 Aug 2025).
6. Theoretical extensions, misconceptions, and open questions
A broader theoretical perspective treats IDFT as gentle finetuning or rebalancing toward a more uniform domain coverage. One formulation defines
15
where 16 is the uniform density on 17, and studies the worst-case risk over all sufficiently diverse test distributions. The main result is that training on the uniform distribution is minimax-optimal for this worst-case objective. When uniform samples are unavailable, the proposed operationalization is an IDFT objective
18
with reweighting 19 and a small, decaying learning rate so that the fine-tuned model remains close to the pre-trained prior. A PAC-Bayes bound then controls the worst-case diverse-distribution risk through the divergence between posterior and prior over weights (Loukas et al., 2024).
Several misconceptions are corrected by this literature. First, IDFT is not a single algorithmic recipe. Depending on context, it may denote model-distribution-aware token weighting, inverse-density reweighting, head-aligned feature-preserving adaptation, or finetune/test distribution matching. Second, “better ID accuracy” is not equivalent to “better generalization”: full fine-tuning can outperform LP in-distribution while underperforming OOD, and medical-image quality mismatch can negate the gains from pretraining altogether (Kumar et al., 2022). Third, the relevant distribution need not be the empirical training distribution; in DDT-based IDFT, the reference is the model-induced distribution itself, and in quality-aware finetuning the critical variable is the mismatch between the finetuning and deployment distributions (Zhang et al., 12 Feb 2026).
The open questions are correspondingly heterogeneous. The LLM formulation highlights calibration sensitivity and the need to clip 20. The quality-aware medical setting explicitly points to adapter-based or quality-aware sampling strategies and richer low-quality datasets. The rebalancing framework raises the problem of density estimation in high dimensions and outside-support shift. Across these strands, however, the underlying principle remains stable: finetuning is most effective when its gradients, data weights, and sample composition are made commensurate with the distribution on which the adapted model is expected to operate (Tang et al., 16 Aug 2025).