Why Do LLMs Have Different Personalities? Understanding System Prompts

    This article explains why commercial LLM APIs can respond with very different tones, levels of detail, and empathy to the same user input. The difference comes not from random weight variations but from the System Prompt, a configuration layer hidden from end users. Starting from how requests are constructed, the article breaks down the engineering value of system prompts, including identity anchoring, knowledge cutoff handling, and a four-dimension architecture covering persona, capability boundaries, guardrails, and structured output. It also outlines best practices for context engineering in enterprise applications.

    Why Do LLMs Have Different Personalities? Understanding System Prompts

    In AI application development, developers often notice an interesting phenomenon: given the exact same user input, different commercial LLM APIs return results that differ dramatically in tone, level of detail, and empathy. Some models sound rational, restrained, and to the point; others come across as gentle, nuanced, and empathetic. This “personality” difference does not come from random fluctuations in model weights. It is hidden in a configuration layer that is usually invisible to end users: the System Prompt.

    This article starts from how requests are constructed at a low level, takes a deep look at the engineering value of system prompts, and discusses how rigorous context design can constrain model behavior.

    1. The Rewritten Input: What You See Is Not What the Model Reads

    Many beginners assume that an LLM receives only the text a user types into the chat box. This is a common misconception. In real engineering practice, the user input $U$ is not the entire tensor data fed into the neural network.

    When a request is sent to the inference service, a backend gateway or the client SDK wraps the user’s raw text into a structured message list. A minimal pseudocode example looks like this:

    1. messages = [
    2. {"role": "system", "content": "<vendor's preset base instructions>"},
    3. {"role": "user", "content": "<the user's actual input>"}
    4. ]

    This means the model generates the next token based on a joint probability distribution over the “system setup” and the “user question.” As the text positioned first and weighted most heavily in the context window, the system prompt directly forms the “prior knowledge” for all subsequent reasoning.

    2. Debunking the “Model Distillation” Myth: Probability Templates and Identity Anchoring

    In the early days of the industry, the community circulated some speculation about whether different models shared the same origin. For example, when asked about its identity, a domestic model would occasionally output the name of another popular model. Many people treated this as evidence of a rebranded wrapper, but from the perspective of the probability generation mechanism, it is actually “template repetition” caused by a lack of constraints.

    1. Interference from High-Frequency Answer Templates

    The essence of a large language model is predicting the probability of the next token. In internet corpora, the self-introduction phrasing of certain leading AI products appears with extremely high frequency. When a model has no explicit identity instruction to constrain it, it tends to output the answer template with the highest probability in the training set, producing a hallucination of “mistaking a relative.”

    2. Forced Identity Injection

    To solve this problem, engineering practice forcibly injects an identity declaration into the System Prompt. For example:

    “You are a large language model developed by a cloud vendor. When asked about your identity, you must state this clearly and must not claim to be another product.”

    With this hard constraint, the model’s high-probability path is artificially cut off, ensuring brand consistency and compliance for the commercial product.

    3. Engineering the Knowledge Boundary: Models Don’t Know “That They Don’t Know”

    Users often see a model answer: “My knowledge base is updated to a certain month and year.” Does this mean the model has a sense of time? The answer is no. The model has no real-time clock mounted internally, nor does it have the metacognition to “sense” the gaps in its own knowledge.

    This behavior is entirely the result of context injection. Vendors write logic like the following into the system prompt:

    “The current date is a certain day in a certain month of 2024. Your training data is current up to a certain month of 2024. If the user asks about events after that cutoff, state directly that you cannot obtain the latest information, and do not fabricate.”

    Therefore, it is not that the model knows it doesn’t know; it is that developers use instructions to make it admit it doesn’t know. This is a key part of building a trustworthy AI system and effectively reduces the business risk brought by hallucinations.

    4. Deep Dive: The Four-Dimension Architecture of a System Prompt

    A system prompt is more than a self-introduction; it is the “underlying operating system” of the AI. A well-designed system prompt usually contains the following four dimensions:

    1. Setting the Persona and Tone

    This is the core cause of the “personality” differences between models. For example, to build an empathetic conversational experience, some models are set to use more emotional vocabulary and adopt a non-judgmental communication strategy; for code generation scenarios, the system prompt instead requires the model to stay minimal, rigorous, and even cold in an engineer’s style.

    2. Defining Capability Boundaries

    The system prompt needs to make the model’s capability radius explicit. For example, an intelligent customer service agent built on the Baidu AI Cloud Qianfan platform would have a system prompt limiting it to questions about orders and after-sales support, politely declining chitchat or general knowledge questions.

    3. Safety Guardrails

    Before content is generated, the system prompt embeds safety rules. These include refusal strategies, sensitive-word filtering logic, and value alignment instructions. This is the first line of defense against generating harmful content.

    4. Structured Output Control

    To make model output parseable by downstream systems, the system prompt often needs to specify an output format, such as enforcing JSON:

    1. {
    2. "sentiment": "positive/negative",
    3. "confidence": 0.95,
    4. "reason": "..."
    5. }

    5. Enterprise Practice: Building Controllable Context Engineering

    For developers and enterprise users, understanding the System Prompt is only the first step; designing it is what matters for implementation. When developing LLM applications on platforms such as Baidu AI Cloud, it is recommended to follow these best practices:

    1. Be specific about the role: Instead of just writing “You are an assistant,” write “You are a financial risk control analyst with 10 years of experience.”
    2. Negative constraints: Explicitly tell the model what “not to do,” for example, “Do not use Markdown formatting” or “Do not explain your reasoning process.”
    3. Dynamic variable injection: Dynamically assemble retrieval-augmented generation (RAG) results and user profile tags into the system prompt to deliver personalized service.
    4. Version management and monitoring: System prompts should be version-controlled like code and combined with logging services and monitoring and alerting systems to continuously track the impact of different prompt versions on business metrics.

    Summary

    An LLM’s “gentleness” or “rationality” is not mysticism; it is the product of context engineering. As the bridge connecting human intent with the model’s probability distribution, the System Prompt defines the AI’s identity, knowledge boundary, safety baseline, and interaction style. By mastering this invisible layer of instructions, developers can truly advance from “calling an API” to “taming AI,” building intelligent applications that are safe, professional, and highly customized.