Evaluating LLMs with a Large Context Window

8 Aug 2024

Problem

Teams that train or choose long-context LLMs must score answers to questions over long documents. Overlap metrics such as ROUGE-L and F1 (used in LongBench) ignore synonyms and meaning, so they suit only some question types. Side-by-side expert comparison is accurate but slow and expensive, so repeating the comparison after every training run is impractical.

Example from the article: MTS AI built two 50-question benchmarks (16k and 32k contexts) and compared its Cotype models with gpt-4, YandexPro and GigaChat-Plus. A reply saying righteous souls go to the Elysian Fields has to count as matching a reference answer phrased differently.

Solution in brief

Embed the model answer and the reference answer with e5-mistral-7b, multiply the two vectors and average the result over the benchmark (the e5m-score). The authors chose it because it correlated best with averaged expert scores. They trained the long-context models with LongLoRA and doubled the context of one model with linear RoPE scaling.

Questions this case answers
  • How to score free-form model answers against a reference answer cheaply while staying close to human judgment, when overlap metrics miss synonyms and expert review is too slow to repeat
  • How to extend the usable context length of a language model when attention cost grows quadratically with input length and compute is limited
  • How to score free-form answers of a long-context LLM against a reference answer without paying for expert review every time?
  • How to choose an automatic similarity metric that agrees with human judges?

Tools and methods

  • e5-mistral-7b embeddings — turn an answer and a reference into vectors; their product is the similarity score
  • Expert ternary scoring (0 / 0.5 / 1) — ground truth for choosing the metric
  • LongLoRA (shifted sparse attention) — cheaper training on long inputs
  • Linear RoPE scaling — longer context without long-context training
Continue reading — it's free

Google or a one-time email code. No password.