Papers › On the Noise Robustness of In-Context Learning for Text Generation

On the Noise Robustness of In-Context Learning for Text Generation

27 May 2024arXiv:2405.17264archive 2025-07-28

Hongfu Gao, Feipeng Zhang, Wenyu Jiang, Jun Shu, Feng Zheng, Hongxin Wei

Large language models (LLMs) have shown impressive performance on downstream tasks by in-context learning (ICL), which heavily relies on the quality of demonstrations selected from a large set of annotated examples. Recent works claim that in-context learning is robust to noisy demonstrations in text classification. In this work, we show that, on text generation tasks, noisy annotations significantly hurt the performance of in-context learning. To circumvent the issue, we propose a simple and effective approach called Local Perplexity Ranking (LPR), which replaces the "noisy" candidates with their nearest neighbors that are more likely to be clean. Our method is motivated by analyzing the perplexity deviation caused by noisy labels and decomposing perplexity into inherent perplexity and matching perplexity. Our key idea behind LPR is thus to decouple the matching perplexity by performing the ranking among the neighbors in semantic space. Our approach can prevent the selected demonstrations from including mismatched input-label pairs while preserving the effectiveness of the original selection methods. Extensive experiments demonstrate the effectiveness of LPR, improving the EM score by up to 18.75 on common benchmarks with noisy annotations. Our code is available at https://github.com/ml-stat-Sustech/Local-Perplexity-Ranking.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2405.17264")

Code

Syntology Ran 5 of 11 code samples harvested from 1 repository linked to this paper; 6 have no recorded run. Of those that ran: 5 ran with no contract checked.

By repository: official repository: 11 samples from 1 repository, 5 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

ml-stat-sustech/local-perplexity-ranking officialmentioned in papermentioned on GitHubpytorchApache-2.0 report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

11 samples harvested; 5 ran; 0 honoured the contract we drafted; 6 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

5ran
6unverified

Licence: 0 of the 11 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from ml-stat-Sustech/Local-Perplexity-Ranking. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

get_inputes ml-stat-Sustech/Local-Perplexity-Ranking/common/utils.py official repository ran Apache-2.0 (permissive) · 29e3b3506f0f02c6 · report
get_logger ml-stat-Sustech/Local-Perplexity-Ranking/common/logging.py official repository ran Apache-2.0 (permissive) · 792a2c8b12b13057 · report
get_prompt_label ml-stat-Sustech/Local-Perplexity-Ranking/common/utils.py official repository ran Apache-2.0 (permissive) · 14ee44efe36afcfb · report
ignore_pad_dict ml-stat-Sustech/Local-Perplexity-Ranking/common/collators.py official repository ran Apache-2.0 (permissive) · 4753b3ba80fb1cca · report
is_api_available ml-stat-Sustech/Local-Perplexity-Ranking/common/api.py official repository ran Apache-2.0 (permissive) · aa66004e48501c30 · report
api_get_ppl ml-stat-Sustech/Local-Perplexity-Ranking/common/api.py official repository unverified Apache-2.0 (permissive) · fc0a9b057f213a9a · report
api_get_tokens ml-stat-Sustech/Local-Perplexity-Ranking/common/api.py official repository unverified Apache-2.0 (permissive) · 430c98669fe41c1a · report
get_dataloader ml-stat-Sustech/Local-Perplexity-Ranking/dataset/utils.py official repository unverified Apache-2.0 (permissive) · de0caf0b39aa6452 · report
get_model ml-stat-Sustech/Local-Perplexity-Ranking/model/utils.py official repository unverified Apache-2.0 (permissive) · 58927e35b21bb640 · report
get_retriever ml-stat-Sustech/Local-Perplexity-Ranking/algorithms/utils.py official repository unverified Apache-2.0 (permissive) · 9350b61b9bb071e4 · report
get_tokenizer ml-stat-Sustech/Local-Perplexity-Ranking/model/utils.py official repository unverified Apache-2.0 (permissive) · a9c86da890c793a6 · report

Tasks

In-Context LearningText ClassificationText Generationtext-classification

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

SET

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections