Data: From Business Records To Model Inputs · Lesson 10

Data For Pretraining, Fine-Tuning And Testing

Data roles follow how information is used. Independence requires controlling the actual paths by which examples influence learning and development, not merely naming folders.

Study And Save Progress

Watch The Lesson

6 min 10 sec

Read the video transcript

Our fictional company has 85 approved order examples. It wants to predict, at checkout, whether an order will be returned within 30 days. Which examples may help the model learn, and which must remain independent to judge it? A sensible-looking split is only useful when we know the prediction time, target and deployment claim. Follow the roles before interpreting a score.

Pretraining supports broad initial learning under an objective, such as learning patterns in language. Post-training changes selected behavior later, including instruction following or task performance. Fine-tuning a pretrained model on specialized examples is 1 form of later training. Evaluation instead measures behavior under specified conditions. These are roles in a process.

The same question-and-answer format could appear in a training collection or a test; its file format cannot establish its role. Hugging Face's Transformers documentation illustrates fine-tuning a pretrained classifier with separate training and evaluation data. That is a specific software workflow, not evidence that our 85 examples are enough or that training will improve this business.

Record which examples and transformations influence learning, which help development choices, and which remain reserved for the final claim. Use the explicit hypothetical split from the course project. January through March orders for customer groups C001 through C016 supply 68 training examples. April orders for entirely different groups C017 through C020 supply 17 final-evaluation examples.

No customer group crosses the partition. The intended claim is return risk at checkout for later orders from customers unseen in training. Both time and customer novelty change together; this 1 test cannot isolate their separate effects. The project makes the arithmetic reproducible. 12 training groups have 4 orders each and 4 groups have 5:

48 plus 20 equals 68. 3 evaluation groups have 4 each and 1 has 5: 12 plus 5 equals 17. These counts describe a synthetic partition. They establish no label accuracy, useful performance, sufficient sample size or absence of leakage. The final 17 outcomes must mature over the 30-day horizon before scoring.

Only information available by checkout belongs in inputs for this claim. A return observed later can be a target once its horizon matures. A later delivery status or revised label must not slip backward into checkout features. Scikit-learn's version 1.7 documentation explains leakage as using information unavailable

at prediction time in model building. Its examples motivate auditing preprocessing as well as the obvious input fields. Keep development separate from final testing. Suppose a team inspects the 17 outcomes and changes its labels, features, prompts, thresholds or model choice to improve that result. Those cases have now influenced development.

Reporting them again as an untouched final test would overstate independence. Use a separate development-validation process for iteration, then freeze the candidate and assess the reserved final set. The project supplies no particular development sample count or measured score. Contamination can also enter through near-duplicate answers, related customer episodes, retrieved test answers or

a public benchmark already encountered during training. Separate directory names cannot prevent these information paths. Trace source families, groups, timing and development access. If you cannot establish an independence claim, state that limitation and design a better test rather than presenting the same number with greater confidence. Training mixtures create another choice. Sources, languages, domains and formats

contribute under selected proportions or sampling rules. More material from 1 source can change what the model practices, but it gives no guaranteed proportional gain. Version the dataset, transformations, split rule and label guide together. A model comparison becomes difficult to interpret if its test set changes silently.

Our checkout predictor also remains separate from the assistant's request-time order lookup and policy retrieval. Penedo and colleagues' FineWeb study, first released in June 2024, documented pretraining-data curation and experiments varying filtering and deduplication choices. They released curation code and the models trained in those experiments. The evidence comes from comparing defined

choices on tested models and benchmarks. It does not make 1 filter a universal guarantee. For our smaller task, preserve the data and transformation versions so a comparison can reveal what changed, and keep evaluation independent of the decisions being compared. Here is the checkpoint. Why preserve a final test set while using a development set?

Think about what happens when repeated decisions are made after looking at the same outcomes. Repeated tuning can adapt choices to that set. A separate final set supports a more credible assessment of the frozen candidate under its stated claim. Independence still needs checks for groups, timing, duplicates and information access; the name final does not provide them.

