SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2401.04514 · ACL · 2024

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

Haochen Li, Xin Zhou, Zhiqi Shen

arXiv · PDF · Open in the Atlas

Code that ran

5 of 9 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 2 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 3 failures of our instrument; 4 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2401.04514.json · badge: /api/ran/2401.04514.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
alex-haochenli/reco canonical (classifier label)
classifier basis: census
5 ran · 3 no recorded run
Alex-HaochenLi/ReCo community
Papers with Code archive
0 ran · 1 no recorded run
FunctionStatusWhere it lives
DFG_csharp Ran
ran; our contract draft was wrong, not the code
alex-haochenli/reco/metrics/parser/DFG.py
pointer only (licence: NONE) · get_code("ec263cd21fc00661")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, alex-haochenli/reco when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

calc_score Ran
ran, honoured the contract we drafted
alex-haochenli/reco/metrics/rouge.py
pointer only (licence: NONE) · get_code("ee6b82869d67c8a7")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, alex-haochenli/reco when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

extract_subtrees Ran
ran; our contract draft was wrong, not the code
alex-haochenli/reco/metrics/code_style_sim.py
pointer only (licence: NONE) · get_code("8cc674de4fd3c826")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, alex-haochenli/reco when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

my_lcs Ran
ran, honoured the contract we drafted
alex-haochenli/reco/metrics/rouge.py
pointer only (licence: NONE) · get_code("d6f215d655a876ee")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, alex-haochenli/reco when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

pad_sequence Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
alex-haochenli/reco/metrics/utils.py
pointer only (licence: NONE) · get_code("cd90fe437a24c233")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, alex-haochenli/reco when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

DFG_java Not yet run
unverified (harvested, no recorded run)
alex-haochenli/reco/metrics/parser/DFG.py
pointer only (licence: NONE) · get_code("8ad8aef57770407f")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, alex-haochenli/reco when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

DFG_python Not yet run
unverified (harvested, no recorded run)
alex-haochenli/reco/metrics/parser/DFG.py
pointer only (licence: NONE) · get_code("e9c213ae4e45bf1b")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, alex-haochenli/reco when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

collect_corpus Not yet run
unverified (harvested, no recorded run)
alex-haochenli/reco/ReCo/prepare_bm25_data.py
pointer only (licence: NONE) · get_code("eb0d2a3d9e5a7c18")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, alex-haochenli/reco when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

collect_query Not yet run
unverified (harvested, no recorded run)
Alex-HaochenLi/ReCo/ReCo/bm25.py
pointer only (licence: NONE) · get_code("fe4aede7dc3dd319")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, Alex-HaochenLi/ReCo when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 5 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 0 the same month, 1 later) and 4 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
pad_sequence 10 other papers
7 dated earlier, 3 later
1909.09436 (2019-09)
CodeSearchNet Challenge: Evaluating the State of Semantic Code Search
1911.04700 (2019-11)
A Pre-training Based Personalized Dialogue Generation Model with Persona-sparse Data
2009.10297 (2020-09)
CodeBLEU: a Method for Automatic Evaluation of Code Synthesis
and 7 more not named here
my_lcs 7 other papers
7 dated earlier
1503.01817 (2015-03)
YFCC100M: The New Data in Multimedia Research
1608.00272 (2016-08)
Modeling Context in Referring Expressions
1802.06842 (2018-02)
Zero-Shot Question Generation from Knowledge Graphs for Unseen Predicates and Entity Types
and 4 more not named here
DFG_csharp 1 other paper
1 dated earlier
2009.10297 (2020-09)
CodeBLEU: a Method for Automatic Evaluation of Code Synthesis
DFG_java 1 other paper
1 dated earlier
2009.10297 (2020-09)
CodeBLEU: a Method for Automatic Evaluation of Code Synthesis
DFG_python 1 other paper
1 dated earlier
2009.10297 (2020-09)
CodeBLEU: a Method for Automatic Evaluation of Code Synthesis

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

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.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2401.04514")
get_code_for_paper("2401.04514")
have("2401.04514")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2401.04514.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2401.04514.svg)](https://syntology.ai/paper/2401.04514)

Connect an agent — have() is free.