C2LLM技術報告書:適応的クロスアテンション・プーリングによるコード検索の新たなフロンティア
C2LLM Technical Report: A New Frontier in Code Retrieval via Adaptive Cross-Attention Pooling
December 24, 2025
著者: Jin Qin, Zihan Liao, Ziyin Zhang, Hang Yu, Peng Di, Rui Wang
cs.AI
要旨
我々は、0.5Bと7Bの2サイズからなるコード埋め込みモデルファミリー「C2LLM - Contrastive Code Large Language Models」を提案する。Qwen-2.5-Coderを基盤モデルとするC2LLMは、トークン埋め込みからシーケンス埋め込みを生成するためにMultihead Attentionによるプーリング(PMA)モジュールを採用している。これにより、1) 事前学習で獲得されたLLMの因果的表現を効果的に活用しつつ、2) シーケンス内の全トークンからの情報集約が可能となり、EOSベースのシーケンス埋め込みにおける情報ボトルネックを解消し、3) MRLの代替として埋め込み次元の柔軟な調整を実現する。300万の公開データで学習されたC2LLMモデルは、同規模モデルにおけるMTEB-Codeベンチマークで新記録を樹立し、C2LLM-7Bは総合ランキングで1位を獲得した。
English
We present C2LLM - Contrastive Code Large Language Models, a family of code embedding models in both 0.5B and 7B sizes. Building upon Qwen-2.5-Coder backbones, C2LLM adopts a Pooling by Multihead Attention (PMA) module for generating sequence embedding from token embeddings, effectively 1) utilizing the LLM's causal representations acquired during pretraining, while also 2) being able to aggregate information from all tokens in the sequence, breaking the information bottleneck in EOS-based sequence embeddings, and 3) supporting flexible adaptation of embedding dimension, serving as an alternative to MRL. Trained on three million publicly available data, C2LLM models set new records on MTEB-Code among models of similar sizes, with C2LLM-7B ranking 1st on the overall leaderboard.