paper-with-me

홈 › Papers

When Many-Shot Prompting Fails: An Empirical Study of LLM Code Translation

2025-10-19 · Amirkia Rafiei Oskooei, Kaan Baturalp Cosdan, Husamettin Isiktas, Mehmet S. Aktas arxiv

Large Language Models (LLMs) with vast context windows offer new avenues for in-context learning (ICL), where providing many examples ("many-shot" prompting) is often assumed to enhance performance. We investigate this assumption for the complex task of code translation. Through a large-scale empirical study of over 90,000 translations, we systematically evaluate the impact of scaling in-context examples from zero-shot to many-shot configurations of up to 625 examples, with prompts spanning from approximately 100,000 to 800,000 tokens. Our findings reveal a "many-shot paradox": while static similarity metrics may modestly improve with more examples, functional correctness consistently peaks with few-shot prompting (5-25 examples). Providing substantially more examples often degrades this crucial functional performance. This study highlights that for code translation, the quality of a few well-chosen examples outweighs sheer quantity, challenging the universal efficacy of "more is better" for ICL and underscoring the task-dependent nature of optimal prompting strategies. Our results have significant implications for effectively leveraging LLMs in software engineering.

📄 PDF Abstract BibTeX arXiv:2510.16809

Code (0)

등록된 구현이 없습니다.

Tasks

Code Translation

Similar Papers 제목 키워드 기반

Test-Time Adaptation via Many-Shot Prompting: Benefits, Limits, and Pitfalls

2026-03-06 · Shubhangi Upasani, Chen Wu, Jay Rainton, Bo Li 외 arxiv

Test-time adaptation enables large language models (LLMs) to modify their behavior at inference without updating model parameters. A common approach is many-shot prompting, where large numbers of in-context learning (ICL…

Test-time Adaptation

Show or Tell? Effectively prompting Vision-Language Models for semantic segmentation

2025-03-25 · Niccolo Avogaro, Thomas Frick, Mattia Rigotti, Andrea Bartezzaghi 외

Large Vision-Language Models (VLMs) are increasingly being regarded as foundation models that can be instructed to solve diverse tasks by prompting, without task-specific training. We examine the seemingly obvious questi…

Few-Shot LearningSegmentationSemantic Segmentation

Soft Guidance Starts to Outperform CoT Prompting as LLMs Improve

2026-08-04 · Denys Pushkin, Albert Q. Jiang, Aryo Lotfi, Colin Sandon 외 arxiv

Chain-of-Thought (CoT) prompting remains the standard baseline for evaluating models' reasoning abilities. Originally, this technique was introduced to elicit step-by-step reasoning from large language models (LLMs), whi…

Do Prompts Solve NLP Tasks Using Natural Language?

2022-01-16 · ACL ARR January 2022 1 · Anonymous

Thanks to the advanced improvement of large pre-trained language models, prompt-based fine-tuning is shown to be effective on a variety of downstream tasks.Though many prompting methods have been investigated, it remains…

Do Prompts Solve NLP Tasks Using Natural Language?

2022-03-02 · Sen yang, Yunchen Zhang, Leyang Cui, Yue Zhang

Thanks to the advanced improvement of large pre-trained language models, prompt-based fine-tuning is shown to be effective on a variety of downstream tasks. Though many prompting methods have been investigated, it remain…