← All questions
Training & Fine-tuningMedium· SFT· Context Grounding· Dataset Curation

The correct passage is in the context window, but the m...

When a model ignores a relevant passage present in its context window and relies on parametric memory instead, the problem is not a lack of knowledge, but an alignment/behavioral failure. Consequently, the Supervised Fine-Tuning (SFT) stage owns resolving this issue.

To correct this behavior, the SFT dataset must be designed to explicitly teach context reliance. Training examples should include pairs where the correct golden document is provided in the prompt and used to form the answer. To make the model robust, a deliberate fraction of training data should omit the golden document or include counterfactual documents. This teaches the model the precise boundary of when to ground its response in the provided context and when to refrain from relying on context.

Code playground (Python)