A good instruction tuning dataset does not need to come from chat logs. Technical corpora make strong supervision targets because the "prompt" and "answer" are structurally separated. Patents are ideal: the claims are the question, the description is the evidence.
The pattern Each row is a JSONL dataset record: one instruction, one context, one target.
python import json src = json.load(open("patent.json")) # title, abstract, claims, description rec = { "instruction": f"Summarize what {src['title']} protects.", "context": src["description"][:1500], "output": src["abstract"], } print(json.dumps(rec, ensure_ascii=False)) Quality gates for training data
Cap context length; truncate at paragraph boundaries, not mid-sentence.
Keep identifiers (publication_number) in metadata, not in the target text.
De-duplicate by abstract hash before splitting train/eval.
Schema check log
Region Final URL Status Language Price
US (patent text host) parsed / failed en quote
No-budget alternatives USPTO and EPO bulk XML are free and complete. The cost is ETL time: you will write the XML-to-JSONL converter yourself.
If you would rather start from a ready text dataset with claims/description/abstract already normalized into JSONL, Thordata publishes that form for patent and legal corpora on its DataMall marketplace.