Implemented project · Personal reference
LLM Evaluation Lab
Evaluate a tenant-scoped lexical baseline with revision handling, deletion propagation, Recall@K, MRR and binary nDCG.
Context and requirements
Measure retrieval behavior before adding generation and verify that retired documents stay absent.
Synthetic documents have tenant, ID, revision and optional text. Queries are scored against explicit relevance judgments.
Architecture
- Synthetic corpus
- Latest authorized revision
- Lexical ranking
- Relevance judgments
- Retrieval metrics
Alternatives and implementation
A lexical baseline is cheap to reproduce. Compare BM25, dense vectors and hybrid rank fusion later using identical judgments.
Download executable Python reference · Download test suite · License
Save the Python lab sources from the project directory inside a folder named labs. From its parent, run python3 -m labs.retrieval_evaluation. To run the shared suite, place test_labs.py next to the folder and run python3 -m unittest test_labs.
Security, cost and operations
Apply tenant restrictions before scoring. Track deleted-document leakage, retrieval metrics and index lag.
Results and lessons
The tests cover tenant isolation, deletion, ranking metrics and duplicate result IDs. The current experiment measures retrieval on synthetic labels.
Cache keys need tenant and index revision. Introduce hard negatives and split evaluation sets by source document when expanding the corpus.