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

arXiv:2511.20933 · cs.SE · Submitted 2025-11-25 · Read on arXiv

Listen

Radio episode about this paper

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?

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

cs.SE

Submitted: 2025-11-25

Updated: 2026-12-01

Comments: 40 pages, 20 figures, Accepted for publication in ACM Transactions on Software Engineering and Methodology (TOSEM)

License: http://creativecommons.org/licenses/by/4.0/

Importance score: 80/100

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…

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

Summary

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

Where the paper says it

Hierarchical Evaluation of Software Design Capabilities of Large Language Models of Code MOOTEZ SAAD, Dalhouise University, Canada BOQI CHEN, McGill University, Canada JOSÉ ANTONIO HERNÁNDEZ LÓPEZ, University of Murcia, Spain DÁNIEL VARRÓ, Linköping University, Sweden TUSHAR SHARMA, Dalhouise University, Canada 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).

<ref:2511.20933#pg1,robustness of their grasp on core software design concepts remains unclear>. p. 0
Where the paper says it

Hierarchical Evaluation of Software Design Capabilities of Large Language Models of Code MOOTEZ SAAD, Dalhouise University, Canada BOQI CHEN, McGill University, Canada JOSÉ ANTONIO HERNÁNDEZ LÓPEZ, University of Murcia, Spain DÁNIEL VARRÓ, Linköping University, Sweden TUSHAR SHARMA, Dalhouise University, Canada 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 conduct an empirical study to systematically evaluate their understanding of cohesion (intra-module) and coupling (inter-module). p. 0
Where the paper says it

Hierarchical Evaluation of Software Design Capabilities of Large Language Models of Code MOOTEZ SAAD, Dalhouise University, Canada BOQI CHEN, McGill University, Canada JOSÉ ANTONIO HERNÁNDEZ LÓPEZ, University of Murcia, Spain DÁNIEL VARRÓ, Linköping University, Sweden TUSHAR SHARMA, Dalhouise University, Canada 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).

<ref:2511.20933#pg1,We conduct an empirical study to systematically evaluate their understanding of cohesion (intra-module) and coupling (inter-module)>

Pruning redundant reasoning tokens

The goal of the study is to investigate the knowledge that language models of code have about software design and the conditions under which they can manipulate and apply it.<ref:2511.20933#pg2,The goal of the study is to investigate the knowledge that language models of code have about software design and the conditions under which they can manipulate and apply it>. p. 1

Where the paper says it

This leads us to the central analogy of our work: are llms akin to efficient interns, capable of flawlessly executing well-defined tasks specified using prompts, or do they exhibit the analytical autonomy of senior software engineers, who can navigate ambiguity and natively adopt best-practices derived from design principles? The goal of the study is to investigate the knowledge that language models of code have about software design and the conditions under which they can manipulate and apply it.

Specifically, we focus on two foundational software design principles: cohesion and coupling. p. 1
Where the paper says it

The goal of the study is to investigate the knowledge that language models of code have about software design and the conditions under which they can manipulate and apply it. Specifically, we focus on two foundational software design principles: cohesion and coupling.

<ref:2511.20933#pg2,Specifically, we focus on two foundational software design principles: cohesion and coupling>. p. 1
Where the paper says it

The goal of the study is to investigate the knowledge that language models of code have about software design and the conditions under which they can manipulate and apply it. Specifically, we focus on two foundational software design principles: cohesion and coupling.

These principles are important to create maintainable and adaptable software. p. 1
Where the paper says it

Specifically, we focus on two foundational software design principles: cohesion and coupling. These principles are important to create maintainable and adaptable software.

<ref:2511.20933#pg2,These principles are important to create maintainable and adaptable software>. p. 1
Where the paper says it

Specifically, we focus on two foundational software design principles: cohesion and coupling. These principles are important to create maintainable and adaptable software.

Cohesion describes how closely the elements within a module relate to one another. p. 1
Where the paper says it

These principles are important to create maintainable and adaptable software. Cohesion describes how closely the elements within a module relate to one another [39], while coupling characterizes the degree of interdependence between different modules [13].

<ref:2511.20933#pg2,Cohesion describes how closely the elements within a module relate to one another>, while coupling characterizes the degree of interdependence between different modules. p. 1
Where the paper says it

These principles are important to create maintainable and adaptable software. Cohesion describes how closely the elements within a module relate to one another [39], while coupling characterizes the degree of interdependence between different modules [13].

