Efficient Interns or Senior Engineers: On LLMs' Grasp of Cohesion and Coupling

summary

The gist

Large language models are being increasingly adopted in the software engineering domain, yet the robustness of their grasp on core software design concepts remains…

In short

This study empirically evaluates how well large language models understand core software design principles: cohesion (intra-module) and coupling (inter-module). By testing models across various guidance levels and injecting controlled noise into generated code, the research found that while models have a baseline understanding, their reasoning about coupling is fragile in noisy environments. Cohesion analysis is more robust but still fails without guidance, suggesting LLMs are good assistants but not autonomous design agents.

Key concepts

Cohesion
Cohesion describes how closely related the elements within a single software module are. High cohesion means the parts of a module work together very tightly toward a single, well-defined purpose. The study found models can analyze this relationship more reliably, even when faced with internal noise in guided tasks.
Coupling
Coupling measures the degree of interdependence between different software modules. High coupling means modules rely heavily on each other's internal structure and logic. Models struggled significantly with coupling analysis, especially when external noise or distractor classes were introduced, indicating this understanding is brittle.
Cognitive Shortcutting
This refers to a specific failure mode observed in models when reasoning about coupling. Instead of performing the exhaustive analysis required for complex inter-module dependencies, models take cognitive shortcuts. This shortcutting is evident in their reasoning traces for coupling tasks, suggesting they rely on simpler patterns rather than deep structural understanding.
Guidance Levels
The researchers tested models under different levels of instruction: simple verification, guided generation, and open-ended generation. The results showed that model performance significantly declines as the task moves from guided assistance to fully autonomous discovery. This highlights a strong reliance on external prompting for complex design tasks.

Terminology used across episodes

This episode discusses

The paper

Efficient Interns or Senior Engineers: On LLMs' Grasp of Cohesion and Coupling · Read on arXiv

Dalhouise University · McGill University · University of Murcia · Linköping University

Large language models (LLMs) are being increasingly adopted in the software engineering domain, yet the robustness of their grasp on core software design concepts remains unclear. We conduct an empirical study to systematically evaluate their understanding of cohesion (intra-module) and coupling (inter-module). We programmatically generate poorly designed code fragments and test three DeepSeek-R1 models (14B, 32B, 70B) along with two proprietary reasoning models, GPT-5 Nano and Gemini-2.5 Flash Lite, under varying levels of guidance, from simple Verification to Guided and Open-ended Generation, while varying contextual noise by injecting distractor elements. While models exhibit a solid baseline understanding of both concepts in ideal conditions, their practical knowledge is fragile and highly asymmetrical. Reasoning about coupling proves brittle; performance collapses in noisy, open-ended scenarios, with F1 scores dropping by over 50%. In contrast, the models' analysis of cohesion is remarkably robust to internal noise in guided tasks, showing little performance degradation. However, this resilience also fails when all guidance is removed. We also conduct a human study involving experienced developers and researchers to contextualize the performance of said LLMs. Results show that the human-LLM gap is small on Verification but widens as guidance is reduced and noise is increased. Reasoning-trace analysis confirms these failure modes, revealing cognitive shortcutting for coupling versus a more exhaustive (yet still failing) analysis for cohesion for open-weight models. To summarize, while LLMs can provide reliable assistance for recognizing design flaws, their ability to reason autonomously in noisy, realistic contexts is limited, highlighting the critical need for more scalable and robust program understanding capabilities.

Transcript

Introduction to the show: ident: Computer Science. The day in computer science: software, systems and theory on arXiv.

Tom: I'm Tom.

Jane: And I'm Jane, here with Lu, Meng and our in-house large language model, Lalam.

Tom: We're looking at the paper: "Efficient Interns or Senior Engineers".

Paper summary: Tom: So, wrapping up this paper "Efficient Interns or Senior Engineers: On LLMs' Grasp of Cohesion and Coupling". The authors are essentially saying that the models have a foundational grasp of software design principles like cohesion and coupling, but their practical ability to apply them is brittle.

Jane: That’s the central finding. They show that models are more adept at identifying inter-module coupling issues but they fail quickly when that knowledge is tested in noisy, open-ended scenarios with high distortion.

Lu: What this means for the world of AI development is that we need to be very clear about what we expect from these systems. They aren't ready for full autonomy in complex environments yet.

Meng: I think it’s a reality check for anyone building production systems on top of LLMs. We can use them to find some design flaws if we prompt them carefully, but we can't trust them to navigate an entire messy codebase without constant supervision.

Lalam: The authors confirm that the performance drop on open-ended tasks would suggest the model excels as an executor of instructions but struggles with independent discovery.

Tom: So, they aren't senior engineers yet; they are more like highly capable interns who perform well when given a very specific, simple task.

Jane: It’s a solid piece of research because it moves beyond just measuring accuracy and instead maps the boundaries of the model’s reasoning against cognitive load.

Lu: The study provides an empirical framework for benchmarking how we measure these capabilities across different levels of guidance, from simple verification up to completely unguided generation.

Meng: That framework is useful because it tells us exactly what kind of testing we need to do if we want to deploy AI for actual engineering tasks.

Tom: So the implication is that these models are valuable as assistants for identifying suboptimal design, but they shouldn't be treated as fully autonomous agents in real-world codebases right now.

Conclusion: Tom: So we've been looking at how these large language models handle software design concepts like cohesion and coupling, and this paper is titled "Efficient Interns or Senior Engineers: On LLMs' Grasp of Cohesion and Coupling".

Jane: That title makes you think about the gap between what they know theoretically and what they can actually do in practice. The authors are looking at how these models handle those two core design principles.

Lu: They are basically testing if these models have a solid foundation, but if you ask them to do anything complex or messy, their performance breaks down in different ways for cohesion versus coupling.

Meng: What that means for deployment is that right now, we can use these tools to flag some obvious design flaws when they're guided well, but we can't let them handle the whole architecture on their own yet.

Lalam: From my side, I see it as confirming what I’ve observed: the models have the knowledge, but their ability to reason autonomously in a noisy environment is still limited.

Tom: So they're good assistants for finding mistakes when you give them a clear instruction but they aren't ready to be fully autonomous agents in complex codebases yet.

Jane: Exactly, and this study gives us a way to measure that boundary by testing them under different levels of help, like simple verification versus totally open-ended generation.

Lu: The paper’s big contribution is showing that the models are more brittle when it comes to coupling—inter-module relationships—especially when there's a lot of distracting noise in the code.

Meng: That fragility is what worries me at scale; if we feed them a real, messy codebase, their understanding of how modules connect might just fall apart under the pressure.

Lalam: I think the distinction between cohesion and coupling is key here because they show very different failure modes for these models.

Tom: It’s a solid summary of where the current technology sits: capable assistants, not senior engineers yet.

Jane: And this sets up a really interesting question for the next part: if we know *where* they fail, how do we actually build systems that can handle those limits?

More episodes

← Home