TL;DR
Enterprise data pipelines are a maze of multilingual scripts, making it hard for AI coding agents to trace where a specific data column actually comes from. This paper shows how to distill that tracing skill into a compact, locally runnable 7B-parameter model (Qwen2.5-Coder-7B) using a two-stage training recipe. The resulting specialist model matches GPT-4o at extracting "schema lineage" and boosts a downstream text-to-SQL agent's execution accuracy from 27.4% to 75.0%.
What Problem Does This Paper Address?
In real-world companies, data pipelines transform raw tables into derived columns across long, multi-stage scripts. To interpret those columns—or write accurate SQL against them—AI agents need target-specific schema lineage: the exact source columns ($C$), source tables ($T$), ordered transformations ($F$), and aggregations ($A$) that produce a given target column $y$, while ignoring unrelated code in the same script.
Calling a frontier cloud model like GPT-4o for every single column is expensive, and sending proprietary enterprise code to external APIs often violates privacy constraints. The authors tackle the challenge of building a compact, locally deployable specialist model that can recover this structured lineage on its own.
Methods
The authors use a two-stage fine-tuning framework on Qwen2.5-Coder-7B Base:
- Teacher Distillation & Supervised Fine-Tuning (SFT): GPT-4.1 acts as a teacher, taking pipeline scripts, expert annotations, and human reasoning exemplars to generate step-by-step reasoning traces and structured four-field answers. Only traces whose final answers score above 0.95 on the SLiCE (Schema Lineage Composite Evaluation) metric are kept. These high-quality traces are used for completion-only LoRA SFT, teaching the 7B model the expected reasoning style and output format.
- Reinforcement Fine-Tuning with Graded SLiCE: Standard SLiCE uses binary multipliers for format validity and exact source-column match. If a model misses even one source column, the entire reward drops to zero, starving Group Relative Policy Optimization (GRPO) of any within-group learning signal. To fix this, the authors introduce Graded SLiCE: it still assigns
0to unparseable or format-invalid outputs, but otherwise gives partial credit based on source-column F1 overlap ($s$) and semantic similarity ($B$).
Datasets
The accepted teacher corpus contains 1,700 records across 50 multilingual enterprise pipelines, split into Train, Dev, and Test sets across Easy, Medium, and Hard difficulty levels:
Only the 999 records from the 28 training pipelines enter SFT, while held-out pipelines are used to evaluate both lineage extraction and downstream text-to-SQL performance.
Key Insights and Ideas
- Partial credit unlocks RL for structured extraction: Binary exact-match rewards cause partially correct candidates to collapse into all-zero groups during RL. Graded SLiCE preserves strict formatting rules while rewarding partial source recovery, giving GRPO a smooth signal to optimize.
- Task-specific fine-tuning beats raw parameter scale: A specialized 7B model outperforms a much larger 32B general-purpose coding model (
Qwen2.5-Coder-32B) on this benchmark, showing that targeted domain adaptation can outweigh sheer model size. - Lineage is actionable context, not just metadata: Giving a text-to-SQL agent matched metadata without lineage still leaves it guessing—and often writing executable but semantically wrong SQL ("silent errors"). Supplying extracted lineage dramatically cuts those silent errors.
Key Results
- Lineage Extraction: Under the frozen evaluator,
Qwen2.5-Coder-7Bjumps from 0.1392 pipeline-macro SLiCE to 0.5233 after SFT, and reaches 0.5843 with Graded SLiCE GRPO. This matches GPT-4o (0.5764) and beats Qwen2.5-Coder-32B (0.4743) and Gemma-4-12B (0.5324), though it trails larger contemporary models like Devstral-Small-2-24B (0.6106) and Qwen3.6-27B (0.6738). - Downstream Text-to-SQL: Supplying the 7B model's Graded-SLiCE-GRPO lineage to a GPT-5.6 Sol Medium SQL agent raises execution accuracy on lineage-dependent questions from 0.274 (no lineage) to 0.750, while slashing silent errors from 0.726 to 0.250.
Limitations and Future Work
- Downstream Bottleneck: Expert gold lineage achieves 1.000 SQL execution accuracy compared to 0.750 with the 7B model, showing that lineage-producer quality remains a bottleneck.
- Benchmarking: Future datasets should organize pipelines by business family and production DAG, add independently sampled pipelines, and support family- and DAG-disjoint evaluation.
- Richer Supervision: Graded SLiCE is still an answer-level reward; incorporating trace-, graph-, and execution-aware signals—along with verifier-approved traces from multiple teachers—could make RL fine-tuning more robust.
Summary updated