Identify a schema change in a model response

Check units and version numbers as you type. · 188 words

A schema is the agreed shape of a model's response: its required fields, field names, and data types. A schema change occurs when the response no longer matches that contract, even if the underlying facts sound reasonable. For example, a museum event extractor expects {"title":"Night Tour","date":"2025-06-10","admitted":true}. The old response has all three fields with the correct types. A new response is {"event":"Night Tour","date":"2025-06-10","free":true}. The title field was renamed, the admitted field disappeared, and an extra free field appeared, so code expecting the old schema cannot read it safely.

Another failure can be a type change. Suppose a library notice is expected as one object with loan_days set to the number 14. After a model update, the model returns loan_days as the string "14 days." The information is understandable, but automatic arithmetic fails because "14 days" is not a number. A reliable pipeline should parse the response, check required names and types, and label a mismatch as a schema error. It can retry with the required shape shown in the prompt. It should not silently guess that a missing field is false or that every string can be converted.

Check your recall

What schema changes occur between the two museum event responses?

Check your answer

The response renames title to event, removes the required admitted field, and adds an unexpected free field. The date field remains a string, so it is unchanged.

Sources and credits

Original KeyTouch lesson. Background reading · Google · Rules of Machine Learning.