UCoder: 大規模言語モデルの内部プロービングによる教師なしコード生成
UCoder: Unsupervised Code Generation by Internal Probing of Large Language Models
December 19, 2025
著者: Jiajun Wu, Jian Yang, Wei Zhang, Lin Jing, Yuqing Ma, Ensheng Shi, Yuchi Ma, Zhoujun Li, Xianglong Liu
cs.AI
要旨
大規模言語モデル(LLM)は、コード生成タスクにおいて顕著な能力を発揮している。しかし、その有効性は大規模なラベル付きデータ(例:質問応答ペア)またはラベルなしデータセット(例:コードスニペット)を用いた教師あり学習に大きく依存しており、これらは高コストで大規模な取得が困難な場合が多い。この制約に対処するため、本論文はIPCと呼ばれる手法を提案する。これは外部コーパス(ラベルなしコードスニペットすらも)を一切用いず、LLM内部の知識を活用する教師なしコード生成フレームワークである。我々は、LLM内に存在する内部知識と確信度パターンを探るため、問題空間プロービング、テスト理解プロービング、解決策空間プロービング、および知識統合・強化を導入する。さらに、IPCは自己一貫性メカニズムと表現ベースの品質推定を通じて信頼性の高いコード候補を特定し、UCoder(教師なし学習によるコーダー)を学習させる。提案手法を複数のコードベンチマークで検証した結果、教師あり手法と同等の性能を達成しつつ、ラベル付きデータと計算資源への依存を大幅に低減できることを実証する。分析実験により、モデルの内部状態にはコードの品質と正当性に関する豊富な信号が含まれており、これらの信号を適切に利用することでコード生成タスクの効果的な教師なし学習が可能となることが明らかになった。これは、リソースが制約された環境でのコードLLM学習に向けた新たな方向性を開くものである。
English
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.