arXiv AI By Kefeng Duan, Dewu Zheng, Yanlin Wang, Terry Yue Zhuo, Mingwei Liu, Jianxing Yu, Jiachi Chen, Ensheng Shi, Xilin Liu, Yuchi Ma, Zibin Zheng

Adaptive Critical Token-Aware Retrieval for Repository-Level Code Generation

Read the original on arXiv AI →

The Flow has not summarised this story yet — read it at arXiv AI.

arXiv Computation and Language
Oct 16

Enhancing Knowledge Density via Hierarchical Context Pruning for Retrieval-Augmented Repository-Level Code Completion

The paper introduces SaraCoder, a retrieval‑augmented framework that improves knowledge density for repository‑level code completion by pruning redundant context and selectively injecting cross‑file dependency definitions within a fixed token budget. It employs a Hierarchical Feature Optimization module to reduce an over‑complete candidate pool in four stages, freeing tokens for an External‑Aware Identifier Disambiguator. Experiments on CrossCodeEval and RepoEval‑Updated demonstrate that SaraCoder outperforms strong RAG baselines such as GraphCoder and Repocoder across multiple code LLMs without increasing token usage, and achieves synergistic gains when combined with other cross‑file methods.

By Xiaohan Chen, Xiang Chen, Yu Tian, Piji Li, Sheng-Jun Huang, Songcan Chen
arXiv Machine Learning
Oct 22

Code Comprehensor: Hierarchical Documentation and Cross-Modal Retrieval for Large Repositories

Code Comprehensor is a hybrid retrieval‑reasoning framework designed to aid understanding of large codebases. It combines a code dependency callgraph, CodeScribe—which generates hierarchical documentation using code‑aware LLMs—and CodeContrast, a CLIP‑style dual‑encoder that learns aligned text‑code embeddings for fast, semantically precise retrieval. Experiments on OpenCV and a 5M‑LOC proprietary repository show that CodeScribe‑derived supervision improves cross‑modal retrieval accuracy, and LLM‑based evaluation reports over 90% faithfulness.

By Sujoy Roychowdhury, Joseph H. R. Isaac, Jiangning Gao, Martin Klitte, Diarmuid Corcoran