Abstract
Supervised Fine-Tuning (SFT) is critical for aligning Large Language Models (LLMs) with specific tasks. While current data cleaning methods focus on sample-level filtering, they often overlook the redundancy within high-quality samples. We introduce Token Cleaning, a fine-grained approach that filters uninformative individual tokens using an influence-guided scoring system. By isolating task-specific "informative" tokens, our method achieves up to a 6.3% performance boost compared to training on full datasets, demonstrating that fine-grained selection can significantly enhance model alignment.
Introduction
The prevailing paradigm in Supervised Fine-Tuning has shifted from maximizing data volume to prioritizing data quality. However, existing cleaning techniques are typically "coarse-grained," discarding entire conversations or instructions based on sample-level metrics. This paper argues that even "clean" samples contain significant noise—redundant phrases, structural patterns, or knowledge the model has already acquired during pre-training. These uninformative tokens dilute the gradient signal, forcing the model to expend optimization effort on redundant information rather than task-specific nuances. We propose treating these tokens as a "noisy label" problem and introduce a pipeline to isolate informative tokens that drive task performance.
Methodology: The Token Cleaning Pipeline
The core of our approach is an influence-guided scoring mechanism that quantifies the "quality" of individual tokens.
Scoring via Influence
The quality of a token is defined by the difference in loss between a Base Model (the pre-trained starting point) and a Reference Model (a model exposed to task-specific data). A token is considered "informative" if the Reference Model exhibits a significantly lower loss on it compared to the Base Model.
Implementation Strategies
We evaluate two primary strategies for implementing this pipeline:
- Fixed-Model Cleaning: A one-shot approach where a static reference model scores the entire dataset.
- Self-Evolving Cleaning: An iterative strategy where the dataset is partitioned. The model is trained on an initial subset and then serves as the reference to clean subsequent parts, creating a virtuous cycle of refinement.
Global Thresholding
After scoring, we apply a global threshold (e.g., retaining the top 60% of tokens by influence score). Unlike local ranking methods that filter tokens within each sample, global ranking allows high-quality samples to retain more tokens while potentially stripping low-quality samples entirely.
Experimental Setup
We constructed a high-quality pool of 50,000 samples from five major SFT sources: Flan v2, Open Assistant 1, Stanford Alpaca, Dolly, and WizardLM. Evaluation was conducted across seven benchmarks from the OpenLLM Leaderboard, including MMLU, TruthfulQA, TydiQA, HellaSwag, ARC-Challenge, BoolQ, and LogiQA.
Key Results and Insights
Our experiments demonstrate that Token Cleaning consistently outperforms traditional baselines, including full-token training and sample-level selection.
Performance Gains
On the LLaMA-3.2-3B model, Token Cleaning provided a 6.3% average improvement over the full-token baseline. For larger models like Mistral-7B and LLaMA-3.1-8B, improvements ranged from 2.0% to 4.4%. These results suggest that the "informative vs. uninformative" distinction is a fundamental property of SFT data across different scales.
The "Matthew Effect" and Token Sparsity
We observed a "Matthew Effect" in the self-evolving strategy: high-quality data groups produce superior reference models, which then more effectively clean subsequent data. Furthermore, we found that "less is more"—optimal performance was frequently achieved by discarding 30% to 50% of response tokens, confirming that a substantial portion of SFT data acts as "filler."
Conclusion and Future Work
Token Cleaning represents a significant step toward fine-grained data efficiency in LLM alignment. While the current implementation improves data quality, it does not yet offer a training speedup as the model still processes the full context. Future research will explore methods to skip uninformative tokens during the forward pass and investigate the dynamics of token cleaning at the 70B+ parameter scale. Additionally, developing automated algorithms to estimate the optimal noise ratio for specific datasets remains a priority.
Summary updated