Agentic Instruction Data Selection: Let DataMaster Interpret Your Intent

Fanqi Zhou, Qiaosheng Chen, Zixian Huang, Gong ChengarXiv 2026

TL;DR

Fine-tuning large language models (LLMs) requires high-quality instruction data, but static, one-size-fits-all filtering metrics fail to capture diverse user intents. This paper introduces DataMaster, an agentic data-selection system that translates natural-language user requirements into dynamic, multi-stage curation strategies. By cascading specialized LLM agents, DataMaster consistently outperforms static baselines and frequently beats full-dataset training while using a fraction of the data at a negligible API cost (<$5 per task).

What Problem Does This Paper Address?

Supervised Fine-Tuning (SFT) is a cornerstone of modern LLM development, but indiscriminately training on massive, heterogeneous datasets is computationally expensive and can degrade model performance. To combat this, researchers have developed various data selection metrics based on quality, difficulty, or informativeness.

However, existing methods rely on static selection strategies. They apply the same hard-coded filtering rules regardless of what the developer actually wants to achieve. For instance, a static filter might prioritize highly complex data across the board. But while a mathematical reasoning task might benefit most from samples of moderate difficulty relative to the target model, a medical knowledge task might require exceptionally difficult, long-tail factual data.

Currently, developers must manually inspect datasets and hand-craft heuristic rules for every new application—a tedious, error-prone process that doesn't scale.

Methods

DataMaster replaces manual configuration with an automated, intent-conditioned orchestration pipeline. It takes a natural-language description of the user's goal (e.g., "Curate a math reasoning subset... keep rigorously step-by-step solutions...") and processes the data pool through a cascade of four specialized agents:

Figure 1: Static selection versus intent-conditioned selection. (a) Conventional methods apply fixed selection criteria independently of user needs, producing a one-size-fits-all subset. (b) DataMaster interprets the natural-language instruction and the training set to dynamically configure a four-agent cascade across domain, characteristics, informativeness, and quality. Consequently, the same SFT data pool yields different task-aligned subsets for different needs, e.g., mathematical reasoning and medical question answering. The target model further informs the learning-value assessment of the Informativeness Agent.
  1. Domain Agent (Stage 1): Interprets the user's prompt, embeds the data pool, performs semantic clustering (using HDBSCAN or KMeans), and isolates the clusters that match the target domain.
  2. Characteristic Agent (Stage 2): Equipped with a sandboxed Python environment, this agent writes temporary scripts to inspect data schemas, length distributions, and content patterns. It then dynamically generates deterministic filtering rules (e.g., length constraints, noise-character caps, or keyword blacklists) tailored to the dataset's current state.
  3. Informativeness Agent (Stage 3): Assesses the learning value of samples relative to the target model. Instead of relying on a single metric, it dynamically weights four distinct signals—Negative Log-Likelihood (NLL), token-level entropy, semantic drift, and parameter-change magnitude (MeanDiff)—based on the task type.
  4. Quality Agent (Stage 4): Acts as an LLM-as-a-Judge. It generates a customized scoring rubric based on the user's intent (e.g., prioritizing logical rigor for math or factual accuracy for medicine) and conducts batched listwise scoring to select the final top-$k$ samples.

DataMaster utilizes DeepSeek-V4-Flash as its core backbone LLM to drive agent reasoning and judging.

Datasets

The authors evaluated DataMaster across multiple domains using several prominent open-source instruction pools and benchmarks:

  • Single-Domain Source Pools: Math (OpenR1-Math, Synthetic-Math), Medical (Medical-Reasoning, UltraMedical), and Code (OSS-Instruct, Code-Alpaca).
  • Multi-Domain Mixed Pools: OpenHermes-2.5 (1M samples) and Tulu-3-SFT-Mixture (939K samples).
  • Evaluation Benchmarks:
  • Math: GSM8K, MATH, Minerva-Math, AMC23, AIME 2024/2025.
  • Code: LiveCodeBench, HumanEval, BigCodeBench.
  • Medical: MedQA, MMLU-Medical.
  • Science: MMLU-STEM, GPQA-Diamond.

Key Insights and Ideas

  • The Power of Dynamic Weighting: Traditional metrics like NLL perform inconsistently across tasks. DataMaster's "aha moment" is letting an LLM dynamically shift metric weights based on intent. For example, it automatically assigns higher weight to semantic drift for step-by-step math problems, but favors NLL (knowledge gaps) for factual medical data.
  • Tool-Assisted Curation: Rather than blindly guessing filtering thresholds, the Characteristic Agent acts like a human data engineer—running descriptive statistics on the data pool before finalizing its rules.
  • Preventing Objective Collapse: By breaking the pipeline into a sequential cascade (Domain $\rightarrow$ Characteristics $\rightarrow$ Informativeness $\rightarrow$ Quality), DataMaster avoids collapsing the selection criteria into a single, oversimplified proxy metric.

Key Results

DataMaster was tested against six static baselines (including SuperFiltering, SelectIT, and DEFT) and a strong dynamic baseline (Claude Code powered by Claude Opus 4.7) across three target models (Qwen2.5-7B, Llama-3.1-8B, and Olmo-3-7B-Instruct).

Single-domain experimental results
  • Beating the Baselines: In single-domain experiments, DataMaster achieved the highest average score among static baselines in 16 out of 18 experimental settings. It also outperformed all static baselines in every multi-domain test case.
  • Less is More: Curation via DataMaster selected a compact subset of just 10K samples. Remarkably, training on this tiny subset outperformed training on the Full Pool (which contained up to 41$\times$ more data) in 12 out of 18 settings, drastically reducing compute costs while yielding superior models.
  • Highly Cost-Effective: The entire agentic pipeline is remarkably cheap, costing an average of less than US$5 in API tokens per data-selection task.

Limitations and Future Work

While DataMaster represents a major step forward, the authors note a few limitations:

  • Model Scale: The evaluation was restricted to target models in the 7B–8B parameter range; future work is needed to see if these gains scale to larger architectures.
  • Rigid Cascade Order: The four stages currently execute in a fixed sequence. The authors suggest that future iterations could benefit from adaptive orchestration, allowing the system to dynamically reorder or skip stages depending on the user's prompt and the initial data pool composition.

Summary updated

BibTeX
@misc{zhou2026agentic,
  author = {Fanqi Zhou and Qiaosheng Chen and Zixian Huang and Gong Cheng},
  title = {{Agentic Instruction Data Selection: Let DataMaster Interpret Your Intent}},
  year = {2026},
  eprint = {2608.10579},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2608.10579},
}
Figure