paper-with-me

홈 › Papers

Do not copy and paste! Rewriting strategies for code retrieval

2026-05-08 · Andrea Gurioli, Federico Pennino, Maurizio Gabbrielli arxiv

Embedding-based code retrieval often suffers when encoders overfit to surface syntax. Prior work mitigates this by using LLMs to rephrase queries and corpora into a normalized style, but leaves two questions open: how much representational shift helps, and when is the per-query LLM call justified? We study a hierarchy of three rewriting strategies: stylistic rephrasing, NL-enriched PseudoCode, and full Natural-Language transcription, under joint query-corpus (QC, online) and corpus-only (C, offline) augmentation, across six CoIR benchmarks, five encoders, and three rewriters spanning independent model families (Qwen, DeepSeek, Mistral). We are the first to evaluate NL-enriched PseudoCode and snippet-level Natural Language as direct retrieval representations, rather than as transient intermediates. Full NL rewriting with QC yields the largest gains (+0.51 absolute NDCG@10 on CT-Contest for MoSE-18), while corpus-only rewriting degrades retrieval in 56 of 90 configurations, about 62%. We introduce two diagnostics, Delta H, token entropy, and Delta s, embedding cosine, and show that Delta H predicts retrieval gain under QC across all three rewriter families: pooled Spearman rho = +0.436, p < 0.001 on DeepSeek+Codestral; rho = +0.593 on Codestral alone; rho = +0.356 on Qwen. This establishes Delta H as a cheap, rewriter-agnostic proxy for deciding when rewriting pays off before running retrieval. Our analysis reframes LLM rewriting as a cost-benefit decision: it is most effective as a remediation layer for lightweight encoders on code-dominant queries, with diminishing returns for strong encoders or NL-heavy queries.

📄 PDF Abstract BibTeX arXiv:2605.08299

Code (0)

등록된 구현이 없습니다.

Similar Papers 제목 키워드 기반

Copy-Paste to Mitigate Large Language Model Hallucinations

2025-10-01 · Yongchao Long, Xian Wu, Yingying Zhang, Xianbin Wen 외 arxiv

While Retrieval-Augmented Generation (RAG) enables large language models (LLMs) to generate contextually grounded responses, contextual faithfulness remains challenging as LLMs may not consistently trust provided context…

Staging E-Commerce Products for Online Advertising using Retrieval Assisted Image Generation

2023-07-28 · Yueh-Ning Ku, Mikhail Kuznetsov, Shaunak Mishra, Paloma de Juan

Online ads showing e-commerce products typically rely on the product images in a catalog sent to the advertising platform by an e-commerce platform. In the broader ads industry such ads are called dynamic product ads (DP…

Generative Adversarial NetworkImage GenerationRetrieval

Depth-Copy-Paste: Multimodal and Depth-Aware Compositing for Robust Face Detection

2025-12-12 · Qiushi Guo arxiv

Data augmentation is crucial for improving the robustness of face detection systems, especially under challenging conditions such as occlusion, illumination variation, and complex environments. Traditional copy paste aug…

Data AugmentationFace Detection

Unsupervised Context Rewriting for Open Domain Conversation

2019-10-18 · IJCNLP 2019 11 · Kun Zhou, Kai Zhang, Yu Wu, Shujie Liu 외

Context modeling has a pivotal role in open domain conversation. Existing works either use heuristic methods or jointly learn context modeling and response generation with an encoder-decoder framework. This paper propose…

DecoderReinforcement LearningReinforcement Learning (RL)Response Generation+1

AdaptivePaste: Code Adaptation through Learning Semantics-aware Variable Usage Representations

2022-05-23 · Xiaoyu Liu, Jinu Jang, Neel Sundaresan, Miltiadis Allamanis 외

In software development, it is common for programmers to copy-paste or port code snippets and then adapt them to their use case. This scenario motivates the code adaptation task -- a variant of program repair which aims …

Program Repair