<ref:2511.20933#pg2,while coupling characterizes the degree of interdependence between different modules>. p. 1
Where the paper says it

These principles are important to create maintainable and adaptable software. Cohesion describes how closely the elements within a module relate to one another [39], while coupling characterizes the degree of interdependence between different modules [13].

Our study design draws inspiration from Bloom’s Taxonomy [12] to achieve the above-stated goal. p. 1
Where the paper says it

Despite their importance, little empirical evidence exists about whether llms can recognize or reason about them. Our study design draws inspiration from Bloom’s Taxonomy [12] to achieve the above-stated goal.

<ref:2511.20933#pg2,Our study design draws inspiration from Bloom’s Taxonomy [12] to achieve the above-stated goal>. p. 1
Where the paper says it

Despite their importance, little empirical evidence exists about whether llms can recognize or reason about them. Our study design draws inspiration from Bloom’s Taxonomy [12] to achieve the above-stated goal.

We devise an experimental framework that operationalizes its levels (such as understanding, evaluating, and creating) through varying the instruction type and provided contextual information in our prompts to llms. p. 1
Where the paper says it

In software engineering literature, it has been used by Buckley and Exton [14] to evaluate the developers’ comprehension of a software system. We devise an experimental framework that operationalizes its levels (such as understanding, evaluating, and creating) through varying the instruction type and provided contextual information in our prompts to llms.

<ref:2511.20933#pg2,We devise an experimental framework that operationalizes its levels (such as understanding, evaluating, and creating) through varying the instruction type and provided contextual information in our prompts to llms>. p. 1
Where the paper says it

In software engineering literature, it has been used by Buckley and Exton [14] to evaluate the developers’ comprehension of a software system. We devise an experimental framework that operationalizes its levels (such as understanding, evaluating, and creating) through varying the instruction type and provided contextual information in our prompts to llms.

How the training signal is built

The study design involves programmatically generating poorly designed code fragments and testing the DeepSeek-R1 model family (14B, 32B, 70B) under varying levels of guidance, from simple Verification to Guided and Open-ended Generation.<ref:2511.20933#pg1,We programmatically generate poorly designed code fragments and test the DeepSeek-R1 model family (14B, 32B, 70B) under varying levels of guidance, from simple Verification to Guided and Open-ended Generation>. p. 0

Where the paper says it

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 the DeepSeek-R1 model family (14B, 32B, 70B) under varying levels of guidance, from simple Verification to Guided and Open-ended Generation, while varying contextual noise by injecting distractor elements.

To introduce controlled noise, for cohesion, we inject methods from unrelated classes into highly cohesive ones; for coupling, we introduce distractor classes around truly coupled pairs that were generated using a set of code transformations. p. 1
Where the paper says it

Our evaluation framework evaluates three variants of the DeepSeek-R1 model (14B, 32B and 70B) and controls for two key variables: the level of contextual help provided, and by extension, the cognitive load and the distortion levels, which introduce controlled noise into the input space to mimic a realistic development environment. To introduce controlled noise, for cohesion, we inject methods from unrelated classes into highly cohesive ones; for coupling, we introduce distractor classes around truly coupled pairs that were generated using a set of code transformations.

<ref:2511.20933#pg2,To introduce controlled noise, for cohesion, we inject methods from unrelated classes into highly cohesive ones; for coupling, we introduce distractor classes around truly coupled pairs that were generated using a set of code transformations>. p. 1
Where the paper says it

Our evaluation framework evaluates three variants of the DeepSeek-R1 model (14B, 32B and 70B) and controls for two key variables: the level of contextual help provided, and by extension, the cognitive load and the distortion levels, which introduce controlled noise into the input space to mimic a realistic development environment. To introduce controlled noise, for cohesion, we inject methods from unrelated classes into highly cohesive ones; for coupling, we introduce distractor classes around truly coupled pairs that were generated using a set of code transformations.

This structure allows us to quantify whether model performance is consistent and aligned with software engineering principles under real constraints. p. 1
Where the paper says it

To introduce controlled noise, for cohesion, we inject methods from unrelated classes into highly cohesive ones; for coupling, we introduce distractor classes around truly coupled pairs that were generated using a set of code transformations. This structure allows us to quantify whether model performance is consistent and aligned with software engineering principles under real constraints, leading us to our research questions: RQ1: What is the llm’s baseline performance in recognizing the concepts of cohesion and coupling?

<ref:2511.20933#pg2,This structure allows us to quantify whether model performance is consistent and aligned with software engineering principles under real constraints>. p. 1
Where the paper says it

To introduce controlled noise, for cohesion, we inject methods from unrelated classes into highly cohesive ones; for coupling, we introduce distractor classes around truly coupled pairs that were generated using a set of code transformations. This structure allows us to quantify whether model performance is consistent and aligned with software engineering principles under real constraints, leading us to our research questions: RQ1: What is the llm’s baseline performance in recognizing the concepts of cohesion and coupling?

Where the gains come from

The contributions of this work are as follows:

  1. A novel benchmark and methodology for the controlled evaluation of llm reasoning on two core software design concepts. p. 2

    Where the paper says it

    Across both concepts, larger models (32B, 70B) generate shorter traces than the smaller 14B model. The contributions of this work are as follows: • A novel benchmark and methodology for the controlled evaluation of llm reasoning on two core software design concepts: our approach enables the systematic generation of code with quantifiable cohesion and coupling flaws, facilitating reproducible experiments on model robustness.

    <ref:2511.20933#pg4>.

  2. The first in-depth empirical study revealing an asymmetry in how models handle cohesion versus coupling: we provide quantitative evidence that while models possess foundational knowledge, their practical reasoning about coupling is highly susceptible to noise, whereas their cohesion analysis is more robust but brittle under full autonomy. p. 2

    Where the paper says it

    The contributions of this work are as follows: • A novel benchmark and methodology for the controlled evaluation of llm reasoning on two core software design concepts: our approach enables the systematic generation of code with quantifiable cohesion and coupling flaws, facilitating reproducible experiments on model robustness. • The first in-depth empirical study revealing an asymmetry in how models handle cohesion versus coupling: we provide quantitative evidence that while models possess foundational knowledge, their practical reasoning about coupling is highly susceptible to noise, whereas their cohesion analysis is more robust but brittle under full autonomy.

    <ref:2511.20933#pg4>.

  3. Mechanistic insights into the failure modes of llms for design analysis, derived from Chain-of-Thought traces: we identify and contrast distinct reasoning patterns: cognitive shortcutting when faced with combinatorial complexity in coupling tasks versus a brute-force analysis for cohesion. p. 2

    Where the paper says it

    • The first in-depth empirical study revealing an asymmetry in how models handle cohesion versus coupling: we provide quantitative evidence that while models possess foundational knowledge, their practical reasoning about coupling is highly susceptible to noise, whereas their cohesion analysis is more robust but brittle under full autonomy. • Mechanistic insights into the failure modes of llms for design analysis, derived from Chain-of-Thought traces: we identify and contrast distinct reasoning patterns: cognitive shortcutting when faced with combinatorial complexity in coupling tasks versus a brute-force analysis for cohesion.

    <ref:2511.20933#pg4>.

  4. Actionable insights for researchers and practitioners on the readiness of llms for software design tasks: our findings characterize current models as effective guided assistants for identifying suboptimal design but caution against their use as fully autonomous agents in noisy, complex codebases. p. 2

    Where the paper says it

    • Mechanistic insights into the failure modes of llms for design analysis, derived from Chain-of-Thought traces: we identify and contrast distinct reasoning patterns: cognitive shortcutting when faced with combinatorial complexity in coupling tasks versus a brute-force analysis for cohesion. • Actionable insights for researchers and practitioners on the readiness of llms for software design tasks: our findings characterize current models as effective guided assistants for identifying suboptimal design but caution against their use as fully autonomous agents in noisy, complex codebases.

    <ref:2511.20933#pg4>.

The results show that models exhibit a solid baseline understanding of both concepts in ideal conditions, but their practical knowledge is fragile and highly asymmetrical.<ref:2511.20933#pg1,While models exhibit a solid baseline understanding of both concepts in ideal conditions, their practical knowledge is fragile and highly asymmetrical>. p. 0

Where the paper says it

We programmatically generate poorly designed code fragments and test the DeepSeek-R1 model family (14B, 32B, 70B) 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%. p. 0
Where the paper says it

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%.

<ref:2511.20933#pg1,Reasoning about coupling proves brittle; performance collapses in noisy, open-ended scenarios, with F1 scores dropping by over 50%>. p. 0
Where the paper says it

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. p. 0
Where the paper says it

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.

