Do Not Treat Code as Natural Language: Implications for Repository-Level Code Generation and Beyond
Analyze & explore related research in Conceptio
Connect this record directly into your research workflow or AI agent. Explore citations across open repositories, query full text, and export structured proof bundles.
[2602.11671] Do Not Treat Code as Natural Language: Implications for Repository-Level Code Generation and Beyond Skip to main content Search Submit Donate Log in Computer Science > Software Engineering arXiv:2602.11671 (cs) [Submitted on 12 Feb 2026 ( v1 ), last revised 28 Aug 2026 (this version, v2)] Title: Do Not Treat Code as Natural Language: Implications for Repository-Level Code Generation and Beyond Authors: Minh Le-Anh , Huyen Nguyen , Khanh An Tran , Nam Le Hai , Linh Ngo Van , Nghi D.Q. Bui , Bach Le View PDF HTML (experimental) Abstract: Large language models for code (CodeLLMs) have demonstrated remarkable success in standalone code completion and generation, sometimes even surpassing human performance, yet their effectiveness diminishes in repository-level settings where cross-file dependencies and structural context are essential. Existing Retrieval-Augmented Generation (RAG) approaches often borrow strategies from NLP, relying on chunking-based indexing and similarity-based retrieval. Chunking results in the loss of coherence between code units and overlooks structural relationships, while similarity-driven methods frequently miss functionally relevant dependencies such as helper functions, classes, or global variables. To address these limitations, we present Hydra, a repository-level code generation framework that treats code as structured code rather than natural language. Our approach introduces (i) a structure-aware indexing strategy that represents repositories as hierarchical trees of functions, classes, and variables, preserving code structure and dependencies, (ii) a lightweight dependency-aware retriever (DAR) that explicitly identifies and retrieves the true dependencies required by a target function, and (iii) a hybrid retrieval mechanism that combines DAR with similarity-based retrieval to provide both essential building blocks and practical usage examples. Extensive experiments on the challenging DevEval and RepoExec benchmarks, both requiring function implementation from real-world repositories with complex large repository context, show that Hydra achieves state-of-the-art performance across open- and closed-source CodeLLMs. Notably, our method establishes a new state of the art in repository-level code generation, surpassing strongest baseline by over 5% in Pass@1 and even enabling smaller models to match or exceed the performance of much larger ones that rely on existing retrievers. Comments: Accepted to FSE 2026 Subjects: Software Engineering (cs.SE) Cite as: arXiv:2602.11671 [cs.SE] (or arXiv:2602.11671v2 [cs.SE] for this version) https://doi.org/10.48550/arXiv.2602.11671 Focus to learn more arXiv-issued DOI via DataCite Submission history From: Nam Le Hai [ view email ] [v1] Thu, 12 Feb 2026 07:44:00 UTC (755 KB) [v2] Fri, 28 Aug 2026 06:13:23 UTC (1,111 KB) Full-text links: Access Paper: View PDF HTML (experimental) TeX Source view license Current browse context: cs.SE < prev | next > new | recent | 2026-02 Change to browse by: cs References & Citations NASA ADS Google Scholar Semantic Scholar export BibTeX citation Bookmark Bibliographic Tools Bibliographic and Citation Tools Bibliographic Explorer Toggle Bibliographic Explorer ( What is the Explorer? ) Connected Papers Toggle Connected Papers ( What is Connected Papers? ) Litmaps Toggle Litmaps ( What is Litmaps? ) scite.ai Toggle scite Smart Citations ( What are Smart Citations? ) Code, Data, Media Code, Data and Media Associated with this Article alphaXiv Toggle alphaXiv ( What is alphaXiv? ) Links to Code Toggle CatalyzeX Code Finder for Papers ( What is CatalyzeX? ) DagsHub Toggle DagsHub ( What is DagsHub? ) GotitPub Toggle Gotit.pub ( What is GotitPub? ) Huggingface Toggle Hugging Face ( What is Huggingface? ) ScienceCast Toggle ScienceCast ( What is ScienceCast? ) Demos Demos Replicate Toggle Replicate ( What is Replicate? ) Spaces Toggle Hugging Face Spaces ( What is Spaces? ) Spaces Toggle TXYZ.AI ( What is TXYZ.AI? ) Related Papers Recommenders and Search Tools Link to Influence Flower Influence Flower ( What are Influence Flowers? ) Core recommender toggle CORE Recommender ( What is CORE? ) Author Venue Institution Topic About arXivLabs arXivLabs: experimental projects with community collaborators arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website. Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them. Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs . Which authors of this paper are endorsers? | Disable MathJax ( What is MathJax? ) We gratefully acknowledge support from our major funders , member institutions , and all contributors. About · Help · Contact · Subscribe · Copyright · Privacy · Accessibility · Operational Status (opens in new tab) Major funding support from
Related documents
- Do Not Treat Code as Natural Language: Implications for Repository-Level Code Generation and Beyond#684354
- TICoder: A Repository-Level Code Generation Framework with Test-Driven Planning and Implementation-Aware Reuse#267730
- Prompt Optimization for LLM Code Generation via Reinforcement Learning#204858
- VibeMemBench: Evaluating Memory Systems for Coding Agents on Real Repository Coding Tasks#1049309
- VibeMemBench: Evaluating Memory Systems for Coding Agents on Real Repository Coding Tasks#1028772
Retrieved via Conceptio: every document is proof-bundled with source, license, and retrieval metadata.
Read the Docs → · View CLI source on GitHub · Conceptio Open Knowledge Archive