SWHForest filters large code corpora before files are downloaded
Original title: SWHForest: A Structural Curation and Search Layer for Large-Scale Code Corpora
On Stack-Edu's ten largest languages, authors report 46-72% fewer downloads and millisecond curation queries.
Researchers present SWHForest, an open-source framework and public dataset that adds a structural search layer to pointer-based code corpora without redistributing source text. One archive pass parses each file into an AST, discards the source, and keeps a structural summary. Queries over SQL or index intersection select files first so only matching candidates are downloaded. Across the ten largest languages of Stack-Edu, 52.1 million unique files and 341 million definitions, the authors report curation queries in milliseconds and live structural searches reduced from hours to seconds or minutes.
Unconfirmed: Download and latency figures are reported by the authors only.
- The layer targets documented files, boilerplate, contamination checks, and code patterns.
- It can run locally or as a provider-side filtering API.
- The corpus is not redistributed as source text.
- Reported download cuts range from 46% to 72%.
From the original article
1 min read at arxiv.orgPre-training code language models relies on massive code corpora usually streamed over the internet. However, researchers rarely need a multi-terabyte archive in its entirety; instead, their workflow centers on curated subsets: selecting well-documented files, filtering out repetitive boilerplate, auditing for benchmark contamination, or retrieving specific code patterns.
By Federico Pennino · arxiv.org
A short excerpt; the article and its images belong to the publisher. Summary, key facts and assessment above are AI-written from the article and can be wrong.