There seems to be overlaping IDs.

#2
by nevakrien - opened

Thankfully the issue is contained to just the test set leaking to the val set on the edit problem. Unfortunately it seems to be the entire
test set... all of it. in all versions published.

I was very surprised to find this, at first I was sure my Agent was just persistently wrong or that perhaps there is an absolutely bizarre bug in huggingface code.
I made a minimal reproducible example that uses JUST pyarrow to rule out weird inconsistencies and bugs.

reading the printout its clear that in all iterations of this dataset the same systematic leak occurs. which from what I gather in the paper was not intended to be the case? at least it would be very weird if this is intended behavior

program:

"""pip install pyarrow; python check_history.py"""
import io
import json
from pathlib import Path
from urllib.request import urlopen
import pyarrow.parquet as pq

base = "https://huggingface.co"
repo = "CodeEff/ECCO"
out = Path(__file__).resolve().parent / "ecco_history"
out.mkdir(exist_ok=True)

def get(url):
    with urlopen(url, timeout=120) as r:
        return r.read()

commits = json.loads(get(f"{base}/api/datasets/{repo}/commits/main"))
(out / "commits.json").write_text(json.dumps(commits))
assert commits[-1]["title"] == "initial commit", "Incomplete commit history"
cache = {}
for c in reversed(commits):
    sha = c["id"]
    raw = get(f"{base}/api/datasets/{repo}/tree/{sha}?recursive=true")
    (out / f"{sha}.json").write_bytes(raw)
    splits = {"val": set(), "test": set()}
    for f in json.loads(raw):
        if not f["path"].startswith("edit/"):
            continue
        split = f["path"].split("/")[-1].split("-")[0]
        if split not in splits or not f["path"].endswith(".parquet"):
            continue
        oid = f["oid"]
        if oid not in cache:
            data = get(f"{base}/datasets/{repo}/resolve/{sha}/{f['path']}")
            (out / f"{oid}.parquet").write_bytes(data)
            cache[oid] = set(pq.read_table(io.BytesIO(data), columns=["problem_id"])["problem_id"].to_pylist())
        splits[split].update(cache[oid])
    v, t = splits["val"], splits["test"]
    shared = sorted(v & t)
    print(c["date"], sha, "val", len(v), "test", len(t), "shared", len(shared), flush=True)
    print(shared, flush=True)

Sign up or log in to comment