goldodemon's picture
|
download
raw
3.41 kB
---
license: cc-by-4.0
task_categories:
- text2text-generation
language:
- en
tags:
- code-generation
- code-infilling
- fill-in-the-middle
pretty_name: Real-FIM-Eval
size_categories:
- 10K<n<100K
configs:
- config_name: add
data_files:
- split: test
path: add/test.jsonl.gz
- config_name: edit
data_files:
- split: test
path: edit/test.jsonl.gz
---
# Real-FIM-Eval Benchmark
Real-FIM-Eval is a benchmark to evaluate Fill-in-the-Middle (FIM) capabilities of code LLMs in scenarios that reflect real-world code completion.
Real-FIM-Eval is built using data from GitHub commits between Jan. 2025 and Feb. 2025. These commits originate from 228 permissively licensed GitHub repositories with 10,000+ stars, spanning the top 12 widely-used programming languages.
- Paper: https://arxiv.org/abs/2506.00204
We process git commits using `diff_match_patch` ([https://github.com/google/diff-match-patch](https://github.com/google/diff-match-patch)) to identify line-level changes. The commits are then categorized into two splits: `Add` and `Edit`.
![Construction of Fill-in-the-Middle (FIM) examples for the proposed Real-FIM-Eval benchmark splits, derived from real-world git commits.](https://huggingface.co/datasets/gonglinyuan/real_fim_eval/resolve/main/example.png)
- `Add` (17,879 examples): This split uses git commits where a developer added a new segment of code into an existing file. To create the FIM prompt, we treat the added code segment as the "middle" part that the language model needs to predict. The code surrounding the addition forms the prefix (code before) and the suffix (code after).
- `Edit` (13,922 examples): This split uses git commits where a developer modified existing code by removing a segment and replacing it with a new one. We present this task to LLMs in a *conflict-merge* format. The prompt includes the code context (prefix and suffix) and marks the original code segment (to be removed). The model is asked to infill the updated code segment.
## Evaluation Metric
The evaluation metric is character-level perplexity (lower = better), calculated as:
$$
\exp\left(-\frac{1}{\mathrm{n\_chars}(\mathrm{mid})} \sum_{i\in\mathrm{mid}} \log p_{i}\right)
$$
In this formula, `p_i` represents the probability the model assigns to the `i`-th token of the ground truth (only the "middle" part that the model is tasked to infill), and `n_char(mid)` is the total number of characters in that ground truth middle segment.
## Statistics of Programming Languages
| Language | Num Examples |
|:---------|-----:|
| Python | 6,271 |
| Rust | 4,727 |
| Java | 3,716 |
| C++ | 3,265 |
| TypeScript | 3,182 |
| Go | 2,587 |
| Ruby | 1,686 |
| C# | 1,563 |
| JavaScript | 1,502 |
| Kotlin | 1,440 |
| PHP | 1,396 |
| Scala | 466 |
## Copyright Information
The dataset is a verbatim snapshot of source‑code files from public GitHub repositories. Each data example retains the exact license chosen by its original author(s). The repository of origin for every file is recorded in that data example’s `repo` field. To reuse or redistribute any code sample, you must comply with the license found in the upstream repository (see the LICENSE file in that repo for full terms). The dataset organization and the `README.md` file are licensed under [Creative Commons Attribution 4.0 International (CC‑BY‑4.0)](https://creativecommons.org/licenses/by/4.0/).

Xet Storage Details

Size:
3.41 kB
·
Xet hash:
c3d87b2ffac23b82e97ba7d2eff3f2ace63aa1b9ffe40dfb0231b93c6abb9a0b

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.