gonglinyuan commited on
Commit
47df7ba
·
1 Parent(s): 82baa74

Add README

Browse files
Files changed (1) hide show
  1. README.md +36 -2
README.md CHANGED
@@ -24,8 +24,42 @@ configs:
24
 
25
  # Real-FIM-Eval Benchmark
26
 
27
- TODO: Intro Here
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28
 
29
  ## Copyright Information
30
 
31
- TODO: Copyright Here
 
24
 
25
  # Real-FIM-Eval Benchmark
26
 
27
+ 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.
28
+ 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.
29
+
30
+ 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`.
31
+
32
+ - `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).
33
+
34
+ - `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.
35
+
36
+ ## Evaluation Metric
37
+
38
+ The evaluation metric is character-level perplexity (lower = better), calculated as:
39
+
40
+ $$
41
+ \exp\left(-\frac{1}{\mathrm{n\_chars}(\mathrm{mid})} \sum_{i\in\mathrm{mid}} \log p_{i}\right)
42
+ $$
43
+
44
+ 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 $\mathrm{n\_chars}(\mathrm{mid})$ is the total number of characters in that ground truth middle segment.
45
+
46
+ ## Statistics of Programming Languages
47
+
48
+ | Language | Num Examples |
49
+ |:---------|-----:|
50
+ | Python | 6,271 |
51
+ | Rust | 4,727 |
52
+ | Java | 3,716 |
53
+ | C++ | 3,265 |
54
+ | TypeScript | 3,182 |
55
+ | Go | 2,587 |
56
+ | Ruby | 1,686 |
57
+ | C# | 1,563 |
58
+ | JavaScript | 1,502 |
59
+ | Kotlin | 1,440 |
60
+ | PHP | 1,396 |
61
+ | Scala | 466 |
62
 
63
  ## Copyright Information
64
 
65
+ 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/).