Build an Evaluation Set for Contract Clause Extraction Prompts
Last updated: November 29, 2026
Quick Overview
Your team is changing the model and prompt behind a tabular review column that extracts clauses such as change of control, governing law and termination rights. How do you build an evaluation that tells you, before shipping, whether the change is better?
Legora
November 29, 20260
0
0 solved
Your team is changing the model and prompt behind a tabular review column that extracts clauses such as change of control, governing law and termination rights. How do you build an evaluation that tells you, before shipping, whether the change is better?
Legora's AI engineering roles centre on implementing and evaluating LLM applications, and Tabular Review answers go straight into due diligence reports. The interviewer looks for a concrete eval design with lawyer-labelled data, metrics that match the output types, and awareness of judge bias and data leakage.
What the Interviewer Expects
- Defines the task per column type: presence, extracted span, normalised value
- Builds a labelled set with lawyers, including hard and negative cases
- Picks metrics per type: precision and recall for presence, span overlap, exact match for normalised values
- Evaluates citation correctness separately from answer correctness
- Uses an LLM judge only after calibrating it against human labels
- Defines a ship rule with confidence intervals, not a single average
Key Topics to Cover
How to Approach This
- Understand the bias-variance trade-off. High training accuracy but low test accuracy signals overfitting.
- Choose evaluation metrics carefully based on the problem. Accuracy alone is often insufficient.
- Feature engineering is often more impactful than model selection.
- Know when to use tree-based models (tabular data) vs neural networks (unstructured data).
- Handle class imbalance with SMOTE, class weights, or appropriate loss functions.
Possible Follow-up Questions
- How many labelled documents do you need to detect a 3 point recall change?
- How would you stop the eval set from leaking into prompt tuning?
- Which errors are worse for a due diligence lawyer, misses or false positives, and how does that change the metric?
- How would you keep the eval useful as customers bring documents in new languages?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Explore ML Interview PrepSample Answer
Clarify
For each column, the output has three parts: is the clause present, what text supports it (citation), and a normalised answer (for governing law, a jurisdiction; for change of control, consent require...
Approach
- Sample 300 to 500 documents stratified by document type, length, language and OCR quality, deliberately including documents where the clause is absent or phrased unusually. 2. Two lawyers label eac...