Our new X account is live! Follow @wizwand_team for updates
WorkDL logo mark

UCoder: Unsupervised Code Generation by Internal Probing of Large Language Models

About

Large language models (LLMs) have demonstrated remarkable capabilities in code generation tasks. However, their effectiveness heavily relies on supervised training with extensive labeled (e.g., question-answering pairs) or unlabeled datasets (e.g., code snippets), which are often expensive and difficult to obtain at scale. To address this limitation, this paper introduces a method IPC, an unsupervised framework that leverages Internal Probing of LLMs for Code generation without any external corpus, even unlabeled code snippets. We introduce the problem space probing, test understanding probing, solution space probing, and knowledge consolidation and reinforcement to probe the internal knowledge and confidence patterns existing in LLMs. Further, IPC identifies reliable code candidates through self-consistency mechanisms and representation-based quality estimation to train UCoder (coder with unsupervised learning). We validate the proposed approach across multiple code benchmarks, demonstrating that unsupervised methods can achieve competitive performance compared to supervised approaches while significantly reducing the dependency on labeled data and computational resources. Analytic experiments reveal that internal model states contain rich signals about code quality and correctness, and that properly harnessing these signals enables effective unsupervised learning for code generation tasks, opening new directions for training code LLMs in resource-constrained scenarios.

Jiajun Wu, Jian Yang, Wei Zhang, Lin Jing, Yuqing Ma, Ensheng Shi, Yuchi Ma, Zhoujun Li, Xianglong Liu• 2025

Related benchmarks

TaskDatasetResultRank
Code GenerationHumanEval
Pass@189
850
Code GenerationHumanEval+
Pass@182.9
189
Code GenerationMBPP+
Pass@175.7
122
Code GenerationLiveCodeBench
Pass@122.9
89
Code GenerationBigCodeBench-Completion Full
pass@155.4
41
Code GenerationBigCodeBench-Completion Hard
pass@127.7
38
Code GenerationBigCodeBench-Instruct (Full)
Pass@10.457
37
Code GenerationBigCodeBench-Instruct Hard
Pass@117.6
37
Code GenerationMBPP
Pass@189.7
20
Code GenerationFullStackBench
Pass@153.35
20
Showing 10 of 10 rows

Other info

Follow for update