A hands-on guide to evaluating LLMs and RAG pipelines using Langchain and Hugging Face. Covers three main evaluation approaches: criteria-based evaluation (conciseness, correctness, custom criteria), RAG evaluation using Langchain's ContextQAEvalChain, and pairwise comparison/scoring. Uses Llama-2-70B as the model under evaluation and GPT-4 as the judge, demonstrating the LLM-as-a-judge paradigm. Includes code examples for each method and discusses trade-offs between human evaluation and automated LLM-based evaluation.
Table of contents
Criteria-based evaluationRetrival Augmented Generation (RAG) evaluationPairwise comparison and scoringConclusion2 Impressions