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

Preprint Sep 2026

Quality over Quantity: Diversity-Aware Data Selection for Efficient Verilog Code Generation

Large Language Models (LLMs) have shown remarkable potential in Verilog code generation, yet existing datasets contain con siderable noise and redundancy. Prior data selection methods address only isolated quality aspects, neglect the global diversity of the training set, and cannot capture Verilog-specific structural...

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.

Aaron 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

MIT News · Artificial Intelligence Oct 15, 2026

AI model decodes the language cells use to communicate

A new computational approach reveals how cells communicate to assemble into tissues. This could accelerate stem cell engineering, improve disease models, and inform therapies.

Microsoft Research Blog Oct 15, 2026

Proof-based general-purpose computing with Magnetar

Zero-knowledge proofs can verify computing results without rerunning workloads or exposing sensitive data. Magnetar helps bring them into the mainstream with support for standard programming languages, major speed gains, and quantum-resistant security. The post Proof-based general-purpose computing with Magnetar appeared first on Microsoft Research.

MIT News · Artificial Intelligence Sep 24, 2026

Estimating suicide risk from text

A new language-processing tool could help identify the highest-risk individuals from natural language, enabling swifter interventions.

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