Environment-Aware Code Generation: How far are We?

Tongtong Wu, Rongyi Chen, Wenjie Du, Suyu Ma, Guilin Qi +4 more
1/18/2026
cs.SEcs.CL

No confident code implementation found for this paper. 2 possible matches can be shown below.

Abstract

Recent progress in large language models (LLMs) has improved code generation, but most evaluations still test isolated, small-scale code (e.g., a single function) under default or unspecified software environments. As a result, it is unclear whether LLMs can reliably generate executable code tailored to a user's specific environment. We present the first systematic study of Environment-Aware Code Generation (EACG), where generated code must be functionally correct and directly executable under arbitrary software configurations. To enable realistic evaluation, we introduce VersiBCB, a benchmark that is multi-package, execution-verified, and deprecation-aware, capturing complex and evolving environments that prior datasets often overlook. Using VersiBCB, we investigate three complementary adaptation axes: data, parameters, and cache, and develop representative strategies for each. Our results show that current LLMs struggle with environment-specific code generation, while our adaptations improve environment compatibility and executability. These findings highlight key challenges and opportunities for deploying LLMs in practical software engineering workflows.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 2 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{wu2026environmentaware,
  title  = {Environment-Aware Code Generation: How far are We?},
  author = {Tongtong Wu and Rongyi Chen and Wenjie Du and Suyu Ma and Guilin Qi and Zhenchang Xing and Shahram Khadivi and Ramesh Periyathambi and Gholamreza Haffari},
  year   = {2026},
  eprint = {2601.12262},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2601.12262v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2601.12262.svg)](https://codeofpaper.com/paper/2601.12262)

Discussion