All jobs / AI engineer / Document AI
AI engineer interview question · 3–5 years
A legal team will only use your contract assistant if every answer points to a real page and clause. How do you build that?
The strongest answer
Citations come from the pipeline, not the model’s recall: chunks carry page and clause from parsing, the model cites the chunk ids it was given, and code resolves them and verifies each quote is really there
Why it works
Right — a citation is metadata you carried from the parser plus a check you ran, never a number the model typed from memory.
What a good answer covers
- Citations are carried metadata, verified.
- Keep page and clause from parsing.
- Model cites ids; code resolves them.
- Verify the quote exists in the source.
Answers that fall short
- Close, but not the strongest: Ask the model to end each answer with the page and clause numbers, and include the page numbers in the chunk text
Page numbers in the text help, but a model asked to type references can still produce ones that look right and are not. Resolve ids in code and verify. - Weak: Show the top retrieved chunks beside the answer as its sources; whatever was retrieved is what the answer used
Retrieved is not the same as used: the answer may rest on one chunk, or on none. Sources must be tied to claims. - Red flag: Let the model write the references from its reading; lawyers will check the important ones themselves anyway
An invented clause reference in a legal tool ends its use. Pushing verification onto the lawyers is exactly what they said they would not accept.
Who gets asked this
More Document AI questions
- In your equipment manuals the wiring diagrams and annotated screenshots carry the key information. The…
- A customer’s legal team asked your contract assistant whether a 300-page agreement had an auto-renewal…
- Your service extracts supplier, totals and bank details from invoices in hundreds of layouts. Finance wants…
- Two PDFs look identical on screen, but your parser gets clean text from one and nothing from the other. Why…
- Why is “just extract the text from the PDF” harder than it sounds?
- Your document Q&A is good on prose but wrong on figures that come from tables. In the extracted text, a table…
- How do you chunk a long contract or manual that has headings, numbered clauses, tables and figures?