Abstract
Instruction tuning has emerged as a paramount method for tailoring the behaviors of Large Language Models (LLMs). Recent work has unveiled the potential for LLMs to achieve high performance through fine-tuning with a limited quantity of high-quality instruction data. Building upon this approach, we further explore the impact of prompt robustness on the selection of high-quality instruction data. This paper proposes a pioneering framework for high-quality online instruction data mining, focusing on the impact of prompt robustness on the mining process. Our notable innovation is the generation of adversarial instruction data by conducting attacks on the prompts of online instruction data. We introduce an Adversarial Instruction-Following Difficulty (AIFD) metric and a novel Adversarial Instruction Output Embedding Consistency (AIOEC) approach to select high-quality "diamond" instruction data. Experimental results underscore the effectiveness of our proposed methods and the critical practical significance of considering prompt robustness.
Introduction
Fine-tuning LLMs on extensive instruction datasets is computationally expensive and often redundant. Recent research suggests that a small "core set" of high-quality instructions can yield comparable or superior performance. However, existing methods like Instruction-Following Difficulty (IFD) often ignore the model's sensitivity to prompt phrasing. LLMs are notoriously sensitive to minor perturbations; a single typo or synonym swap can lead to vastly different outputs. This paper argues that robustness is a key indicator of data quality: instructions where a model's performance is unstable under perturbation often represent complex, high-value samples that the model has yet to master.
Methodology: Mining "Diamond" Data
We propose a framework that identifies high-quality "diamond" data by "stress-testing" instructions through adversarial attacks. This process identifies samples that provide the most significant learning signals for the model.
Adversarial Instruction-Following Difficulty (AIFD)
As illustrated in the framework overview, AIFD extends the IFD metric by evaluating a model's difficulty in generating correct responses across multiple adversarial versions of an instruction. We employ three levels of attacks:
- Character-level: Introducing typos (e.g., "helthy" instead of "healthy").
- Word-level: Replacing words with synonyms (e.g., "salubrious" instead of "healthy").
- Sentence-level: Appending irrelevant distractor sentences.
AIFD calculates the average difficulty across these variations. High AIFD scores pinpoint instructions that are challenging yet semantically rich, making them ideal for fine-tuning.
Adversarial Instruction Output Embedding Consistency (AIOEC)
For scenarios lacking ground-truth responses, such as online data mining from user logs, we propose AIOEC. This method measures the cosine similarity between the model's internal representations (embeddings) of the original prompt and its adversarial counterparts.
As shown in Figure 2, AIOEC involves a three-step pipeline:
- Generation: Producing adversarial instruction output embeddings using various attack levels.
- Measurement: Calculating embedding consistency (cosine similarity) between the original and perturbed outputs.
- Mining: Selecting data with low consistency (high sensitivity) as high-quality samples, followed by expert calibration to ensure alignment with human preferences.
Experimental Evaluation
We validated our approach using the Alpaca (52K) and WizardLM70K datasets, evaluating performance on benchmarks including MMLU (general knowledge), HellaSwag (common sense), ARC (science), and TruthfulQA (factuality).
Key Results
- Efficiency and Performance: Using only 10% of the Alpaca dataset selected via AIFD, a LLaMA-7B model achieved an average score of 48.36, outperforming the standard IFD method (47.07).
- LLaMA2 Generalization: On LLaMA2-7B, 5% of AIFD-selected data outperformed the IFD baseline by 0.54%.
- Online Mining: AIOEC successfully identified high-quality data from raw logs without requiring human labels, demonstrating its utility for real-world online instruction mining.
Discussion and Insights
Our analysis reveals that robustness serves as an effective proxy for data quality. "Diamond" data identified by AIFD frequently involves creative tasks (e.g., "Write," "Generate," "Create"), whereas low-quality data often consists of formulaic tasks (e.g., "Rewrite," "Edit"). This suggests that instructions the model finds "unstable" are often those with the highest semantic complexity and logical depth.
Conclusion and Future Work
This research highlights the importance of prompt robustness in instruction data mining. While effective, the approach introduces computational overhead due to adversarial generation. Future work will explore more diverse attack types and cross-model data transferability to further refine the selection of "diamond" instruction data for more efficient LLM training.
Summary updated