paper-with-me

홈 › Papers

Rewriting the Code: A Simple Method for Large Language Model Augmented Code Search

2024-01-09 · Haochen Li, Xin Zhou, Zhiqi Shen

In code search, the Generation-Augmented Retrieval (GAR) framework, which generates exemplar code snippets to augment queries, has emerged as a promising strategy to address the principal challenge of modality misalignment between code snippets and natural language queries, particularly with the demonstrated code generation capabilities of Large Language Models (LLMs). Nevertheless, our preliminary investigations indicate that the improvements conferred by such an LLM-augmented framework are somewhat constrained. This limitation could potentially be ascribed to the fact that the generated codes, albeit functionally accurate, frequently display a pronounced stylistic deviation from the ground truth code in the codebase. In this paper, we extend the foundational GAR framework and propose a simple yet effective method that additionally Rewrites the Code (ReCo) within the codebase for style normalization. Experimental results demonstrate that ReCo significantly boosts retrieval accuracy across sparse (up to 35.7%), zero-shot dense (up to 27.6%), and fine-tuned dense (up to 23.6%) retrieval settings in diverse search scenarios. To further elucidate the advantages of ReCo and stimulate research in code style normalization, we introduce Code Style Similarity, the first metric tailored to quantify stylistic similarities in code. Notably, our empirical findings reveal the inadequacy of existing metrics in capturing stylistic nuances. The source code and data are available at \url{https://github.com/Alex-HaochenLi/ReCo}.

📄 PDF Abstract BibTeX arXiv:2401.04514

Code (1)

alex-haochenli/reco 공식 구현 pytorch

Tasks

Code GenerationCode SearchLanguage ModelingLanguage ModellingLarge Language ModelNatural Language QueriesRetrieval

Similar Papers 제목 키워드 기반

A Recipe For Arbitrary Text Style Transfer with Large Language Models

2021-09-08 · ACL 2022 5 · Emily Reif, Daphne Ippolito, Ann Yuan, Andy Coenen 외

In this paper, we leverage large language models (LMs) to perform zero-shot text style transfer. We present a prompting method that we call augmented zero-shot learning, which frames style transfer as a sentence rewritin…

SentenceSentence ReWritingStyle TransferText Style Transfer+1

A Recipe For Arbitrary Text Style Transfer with Large Language Models

2021-06-16 · ACL ARR October 2021 10 · Anonymous

In this paper, we leverage large language models (LLMs) to perform zero-shot text style transfer. We present a prompting method that we call augmented zero-shot learning, which frames style transfer as a sentence rewriti…

SentenceSentence ReWritingStyle TransferText Style Transfer+1

DP-MLM: Differentially Private Text Rewriting Using Masked Language Models

2024-06-30 · Stephen Meisenbacher, Maulik Chevli, Juraj Vladika, Florian Matthes

The task of text privatization using Differential Privacy has recently taken the form of $\textit{text rewriting}$, in which an input text is obfuscated via the use of generative (large) language models. While these meth…

Decoder

AddrLLM: Address Rewriting via Large Language Model on Nationwide Logistics Data

2024-11-17 · Qinchen Yang, Zhiqing Hong, Dongjiang Cao, Haotian Wang 외

Textual description of a physical location, commonly known as an address, plays an important role in location-based services(LBS) such as on-demand delivery and navigation. However, the prevalence of abnormal addresses, …

Language ModelingLanguage ModellingLarge Language ModelRetrieval+1

Mitigating Lost-in-Retrieval Problems in Retrieval Augmented Multi-Hop Question Answering

2025-02-20 · Rongzhi Zhu, Xiangyu Liu, Zequn Sun, Yiwei Wang 외

In this paper, we identify a critical problem, "lost-in-retrieval", in retrieval-augmented multi-hop question answering (QA): the key entities are missed in LLMs' sub-question decomposition. "Lost-in-retrieval" significa…

Answer GenerationMulti-hop Question AnsweringQuestion AnsweringRetrieval+1