For practice, classify data roles and challenge a proposed checkout feature and a reused test. The worksheet binds the same project split and gives a separate key. Our 68 and 17 remain teaching counts, with no model score supplied. Before claiming performance, name what was learned from, what guided decisions, what was held out,

and which future situation the test represents. Next we will ask what changes when some examples are generated rather than independently observed.

Main Point

Data roles follow how information is used. Independence requires controlling the actual paths by which examples influence learning and development, not merely naming folders.

Key Points

1. Bind the course's synthetic split

The following hypothetical project example defines the customer groups, dates and intended test claim explicitly.

The target is occurrence of a return within 30 days, predicted at checkout for later orders from unseen customers. Only checkout-available inputs qualify. January–March groups C001–C016 give 68 training examples: 12 × 4 + 4 × 5. April groups C017–C020 give 17 final examples: 3 × 4 + 1 × 5. Groups do not overlap. Time and customer novelty vary jointly, so the test does not identify their separate effects. Score only after the 30-day outcomes mature.

These invented counts define a partition, not sufficient evidence of quality, size, performance or leakage absence. The guide/version and feature-availability rules still need inspection.

2. Keep roles and information paths distinct

A question-answer pair can train a model or evaluate it. Transformers 4.57.0 illustrates specialized fine-tuning of a pretrained classifier; its software example supplies no benefit estimate for the course case. [HF-TRAIN]

Development may use separate validation or training-only resampling under an explicit design. Once the final 17 outcomes influence a label, feature, prompt, threshold or candidate choice, they have influenced development. The same set cannot honestly retain an untouched-final claim.

Scikit-learn 1.7.2 explains leakage and appropriate split/preprocessing practices. Related groups, future information, duplicates and test-derived preprocessing can undermine an apparent holdout. [SK-LEAK;SK-SPLIT]

3. Preserve the comparison

Version dataset identities, mixture rules, transformations, label guide and evaluation together. Explain which changes belong to a new test rather than quietly replacing old results. Keep runtime retrieval and application state distinct from training and reserved evaluation. Use the worksheet to inspect role, timing and development contamination without inventing a score.

4. A dated example

Penedo and colleagues' FineWeb study, first released in June 2024, documented pretraining-data curation and experiments varying filtering and deduplication choices. They released curation code and the models trained in those experiments. The evidence comes from comparing defined choices on tested models and benchmarks. It does not make one filter a universal guarantee. For our smaller task, preserve the data and transformation versions so a comparison can reveal what changed, and keep evaluation independent of the decisions being compared.

5. Bringing the lesson together

The 68 training and 17 final examples now have a defined timing and deployment claim. You can inspect what influenced learning or development and decide whether a final test still supports an independent comparison.

Learning Checks

Attempt each answer before expanding the reasoning.

M13-L10-Q01

Why preserve a final test set while using a development set? Think about what happens when repeated decisions are made after looking at the same outcomes.

Show reasoning

Repeated tuning can adapt choices to that set. A separate final set supports a more credible assessment of the frozen candidate under its stated claim. Independence still needs checks for groups, timing, duplicates and information access; the name final does not provide them.

Sources

Learner Materials

Download Lesson 10 Learner Materials

Use the supplied fictional cases and templates for practice.

Practice

Write your answer, compare it with the model answer and decide what to revisit. These written checkpoints are self-assessed.

Here is the checkpoint. Why preserve a final test set while using a development set? Think about what happens when repeated decisions are made after looking at the same outcomes.

Show The Model Answer

Repeated tuning can adapt choices to that set. A separate final set supports a more credible assessment of the frozen candidate under its stated claim. Independence still needs checks for groups, timing, duplicates and information access; the name final does not provide them.

Compare your reasoning with the model answer. These written checks are self-assessed.

Open Practice And Save Your Work