CoolFace
Modelpublic

wallfacers/weft-lineage-extractor-7b

sourceHugging Faceotherupdated 2mo agoView on Hugging Face
0likes11downloads
Model Card

weft-lineage-extractor-7b

A 7B code model (LoRA fine-tuned, merged) that extracts table- and column-level data lineage from ETL scripts as structured JSON. Trained on 1,154 real-world GitHub ETL scripts with tri-vendor consensus silver labels.

## ⚠️ Published primarily as a scale-curve NEGATIVE RESULT: the 7B "capacity valley". On the real-world benchmark, 7B ≈ 3B — its table F1 (0.706) is slightly below the 3B column specialist (0.723) while column F1 is comparable (0.924 vs 0.931). The scale dividend on this task only materializes at 14B. Additionally, table-token loss weighting is inert at 7B (+0.004 table R, vs +0.048 for the same W=3 at 14B): the lever that balances table/column at other sizes has a capacity threshold that 7B does not clear. If you want quality, use [weft-lineage-extractor-14b](https://huggingface.co/wallfacers/weft-lineage-extractor-14b); if you want efficiency, use [weft-lineage-extractor-3b](https://huggingface.co/wallfacers/weft-lineage-extractor-3b). This checkpoint is the evidence in between.

Branches & evaluation

Real-world benchmark: 129 non-empty GitHub scripts, tri-vendor consensus gold (qwen-max ∩ deepseek-v4-pro ∩ GPT-5.6, 2-of-3), greedy decoding, max_new_tokens=512. Column metrics are conditional on matched tables.

BranchVariantTable P / R / F1Column P / R / F1Direction
`main`plain full-column0.813 / 0.624 / 0.7060.934 / 0.914 / 0.9240.620
tri-lw3loss-weighted W=30.809 / 0.628 / 0.7070.938 / 0.853 / 0.8940.626

The two branches are nearly identical on tables — that near-identity is the finding (loss weighting does nothing at 7B, unlike 3B and 14B).

For reference, the same recipe trained on 10,000 synthetic scripts scores 0.999 table F1 on the synthetic held-out set and 0.467 on real scripts — synthetic-only scores are systematically misleading (see the family's negative-result artifacts below).

Training details

Base modelQwen/Qwen2.5-Coder-7B-Instruct
MethodLoRA r=32, α=64, bf16 (merged into this checkpoint)
Data1,154 real GitHub ETL scripts, tri-vendor consensus silver labels (tables + columns)
Schedule3 epochs (219 steps), effective batch 16, lr 2e-4 cosine, max seq 2048
Hardware1× RTX 6000D 84 GB, ~32 min per variant

Usage

Same interface as the whole family — system prompt in, one JSON object out.

python
from transformers import AutoModelForCausalLM, AutoTokenizer

REPO = "wallfacers/weft-lineage-extractor-7b"
tok = AutoTokenizer.from_pretrained(REPO)
model = AutoModelForCausalLM.from_pretrained(REPO, dtype="bfloat16", device_map="cuda")

SYSTEM_PROMPT = (
    'You are a data lineage extractor for ETL scripts. Given a PYTHON, SHELL, SCALA or '
    'JAVA task script (Spark/Flink jobs included), output ONLY a JSON object '
    '{"reads": [...], "writes": [...]} where each '
    'item is {"table": str, "columns": [str] or null}. Rules: include a table only if '
    'its literal name appears in the script text; ignore dynamically-built table names, '
    'commented-out SQL, and SQL that is merely printed or logged; if nothing is read or '
    'written, output {"reads": [], "writes": []}.'
)

msgs = [{"role": "system", "content": SYSTEM_PROMPT},
        {"role": "user", "content": "task_type: PYTHON\nscript:\n" + script}]
ids = tok.apply_chat_template(msgs, add_generation_prompt=True, return_tensors="pt").to(model.device)
out = model.generate(ids, max_new_tokens=512, do_sample=False)
print(tok.decode(out[0, ids.shape[1]:], skip_special_tokens=True))

Output schema: {"reads": [{"table": str, "columns": [str] | null}], "writes": [...]}. Extraction convention ("Convention A"): a table is labeled only when its literal name appears in an executable read/write statement; dynamic names, commented-out/printed SQL and temp views are out of scope by design.

Intended use & limitations

  • —Intended: reproducing the scale curve; ablation baselines; research on capacity thresholds for structured extraction.
  • —Not the deployment pick: 14B strictly dominates it on quality and 3B matches it at a third of the cost. Table recall 0.62 means real misses; labels are LLM-consensus silver, not human gold.

Model family

ModelRole
weft-lineage-extractor-14bbest single models (3 branches)
weft-lineage-extractor-7bthis repo — capacity-valley scale point
weft-lineage-extractor-3befficient family (12 GB-GPU deployable), 3 branches
weft-lineage-extractor-1.5bsynthetic-only negative-result artifact
weft-lineage-extractor-0.5bscale-curve point (synthetic-only)
weft-lineage-extractor-jvm-1.5bcross-language (Scala/Java) negative result
weft-script-lineage-synthsynthetic corpus + evidence reports

Full experiment ledger: github.com/wallfacers/data-weave (ml/lineage-extractor/out/FINDINGS-14b-cloud.md).