Coding Triangle: How Does Large Language Model Understand Code?

Taolin Zhang, Zihan Ma, Maosong Cao, Junnan Liu, Songyang Zhang +1 more
7/8/2025
cs.CLcs.AI

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

Abstract

Large language models (LLMs) have achieved remarkable progress in code generation, yet their true programming competence remains underexplored. We introduce the Code Triangle framework, which systematically evaluates LLMs across three fundamental dimensions: editorial analysis, code implementation, and test case generation. Through extensive experiments on competitive programming benchmarks, we reveal that while LLMs can form a self-consistent system across these dimensions, their solutions often lack the diversity and robustness of human programmers. We identify a significant distribution shift between model cognition and human expertise, with model errors tending to cluster due to training data biases and limited reasoning transfer. Our study demonstrates that incorporating human-generated editorials, solutions, and diverse test cases, as well as leveraging model mixtures, can substantially enhance both the performance and robustness of LLMs. Furthermore, we reveal both the consistency and inconsistency in the cognition of LLMs that may facilitate self-reflection and self-improvement, providing a potential direction for developing more powerful coding models.

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. 5 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{zhang2025coding,
  title  = {Coding Triangle: How Does Large Language Model Understand Code?},
  author = {Taolin Zhang and Zihan Ma and Maosong Cao and Junnan Liu and Songyang Zhang and Kai Chen},
  year   = {2025},
  eprint = {2507.06138},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2507.06138v1}
}

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/2507.06138.svg)](https://codeofpaper.com/paper/2507.06138)

Discussion