Why LLMs Behave Differently in Chat: Context, Prompts, and Evaluation
This article explains why large language models in the same capability tier can deliver very different chat experiences. It breaks the issue down into context length and truncation, default system instructions, and user input quality, then covers how multi-turn memory is engineered, how to turn vague requests into verifiable tasks, which decoding parameters affect output completeness, and how to build a small scenario-based evaluation set. It closes with practical engineering advice on treating model capability as a replaceable component.
1. The Symptom: Why “the Same Class of Model” Feels So Different
In practice, many teams notice something odd. When calling models from the same capability tier, one product can take a short, one-line question and return a well-structured answer, filling in assumptions, boundary conditions, and potential risks on its own. Another product needs a highly specific instruction before it produces anything usable; otherwise the answer is vague and very short. Users tend to read this as the model being “lazy,” but from an engineering standpoint it is usually not a matter of the model’s attitude. It is the combined effect of three layers.
The first layer is the usable context length and truncation strategy on the product side. Mobile apps and web clients often differ in how much conversation history they retain, how attachments are parsed, and what the per-response output limit is. Once history is trimmed, the model simply has less material to reason from.
The second layer is the default system instruction and alignment policy. The system prompt decides whether the model asks clarifying questions first or delivers a complete plan first, and it also shapes how detailed the answer should be.
The third layer is insufficient information density in the user’s input. A question that omits role, goal, constraints, output format, and acceptance criteria can only get a statistically “average answer” from any model.
2. Context and Memory: How Multi-Turn Consistency Is Actually Built
What people call a “strong memory” usually consists of three parts in engineering terms: the short-term context window, session-level summary compression, and explicit cross-session memory storage. The first two are context assembly during inference; the last one requires the application layer to maintain a store and retrieve from it before each request.
It is worth stressing that memory is not a spontaneous model capability. It is a result of application orchestration. If a product does not enable cross-session memory, the user has to repeat the background every time. Here is a minimal experiment you can run yourself:
# Pseudocode: comparing "no memory" with "explicit memory injection"history = [] # short-term contextprofile = {} # structured cross-session memorydef ask(q, use_memory=True):ctx = build_prompt(system="You are a senior backend engineer; output must include assumptions, plan, risks, and acceptance criteria",memory=profile if use_memory else {},history=history[-8:], # control truncation to avoid exceeding the windowuser=q,)ans = llm.chat(ctx)history.append((q, ans))return ans
The difference in output quality comes mostly from whether the system constraints and the memory injection are in place, not from how “diligent” the model itself is.
3. Prompt Engineering: Turning a Vague Request into a Verifiable Task
High-quality output starts with a task description that can be verified. A five-element template works well: role, goal, constraints, output format, and acceptance criteria.
Role: backend architect experienced in high-concurrency systemsGoal: design a collection and query plan for 50 million new log entries per dayConstraints: use generic capability categories (message queue, object storage, log service, monitoring and alerting); do not bind to a specific vendorOutput: layered architecture diagram (text), capacity estimation table, three-phase rollout planAcceptance: single-point-of-failure analysis, cost-sensitive items, rollback strategy
Compare that with a single line such as “help me design a logging system.” The output from the latter will inevitably be short and generic. The information entropy of the instruction directly determines the information entropy of the answer, which is well-established engineering common sense.
4. Output Completeness: Parameters and Prompt Strategies That Prevent Early Stopping
Answers that are too short are usually related to decoding strategy and length constraints. Raising the maximum output length moderately, loosening overly conservative stopping conditions, and explicitly asking in the prompt for “analysis before conclusion, include risks and alternatives” all improve completeness noticeably. An illustrative configuration:
{"max_output_tokens": 2048,"temperature": 0.4,"top_p": 0.9,"system": "Do not give conclusions only; must include assumptions, plan comparison, risks, and validation steps"}
Parameters need tuning per scenario: code generation favors lower temperature for stability, while creative work and solution brainstorming can tolerate a moderate increase.
5. Scenario-Based Evaluation: Replace Subjective Feelings with Metrics
A subjective “this one is better” is hard to reproduce. Build a small evaluation set instead: 20 to 50 real questions per scenario category, scored blind. Dimensions can include instruction adherence, factual correctness, structural completeness, context consistency, and cost per unit. The evaluation loop can be scripted:
cases = load_cases("eval_set.jsonl") # includes query, reference answer, scoring dimensionsfor c in cases:r = ask(c["query"])scores = judge(r, c["rubric"]) # human or rule-based scoringreport.append((c["id"], scores))
Keep iterating for two weeks and the selection decision shifts from a “feeling” to explainable data.
6. Engineering Advice from the Baidu AI Cloud Perspective
In practice with Baidu AI Cloud, the safer approach is to treat model capability as a replaceable component: wrap the invocation layer uniformly, and decouple system instructions, memory storage, retrieval augmentation, and the evaluation pipeline from the application. Storage and retrieval can rely on generic capability categories such as object storage, log service, and monitoring and alerting, avoiding tight coupling to a single model, which controls cost and migration risk while preserving output quality.
7. Conclusion
“Which one is better” is not the final question. The real answer is: write the requirement clearly, manage the context, and make the evaluation solid. Do those three things and model selection turns from a gamble into an engineering decision.
