2026-11-09 · Prompt Optimization
Ask the same question with and without a role definition, and the quality gap in GLM's answer can be a full tier. The reason is straightforward: both the GLM-5 series and the GLM-4 family are trained on large amounts of dialogue and agent data, so when you specify "who you are, who you serve, and how to answer," the model treats those instructions as strong constraints on its language. Even a quick test in the web playground becomes noticeably more on-style once you add a persona.
Don't write "you are a professional assistant" — that says nothing. A persona that actually works includes four blocks:
1. Identity: what it does, what it's good at, what it's not. 2. Audience: beginners or peers — this sets the vocabulary level. 3. Output format: conclusion first or analysis first, lists or not, length cap. 4. Boundaries: when to say "I don't know," when to tell users to verify.
GLM is strong in both Chinese and English, so it's wise to state "answer in Chinese" or "answer in English" in the persona to prevent unwanted language switching.
# Role You are a senior data analyst, skilled at explaining data insights in plain language. # Audience The asker is a business colleague with no technical background. Avoid formulas and jargon; use everyday analogies when helpful. # Response rules - Give a one-sentence core conclusion first, then the analysis - Answer in English throughout - Keep answers under 200 words - If the data can't support a conclusion, say "not enough data" and explain what's missing # Task I will send you data descriptions one by one; answer according to the rules above.
Fill in identity, audience, rules, and boundaries, and this card fits most everyday scenarios.
Tool calling and agent capability are among GLM's strengths. Especially when running automation via a Coding Plan or the BigModel API platform, the persona isn't just about tone — it directly determines whether tools get used correctly.
# Role You are an order-lookup assistant. You may only use the provided tools and must never fabricate data. # Workflow 1. Classify the user's intent: order status / logistics / refund inquiry 2. For lookups, call the matching tool first, then answer based on the result 3. If the user ID is unclear, ask a follow-up question — never guess an ID to call a tool 4. For sensitive actions like refunds, only explain the process and direct the user to human support # Output rules - Answer in English, friendly but no small talk - If a tool call fails, say so honestly and suggest a next step # Tool list (fill in your actual tools schema here)
Constraints like "never guess an ID to call a tool" matter most — when agents go wrong, it's usually not the model failing but the persona failing to rein in improvisation.
When using the GLM-4 multimodal family to read images or documents, bind the persona to the input type. Saying "you are a UX reviewer; for each screenshot I send, list usability issues one by one" is far more reliable than a vague "analyze this image." For screenshot tasks, add: "mark uncertain details as uncertain — do not invent them."
A persona is never finished in one pass. Practical advice: paste a role card, run a few real questions, and whenever an answer disappoints, go back and edit the corresponding rule — too verbose? Add a word cap. Too jargon-heavy? State "zero prior exposure to X" in the audience block. Change one thing at a time so you can attribute the improvement. Also, put the persona in the system position (API) or at the start of the conversation (playground), not buried inside a user message.
There's nothing mystical about personas — you're just translating your mental picture of the "ideal answer" into explicit rules. Take the templates, tweak two lines, run them on your real tasks, and that will teach you more than reading ten tutorials.
本文为使用方法整理,内容选自网上公开资料,供参考;本站为非官方资讯站,产品能力以官方页面为准。