Advanced level · Module 10: NLP Model Evaluation and Deployment · Lesson 3 of 4
Optimising, Documenting and Monitoring
Learners speed up CPU inference, write a model card and set up simple monitoring and feedback so that the system's quality is tracked after deployment.
In this lesson you will
- Optimise a model for CPU inference
- Write a model card and a monitoring plan
Key concepts
smaller modelsdynamic quantisationbatchingmodel cardmonitoring and feedback loop
The lesson
Options to speed up CPU inference include choosing a smaller model, shortening the maximum input length, batching requests and dynamic quantisation of linear layers in PyTorch (torch.ao.quantization.quantize_dynamic). Always re-check accuracy after optimising.
A model card states the model's purpose, training data and licences, evaluation results by slice, supported and unsupported languages, known limits and the review process. It is the document an organisation reads before deciding to use the system.
Monitoring logs predictions (without storing personal text unnecessarily), tracks the share of 'unsure' cases and lets staff correct labels. Corrections become new training and test data, and the model is re-evaluated before any update.
Step by step
- Measure prediction time, apply one optimisation and re-measure, checking accuracy.
- Write the model card.
- Add logging of labels, confidence and staff corrections.
- Write a monthly review procedure.
Practice activity
Optimise the project service, write its model card and add a monitoring and feedback loop.
Expected result: A faster service with unchanged or documented accuracy, a complete model card and working monitoring.
Check your understanding
-
What must you check after optimising a model?
Show answer
That its accuracy has not dropped unacceptably.
-
What should a model card say about languages?
Show answer
Which languages were evaluated and supported, and which are not supported.
Further learning
Taught live by an instructor — online or in person. Free course lessons are for self-study and do not lead to a certificate — see registration options.