• Home
  • Search
  • Rewriting the Code: A Simple Method for Large Language Model Augmented Code Search
  • Open Access IconOpen Access
  • Cite Icon11
  • https://doi.org/10.18653/v1/2024.acl-long.75Copy DOI Icon

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

  • Jan 1, 2024
  • Haochen Li +2 more
Show More
  • Abstract
  • Literature Map
  • Citations
  • Similar Papers
Abstract

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 https: //github.com/Alex-HaochenLi/ReCo.

Similar Papers
  • Research Article

METHOD OF PARALLEL HYBRID SEARCH FOR LARGE-SCALE CODE REPOSITORIES

  • Sep 22, 2025
  • Radio Electronics Computer Science Control
  • Вікторія Бойко
  • Conference Article
  • Citations63

Relationship-aware code search for JavaScript frameworks

  • Nov 01, 2016
  • Xuan Li +5
  • Research Article
  • Citations3

LLM-assisted Bug Identification and Correction for Verilog HDL

  • Oct 17, 2025
  • ACM Transactions on Design Automation of Electronic Systems
  • Khushboo Qayyum +4
  • Conference Article
  • Citations621

Deep code search

  • May 27, 2018
  • Xiaodong Gu +2
  • Conference Article
  • Citations30

Is a Single Model Enough? MuCoS: A Multi-Model Ensemble Learning Approach for Semantic Code Search

  • Oct 26, 2021
  • Lun Du +5
  • Conference Article
  • Citations69

Are the Code Snippets What We Are Searching for? A Benchmark and an Empirical Study on Code Search with Natural-Language Queries

  • Feb 01, 2020
  • Shuhan Yan +4
  • Research Article
  • Citations1

Optimization of traditional methods for determining the similarity of project names and purchases using large language models

  • Apr 01, 2024
  • Litera
  • Aleksei Aleksandrovich Golikov +2
  • Research Article

DocuMind: An Enterprise-Grade Contextual Information Retrieval System Using Retrieval-Augmented Generation and Java Spring Boot

  • Apr 12, 2026
  • INTERNATIONAL JOURNAL OF SCIENTIFIC RESEARCH IN ENGINEERING AND MANAGEMENT
  • P Nareen +3
  • Research Article
  • Citations69

CRUD-RAG: A Comprehensive Chinese Benchmark for Retrieval-Augmented Generation of Large Language Models

  • Jan 21, 2025
  • ACM Transactions on Information Systems
  • Yuanjie Lyu +9
  • Research Article
  • Citations18

Evaluating text and visual diagnostic capabilities of large language models on questions related to the Breast Imaging Reporting and Data System Atlas 5th edition.

  • Sep 09, 2024
  • Diagnostic and interventional radiology (Ankara, Turkey)
  • Yasin Celal Güneş +3
  • Research Article
  • Citations1

BIMCoder: A Comprehensive Large Language Model Fusion Framework for Natural Language-Based BIM Information Retrieval

  • Jul 08, 2025
  • Applied Sciences
  • Bingru Liu +1
  • PDF
  • Research Article
  • Citations11

Incorporating Code Structure and Quality in Deep Code Search

  • Feb 16, 2022
  • Applied Sciences
  • Hao Yu +3
  • Conference Article
  • Citations1

HiBench: Benchmarking LLMs Capability on Hierarchical Structure Reasoning

  • Aug 03, 2025
  • Zhuohang Jiang +9
  • Conference Article

Balancing Precision and Generalization: Dynamic Instruction Generation for Model Adaptive Zero-Shot Reasoning in LLMs

  • Jul 13, 2025
  • Ruihan Zhu +5
  • Research Article

From Logs to Insights in the Pulp & Paper Industry: Generating Structured Alarm Reports Using LLMs and RAG

  • Oct 25, 2025
  • Jurnal Teknik Informatika (Jutif)
  • Handri Santoso +3
Cactus Communications logo

Copyright 2026 Cactus Communications. All rights reserved.