<ref:2511.20933#pg1,In contrast, the models’ analysis of cohesion is remarkably robust to internal noise in guided tasks>. p. 0
Where the paper says it

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. p. 0
Where the paper says it

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.

<ref:2511.20933#pg1,However, this resilience also fails when all guidance is removed>. p. 0
Where the paper says it

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.

Reasoning-trace analysis confirms these failure modes, revealing cognitive shortcutting for coupling versus a more exhaustive (yet still failing) analysis for cohesion. p. 0
Where the paper says it

However, this resilience also fails when all guidance is removed. Reasoning-trace analysis confirms these failure modes, revealing cognitive shortcutting for coupling versus a more exhaustive (yet still failing) analysis for cohesion.

<ref:2511.20933#pg1,Reasoning-trace analysis confirms these failure modes, revealing cognitive shortcutting for coupling versus a more exhaustive (yet still failing) analysis for cohesion>. p. 0
Where the paper says it

However, this resilience also fails when all guidance is removed. Reasoning-trace analysis confirms these failure modes, revealing cognitive shortcutting for coupling versus a more exhaustive (yet still failing) analysis for cohesion.

To summarize, while llms can provide reliable assistance for recognizing design flaws, their ability to reason autonomously in noisy, realistic contexts is limited. p. 0
Where the paper says it

Reasoning-trace analysis confirms these failure modes, revealing cognitive shortcutting for coupling versus a more exhaustive (yet still failing) analysis for cohesion. 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.

<ref:2511.20933#pg1,To summarize, while llms can provide reliable assistance for recognizing design flaws, their ability to reason autonomously in noisy, realistic contexts is limited>. p. 0
Where the paper says it

Reasoning-trace analysis confirms these failure modes, revealing cognitive shortcutting for coupling versus a more exhaustive (yet still failing) analysis for cohesion. 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.

The performance drop on open-ended tasks would suggest the model excels as an executor of instructions but struggles with independent discovery.<ref:2511.20933#pg2,A performance drop on open-ended tasks would suggest the model excels as an executor of instructions but struggles with independent discovery>. p. 1

Where the paper says it

We measure performance across different levels of help: Verification (maximum), Guided Generation (partial), and Open-ended Generation (minimal). A performance drop on open-ended tasks would suggest the model excels as an executor of instructions but struggles with independent discovery.

Model performance declines as cognitive load increases, showing a strong reliance on guidance. p. 1
Where the paper says it

A performance drop on open-ended tasks would suggest the model excels as an executor of instructions but struggles with independent discovery. Model performance declines as cognitive load increases, showing , Vol.

<ref:2511.20933#pg2,Model performance declines as cognitive load increases, showing a strong reliance on guidance>. p. 1
Where the paper says it

A performance drop on open-ended tasks would suggest the model excels as an executor of instructions but struggles with independent discovery. Model performance declines as cognitive load increases, showing , Vol.

For coupling, the 70B model drops over 31% (F1: 0. p. 1
Where the paper says it

Our results show that llms recognize cohesion and coupling in simple tasks, but performance drops with complexity. The 70B model scores 0.

89 → 0.61), while cohesion reaches an ARI score of 0. p. 2
Where the paper says it

For coupling, the 70B model drops over 31% (F1: 0. 61), while cohesion reaches an ARI score of 0.

43 in open-ended tasks. p. 0
Where the paper says it

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.

<ref:2511.20933#pg2>. This shows that while the model is proficient at validating a specific cohesive relationship, its ability to autonomously discover all of a class’s underlying responsibilities is significantly more challenging. p. 8
Where the paper says it

The selection process of noisy classes that are used to generate the distractor elements for the coupling task. This approach tests the model’s ability to focus its analysis and discern a specific inter-class relationship amidst a field of irrelevant, but syntactically valid, code.

<ref:2511.20933#pg3>.

The results indicate that the models’ ability to reason about inter-module dependencies is highly sensitive to the presence of unrelated distractor classes.<ref:2511.20933#pg4>. In the most challenging task, Open-ended Generation, performance degrades sharply and steadily for all models. p. 1

Where the paper says it

We devise an experimental framework that operationalizes its levels (such as understanding, evaluating, and creating) through varying the instruction type and provided contextual information in our prompts to llms. Specifically, we design prompts that exhibit decreasing levels of guidance: (1) Verification: the model is presented with an assertion and must simply confirm or deny it, (2) Guided generation: the model is given a partial context and must apply its knowledge to complete the task; and (3) Open-ended generation: the model is given only the raw code and must autonomously discover design elements.

<ref:2511.20933#pg4>. For instance, the F1 score for the 70B model drops from 0. p. 2
Where the paper says it

For coupling, the 70B model drops over 31% (F1: 0. 61), while cohesion reaches an ARI score of 0.

59 at a low distortion ratio of 0. p. 7
Where the paper says it

Figure 7 illustrates how the models are prompted regarding each design concept under different task formulations: 3. 4 Controlled Distortion Injection In addition to varying the level of guidance, we systematically manipulate the signal-to-noise ratio of each case to assess the robustness of the model’s understanding.

1 to just 0.27 at a high ratio of 0. p. 2
Where the paper says it

2 Related Work 2. 1 Nonfunctional Requirements of Software Functional correctness is insufficient for capturing the spectrum of what it means to produce high-quality software.

9, representing a performance decrease of over 54%. p. 0
Where the paper says it

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%.

<ref:2511.20933#pg4>. A similar trend is observed for the smaller models, whose scores fall to 0. p. 2
Where the paper says it

Models’ performance on coupling tasks declines with distortion, with the 70B model dropping from 0. 27 F1 in open-ended tasks and similar trends across smaller models.

24 and 0.22, respectively.<ref:2511.20933#pg4>.

The results reveal an asymmetry in how distortion affects the models’ reasoning.<ref:2511.20933#pg4>. The models’ understanding of coupling is fragile; performance degrades across all task types as the number of distractor classes increases. p. 2

Where the paper says it

This allows us to determine if the model’s reasoning is fragile when noise increases. Models’ performance on coupling tasks declines with distortion, with the 70B model dropping from 0.

<ref:2511.20933#pg4>. Conversely, the models’ understanding of cohesion is relatively robust, with performance remaining stable in guided tasks regardless of how many unrelated responsibilities are injected into a class. p. 0
Where the paper says it

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.

<ref:2511.20933#pg4>. This resilience suggests that reasoning about inter-module relationships requires a global view that is easily disrupted by irrelevant context. p. 8
Where the paper says it

This approach tests the model’s ability to focus its analysis and discern a specific inter-class relationship amidst a field of irrelevant, but syntactically valid, code. Together, these two methods of distortion allow us to rigorously evaluate the model’s resilience and practical utility in non-idealized conditions.

<ref:2511.20933#pg4>.

The analysis of CoT traces for coupling reveals unexpectedly shorter traces on the open-ended generation task compared to those of verification and guided generation.<ref:2511.20933#pg4>. This finding suggests that a higher cognitive load does not necessarily lead to a more exhaustive deliberation process when models reason about coupling. p. 0

Where the paper says it

Reasoning-trace analysis confirms these failure modes, revealing cognitive shortcutting for coupling versus a more exhaustive (yet still failing) analysis for cohesion. 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.

<ref:2511.20933#pg4>.

The analysis of CoT traces for cohesion reveals a distinct reasoning pattern that contrasts with the findings for coupling.<ref:2511.20933#pg4>. In this case, the length of the reasoning traces aligns with the expected cognitive load of the task formulations. p. 2

Where the paper says it

In coupling tasks, surprisingly, llms produce shorter reasoning traces in open-ended settings than in guided ones. For cohesion, trace length grows with cognitive load, particularly in open-ended settings.

<ref:2511.20933#pg4>. The Open-ended Generation task consistently required the most reasoning, producing the longest traces. p. 2
Where the paper says it

