CCCI: Code Completion with Contextual Information for Complex Data Transfer Tasks Using Large Language Models
Hangzhan Jin, Mohammad Hamdaqa · 2025
Read CCCI: Code Completion with Contextual Information for Complex Data Transfer Tasks Using Large Language Models by Hangzhan Jin, Mohammad Hamdaqa (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2503-23231.txt.
Introduction
Hangzhan Jin and Mohammad Hamdaqa introduced CCCI in twenty twenty-five, a method that helps language models complete code inside large existing systems. Completing code is harder than writing it fresh: the model must respect variable scope, object models, and database links around the gap. For data transfer code, which leans heavily on such links, acceptance of suggestions can fall well below a third.
CCCI feeds the model the missing context: table relations, object models, and library details. The team tested it on nearly three hundred Java snippets drawn from over eight hundred working industrial scripts. It reached build pass rates near forty-nine percent and code match scores on par with leading methods. The study shows context, not just model size, drives useful completions for enterprise code.
Catalog record
| CREATOR | Hangzhan Jin, Mohammad Hamdaqa |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 41 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2503-23231
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
CCCI: Code Completion with Contextual Information for Complex Data Transfer Tasks Using Large Language Models Hangzhan Jin, Mohammad Hamdaqa Abstract Unlike code generation, which involves creating code from scratch, code completion focuses on integrating new lines or blocks of code into an existing codebase. This process requires a deep understanding of the surrounding context, such as variable scope, object models, API calls, and database relations, to produce accurate results. These complex contextual dependencies make code completion a particularly challenging problem. Current models and approaches often fail to effectively incorporate such context, leading to inaccurate completions with low acceptance rates (around 30%). For tasks like data transfer, which rely heavily on specific relationships and data structures, acceptance rates drop even further. This study introduces CCCI, a novel method for generating context-aware code completions specifically designed to address data transfer tasks. By integrating contextual information, such as database table relationships, object models, and library details into Large Language Models (LLMs), CCCI improves the accuracy of code completions. We evaluate CCCI using 289 Java snippets, extracted from over 819 operational scripts in an industrial setting. The results demonstrate that CCCI achieved a 49.1% Build Pass rate and a 41.0% CodeBLEU score, comparable to state-of-the-art methods that often struggle with complex task completion. Keywords: Code Completion, Large Language Models (LLMs), Data Transfer, Contextual Information 1 Introduction Recent advancements in Large Language Models (LLMs) like GPT and Copilot [ 1 ] have demonstrated the potential in code completion tasks [ 2 , 3 ] , thereby enhancing developer productivity. Despite these advancements, the acceptance rates for these tools remain low [ 4 , 5 ] , primarily due to their generation of generic, context-agnostic code. Prior studies in automated code completion face several significant limitations. Many approaches rely solely on integrating existing libraries [ 6 , 7 ] , recommending APIs [ 8 , 9 ] based on those libraries without considering data structure or relations. Others require extensive labelled data for fine-tuning [ 10 ] or pre-training [ 11 , 12 , 13 ] and demand developers to provide pseudo-code [ 14 , 15 ] , which is labor-intensive and not scalable for large systems. Additionally, some methods focus only on retrieving [ 16 ] or searching [ 17 ] similar code examples for code suggestions, and some methods pay more attention to predicting code completion invocation [ 10 ] , neglecting the contextual information like code comments [ 18 , 19 ] embedded in the applications of enterprises. These methods fail to leverage the real-time data structure and relations present in current software development, resulting in code completions that often lack relevance, especially in data transfer tasks. This gap highlights the need for a more sophisticated approach that can integrate detailed contextual information to enhance the relevance and applicability of code completion. Given the aforementioned challenges, our study aims to refine the integration of contextual information into LLMs. We hypothesize that this enriched context can improve the utility and accuracy of automatic code completion in data transfer tasks. By addressing these research gaps, our work seeks to pave the way for more sophisticated, context-aware tools that can genuinely enhance developer efficiency. The significance of our research lies in addressing this gap by integrating contextual information—such as database table relations, existing object models, and specific API usage—directly into LLMs. This approach aims to produce higher accuracy code, thereby potentially increasing the practical utility of these models in real-world software development environments. The main contributions of our paper are summarized as follows: • We propose a retrieval-augmented code completion approach that can retrieve code from the current project and its complex dependencies and integrate different LLMs to improve code completion performance. • We perform a comprehensive evaluation of our approach, and the results illustrate that our approach improves the GPT-4o by up to 142.6% in terms of CodeBLEU, the Build Pass rate improved dramatically from 0% to 49.1%. • We examine the performance of our approach in six popular open-source and closed-source LLMs, and the results show our approach can produce a noticeable improvement in those models compared to the GPT-4o model with an original prompt. The structure of this paper is organized as follows: Section II introduces the challenges of code completion for data transfer tasks necessary for understanding the concepts discussed. Section III details our research methodology. Section IV presents the empirical evaluation of the CCCI method. Section V reviews related work to contextualize our study within the current state of research. Section VI identifies potential threats to the validity of our study, and Section VII concludes the paper with a summary of our contributions and future research directions. 2 Challenges of Code Completion for Data Transfer Tasks Figure 1: A common data transfer scenario To illustrate the challenges of code completion for data transfer tasks, we will start by explaining a case study of a Warehouse Management System (WMS) and use this case study to highlight the challenges as well as showcase the steps in our approach. Data transfer tasks are repetitive and complex tasks that developers frequently encounter in real software development, transforming one or more input objects from different data sources like APIs or databases into an output object by mapping fields to the required format [ 20 , 21 ] . This involves converting front-end request parameters into the format required by third-party services and modifying service outputs to meet the website’s needs. As shown in Figure 1 , a developer needs to understand the database Relations based on Entity Relationship Graph, API information with data structures in both document and source code, and external libraries to guide programming for the tasks. This process demands extensive time to understand the contextual information [ 22 , 23 ] for programming. While capable of generating high-quality code, it often requires developers to invest substantial effort in preparing detailed prompts and contextual background, which can be as time-consuming as manual coding, and the quality of generated code depends on developers’ skill to write prompts [ 24 , 25 , 26 ] , making it difficult for them to adopt code completion to finish data transfer tasks manually. 2.1 Case Study We explore the application of our CCCI methodology within a real enterprise’s WMS. A WMS typically integrates with numerous external systems and is designed to optimize warehouse operations by streamlining tasks such as inventory management, order fulfillment, and logistics. The WMS under study in our research includes 111 tables, 2204 columns, and nine external libraries. In such a system, using LLMs for data transfer tasks needs to analyze the hierarchical data structures and flatten them into text by recursively retrieving data file information within current projects and the nine third-party dependencies, then combine the text with DB relationships and task definitions to construct the intricate prompt to guide LLMs implementing the code completion. The study’s goal is to automate this process and use the WMS system to verify our approach. We use a data transfer task that maps the classes and field information from four input models: InventoryInfoDTO, SKUInfoDTO, UserDTO, and WarehouseDTO (Listing 1) to the output model InventoryResponseDTO (Listing 2) as a showcase to illustrate the challenges of this task due