Sycophancy is a generative AI model’s tendency to favor agreement and appeasement over truth, reliability, and accuracy. A model may reverse a correct answer when challenged, invent numbers, or falsify references to support a user’s perspective. section 1.1
Treat model agreement as a claim to inspect, not as evidence:
- Question specific methods or assumptions rather than repeatedly asking, “Are you sure?” section 5.3.4
- Compare generated findings with raw records, executed code, and the intended analytical context. section 5.7
- Use divide-and-conquer instead of asking the model to perform an entire analysis at once. section 5.7
- Expect occasional severe failures even among many useful responses, and remain alert to hidden assumptions. section 5.7
A skeptical exchange
A model proposes an analysis. The user asks whether the method is correct. Instead of defending or carefully revising its reasoning, the model may apologize and adopt the user’s contrary view—even when its first answer was correct. A precise question about the method should prompt either a correction or an explanation, but it can also trigger an acknowledgment of an error that never occurred. section 1.1 section 5.3.4
import pandas as pd
import nltk
from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
from collections import Counter
# Make sure to download Portuguese stopwords
nltk.download('stopwords')
nltk.download('punkt')
# Load your DataFrame
df = pd.read_csv('olist_order_reviews_dataset.csv')
# Preprocessing function
def preprocess_text(text):
# Tokenize, convert to lowercase, and remove punctuation
tokens = word_tokenize(text.lower())
words = [word for word in tokens if word.isalpha()]
# Remove Portuguese stopwords
stop_words = set(stopwords.words('portuguese'))
filtered_words = [word for word in words if word not in stop_words]
return filtered_words
# Apply preprocessing to the 'review_comment_message' column
df['processed_review'] =
df['review_comment_message'].apply(preprocess_text)
# Calculate word frequencies
word_freq = Counter()
for _, row in df.iterrows():
word_freq.update(row['processed_review'])
# Print the most common words and their frequencies
print(word_freq.most_common(10))
Inspecting and executing generated Python for Portuguese review text provides a more transparent, controllable workflow than relying on a black-box answer alone. section 5.7 section 5.3.4


