arXiv(opens in a new tab)cs.CLAug 2026Cited by 4 papers on PaperVantage

Manuscript Offprint

arXiv:2608.29966

DataFoundry: Evolving Data Preparators via Recursive Self-Improvement

Cehao Yang, Xiaojun Wu, Xueyuan Lin, Chengjin Xu, Xuhui Jiang, Hui Xiong, Jian Guo

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

ABSTRACT

Domain adaptation of large language models increasingly depends on constructing high-quality training data, yet existing data-preparation pipelines typically address quality only after generation through post-hoc filtering. This creates a fundamental mismatch: data-quality issues often originate from the construction process itself, while quality control is applied only to its outputs. We introduce DATAFOUNDRY, a framework for evolving data preparators through recursive self-improvement before large-scale data production. DATAFOUNDRY represents a data preparator as an evolvable runtime specification and instantiates its evolution with a SKILLS-AS-MODULES architecture, in which a central CONTROLLER orchestrates modular skills to compile executable runtimes, diagnose deficiencies on small pilot sets using domain-appropriate criteria, and translate diagnostic feedback into adapters that revise individual preparation components while preserving stable interfaces. We evaluate DATAFOUNDRY on DataPrep-Bench across mathematics, finance, law, and medicine, and find that recursively evolved preparators produce training data with higher downstream utility than baselines. Experiments across different backbones further demonstrate that these improvements are not tied to a particular model, while analyses and case studies further reveal the framework's optimization dynamics and illustrate how its evolution unfolds in practice.

1 INTRODUCTION

Large language models adapted to specialized domains rely on the effective preparation of domain knowledge as training data (Ling et al., 2025; Liang et al., 2026). Instead of directly training on raw corpora, the adaptation typically involves restructuring them into examples that better align with the target tasks and desired model behaviors (Lu et al., 2025; Nayak et al., 2024). Synthetic instruction generation has made this process easier to scale. Early pipelines bootstrap instructions and responses from model generations (Wang et al., 2023; Ding et al., 2023; Xu et al., 2025a), then remove invalid, redundant, or low-quality examples (Li et al., 2025; Yang et al., 2026a).

However, existing pipelines exhibit a fundamental mismatch between where quality issues emerge and where quality control is applied: quality issues can arise during the construction process, whereas quality control is typically applied only to the resulting samples. As shown in Figure 1, these pipelines often rely on post-hoc filtering to discard large fractions of generated data (Xu et al., 2025b; Yu et al., 2025; Li et al., 2024), rather than correcting the upstream processes that repeatedly produce poor examples. This mismatch suggests that improving data quality requires optimizing the preparation pipeline itself before scaling it up.

Addressing this mismatch requires shifting quality intervention upstream, but doing so is far from straightforward. First, data construction often involves long, multi-stage workflows implemented as

1∗^{1*} means equal contribution.

2^{2}† means corresponding authors.

standalone code (Fan et al., 2026; Shi et al., 2026; Kulikov et al., 2026; Du et al., 2026), making it difficult to diagnose and incorporate iterative improvements. Second, even when problematic stages can be identified, there is limited actionable guidance on what should be optimized and how, particularly across domains with different requirements, such as mathematics, finance, law, and medicine (Ling et al., 2025). These challenges motivate a systematic approach that can trace quality issues back to their construction processes and provide targeted, domain-aware guidance for improving the pipeline before the final large-scale data preparation.

To this end, we introduce DATAFOUNDRY, a framework for evolving data preparators through recursive self-improvement before large-scale data production. It represents it as an evolvable runtime specification. We instantiate this process with a SKILLS-AS-MODULES architecture, in which a central CONTROLLER orchestrates modular skills for compiling the current specification into an executable runtime, diagnosing deficiencies on small pilot sets using domain-appropriate criteria, and translating the resulting feedback into adapters that revise the preparator while preserving stable component interfaces. Through this recursive process, DATAFOUNDRY progressively specializes a general data preparator to the requirements of each target domain, and finally compiles the evolved specification into a domain-adapted runtime for full-scale supervised fine-tuning data production.

We evaluate DATAFOUNDRY across four specialized domains, including Math, Finance, Law, and Medical, and show that its recursively evolved data preparators consistently improve the downstream utility of the prepared training data. Beyond the main results with Qwen2.5-7B, we conduct ablation studies with different downstream base models to examine whether the gains generalize beyond a particular model. We further vary the self-improvement rounds to study how performance evolves and to characterize the growth potential of the proposed framework. Finally, through case studies, we trace the changes introduced during recursive self-improvement to individual pipeline components, providing a component-level explanation of how DATAFOUNDRY progressively adapts the data-production process to domain-specific requirements.

Figure

Figure 1: A mismatch between where data-quality issues emerge and where quality control is applied during data preparation. Challenges exist when optimizing the pipeline before scaling it up.

References (30)