paper-with-me

Papers

Mitigating LLM Sycophancy in Code Smell Detection Using Evidence-Guided Reasoning Prompts

2026-07-11 · Istiaq Ahmed Fahad, Kamruzzaman Asif, Md. Nurul Ahad Tawhid arxiv

Large Language Models (LLMs) are increasingly used for code smell detection tasks due to their ability to interpret program semantics. However, their reliability in this context remains poorly explored, particularly under varying prompt conditions where model predictions may be influenced by external cues rather than code characteristics. One such limitation is sycophancy bias, where models tend to align their outputs with user-provided assumptions instead of performing objective analysis. In this paper, we present the first systematic empirical study of sycophancy bias in LLM-based code smell detection. Using the MLCQ dataset, we evaluate how different prompt framings like confirmation bias, contradictory hints, and false premises affect model predictions. Our results show that LLMs are highly sensitive to prompt variations, with Decision Flip Rates reaching up to 72% and False Alignment Rates exceeding 90%, indicating substantial instability and agreement with misleading prompts. To address this issue, we propose Evidence-Guided Debiasing Prompting (EGDP), a structured prompting strategy that enforces evidence-first reasoning. EGDP reduces decision instability and improves robustness, lowering Decision Flip Rates to as low as 12% and False Alignment Rates to as low as 21%, while increasing reliance on structurally grounded evidence. Our findings demonstrate that sycophancy bias poses a critical threat to the reliability of LLM-based code smell detection, and that evidence-guided reasoning provides an effective and generalizable mitigation approach.

📄 PDF Abstract BibTeX arXiv:2607.10411

Code (0)

등록된 구현이 없습니다.

Similar Papers 제목 키워드 기반

Benchmarking and Mitigating Sycophancy in Medical Vision Language Models

2025-09-26 · Juangui Xu, Zikun Guo, Jingwei Lv, Hongbin Lin 외 arxiv

Visual language models (VLMs) have the potential to transform medical workflows. However, the deployment is limited by sycophancy. Despite this serious threat to patient safety, a systematic benchmark remains lacking. Th…

Visual Question Answering

Specification and Detection of LLM Code Smells

2025-12-19 · Brahim Mahmoudi, Zacharie Chenail-Larcher, Naouel Moha, Quentin Stiévenart 외 arxiv

Large Language Models (LLMs) have gained massive popularity in recent years and are increasingly integrated into software systems for diverse purposes. However, poorly integrating them in source code may undermine softwa…

Follow Your Nose -- Which Code Smells are Worth Chasing?

2021-03-02 · Idan Amit, Nili Ben Ezra, Dror G. Feitelson

The common use case of code smells assumes causality: Identify a smell, remove it, and by doing so improve the code. We empirically investigate their fitness to this use. We present a list of properties that code smells …

SWAY: A Counterfactual Computational Linguistic Approach to Measuring and Mitigating Sycophancy

2026-04-02 · Joy Bhalla, Kristina Gligorić arxiv

Large language models exhibit sycophancy: the tendency to shift outputs toward user-expressed stances, regardless of correctness or consistency. While prior work has studied this issue and its impacts, rigorous computati…

LLM Code Smells: A Taxonomy and Detection Approach

2026-05-21 · Zacharie Chenail-Larcher, Brahim Mahmoudi, Naouel Moha, Quentin Stiévenart 외 arxiv

Large Language Models (LLMs) are increasingly integrated into software systems for diverse purposes, due to their versatility, flexibility, and ability to simulate human reasoning to some extent. However, poor integratio…