Design a Citation and Source Attribution System
Last updated: September 4, 2025
Quick Overview
Given LLM-generated text, link specific sentences back to source documents with confidence scores. Handle deduplication, freshness decay, and domain authority weighting.
Perplexity
September 4, 202510
4
2,731 solved
Given LLM-generated text, link specific sentences back to source documents with confidence scores. Handle deduplication, freshness decay, and domain authority weighting.
Citations are what differentiate Perplexity from ChatGPT. This tests the intersection of NLP and system design.
What the Interviewer Expects
- Design sentence-level attribution using NLI or attention-based methods
- Implement source deduplication and authority scoring
- Handle freshness decay for time-sensitive citations
- Design the UI rendering pipeline for inline citations
- Address confidence calibration for citation quality
Key Topics to Cover
How to Approach This
- Start by clarifying functional and non-functional requirements with the interviewer.
- Estimate the scale: QPS, storage, bandwidth. This drives your design decisions.
- Draw a high-level architecture first, then deep dive into 1-2 critical components.
- Discuss trade-offs explicitly (e.g., consistency vs availability, SQL vs NoSQL).
- Address failure scenarios, monitoring, and how the system handles 10x traffic spikes.
Possible Follow-up Questions
- How do you handle cases where the LLM hallucinates a citation?
- What if multiple sources support the same claim?
- How do you evaluate citation quality at scale?
Sharpen Your Skills on Codemia
Practice similar problems with our interactive workspace, get AI feedback, and track your progress.
Practice System Design ProblemsSample Answer
Attribution Pipeline
After generation, decompose the LLM output into individual claims (sentence or clause level). For each claim, run NLI against the retrieved passages t...
Source Ranking
Rank cited sources by: domain authority (based on a pre-computed domain reputation index), content freshness (publication date with exponential decay)...