Skip to content

SynH-Rank: Quality-Aware Code Search via Diverse Data Synthesis and Hierarchical Ranking Training

Jul 2026 · arXiv.org · Vol abs/2607.17139 · 0 citations · 46 references
Computer Science

TL;DR

SynH-Rank is proposed, a quality-aware code reranking framework that combines LLM-driven diverse data synthesis with hierarchical ranking training and employs a three-level labeling scheme to explicitly model the hierarchy: high-quality relevant>low-quality relevant>irrelevant.

Abstract

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.

View source

Similar papers

Open access Sep 2026

Quality over quantity: Diversity-aware data selection for efficient verilog code generation

VeriSelector is proposed, the first data selection framework for Verilog code generation that jointly optimizes quality and diversity, and outperforms full-dataset training and state-of-the-art baselines.

Yi-Heng Shen, Wei Zheng, Xiao Wei et al. · 0 citations
#machine learning Preprint Sep 2026

On the Relation between Code Quality and Machine Learning Performance: A Large-scale Empirical Study

A large-scale empirical study of 265,363 Python notebooks submitted to Kaggle competitions found that competition expertise correlates with better performance, fewer ML-specific violations, and slightly more Python errors and refactoring violations.

Marius Mignard, Steven Costiou, Anne Etien · 0 citations
Book Open access Aug 2026

R-Select: A Robust Multi-Metric Data Selection Approach for Fine-Tuning Large Language Models

R-Select, a robust and scalable framework that optimizes data selection with 30 distinct quality metrics, introduces a novel hierarchical optimization strategy that consistently outperforms both heuristic baselines and model-based methods, offering a robust solution for high-quality data curation.

Xin Gao, Xiao-Yang Wang, Yun Zhu et al. · 0 citations
#artificial intelligence Preprint Sep 2026

Retrieval-Augmented Generation for Scientific Code Understanding

The results indicate that front-loading code understanding into a reusable, codebase-specialised vector store enables small local models to deliver grounded and repository-specific answers, making the agent well suited as a privacy-preserving development tool for in-house scientific codebases.

A. Nobile, Andreas Adelmann, Mohsen Sadr · 0 citations
Preprint Aug 2026

SONAR: Task-Aware Code Summary Evaluation for LLM Consumers Without References

Source code summaries have traditionally been evaluated from a human developer's perspective, with quality determined by how closely they resemble developer-written references and how well they align with human preferences. But this overlooks a growing reality: LLM-based tools and agents increasingly consume code summa...

S. Dristi, M. B. Dwyer · 0 citations
#artificial intelligence Preprint Sep 2026

FeatLens: Feature-Guided Dynamic Code Graph Construction and Retrieval for Repository-Level Code Generation

FeatLens builds a feature index that links natural-language feature descriptions to function-level code entities and dynamically constructs a task-specific seed graph from the feature index and applies semantic-structural graph reasoning with personalized PageRank to select a compact reasoning graph.

Xu-Tian Li, Bo Xiong, Yi-Feng Zhu et al. · 0 citations

Related blog posts

Microsoft Research Blog Oct 22, 2026

Flint-interactive: A language for creating interactive data visualizations

Flint-interactive gives AI agents a language for creating interactive visualizations. Click a chart, filter data, highlight related content, and explore beyond the view the author originally chose. The post Flint-interactive: A language for creating interactive data visualizations appeared first on Microsoft Research.

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.