AI EngineeringInterview preparation
Intermediate·Concept·2 min read

Citations and source attribution

Practice this question

Overview

  • A citation points to evidence supporting a statement.
  • Source attribution identifies the original document, location, and version.
  • The model can suggest references, but the application must ensure they map to actual retrieved sources.

Why this matters

Users need to verify answers, and reviewers need to understand which policy wording was applied.

An everyday example

An employee says “page 12, exclusions section,” so you can check the answer.

A technical example

LLM returns sourceIds: ["S1"]; backend resolves S1 to an authorized document and page link.

How it works

  1. Assign source IDs
  2. Require references
  3. Reject unknown IDs
  4. Check whether evidence supports claims
  5. Render links that recheck access.

Architecture and flow

Retrieved source map → generated references → citation validation → authorized source links.

The insurance assistant example

“The policy requires these documents [Policy v3, page 8]” links to the right version.

When to use it

Policy explanations, enterprise knowledge answers, and research outputs.

When to avoid it

Do not fabricate sources for ordinary creative drafting, or assume a citation proves that the surrounding claim is supported.

Interview answer

“I bind citations to retrieved source IDs and verify applicability and support. A valid link alone does not guarantee a faithful answer.”

Benefits, trade-offs, and production considerations

  • Store source versions with each answer trace.
  • Expiring object-storage URLs should be generated only after access checks.
  • Test citation correctness, unsupported claims, and source accessibility separately.
Adapted from 13_AI.MD · “Citations and source attribution”. Code examples are study fragments. Difficulty and core labels are editorial estimates; version-specific behavior should be checked against your project.