Fine-tuning Large Language Models (LLMs) on specific tasks usually relies on selecting data based on text similarity. However, this approach often misses the deeper "intent" of the data. To address this, researchers have introduced Task-Aware Data Selection (TADS), a novel pipeline that uses LLMs to generate "proxy labels" to align the joint distribution of instructions and labels. By selecting just 10,000 high-quality, task-aligned samples from a pool of 300,000, TADS achieves performance that meets or exceeds state-of-the-art methods while being significantly more computationally efficient.
The Problem: Missing the Underlying Intent
When specializing an LLM for a specific domain (like legal advice or math), the gold standard for data selection is finding samples that match the target distribution.
Currently, most methods look only at the input text ($X$)—using embeddings or gradients to find "similar" looking sentences. This is often insufficient. For example, a "cell phone contract" and a "marital dispute" might both contain the word "contract" and look similar to an embedding model, but their underlying task and domain are completely different.
To truly select the right data, we need to look at the joint distribution of inputs and labels ($X, Y$). However, in the massive, unlabeled "source" datasets used for training, these task-specific labels ($Y$) simply don't exist.
The TADS Pipeline
To bridge this gap, the authors propose a four-step pipeline called Task-Aware Data Selection (TADS):
- Proxy-Label Generation: A capable LLM (like Qwen2.5-7B) annotates a small "target" dataset and the large "source" pool with four semantic tags: Task (core intent), Topic (subject matter), Style (rhetorical tone), and Audience (intended user).
- Clustering and Propagation: The target set's labels are clustered into "semantic anchors" using K-means. Source samples are then projected into this space and assigned to the most relevant anchors based on embedding similarity.
- OOD Filtering: To handle "label noise" (where a source sample is incorrectly matched to a target anchor), an LLM scores the relevance of the sample to its assigned anchor. Samples with low scores are discarded as Out-of-Distribution (OOD).
- Incremental Sampling: Finally, an algorithm selects a subset of the source data that matches the proportions of the target dataset’s labels. This ensures the final training set isn't just "similar" to the target, but actually shares its statistical distribution.
Unlike previous methods that rely on expensive gradient computations or simple feature similarity, TADS uses the reasoning power of LLMs to create a structured, human-interpretable label space for alignment.
Experimental Setup
The researchers evaluated TADS using a Source Pool of 300K samples, which was a mixture of five popular instruction-tuning datasets (Flan V2, Open-Assistant 1, WizardLM, Dolly, and Stanford Alpaca).
The models were tested across five diverse benchmarks: MMLU (General knowledge/Factuality), TruthfulQA (Truthfulness), GSM8K (Math reasoning), BBH (Complex reasoning), and TyDiQA (Multilingual question answering).
Key Insights
- The "Label Information" Boost: Using information theory, the authors show that the mutual information between the task and the selected data is the sum of the information in the text ($X$) and the additional information provided by the labels ($Y$). Standard methods ignore the second term, whereas TADS explicitly captures it.
- LLMs as Noise Filters: Traditional deep learning models tend to "memorize" clean data before noisy data, but training them just to filter labels is slow. TADS demonstrates that using a frozen LLM to "reason" about label relevance is a faster and highly effective proxy for filtering noise.
- Distribution Shape Matters: It’s not enough to just pick the "top 10,000 most similar" items. If your target task is 80% math and 20% logic, your training subset should reflect those proportions. TADS’s incremental sampling explicitly maintains these ratios, successfully mirroring the target distribution.
Results and Efficiency
- Efficiency: TADS is roughly 3x faster than gradient-based methods like LESS. It processed the 300K pool in 19 hours on an A100 GPU, compared to 60+ hours for competitors.
- Performance: Fine-tuning a Llama-3.1-8B model on just 10K samples selected by TADS outperformed the "Full" 300K dataset on several benchmarks, including MMLU and GSM8K.
- Superiority over SOTA: TADS consistently beat other task-specific selection methods across most reasoning and factuality benchmarks.
- Robustness: The method proved resilient even when 20% of the generated proxy labels were intentionally corrupted with noise, thanks to the "averaging" effect of the anchor-based clustering.
Limitations and Future Work
While highly effective, TADS underperformed on the multilingual benchmark (TyDiQA). The authors suspect this is because the proxy labels and the annotator LLM were primarily English-centric, failing to capture the nuances of multilingual data. Additionally, the quality of the selection depends on the capability of the LLM used for annotation; a very weak annotator would likely degrade results.
Future directions include exploring more specific, domain-customized label fields (e.g., "code complexity" for programming tasks) and improving the pipeline for multilingual scenarios.
Summary updated