# Longreward Eval

> This evaluation protocol assesses the long-context understanding, instruction-following, and faithfulness capabilities of LLMs. It combines automated AI-judged scoring on long and short-context benchmarks with human preference alignment tests to validate the effectiveness of the LongReward training method. Use when the user wants to benchmark on LongBench, LongBench-Chat, MT-Bench, AlpacaEval2, or asks about evaluating this task. Reports GPT-4o rating.

- Skill: `qhjqhj00/longreward-eval` (Agent Skill)
- Install (CLI): `npx skillmds add qhjqhj00/longreward-eval`
- Raw SKILL.md: https://api.skillmd.com/api/skills/qhjqhj00/longreward-eval/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Productivity
- Author: qhjqhj00 (https://skillmd.com/u/qhjqhj00)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/qhjqhj00/longreward-eval

---


# longreward-eval

> LongReward: Improving Long-context Large Language Models with AI Feedback — Jiajie Zhang et al. (2024) (arXiv:2410.21252, 2024)

## What this evaluates

This evaluation protocol assesses the long-context understanding, instruction-following, and faithfulness capabilities of LLMs. It combines automated AI-judged scoring on long and short-context benchmarks with human preference alignment tests to validate the effectiveness of the LongReward training method.

## Datasets

- **LongBench** — total 2350; splits: test (2350)
- **LongBench-Chat** — total 50; splits: test (50)
- **MT-Bench** — total 80; splits: test (80)
- **AlpacaEval2** — total 805; splits: test (805)

## Metrics

- `GPT-4o rating` **(primary)** — range: other
  - GPT-4o automatically rates model responses based on the query and ground-truth answers using few-shot prompting for LongBench-Chat or zero-shot prompting for LongBench.
- `FactScore` — range: [0, 1]
  - Ratio of supported atomic facts per response. GPT-4o-mini breaks responses into atomic facts and judges whether each is supported by retrieved context chunks.
- `MT-Bench score` — range: [1, 10]
  - GPT-4 rates model responses on a scale of 1-10 across 8 categories.
- `AlpacaEval2 win rate` — range: percent
  - Length-controlled win rate measured by GPT-4-turbo against GPT-4-turbo.

## Input / output format

**Input**: Query paired with a long context document (8k–64k tokens) for long-context tasks; query alone for short-context tasks.

**Output**: Natural language response generated by the model.

## Scoring recipe

```python
def evaluate(model, dataset, judge_model):
    scores = []
    for instance in dataset:
        response = model.generate(instance.query, instance.context)
        if dataset == 'LongBench-Chat':
            score = judge_model.few_shot_rate(instance.query, instance.ground_truth, response)
        elif dataset == 'LongBench':
            score = judge_model.zero_shot_rate(instance.query, instance.ground_truth, response)
        elif dataset == 'MT-Bench':
            score = judge_model.rate_1_10(instance.query, response)
        elif dataset == 'AlpacaEval2':
            score = judge_model.length_controlled_win_rate(instance.query, response)
        scores.append(score)
    return sum(scores) / len(scores)
```

## Common pitfalls

- GPT-4o/GPT-4 judges may exhibit prompt sensitivity; the paper uses few-shot for LongBench-Chat but zero-shot for LongBench, which can cause score distribution shifts.
- FactScore relies on retrieving top-5 context chunks; if retrieval fails, facts may be incorrectly marked as unsupported, lowering the score.
- AlpacaEval2 uses length-controlled win rates, meaning overly verbose or concise responses can artificially inflate or deflate scores regardless of quality.

## Evidence (verbatim from paper)

> Specifically, we employ GPT-4o-mini to first break the model response into atomic facts and then judge whether each fact is supported by the retrieved context chunks. The results in Table[3] show that the DPO models using LongReward achieve higher FactScore (i.e., the ratio of supported facts) than the SFT baseline, demonstrating the effect of LongReward in improving faithfulness as well as reducing hallucinations for long-context LLMs.

## Citation

```bibtex
@misc{zhang2024longreward,
  title={LongReward: Improving Long-context Large Language Models with AI Feedback},
  author={Jiajie Zhang et al. (2024)},
  year={2024},
  note={arXiv:2410.21252}
}
```

- arXiv: 2410.21252

