SynH-Rank: Quality-Aware Code Search via Diverse Data Synthesis and Hierarchical Ranking Training
On the map: Synthetic data and self-improvement for LLMs → Code and instruction data synthesis
Abstract (arXiv)
Code search enhances developer productivity by enabling efficient code reuse. Current code search systems often use a retrieve-then-rerank pipeline, where rerankers focus on modeling semantic relevance between queries and code. However, these rerankers overlook critical non-functional qualities like execution speed, memory usage, and maintainability, which are essential for practical software development. Studies reveal developers expect results to maintain high coding standards and satisfy specific needs, such as resource optimization, highlighting the importance of quality-aware code search. Achieving quality-aware code search faces two major challenges: the scarcity of quality-annotated datasets for effective training and the limitations of standard contrastive learning objectives, which fail to capture the ordinal relationships among high-quality, low-quality, and irrelevant code. Although contrastive learning excels in distinguishing relevant from irrelevant code, its binary objective does not support nuanced quality distinctions. To address these challenges, we propose SynH-Rank, a quality-aware code reranking framework that combines LLM-driven diverse data synthesis with hierarchical ranking training. SynH-Rank employs a three-level labeling scheme to explicitly model the hierarchy: high-quality relevant > low-quality relevant > irrelevant. Additionally, we introduce a new benchmark with 4,209 pairs and two novel metrics: Quality Preference Accuracy (QPA) for assessing prioritization of high-quality code and Multi-Condition Accuracy (MCA) for evaluating performance under complex constraints. Experimental results show SynH-Rank improves QPA by 20.15% over backbone models and outperforms standard relevance-only contrastive training by 15.80%, while simultaneously enhancing traditional relevance metrics and multi-condition generalizability.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Placed in Code and instruction data synthesis, one of 13 directions in Synthetic data and self-improvement for LLMs. Builds on 34 of its 46 references that are in the map. First posted on arXiv 19 Jul 2026.
Builds on
34 of 46 references.
References · 34
- 2025Qwen3 Technical Reportcited by 8,820
- 2018Representation Learning with Contrastive Predictive Codingcited by 7,777
- 2020Dense Passage Retrieval for Open-Domain Question Answeringcited by 3,824
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
- 2025Qwen3 Embedding: Advancing Text Embedding and Reranking Through Foundation Modelscited by 1,261
- 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,181
- 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 654
- 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 609
- 2023C-Pack: Packed Resources For General Chinese Embeddingscited by 578
- 2020CodeBLEU: a Method for Automatic Evaluation of Code Synthesiscited by 479
- 2020Document Ranking with a Pretrained Sequence-to-Sequence Modelcited by 376
- 2022UniXcoder: Unified Cross-Modal Pre-training for Code Representationcited by 361
22 more
- 2019Multi-Stage Document Ranking with BERTcited by 201
- 2021CodeNet: A Large-Scale AI for Code Dataset for Learning a Diversity of Coding Taskscited by 200
- 2023TACO: Topics in Algorithmic COde generation datasetcited by 160
- 2021GPL: Generative Pseudo Labeling for Unsupervised Domain Adaptation of Dense Retrievalcited by 119
- 2024FIRST: Faster Improved Listwise Reranking with Single Token Decodingcited by 54
- 2023No Need to Lift a Finger Anymore? Assessing the Quality of Code Generation by ChatGPTcited by 47
- 2024EffiLearner: Enhancing Efficiency of Generated Code via Self-Optimizationcited by 30
- 2024NoFunEval: Funny How Code LMs Falter on Requirements Beyond Functional Correctnesscited by 26
- 2024PerfCodeGen: Improving Performance of LLM Generated Code with Execution Feedbackcited by 24
- 2022CoCoSoDa: Effective Contrastive Learning for Code Searchcited by 22
- 2022Code Search: A Survey of Techniques for Finding Codecited by 18
- 2024Exploring the Capabilities of LLMs for Code Change Related Taskscited by 18
- 2024Pre-training by Predicting Program Dependencies for Vulnerability Analysis Taskscited by 17
- 2025CodeRAG: Finding Relevant and Necessary Knowledge for Retrieval-Augmented Repository-Level Code Completioncited by 12
- 2025MultiConIR: Towards multi-condition Information Retrievalcited by 9
- 2022Code Red: The Business Impact of Code Quality -- A Quantitative Study of 39 Proprietary Production Codebasescited by 8
- 2022Revisiting Code Search in a Two-Stage Paradigmcited by 8
- 2025CoQuIR: A Comprehensive Benchmark for Code Quality-Aware Information Retrievalcited by 6
- 2021Cascaded Fast and Slow Models for Efficient Semantic Code Searchcited by 4
- 2025Clean Code, Better Models: Enhancing LLM Performance with Smell-Cleaned Datasetcited by 3
- 2025UniGenCoder: Merging Seq2Seq and Seq2Tree Paradigms for Unified Code Generationcited by 2
- 2025Zero-Shot Cross-Domain Code Search without Fine-Tuningcited by 2
Built on by
Not cited yet.
Similar, not cited
Close in wording, no citation either way
- 2025Enhancing the Non-Functional Quality Compliance of LLM-Generated Code through Quality-Aware Preference Learning
- 2025Beyond the Surface: A Solution-Aware Retrieval Model for Competition-level Code Generation ↗
- 2025SACL: Understanding and Combating Textual Bias in Code Retrieval with Semantic-Augmented Reranking and Localization
- 2026MAP4CS: A Multi-dimensional Data Pruning Framework for Efficient Code Retriever Fine-tuning
- 2024CoSQA+: Pioneering the Multi-Choice Code Search Benchmark with Test-Driven Agents
- 2025ReCode: Improving LLM-based Code Repair with Fine-Grained Retrieval-Augmented Generation
- 2026Do Not Treat Code as Natural Language: Implications for Repository-Level Code Generation and Beyond
- 2025Practical Code RAG at Scale: Task-Aware Retrieval Design Choices under Compute Budgets