R ep E val: Effective Text Evaluation with LLM Representation (2024)

Abstract: The era of Large Language Models (LLMs) raises new demands for automatic evaluation metrics, which should be adaptable to various application scenarios while maintaining low cost and effectiveness. Traditional metrics for automatic text evaluation are often tailored to specific scenarios, while LLM-based evaluation metrics are costly, requiring fine-tuning or rely heavily on the generation capabilities of LLMs. Besides, previous LLM-based metrics ignore the fact that, within the space of LLM representations, there exist direction vectors that indicate the estimation of text quality. To this end, we introduce RepEval, a metric that leverages the projection of LLM representations for evaluation. Through simple prompt modifications, RepEval can easily transition to various tasks, requiring only minimal sample pairs for direction vector construction. Results on fourteen datasets across two evaluation tasks demonstrate the high effectiveness of our method, which exhibits a higher correlation with human judgments than previous methods, even in complex evaluation scenarios involving pair-wise selection under nuanced aspects. Our work underscores the richness of information regarding text quality embedded within LLM representations, offering insights for the development of new metrics.

## introduction text evaluation is widely applied in the era of llm, such as detecting harmful responses @xcite , identifying high-quality data for model training @xcite and constructing preference data for model alignment @xcite @xcite . such requirements pose significant challenges to automatic text evaluation metrics, as metrics must be adaptive to diverse evaluation tasks and achieve high-quality assessment while maintaining a low cost. however, traditional automatic evaluation metrics, such as bleu @xcite and comet @xcite , are usually designed for specific tasks or criteria, making them difficult to transfer to new application scenarios. also, their requirement for references and other inputs makes them infeasible in various evaluation contexts. llm-based metrics offer a possible solution @xcite , but such metrics may also encounter certain limitations. on the one hand, they rely heavily on the generation ability of llm to adhere to predefined formats, which typically require more model parameters or fine-tuning, resulting in higher costs for inference and deployment. on the other hand, their assessment is frequently unsatisfactory, which does not align well with human judgments and exhibits unstable performance @xcite . fortunately, though language models may struggle to generate appropriate responses, their representations contain rich information related to correct answers, which could be extracted with neural network or other models @xcite . imagine, when people are assessing a piece of text, they may have a clear sense of its quality yet struggle to quantify their impressions with a precise score. this implies that during evaluation, we can reduce the reliance on the generation capabilities of llms and instead focus on the meaningful information contained in their representations. by doing so, we can utilize models with fewer parameters, thereby avoiding excessive computational resource consumption while achieving better performance. the remaining questions are: do representations of llm really encapsulate information relevant to text quality? how can we effectively extract and apply this information to evaluation tasks? in this study, we introduce repeval, a metric utilizing the projection of llm representation for custom evaluation. we explored the performance of repeval in two scenarios: absolute evaluation and pair-wise evaluation. in absolute evaluation, which requires evaluation metrics to output scores as assessment, our intuition is that representations of high-quality and low-quality text exhibit distinct distributions. we validate that, in vector space, their projection in a specific direction characterizes the degree of variation in textual properties. in pairwise evaluation, metrics need to select the better one out of the two inputs. to solve this problem, we construct a projection vector that measures the probability of whether the preceding sentence is better than the latter. for absolute evaluation, experiments on three criteria with ten datasets show that our method has better correlations with human judgments than previous metrics, which is flexible and easy to extend to other applications. as to pair-wise evaluation, experiments on four tasks with custom criteria demonstrate that our method remains highly feasible in complex application scenarios, achieving excellent classification accuracy. through visualization, we further demonstrate that a well-designed prompt can transfer the representation to different positions within the semantic space, thus facilitating evaluations based on diverse criteria. we also demonstrate that using pca can produce nearly optimal projection vectors, and we explore the optimization strategy of repeval, offering a reasonable scheme for representation creation. in summary, the key contributions of this work are: ## related work automatic evaluation metrics can be categorized into three types, reference-based, reference-free, and llm-based metrics. ## conclusion we introduce repeval, an evaluation metric utilizing the projection of llm representations to obtain evaluation results, which exhibits a stronger correlation with human judgments in absolute evaluation, as well as higher accuracy in pair-wise selection than previous methods. repeval is flexible and is easy to transfer to other evaluation scenarios, requiring only a few sample pairs for training, while avoiding the usage of llms with a large number of parameters such as gpt-4. we also provide suggestions on the proper application of repeval, such as the selection of tokens and layers. our work provides insights into the development of new metrics.