acceptodds
Under review as a conference paper at ICLR 2027

CoRTL: Combination Utility Guided Context Retrieval for Repository-Level RTL Code Completion

Abstract

Completing register-transfer level (RTL) code within repositories often requires declarations distributed across multiple chunks, making context selection sensitive to interactions among retrieved chunks. We show that selecting chunks by individual utility frequently misses higher-utility combinations. We introduce CoRTL, a fill-in-the-middle (FIM) completion framework that learns from context combinations. Our method, combination utility search, uses a fixed generator to score combinations by their reduction in mean per-token cross-entropy on the reference target code relative to in-file context alone. The selected combinations provide candidate-level ranking supervision for a context reranker and cross-file context for fine-tuning a completion generator to predict the reference target code. We also construct 47,647 FIM training examples and introduce RealBench-FIM, a repository-level RTL FIM benchmark with testbench-based functional correctness evaluation. With a 0.6B reranker and a 7B completion generator, CoRTL achieves 75.31% func@1 on RealBench-FIM and 66.78% exact match on RTL-Repo, outperforming RLCoder and RepoShapley and exceeding GPT-5.4 by 6.34% and 4.17%, respectively, without using a larger teacher model for supervision construction.

Then back it, or bet against it.

Related papers

Open the market on this paper to see 7 more related papers.