@inproceedings{luo-etal-2026-megacode,
title = "{M}ega{C}ode: A Repository-Level Dataset for Long-Context Code Reasoning",
author = "Luo, Wenyang and
Sun, Shuang and
Hu, Yiwen and
Bai, Fei and
Gao, Yanzipeng and
Wang, Shuo and
Lu, Hongyu and
Zhao, Xin and
Wen, Ji-Rong",
editor = "Lee, Hung-Yi and
Dev, Sunipa and
Li, Jessy and
Elliott, Desmond",
booktitle = "Findings of the {A}ssociation for {C}omputational {L}inguistics: {EMNLP} 2026",
month = oct,
year = "2026",
address = "Budapest, Hungary",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2026.findings-emnlp.1484/",
pages = "31608--31626",
ISBN = "979-8-89176-462-0",
abstract = "Code reasoning is essential for building AI systems that can understand, generate, and verify complex software. Yet most open-source code corpora focus on isolated snippets or single functions, failing to capture the long-range dependencies and cross-file interactions that define real-world repositories. We introduce MegaCode, a 300B repository-level corpus designed to support structured code reasoning and long-context modeling. MegaCode preserves full project structure{---}including build scripts, configuration files, and inter-file links{---}and is constructed through a multi-stage curation pipeline combining deduplication, rule-based filtering, and model-based quality assessment. Models pretrained on MegaCode demonstrate consistent gains on code reasoning and long-context benchmarks compared with those trained on flattened code datasets. Also, we validate the effectiveness of adding repo relevent infomation such as LSP, repo structure and repo summary. These results highlight the importance of maintaining repository structure for next-generation code intelligence. We release the dataset, curation pipeline, and evaluation suite to facilitate research on large-scale code pretraining and repository-level understanding."
}<?xml version="1.0" encoding="UTF-8"?>
<modsCollection xmlns="http://www.loc.gov/mods/v3">
<mods ID="luo-etal-2026-megacode">
<titleInfo>
<title>MegaCode: A Repository-Level Dataset for Long-Context Code Reasoning</title>
</titleInfo>
<name type="personal">
<namePart type="given">Wenyang</namePart>
<namePart type="family">Luo</namePart>
<role>
<roleTerm authority="marcrelator" type="text">author</roleTerm>
</role>
</name>
<name type="personal">
<namePart type="given">Shuang</namePart>
<namePart type="family">Sun</namePart>
<role>
<roleTerm authority="marcrelator" type="text">author</roleTerm>
</role>
</name>
<name type="personal">
<namePart type="given">Yiwen</namePart>
<namePart type="family">Hu</namePart>
<role>
<roleTerm authority="marcrelator" type="text">author</roleTerm>
</role>
</name>
<name type="personal">
<namePart type="given">Fei</namePart>
<namePart type="family">Bai</namePart>
<role>
<roleTerm authority="marcrelator" type="text">author</roleTerm>
</role>
</name>
<name type="personal">
<namePart type="given">Yanzipeng</namePart>
<namePart type="family">Gao</namePart>
<role>
<roleTerm authority="marcrelator" type="text">author</roleTerm>
</role>
</name>
<name type="personal">
<namePart type="given">Shuo</namePart>
<namePart type="family">Wang</namePart>
<role>
<roleTerm authority="marcrelator" type="text">author</roleTerm>
</role>
</name>
<name type="personal">
<namePart type="given">Hongyu</namePart>
<namePart type="family">Lu</namePart>
<role>
<roleTerm authority="marcrelator" type="text">author</roleTerm>
</role>
</name>
<name type="personal">
<namePart type="given">Xin</namePart>
<namePart type="family">Zhao</namePart>
<role>
<roleTerm authority="marcrelator" type="text">author</roleTerm>
</role>
</name>
<name type="personal">
<namePart type="given">Ji-Rong</namePart>
<namePart type="family">Wen</namePart>
<role>
<roleTerm authority="marcrelator" type="text">author</roleTerm>
</role>
</name>
<originInfo>
<dateIssued>2026-10</dateIssued>
</originInfo>
<typeOfResource>text</typeOfResource>
<relatedItem type="host">
<titleInfo>
<title>Findings of the Association for Computational Linguistics: EMNLP 2026</title>
</titleInfo>
<name type="personal">
<namePart type="given">Hung-Yi</namePart>
<namePart type="family">Lee</namePart>
<role>
<roleTerm authority="marcrelator" type="text">editor</roleTerm>
</role>
</name>
<name type="personal">
<namePart type="given">Sunipa</namePart>
<namePart type="family">Dev</namePart>
<role>
<roleTerm authority="marcrelator" type="text">editor</roleTerm>
</role>
</name>
<name type="personal">
<namePart type="given">Jessy</namePart>
<namePart type="family">Li</namePart>
<role>
<roleTerm authority="marcrelator" type="text">editor</roleTerm>
</role>
</name>
<name type="personal">
<namePart type="given">Desmond</namePart>
<namePart type="family">Elliott</namePart>
<role>
<roleTerm authority="marcrelator" type="text">editor</roleTerm>
</role>
</name>
<originInfo>
<publisher>Association for Computational Linguistics</publisher>
<place>
<placeTerm type="text">Budapest, Hungary</placeTerm>
</place>
</originInfo>
<genre authority="marcgt">conference publication</genre>
<identifier type="isbn">979-8-89176-462-0</identifier>
</relatedItem>
<abstract>Code reasoning is essential for building AI systems that can understand, generate, and verify complex software. Yet most open-source code corpora focus on isolated snippets or single functions, failing to capture the long-range dependencies and cross-file interactions that define real-world repositories. We introduce MegaCode, a 300B repository-level corpus designed to support structured code reasoning and long-context modeling. MegaCode preserves full project structure—including build scripts, configuration files, and inter-file links—and is constructed through a multi-stage curation pipeline combining deduplication, rule-based filtering, and model-based quality assessment. Models pretrained on MegaCode demonstrate consistent gains on code reasoning and long-context benchmarks compared with those trained on flattened code datasets. Also, we validate the effectiveness of adding repo relevent infomation such as LSP, repo structure and repo summary. These results highlight the importance of maintaining repository structure for next-generation code intelligence. We release the dataset, curation pipeline, and evaluation suite to facilitate research on large-scale code pretraining and repository-level understanding.</abstract>
<identifier type="citekey">luo-etal-2026-megacode</identifier>
<location>
<url>https://aclanthology.org/2026.findings-emnlp.1484/</url>
</location>
<part>
<date>2026-10</date>
<extent unit="page">
<start>31608</start>
<end>31626</end>
</extent>
</part>
</mods>
</modsCollection>
%0 Conference Proceedings
%T MegaCode: A Repository-Level Dataset for Long-Context Code Reasoning
%A Luo, Wenyang
%A Sun, Shuang
%A Hu, Yiwen
%A Bai, Fei
%A Gao, Yanzipeng
%A Wang, Shuo
%A Lu, Hongyu
%A Zhao, Xin
%A Wen, Ji-Rong
%Y Lee, Hung-Yi
%Y Dev, Sunipa
%Y Li, Jessy
%Y Elliott, Desmond
%S Findings of the Association for Computational Linguistics: EMNLP 2026
%D 2026
%8 October
%I Association for Computational Linguistics
%C Budapest, Hungary
%@ 979-8-89176-462-0
%F luo-etal-2026-megacode
%X Code reasoning is essential for building AI systems that can understand, generate, and verify complex software. Yet most open-source code corpora focus on isolated snippets or single functions, failing to capture the long-range dependencies and cross-file interactions that define real-world repositories. We introduce MegaCode, a 300B repository-level corpus designed to support structured code reasoning and long-context modeling. MegaCode preserves full project structure—including build scripts, configuration files, and inter-file links—and is constructed through a multi-stage curation pipeline combining deduplication, rule-based filtering, and model-based quality assessment. Models pretrained on MegaCode demonstrate consistent gains on code reasoning and long-context benchmarks compared with those trained on flattened code datasets. Also, we validate the effectiveness of adding repo relevent infomation such as LSP, repo structure and repo summary. These results highlight the importance of maintaining repository structure for next-generation code intelligence. We release the dataset, curation pipeline, and evaluation suite to facilitate research on large-scale code pretraining and repository-level understanding.
%U https://aclanthology.org/2026.findings-emnlp.1484/
%P 31608-31626
Markdown (Informal)
[MegaCode: A Repository-Level Dataset for Long-Context Code Reasoning](https://aclanthology.org/2026.findings-emnlp.1484/) (Luo et al., Findings 2026)
ACL
- Wenyang Luo, Shuang Sun, Yiwen Hu, Fei Bai, Yanzipeng Gao, Shuo Wang, Hongyu Lu, Xin Zhao, and Ji-Rong Wen. 2026. MegaCode: A Repository-Level Dataset for Long-Context Code Reasoning. In Findings of the Association for Computational Linguistics: EMNLP 2026, pages 31608–31626, Budapest, Hungary. Association for Computational Linguistics.