跳到內容

任務

程式碼生成 (Code generation)

Code generation

LLM 根據自然語言描述或現有 code context 寫或補全原始碼的任務,是 GitHub Copilot、Cursor、Claude Code 背後的核心能力。

登入以收藏
Code generation 是任務:根據自然語言指令、部分 code、或兩者,產生原始碼。輸出範圍從補全接下來幾個字元(「這個 for-loop 的其餘部分」)到寫整個函式、跨檔案重構、debug、或從描述產生完整應用程式。 它重要的原因是:coding 是 LLM 最明顯改變生產力的使用場景之一。GitHub Copilot、Cursor、Claude Code、Aider、Continue、Windsurf 等工具現在已是專業開發者工作流程的標準。Microsoft 等估計這些工具在合適任務上加速日常 coding 20-50%。 舉個例子:在編輯器打「// fetch user with retry and exponential backoff」,Copilot 建議完整的 TypeScript 函式。或對 Claude 描述 bug 並貼上 stack trace——它辨認 off-by-one 錯誤並產出修法。或貼一個 feature request 跟你的 codebase:Claude Code 協調地編輯多個檔案。 品質依模型跟任務差異極大。簡單補全跟定義良好的函式通常正確;複雜跨檔案重構、新穎演算法、或超出模型訓練分布的東西可能產出微妙錯誤的 code。一定要測試。延伸閱讀:HumanEval、SWE-bench、agent、tool use、Cursor。

最後更新: 2026-04-29

We use cookies

Anonymous analytics help us improve the site. You can opt out anytime. Learn more