Prepare model inputs that will also exist at prediction time
A team trains a late-arrival model using the actual arrival time as an input. A second team embeds policy documents for a support assistant. What must each team validate before reporting accuracy?
Prepare model inputs that will also exist at prediction time
A useful feature must be computable from information available at serving time. A useful retrieval result must come from an authorized passage that actually supports the answer. Preserve time, source version and access metadata during preparation so both claims can be tested.
In the recording
Chunk policy documents, embed the question, retrieve matching passages and ground Gemini’s answer in them.
Work through the decision
A team trains a late-arrival model using the actual arrival time as an input. A second team embeds policy documents for a support assistant. What must each team validate before reporting accuracy?
Check your reasoning
For forecasting, keep only fields available at prediction time and evaluate on later unseen records. For document search, retain passage IDs and permissions, embed with a compatible model and evaluate whether the correct passage is retrieved before judging the generated answer.
Decisions and tradeoffs
- Point-in-time features
- Join features as they existed at prediction time. Later outcomes used as inputs leak information into the evaluation.
- Time-based holdout
- Reserve a later period outside training to measure performance under the intended prediction conditions.
- Passage embeddings
- Split documents into identifiable chunks and encode them for similarity search. Preserve source, version and access metadata.
- Retrieval evaluation
- Use questions with known supporting passages to measure whether relevant evidence is present in the returned set.
Keep permissions attached to document passages
For a policy collection, store passage ID, text, document version and the permitted audience beside its embedding. Encode a test question with a compatible embedding model. Restrict retrieval to permitted passages, rank candidates, and pass their IDs and source text to the answer generator. An unrestricted vector search followed only by hiding the citations can expose content to the wrong reader.
Test two different user roles asking the same question. Record which passages each role can retrieve and whether the expected clause is among the first results. Repeat with a superseded clause to verify the version filter.
Practice the guide skills
- Build one feature row with only data available at the scoring cutoff.
- Retrieve a permission-filtered supporting passage for a known question and inspect its source.
Official objectives for this lesson
Related lesson · Train, evaluate and use a model without leaking the outcome
Prepare model inputs that will also exist at prediction time quiz
Answer 3 questions. Check each answer for an explanation.