We introduce a Bayesian latent-variable framework to diagnose and quantify “sycophancy” in large language models (LLMs). Our model defines a hidden agreement score \(S_{i,m,u,p}\sim \mathcal {N}(0,\sigma _S^2)\) and a ternary flip indicator \(\Delta _{i,m,u,p}\in \{-1,0,1\}\) to distinguish regressive (accuracy-decreasing) and progressive (accuracy-increasing) shifts. We embed \(S\) into a generative logistic model with model-specific sensitivity \(\gamma _m\) and perform full posterior inference via Markov chain Monte Carlo (MCMC), yielding complete uncertainty quantification. To characterize sycophantic behavior, we introduce four metrics: overall flip rate \(\widehat{\pi }\) , directional share \(\widehat{\pi }_+\) , average latent strength \(\mathbb {E}[|S|]\approx 0.80\,\sigma _S\) , and model susceptibility \(\widehat{\gamma }_m\) . In simulations with \(\sigma _S\) varying from 0.1 to 2.0 and \(\gamma _m\in \{-1.0,-0.5,0.1,0.5,1.0\}\) , we observe a stable flip rate near 50%, average latent pull matching the theoretical 0.798 \(\sigma _S\) , and clear progressive versus regressive biases aligned with the sign of \(\gamma _m\) . This principled, interpretable toolkit enables comparative auditing of sycophantic tendencies across LLMs and guides targeted mitigation strategies. Simulation code for this study is available at: https://github.com/ParthaPRay/Sycophancy_in_LLM_model.