ChatPaper.aiChatPaper

Diff-XYZ:差分理解評価のためのベンチマーク

Diff-XYZ: A Benchmark for Evaluating Diff Understanding

October 14, 2025
著者: Evgeniy Glukhov, Michele Conti, Egor Bogomolov, Yaroslav Golubev, Alexander Bezzubov
cs.AI

要旨

コード差分の信頼性の高い処理は、リポジトリを大規模に編集・リファクタリングするエージェントの中核をなす。本稿では、コード差分理解のためのコンパクトなベンチマークDiff-XYZを提案する。Diff-XYZは3つの教師付きタスク(適用:旧コード+差分→新コード、逆適用:新コード-差分→旧コード、差分生成:新コード-旧コード→差分)で構成される。ベンチマークのインスタンスは、CommitPackFTの実際のコミットから抽出された三重項⟨旧コード, 新コード, 差分⟩であり、自動評価指標と明確な評価プロトコルを備える。本ベンチマークを用いて、統一差分フォーマットに焦点を当てた実証研究を行い、異なる差分表現のクロスフォーマット比較を実施した。その結果、ユースケースとモデルサイズに応じて異なるフォーマットを使用すべきであることが明らかになった。例えば、検索置換形式での差分表現は、差分生成シナリオにおける大規模モデルでは有効であるが、差分分析や小規模モデルには適さない。Diff-XYZベンチマークは、LLMの差分処理能力を評価・改善するための再利用可能な基盤であり、今後の差分フォーマットやコード編集モデルの開発に寄与し得る。データセットはHuggingFace Hubで公開されている:https://huggingface.co/datasets/JetBrains-Research/diff-xyz。
English
Reliable handling of code diffs is central to agents that edit and refactor repositories at scale. We introduce Diff-XYZ, a compact benchmark for code-diff understanding with three supervised tasks: apply (old code + diff rightarrow new code), anti-apply (new code - diff rightarrow old code), and diff generation (new code - old code rightarrow diff). Instances in the benchmark are triples langle old code, new code, diff rangle drawn from real commits in CommitPackFT, paired with automatic metrics and a clear evaluation protocol. We use the benchmark to do a focused empirical study of the unified diff format and run a cross-format comparison of different diff representations. Our findings reveal that different formats should be used depending on the use case and model size. For example, representing diffs in search-replace format is good for larger models in the diff generation scenario, yet not suited well for diff analysis and smaller models. The Diff-XYZ benchmark is a reusable foundation for assessing and improving diff handling in LLMs that can aid future development of diff formats and models editing code. The dataset is published on HuggingFace Hub: https://huggingface.co/datasets/JetBrains-Research/diff-xyz.
PDF82December 2, 2025