Sharing learnings from evaluating Million+ LLM responses
Hey everyone, we have been working with many LLM builders to help them evaluate and improve the quality of their LLM applications and recently penned down our learnings on how exactly to evaluate them. We have defined multiple evaluation criteria and grouped them according to their applicability. We have the full blog on our website (https://uptrain.ai/blog/how-to-evaluate-your-llm-applications) and am just copying the key excerpts from it. Hope you find it useful.

Why is Evaluating LLMs Tricky?

LLMs are great but they introduce novel complexities when it comes to measuring their performance. In traditional ML/DL, we can annotate data and have “Ground Truths” to compute scores like precision, recall, and accuracy of the model. LLMs on the other hand, operate in realms where it is impossible to define a clear and unique “Ground Truth” to do a word-to-word comparison against. There could be 100s of different email copies and all of them could be equally correct for the task.

When traditional NLP metrics fail, novel techniques have emerged to use LLMs as evaluators. But how can one expect for GPT to reliably score its own response - too self-consumed?

The trick is to simplify the evaluation task. Instead of directly asking whether the response is correct or not, ask the LLM to evaluate the response only along a certain dimension - is it grounded by the context, is it too verbose, is it answering all aspects of the question, is the tone correct, etc.

Now, the dimensions one should care about depend upon the use case. For applications generating marketing copies, tonality, interestingness, etc. would matter more while for RAG and chatbots, factual accuracy, retrieval quality, and response relevance would be better to look at.

Dimensions of LLM Evaluations

Taking our learnings while building UpTrain - an open-source LLM evaluation tool, we have divided these dimensions into 4 categories:

1.Checks for evaluating Task Understanding and Context Awareness: Check to evaluate if your LLM + prompt configuration can comprehend the task at hand and fully utilize the provided context to provide an appropriate response. This category is further divided into 2 sub-categories:

a. Response Appropriateness: Intent understanding, Response Completeness, Response Relevancy, Output Structure Integrity, etc.
b. Context Awareness and Grounding: Hallucinations, Retrieved-context quality, context utilization, etc.

2. Checks for evaluating Language Quality: Dimensions that help to evaluate the quality of the response from a language perspective. We further divide this into two subcategories:

a. Task Independent: Dimensions like grammar correctness, fluency, coherence, toxicity, fairness towards all sectors of society, etc. We
generally see high scores for these, especially for RLHFed LLMs
b. Task Dependent: Tonality match with the given persona, creativity, interestingness, etc. Your prompt can play a big role here

3. Evaluating Reasoning Capabilities: Includes dimensions like logical correctness (right conclusions), logical robustness (consistent with minor input changes), logical efficiency (shortest solution path), and common sense understanding (grasping common concepts). One can’t do much beyond prompting techniques like CoT and primarily depends upon the LLM chosen.

4. Custom Evaluations: Many applications require customized metrics tailored to their specific needs. You want adherence to custom guidelines, check for certain keywords, etc.

You can read the full blog here (https://uptrain.ai/blog/how-to-evaluate-your-llm-applications). Hope you find it useful. I am one of the developer of UpTrain - it is an open-source package to evaluate LLM applications (https://github.com/uptrain-ai/uptrain).

Would love to get feedback from the HN community.