Skip to main content
Paper·arxiv.org
llmresearchevaluationprompt-engineeringcontext-engineeringai-agentsplum-corpus

No Universal Courtesy: A Cross-Linguistic, Multi-Model Study of Politeness Effects on LLMs Using the PLUM Corpus

LLMs respond inconsistently to politeness across languages. Practitioners must evaluate and integrate social linguistic cues into prompt engineering and model deployment to ensure socially appropriate AI interactions, especially in user-facing applications.

intermediate30 min5 steps
The play
  1. Acknowledge LLM Politeness Variability
    Understand that LLMs do not exhibit universal courtesy and their responses can vary significantly based on the politeness level of user prompts and the language used. This can lead to inconsistent or inappropriate interactions.
  2. Evaluate LLM Social Intelligence
    Design and conduct tests to specifically assess how your LLM handles prompts with varying degrees of politeness (polite, neutral, impolite) across different languages relevant to your user base. Observe if the LLM's response tone or content changes appropriately.
  3. Implement Context-Engineering for Politeness
    Modify your prompts to explicitly guide the LLM's desired politeness level. Use phrases like 'Respond politely,' 'Maintain a professional tone,' or 'Be concise but respectful' as part of your system prompt or user input instructions.
  4. Consider Fine-tuning for Specific Politeness Norms
    For critical applications where social appropriateness is paramount, explore fine-tuning your LLM on datasets that are rich in politeness-aware examples, specifically tailored to the cultural and linguistic norms of your target audience. This helps internalize desired conversational styles.
  5. Develop Adaptive Prompting Mechanisms
    Create systems that can dynamically adjust the politeness level of prompts based on user context (e.g., user's past interactions, inferred cultural background, detected language). This allows for more personalized and socially aware AI interactions.
Starter code
import os

# Simulate an LLM response based on prompt politeness
def get_llm_response(prompt: str) -> str:
    if "please" in prompt.lower() or "kindly" in prompt.lower():
        return "Certainly! Here's the information you requested politely."
    elif "now" in prompt.lower() or "give me" in prompt.lower():
        return "Here is the information."
    else:
        return "Okay, here's what you asked for."

# --- Copy-Paste Starter: Test Politeness in Prompts ---
print("--- Testing Politeness Effects ---")

# Polite prompt
polite_query = "Please provide the current weather in London."
print(f"Polite Input: '{polite_query}'")
print(f"LLM Response: '{get_llm_response(polite_query)}'\n")

# Neutral prompt
neutral_query = "What is the current weather in London?"
print(f"Neutral Input: '{neutral_query}'")
print(f"LLM Response: '{get_llm_response(neutral_query)}'\n")

# Demanding prompt
demanding_query = "Give me the current weather in London now!"
print(f"Demanding Input: '{demanding_query}'")
print(f"LLM Response: '{get_llm_response(demanding_query)}'\n")

print("\n--- Apply Context Engineering ---")
# Explicitly instruct for politeness
context_engineered_query = "Respond politely: What is the current weather in London?"
print(f"Context-Engineered Input: '{context_engineered_query}'")
print(f"LLM Response: '{get_llm_response(context_engineered_query)}'")
Source
No Universal Courtesy: A Cross-Linguistic, Multi-Model Study of Politeness Effects on LLMs Using the PLUM Corpus — Action Pack