Source-linked AI summary

DataFoundry: Evolving Data Preparators via Recursive Self-Improvement

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

arXiv:2608.29966v1cs.CL

TL;DR

Existing preparation pipelines commonly apply quality control only after data construction, although defects can originate upstream. DataFoundry recursively evolves a modular data preparator using pilot-set diagnosis and targeted adapters before full-scale production. Across mathematics, finance, law, and medicine, the resulting data delivers stronger downstream utility than baselines, with gains also generalizing across base models.

  • Problem

    Existing pipelines typically filter generated data after construction, despite quality issues arising during construction and limited guidance for improving domain-specific workflows.

  • Method

    DataFoundry represents the preparator as an evolvable runtime specification and uses modular skills to compile, assess pilot data, and adapt components while preserving interfaces.

  • Results

    DataFoundry consistently provides stronger downstream training utility across Math, Finance, Law, and Medical domains, with improvements not tied to a particular backbone model.

  • Takeaways & Limitations

    Recursive self-improvement can systematically adapt data-preparation runtimes to domain-specific requirements before large-scale synthesis.

Abstract

from arXiv · show

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 \textsc{DataFoundry}, a framework for \textbf{evolving data preparators through recursive self-improvement} before large-scale data production. \textsc{DataFoundry} represents a data preparator as an evolvable runtime specification and instantiates its evolution with a \textsc{Skills-as-Modules} architecture, in which a central \textsc{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 \textsc{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

Existing domain-adaptation pipelines often construct synthetic training data first and apply quality control afterward, even though problems arise during construction. DataFoundry instead evolves the preparator before large-scale production through pilot diagnosis and targeted component revisions.

  • Post-hoc filtering addresses generated samples after quality problems have already emerged during construction.
  • Long, multi-stage workflows implemented as standalone code make construction deficiencies difficult to diagnose and improve iteratively.
  • Domain-specific requirements create limited actionable guidance about what pipeline components to optimize across mathematics, finance, law, and medicine.
  • DataFoundry represents a preparator as an evolvable runtime specification and recursively improves it before final data production.
  • A central Controller compiles runtimes, diagnoses pilot-set deficiencies with domain-appropriate criteria, and translates feedback into interface-preserving adapters.
  • Across four domains, recursively evolved preparators improve downstream utility, with evaluations also testing backbone generality, evolution rounds, and component-level changes.

2 RELATED WORK

Related work moves from filtering generated data toward iterative, modular, and recursively evolving preparation systems. DataFoundry belongs to this broader shift by treating runtime skills and update surfaces as mutable objects of improvement.

  • Early data-construction pipelines bootstrap instructions and use filters to control noise, while later systems add rewriting and large-scale synthesis strategies.
  • Recent systems elevate data preparation from a fixed generator to a modular workflow, including methods that search over data states using downstream training feedback.
  • Agent skills package procedural knowledge as composable instructions, code, and resources that provide a portable adaptation surface.
  • Skill-optimization work includes co-evolving skill generation with verification and training lightweight skill generators using generation-level rewards.
  • Recursive self-improvement spans output refinement, self-training, evaluator improvement, harness modification, and autonomous research loops.
  • Experience-centric accounts treat runtime harnesses as infrastructure that routes trajectories and feedback into mutable skills, memory, environments, or parameters.

3 DATAFOUNDRY

DataFoundry models domain data preparation as a runtime that transforms knowledge corpora into supervised fine-tuning data, then improves that runtime through recursive pilot-based evolution. Its modular Controller compiles, assesses, and adapts components while preserving stable interfaces.

  • 3.1 BACKGROUND: DATA PREPARATION: A data-construction runtime transforms a domain knowledge corpus into a supervised fine-tuning dataset of instruction-response samples.
  • 3.1 BACKGROUND: DATA PREPARATION: The conventional construction-then-filtering paradigm builds a candidate pool before a filter selects samples judged valuable for downstream fine-tuning.
  • 3.2 INSPIRATION: EVOLVING VIA RECURSIVE SELF-IMPROVEMENT: DataFoundry shifts adaptation upstream by compiling an initial runtime specification and recursively improving the preparator before final production.
  • 3.2 INSPIRATION: EVOLVING VIA RECURSIVE SELF-IMPROVEMENT: Each iteration compiles the current specification, generates a small pilot set, assesses it with domain-specific criteria, and returns diagnostic feedback.
  • 3.3 FRAMEWORK: CONTROLLER AND SKILLS-AS-MODULES: The Skills-as-Modules architecture uses a Controller and three modular skills to compile, assess, and evolve the data-construction specification.
  • 3.3.1 CONSTRUCTION-RUNTIME-COMPILER: The initial specification exposes stable interfaces for corpus chunking, instruction building, response generation, and batch generation.
  • 3.3.2 CONTEXTUALIZED-DATA-ASSESSOR: Assessment criteria cover instruction alignment, self-containment, information density, and factual grounding, selected contextually for each domain.
  • 3.3.3 ADAPTER-BASED SPECIFICATION EVOLUTION: Adapters revise component policies, prompts, configurations, or coordination logic while preserving compiler-enforced interfaces and preventing uncontrolled specification changes.

4 EXPERIMENTS

Experiments evaluate DATAFOUNDRY across four domains and benchmark suites, using two RSI rounds and multiple comparative settings. It achieves the strongest domain-level averages, with gains over competing generators and matched-backbone baselines.

  • Evaluation Setup: Experiments cover Math, Finance, Law, and Medical domains with multiple benchmark sub-tasks.The evaluation includes GSM8K, AMC 2023, AIME 2024, MinervaMath, Math-5000, Gaokao 2024, OlympiadBench, CPA-KQA, FinEval-KR, XFinBench, LegalBench, LexGLUE, MedCaseReasoning, MedMCQA, and MedR-Bench.
  • Evaluation Setup: Two RSI rounds are used because pilot-set assessment results typically deteriorate after two rounds.All generators are fine-tuned jointly on Dolly-15k and their domain-specific synthesized data.
  • Main Results: 28.8, 66.1, 78.6, and 46.0 are DATAFOUNDRY’s average scores on Math, Finance, Law, and Medical, respectively.These averages outperform the strongest competing generator by 3.3, 1.3, 1.4, and 2.2 points, respectively.
  • Evolution Dynamics: Recursive evolution improves performance through two RSI rounds, but further evolution degrades performance overall.Figure 3 reports this trajectory for Math and Finance using GPT-5.6 Sol as the backbone.
  • Backbone-Controlled Comparisons: DATAFOUNDRY improves over the matched GPT-5.6 Sol Agent-based Generator by 3.4, 14.4, 4.8, and 11.1 points across Math, Finance, Law, and Medical.Against the matched Skill-based Generator, its further gains are 3.8, 6.2, 7.9, and 5.9 points, respectively.

5 ANALYSIS

The analysis shows that recursive self-improvement improves DATAFOUNDRY’s downstream utility and instance quality, but excessive evolution can degrade performance. Gains also transfer across downstream model backbones.

  • Recursive self-improvement: Two RSI rounds deliver the strongest overall performance, while further evolution can cause degradation and partial system collapse.Math rises from 25.6 at Round 0 to 28.8 at Round 2 before falling to 26.1 at Round 3; Finance peaks at 66.1 at Round 2 and declines to 58.3 at Round 3.
  • Cross-backbone generalization: DATAFOUNDRY remains competitive with Llama-3.1-8B, achieving the best scores on Math, Finance, and Medical.The reported scores are 13.6, 41.3, and 39.9, respectively.
  • Cross-backbone generalization: Against the best data generator, DATAFOUNDRY gains 2.6 points on Math, 4.8 points on Finance, and 3.8 points on Medical.These comparisons are reported for the Llama-3.1-8B downstream model.
  • Case studies: Recursive evolution converts diagnosed deficiencies into localized component revisions that specialize the preparation runtime for domain-specific requirements.In Finance, 84 of 100 instructions relied on missing contextual references, prompting targeted updates to responsible components.
  • Case studies: After evolution, a Fourier-series instance becomes fully specified and directly verifiable instead of depending on an external reference to equation (11.28).The example also illustrates richer reasoning-intensive supervision than the DataPrep-Skill baseline.

6 CONCLUSION

DATAFOUNDRY recursively evolves the data preparator before large-scale synthesis by diagnosing pilot data and revising modular components. Across four domains, the resulting datasets provide stronger downstream utility and generalize across base models, while excessive evolution requires control.

  • Conclusion: DATAFOUNDRY evolves the data preparator itself before large-scale synthesis through recursive self-improvement.The framework adapts the preparation runtime rather than only filtering generated outputs.
  • Conclusion: Pilot-set diagnoses are translated into targeted revisions of modular pipeline components that adapt preparation to domain-specific requirements.The conclusion describes this as progressive runtime adaptation.
  • Conclusion: Experiments across Math, Finance, Law, and Medical show stronger downstream training utility and generalization across different base models.The conclusion states this pattern at the dataset level.
  • Conclusion: The analysis shows recursive self-improvement can enhance data quality, but excessive evolution must be controlled.This conclusion reflects the reported degradation after too many evolution rounds.

A.2 CONTEXTUALIZED-DATA-ASSESSOR

The contextualized-data assessor workflow selects domain-appropriate criteria and evaluates pilot samples independently. It then aggregates the assessments into a report for subsequent improvement decisions.

  • Assessment workflow: The assessor inspects the domain, pilot-set path, and output path before loading the pilot set.These steps establish the assessment context and input data.
  • Assessment workflow: It selects one or more criteria from the multiple_criteria library according to the domain and intended downstream use.Criterion selection is explicitly domain-aware.
  • Assessment workflow: Each candidate is judged independently using the domain context and selected rubric.The workflow assesses one sample at a time.
  • Assessment workflow: The workflow aggregates sample-level judgments into an assessment report.The report supplies the diagnostic output for later preparation-runtime revision.

B DOWNSTREAM TRAINING SETUP

Experiments fine-tune all models with LlamaFactory using full-parameter supervised fine-tuning under a common configuration unless otherwise noted.

  • Training configuration: All models are fine-tuned with LlamaFactory using full-parameter supervised fine-tuning.The same configuration is used across training runs unless otherwise noted.

C EVALUATION BENCHMARKS

The evaluation benchmarks are documented in Table 5, including a naming clarification for the MATH benchmark.

  • Table 5 lists the downstream evaluation benchmarks used in the experiments, following Liang et al. (2026).
  • The released MATH-500 evaluation implementation uses 5,000 examples for the reported results.
  • The paper refers to this implementation as MATH-5000 throughout to avoid ambiguity.

D BASELINES IMPLEMENTATION

Table 6 provides the implementation details for the baseline generators used in the experiments.

  • Table 6 documents the implementation details of the baseline generators from Liang et al. (2026).

E PREPARED DATASET SIZE

The prepared-data comparison measures how many training samples each construction method synthesizes across domains from a shared raw source corpus.

  • Table 7 reports the number of training samples synthesized by each data construction method across domains.
  • All data construction methods operate on the same raw source corpus.
  • The Total column aggregates the synthesized-data yield across all domains.
Loading 2608.29966v1…