보는 것 ≠ 이해하는 것: LLM에게 코드 생성을 위해 비공개 라이브러리를 사용하는 방법을 가르치는 방법
To See is Not to Master: Teaching LLMs to Use Private Libraries for Code Generation
대규모 언어 모델(LLM)은 코드 생성에 강력한 잠재력을 보여주었지만, 비공개 라이브러리 기반 코드 생성에는 여전히 한계가 있습니다. 비공개 라이브러리 기반 코드 생성은 비공개 라이브러리의 API를 사용하여 코드를 생성하는 것을 목표로 합니다. 기존 접근 방식은 주로 비공개 라이브러리 API 문서를 검색하고 추론 시 관련 지식을 컨텍스트에 주입하는 방식에 의존합니다. 그러나 본 연구에서는 이러한 방식이 충분하지 않다는 것을 보여줍니다. 즉, 정확한 필수 지식을 제공하더라도 LLM은 여전히 비공개 라이브러리 API를 효과적으로 호출하는 데 어려움을 겪습니다. 이러한 한계를 극복하기 위해, 우리는 자동으로 생성된 데이터를 사용하여 LLM이 비공개 라이브러리 API를 호출하도록 훈련하는 방법인 PriCoder를 제안합니다. 구체적으로, PriCoder는 비공개 라이브러리 데이터 생성을 그래프 구조로 모델링하고, 두 가지 그래프 연산자를 번갈아 사용합니다. (1) Progressive Graph Evolution은 기본 데이터에서 더 다양한 훈련 샘플을 점진적으로 생성하여 데이터 다양성을 향상시키고, (2) Multidimensional Graph Pruning은 엄격한 필터링 파이프라인을 통해 데이터 품질을 향상시킵니다. 엄격한 평가를 지원하기 위해, 본 연구에서는 테스트 모델이 익숙하지 않은 최근에 출시된 라이브러리를 기반으로 두 개의 새로운 벤치마크를 구축했습니다. 세 가지 주요 LLM에 대한 실험 결과, PriCoder는 비공개 라이브러리 기반 코드 생성을 크게 향상시키며, 많은 경우에서 pass@1 비율을 20% 이상 향상시키는 동시에 일반적인 코드 생성 능력에는 미미한 영향을 미칩니다. 본 연구의 코드와 벤치마크는 https://github.com/contact-eniacode/PriCoder 에서 공개적으로 이용할 수 있습니다.
Large Language Models (LLMs) have shown strong potential for code generation, yet they remain limited in private-library-oriented code generation, where the goal is to generate code using APIs from private libraries. Existing approaches mainly rely on retrieving private-library API documentation and injecting relevant knowledge into the context at inference time. However, our study shows that this is insufficient: even given accurate required knowledge, LLMs still struggle to invoke private-library APIs effectively. To address this limitation, we propose PriCoder, an approach that teaches LLMs to invoke private-library APIs through automatically synthesized data. Specifically, PriCoder models private-library data synthesis as the construction of a graph, and alternates between two graph operators: (1) Progressive Graph Evolution, which improves data diversity by progressively synthesizing more diverse training samples from basic ones, and (2) Multidimensional Graph Pruning, which improves data quality through a rigorous filtering pipeline. To support rigorous evaluation, we construct two new benchmarks based on recently released libraries that are unfamiliar to the tested models. Experiments on three mainstream LLMs show that PriCoder substantially improves private-library-oriented code generation, yielding gains of over 20% in pass@1 in many settings, while causing negligible impact on general code generation capability. Our code and benchmarks are publicly available at https://github.com/contact-eniacode/PriCoder.
No Analysis Report Yet
This paper hasn't been analyzed by Gemini yet.
Log in to request an AI analysis.