Skip to main content
QUICK REVIEW

[論文レビュー] ShortCoder: Knowledge-Augmented Syntax Optimization for Token-Efficient Code Generation

Sicong Liu, Yanxian Huang|arXiv (Cornell University)|Jan 14, 2026
Topic Modeling被引用数 0
ひとこと要約

ShortCoder は 10 の Python 構文簡略化ルールと規則ベース+LLM 指南のデータ合成パイプライン、および LoRA 微調整を用いて、意味的に正確なコードを簡潔に生成し、HumanEval で競争力のある性能を維持しつつ約 18.1% のトークン削減を達成。

ABSTRACT

Code generation tasks aim to automate the conversion of user requirements into executable code, significantly reducing manual development efforts and enhancing software productivity. The emergence of large language models (LLMs) has significantly advanced code generation, though their efficiency is still impacted by certain inherent architectural constraints. Each token generation necessitates a complete inference pass, requiring persistent retention of contextual information in memory and escalating resource consumption. While existing research prioritizes inference-phase optimizations such as prompt compression and model quantization, the generation phase remains underexplored. To tackle these challenges, we propose a knowledge-infused framework named ShortCoder, which optimizes code generation efficiency while preserving semantic equivalence and readability. In particular, we introduce: (1) ten syntax-level simplification rules for Python, derived from AST-preserving transformations, achieving 18.1% token reduction without functional compromise; (2) a hybrid data synthesis pipeline integrating rule-based rewriting with LLM-guided refinement, producing ShorterCodeBench, a corpus of validated tuples of original code and simplified code with semantic consistency; (3) a fine-tuning strategy that injects conciseness awareness into the base LLMs. Extensive experimental results demonstrate that ShortCoder consistently outperforms state-of-the-art methods on HumanEval, achieving an improvement of 18.1%-37.8% in generation efficiency over previous methods while ensuring the performance of code generation.

研究の動機と目的

  • コード生成におけるトークン使用量の削減と生成効率の向上を、正確さや可読性を損なわず実現する。
  • AST 保存型の構文簡略化ルールを活用して高品質な簡潔コードコーパスを作成する。
  • 効率的な微調整を通じてLLM に知識を注入し、ゼロショットの簡潔コード生成を可能にする。

提案手法

  • 関数的な喪失なく 18.1% のトークン削減を達成する AST 保存型の ten Python 構文簡略化ルール (Table I) を設計する。
  • 規則ベースと LLM 指南の合成により <original_code, simplified_code> のペアを作成する ShorterCodeBench を構築する(828 件の検証済みペア)。
  • LoRA で Code LLM を微調整し、簡潔さの知識を注入してゼロショットの簡潔コード生成を可能にする。
  • 知識注入のための訓練ペアを生成するための規則ベースと LLM 支援のデータ構築を実施する。
  • pass@k 指標と効率指標(トークン、待ち時間)を用いて HumanEval で評価する。
  • 効率と性能を評価する際、ベースライン(CodeLlama-Instruct、CodeGen、DeepSeek-Coder)と比較する。

実験結果

リサーチクエスチョン

  • RQ1RQ1: ShortCoder は機能的正確さと効率の点でベースラインのコード生成モデルと比較してどうか。
  • RQ2RQ2: ShortCoder の効率はプロンプトベースの効率向上手法と比較してどうか。
  • RQ3RQ3: ShortCoder が生成するコードの可読性と簡潔さはベースラインと比較してどうか(人間評価)。

主な発見

ModelPass@1Pass@10Pass@100GenTokens
CodeGen0.4290.5380.620260.34
CodeLlama-7B-Instruct-hf0.4740.5790.650197.80
DeepSeek-Coder-1.3B-Base0.3240.4570.690171.35
DeepSeek-Coder-6.7B-Instruct0.7910.8840.920186.69
ShortCoder0.6120.7640.967162.02
  • ShortCoder はベースラインと比較して生成トークンを 18.1% 〜 37.8%削減。
  • HumanEval では ShortCoder が Pass@1=0.612、Pass@10=0.764、Pass@100=0.967 を達成し、GenTokens は平均 162.02 トークンを生成。
  • ShortCoder は効率指標でベースラインを上回り、最先端の性能に近づきつつトークンコストを低減。
  • LoRA での微調整は簡潔さの知識を注入でき、学習可能パラメータを減らす。
  • 規則指向の微調整はプロンプトベース手法より一貫して効率が高く、平均問題レイテンシを 25%〜64%削減。
  • ShortCoder のアプローチは機能的正確さを維持または向上させつつ、より短く読みやすいコードを生成する。

より良い研究を、今すぐ始めましょう

論文設計から論文執筆まで、研究時間を劇的に削減しましょう。

クレジットカード登録不要

このレビューはAIが作成し、人間の編集者が確認しました。