825 F1 for the 70B model), but degrade in open-ended scenarios (ARI: 0. RQ4: What are the main trends in reasoning traces generated by the models under the studied experimental conditions?

<ref:2511.20933#pg4>.

The analysis of CoT traces reveals that larger models generate more concise reasoning traces than the smaller 14B model.<ref:2511.20933#pg4>. This conciseness does not correlate with lower performance; on the contrary, as mentioned in RQs 1-3, the larger models are typically more accurate. p. 9

Where the paper says it

Compared to standard llms that typically predict a response directly from the input, reasoning llms distinguish themselves by generating a sequence of intermediate “thinking tokens”, simulating an internal Chain of Thought, before outputting the final answer. We choose this family of models given their higher performance compared to standard llms in software-related tasks [24], and to generate the desiderata for RQ4.

<ref:2511.20933#pg4>. This suggests that the reduction in trace length is a signal of greater reasoning efficiency. p. 2
Where the paper says it

In coupling tasks, surprisingly, llms produce shorter reasoning traces in open-ended settings than in guided ones. For cohesion, trace length grows with cognitive load, particularly in open-ended settings.

<ref:2511.20933#pg4>.

The results indicate that models possess a solid foundational knowledge of both principles but their practical ability to apply these principles is brittle.<ref:2511.20933#pg1>. They are more adept at identifying intermodule coupling but are highly vulnerable to contextual noise, whereas their grasp of intra-module cohesion is more resilient but falters when tasks require autonomous discovery. p. 0

Where the paper says it

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 the DeepSeek-R1 model family (14B, 32B, 70B) under varying levels of guidance, from simple Verification to Guided and Open-ended Generation, while varying contextual noise by injecting distractor elements.

p. 0
Where the paper says it

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 the DeepSeek-R1 model family (14B, 32B, 70B) under varying levels of guidance, from simple Verification to Guided and Open-ended Generation, while varying contextual noise by injecting distractor elements.

<ref:2511.20933#pg1>.

The analysis reveals that though the llms’ problem-solving strategies and failure modes differ between cohesion and coupling, a consistent trend shows that larger models are more efficient, reaching conclusions with shorter, more direct reasoning traces.<ref:2511.20933#pg4>. This suggests that their internal representations of software design principles become more sophisticated. p. 9

Where the paper says it

Furthermore, their large 128K token context window is well-suited for processing the substantial code artifacts in our experiments. We consider that their sophisticated mathematical and logical reasoning capabilities serve as a strong proxy for the abstract reasoning required to analyze software design properties.

<ref:2511.20933#pg4>.

The findings reveal that current models perform well under guidance but lack the robust, scalable reasoning to operate in unconstrained scenarios.<ref:2511.20933#pg5>. This frames a direction for future research. p. 0

Where the paper says it

From automated code generation [29] to bug localization [26], models such as GPT-4 [3] and DeepSeek-R1 [24] have shown remarkable proficiency in assisting developers in multiple tasks. Existing research has mainly focused on assessing whether llms can generate functionally correct code, that is, code that compiles and passes predefined test cases [6, 16, 28, 30, 58].

<ref:2511.20933#pg5>.

The study provides insights into the fundamental software design knowledge that llms have acquired.<ref:2511.20933#pg5>. Our results confirm that these models possess a foundational grasp of cohesion and coupling, enabling them to recognize suboptimally-designed code. p. 2

Where the paper says it

The contributions of this work are as follows: • A novel benchmark and methodology for the controlled evaluation of llm reasoning on two core software design concepts: our approach enables the systematic generation of code with quantifiable cohesion and coupling flaws, facilitating reproducible experiments on model robustness. • The first in-depth empirical study revealing an asymmetry in how models handle cohesion versus coupling: we provide quantitative evidence that while models possess foundational knowledge, their practical reasoning about coupling is highly susceptible to noise, whereas their cohesion analysis is more robust but brittle under full autonomy.

<ref:2511.20933#pg5>. This finding has practical implications: These models can be leveraged as valuable assistants for developers in guided maintenance activities, such as highlighting opportunities for refactoring. p. 3
Where the paper says it

They investigated two core tasks: identifying refactoring opportunities and recommending refactoring solutions, using a dataset of 180 real-world refactorings. When using generic prompts, both models performed poorly at identifying opportunities, with success rates of only 15.

<ref:2511.20933#pg5>.

The paper's methodology provides a generalizable framework for benchmarking llm’s capabilities in other SE tasks.<ref:2511.20933#pg5>. Evaluating along a spectrum of cognitive load, from simple verification to unguided generation, can provide a more nuanced profile of a model’s abilities. p. 7

Where the paper says it

3 Prompt Design To systematically evaluate a model’s reasoning capabilities, we designed three prompting strategies. These strategies create a gradient of cognitive load, ranging from simple recognition to unguided discovery.

<ref:2511.20933#pg5>.

The study's limitations and threats to validity section discusses the potential limitations of our study and the steps taken to mitigate them.<ref:2511.20933#pg6>. Construct Validity concerns whether our methods for creating low-cohesion and high-coupling examples accurately represent these abstract software design concepts. p. 1

Where the paper says it

To introduce controlled noise, for cohesion, we inject methods from unrelated classes into highly cohesive ones; for coupling, we introduce distractor classes around truly coupled pairs that were generated using a set of code transformations. This structure allows us to quantify whether model performance is consistent and aligned with software engineering principles under real constraints, leading us to our research questions: RQ1: What is the llm’s baseline performance in recognizing the concepts of cohesion and coupling?

<ref:2511.20933#pg6>. Internal Validity addresses whether the observed outcomes are truly caused by our independent variables (distortion ratio, level of help) or by other confounding factors. p. 1
Where the paper says it

Our evaluation framework evaluates three variants of the DeepSeek-R1 model (14B, 32B and 70B) and controls for two key variables: the level of contextual help provided, and by extension, the cognitive load and the distortion levels, which introduce controlled noise into the input space to mimic a realistic development environment. To introduce controlled noise, for cohesion, we inject methods from unrelated classes into highly cohesive ones; for coupling, we introduce distractor classes around truly coupled pairs that were generated using a set of code transformations.

<ref:2511.20933#pg6>. Ecological Validity examines whether the findings of a study can be generalized to naturalistic situations. p. 9
Where the paper says it

, from OpenAI, Anthropic, or Google) due to challenges in scientific reproducibility [2, 5, 31, 46]. The frequent, undocumented updates and deprecation of model versions undermine the long-term validity and replicability of experimental findings.

