LLM 프로그램 최적화를 위한 검색 증강 탐색
LLM Program Optimization via Retrieval Augmented Search
June 23, 2026
저자: Sagnik Anupam, Alexander Shypula, Osbert Bastani
cs.AI
초록
최근 연구는 프로그래밍 언어의 핵심 과제인 프로그램 최적화를 위한 대규모 언어 모델(LLM)의 잠재력을 입증했다. 본 논문에서는 Retrieval Augmented Search(RAS)라는 블랙박스 적응 방법을 제안한다. 이 방법은 후보 최적화에 대해 빔 서치를 수행하며, 각 단계에서 느린-빠른 프로그램 쌍으로 구성된 주어진 훈련 데이터셋에서 문맥 내 예제를 검색하여 LLM을 안내한다. 중요한 점은, LLM이 생성한 자연어 설명을 기반으로 문맥 검색을 수행하는 것이 소스 코드 기반 검색보다 훨씬 우수하다는 것을 발견했다는 것이다. 또한 훈련 예제를 본질적으로 훨씬 더 점진적인 '원자적 편집'으로 분해하여 해석 가능성을 개선하는 방법인 AEGIS를 제안한다. RAS가 C++ 프로그램 최적화에서 이전 최신 블랙박스 적응 전략보다 최대 2.06배 더 우수한 성능을 보이며, AEGIS는 훨씬 더 작은 편집을 수행하면서 최대 1.37배 더 우수함을 보여준다. 또한 RAS를 사용하면 기준선 대비 Python 프로그램의 평균 실행 시간 백분위수가 10.27 향상됨을 보여준다.
English
Recent work has demonstrated the potential of large language models (LLMs) for program optimization, a key challenge in programming languages. We propose a blackbox adaptation method called Retrieval Augmented Search (RAS) that performs beam search over candidate optimizations; at each step, it retrieves in-context examples from a given training dataset of slow-fast program pairs to guide the LLM. Critically, we find that performing contextual retrieval based on an LLM-generated natural language description significantly outperforms retrieval based on the source code. We also propose AEGIS, a method for improving interpretability by decomposing training examples into ''atomic edits'' that are significantly more incremental in nature. We show that RAS performs up to 2.06times better than prior state-of-the-art blackbox adaptation strategies on optimizing C++ programs, and that AEGIS performs up to 1.37times better while making significantly smaller edits. We also show that using RAS improves the mean runtime percentile of Python programs by 10.27 compared to baselines.