23 Feb 2024 | Ming Liang, Xiaoheng Xie, Gehao Zhang, Xunjin Zheng, Peng Di, Wei Jiang, Hongwei Chen, Chengpeng Wang, Gang Fan
REPOFUSE is a novel approach for repository-level code completion that effectively addresses the Context-Latency Conundrum by fusing two types of context: analogy context and rationale context. This method enhances code completion accuracy while maintaining inference efficiency. REPOFUSE employs a novel rank truncated generation (RTG) technique to condense these contexts into prompts with restricted size, enabling precise code completions without significant latency. Through testing with the CrossCodeEval benchmark, REPOFUSE achieves a 40.90% to 59.75% increase in exact match (EM) accuracy for code completions and a 26.8% enhancement in inference speed. REPOFUSE has been integrated into a large enterprise's workflow, supporting various coding tasks. The method leverages the rationale context, which captures semantic relationships, and the analogy context, which identifies code segments with similar functionality. By combining these contexts, REPOFUSE provides a richer, more relevant prompt for code completion. The RTG technique ensures that the prompt remains concise while retaining essential information, leading to improved performance and efficiency. REPOFUSE's effectiveness is validated through extensive experiments, demonstrating its superiority over existing methods in terms of accuracy and speed. The approach is designed to be efficient and scalable, making it suitable for real-world applications where fast response times are critical.REPOFUSE is a novel approach for repository-level code completion that effectively addresses the Context-Latency Conundrum by fusing two types of context: analogy context and rationale context. This method enhances code completion accuracy while maintaining inference efficiency. REPOFUSE employs a novel rank truncated generation (RTG) technique to condense these contexts into prompts with restricted size, enabling precise code completions without significant latency. Through testing with the CrossCodeEval benchmark, REPOFUSE achieves a 40.90% to 59.75% increase in exact match (EM) accuracy for code completions and a 26.8% enhancement in inference speed. REPOFUSE has been integrated into a large enterprise's workflow, supporting various coding tasks. The method leverages the rationale context, which captures semantic relationships, and the analogy context, which identifies code segments with similar functionality. By combining these contexts, REPOFUSE provides a richer, more relevant prompt for code completion. The RTG technique ensures that the prompt remains concise while retaining essential information, leading to improved performance and efficiency. REPOFUSE's effectiveness is validated through extensive experiments, demonstrating its superiority over existing methods in terms of accuracy and speed. The approach is designed to be efficient and scalable, making it suitable for real-world applications where fast response times are critical.