<ref:2511.20933#pg6>. External Validity relates to the generalizability of our findings. p. 9
Where the paper says it

, from OpenAI, Anthropic, or Google) due to challenges in scientific reproducibility [2, 5, 31, 46]. The frequent, undocumented updates and deprecation of model versions undermine the long-term validity and replicability of experimental findings.

<ref:2511.20933#pg6>.

In this work, we sought to investigate the depth and robustness of llm’s understanding of cohesion and coupling.<ref:2511.20933#pg7>. Through a controlled experiment using generated code with varying levels of noise and contextual guidance, we mapped the boundaries of the model’s software design reasoning. p. 1

Where the paper says it

Our evaluation framework evaluates three variants of the DeepSeek-R1 model (14B, 32B and 70B) and controls for two key variables: the level of contextual help provided, and by extension, the cognitive load and the distortion levels, which introduce controlled noise into the input space to mimic a realistic development environment. To introduce controlled noise, for cohesion, we inject methods from unrelated classes into highly cohesive ones; for coupling, we introduce distractor classes around truly coupled pairs that were generated using a set of code transformations.

<ref:2511.20933#pg7>.

The paper's findings reveal that models possess a solid foundational knowledge of both principles but their practical ability to apply these principles is brittle.<ref:2511.20933#pg7>. They are more adept at identifying intermodule coupling but are highly vulnerable to contextual noise, whereas their grasp of intra-module cohesion is more resilient but falters when tasks require autonomous discovery.<ref:2511.20933#pg7>. Ultimately, our results indicate that current models perform well under guidance but lack the robust, scalable reasoning to operate in unconstrained scenarios. p. 0

Where the paper says it

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.

<ref:2511.20933#pg7>.

Green — the paper says it, and the page is printed. Red — no passage carries it, so treat that sentence as unverified. The same check runs on your own text: check a summary against its source, $5.

Improvements for AI systems

  1. Improve model reasoning for coupling by implementing strategies to overcome cognitive shortcutting when analyzing complex relationships, as models abandon a comprehensive analysis of all provided classes in open-ended generation tasks due to combinatorial explosion.

  2. Enhance cohesion analysis robustness by developing methods that allow models to perform brute-force analysis for cohesion when facing increased distortion levels, as the paper shows that reasoning about inter-module relationships is vulnerable to contextual noise.

  3. Develop a multi-dimensional evaluation framework that categorizes model capabilities along a spectrum of cognitive load, allowing researchers to differentiate between effective executors of instructions versus those capable of genuine problem-solving.

  4. Implement prompt engineering techniques that systematically manipulate the signal-to-noise ratio for coupling tasks by introducing independent distractor classes while maintaining the core relationship between tightly coupled classes intact.

  5. Integrate a mechanism to assess reasoning efficiency by tracking Chain of Thought length, using the observation that larger models generate more concise reasoning traces than the smaller 14B model as a signal of greater reasoning efficiency.

Abstract

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.

Sources

Related papers