本地+云端协同编程,让苹果开发环境也能用AI助手。
Contextual Augmented Multi-Model Programming (CAMP): A Hybrid Local-Cloud Copilot Framework
- 本地模型用检索增强生成,从代码库抓上下文优化提示。
- 实测在代码质量与用户采纳上均表现优异。
- 适合苹果生态开发者,解决沙盒与算力限制难题。
云上大语言模型(LLMs)已革新AI编程辅助,但在苹果软件生态(如iOS、macOS应用)的本地开发环境中仍面临计算压力与沙盒限制。本文提出CAMP框架,结合本地模型与云端模型:本地模型采用检索增强生成(RAG)技术,从代码库中提取上下文信息,用于构建更精准的提示,从而提升云端模型性能,使大语言模型可在本地集成开发环境(IDE)中有效运行。该方法已应用于Xcode Copilot,支持自动补全、文档生成、错误检测及智能人机交互等任务。客观测试显示生成代码质量高,主观调研表明用户接受度良好,验证了系统的可行性与价值,为AI辅助编程提供了新范式。
原文摘要 · Abstract (English)
The advancements in cloud-based Large Languages Models (LLMs) have revolutionized AI-assisted programming. However, their integration into certain local development environments like ones within the Apple software ecosystem (e.g., iOS apps, macOS) remains challenging due to computational demands and sandboxed constraints. This paper presents CAMP, a multi-model AI-assisted programming framework that consists of a local model that employs Retrieval-Augmented Generation (RAG) to retrieve contextual information from the codebase to facilitate context-aware prompt construction thus optimizing the performance of the cloud model, empowering LLMs' capabilities in local Integrated Development Environments (IDEs). The methodology is actualized in Copilot for Xcode, an AI-assisted programming tool crafted for Xcode that employs the RAG module to address software constraints and enables diverse generative programming tasks, including automatic code completion, documentation, error detection, and intelligent user-agent interaction. The results from objective experiments on generated code quality and subjective experiments on user adoption collectively demonstrate the pilot success of the proposed system and mark its significant contributions to the realm of AI-assisted programming.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。