←新闻详情

Cerebras:Blog更新于 10月13日 12:05

Cerebras 发布 GLM 4.7 迁移指南:10 条提示词与参数调优规则

Cerebras

AI 导读

Cerebras 发布 GLM 4.7 迁移指南,称其为 Z.AI 最新开源模型,在 LiveCodeBench 上超过 Anthropic 和 OpenAI 模型、仅次于 Gemini 3,并在 GPQA 和 AIME 上超过 Claude Sonnet 4.5。指南给出 10 条使用规则,包括把强制指令放在系统提示词最前、使用 MUST 等明确措辞、显式指定回复语言、为智能体设定角色,以及把任务拆成小步骤以弥补其不支持交错思考。在 Cerebras 上 GLM 4.7 支持约 131K 上下文和最多约 40k 输出 token,可通过 disable_reasoning 和 clear_thinking 控制推理,推荐 temperature=1、top_p=0.95,并兼容 OpenAI Python SDK。

推荐理由

精选AI 评分 69

Cerebras 给出的 10 条迁移规则覆盖提示词、推理开关与多智能体分工,可直接用于 GLM 4.7 的落地调优。

主题

标签

正文

当前显示原文,中文全文译文尚未就绪。

Jan 08 2026

So, you need speed, intelligence, and great economics… introducing GLM 4.7, the first open model that delivers all three.

At Cerebras, we’ve seen overwhelming demand from developers for GLM 4.7. The migration to GLM 4.7 is driven by three key factors: cost, speed, and intelligence.

GLM 4.7 is Z.AIs latest model, and the first OS model to rival closed source giants like Sonnet 4.5. Some main points:

But architecture is just theory until you see the results.

If you care about coding and agentic evals, GLM 4.7 lands in the “top open model” tier. On LiveCodeBench, GLM 4.7 outperforms Anthropic and OpenAI models, trailing only Gemini 3.

GLM 4.7 extends that lead with substantial gains on GPQA and AIME, outperforming Claude Sonnet 4.5 on both, see AIME 2025 below.

And when you compare it directly to GLM 4.6, a previous model generation the improvement in coding and general capabilities is substantial, notably +12.4 points in HLE, +16.5 points Terminal Bench 2, amongst others.

Performance is one thing, but usability is another.

The beauty of GLM 4.7 is that it’s open source. This means that you’re no longer obstructed by hardware bottlenecks. Now, your product can achieve token output speeds magnitudes faster than closed source models like Sonnet 4.5 or GPT 5.2 running on GPUs. For example, see the difference in speed for GLM 4.7 across different hardware providers.

Every model has different personality quirks. When migrating to GLM 4.7, a common mistake is reusing old prompts without adjusting them for its unique behavior, which can lead to suboptimal performance. To fully leverage GLM 4.7's strengths, it's essential to refine your prompts, architecture, and sampling parameters accordingly.

Below are 10 rules to help you get the most from GLM 4.7.

On Cerebras, GLM 4.7 supports up to 131K context length. However, like most other large models, the output quality for GLM4.7 is most accurate at shorter lengths and can degrade at extreme lengths.

GLM 4.7 in particular has been observed to have a strong bias towards the beginning of the prompt, even more so than other models. This is especially noticeable when using think tags in conversations - it reinforces earlier instructions.

Accordingly, to ensure proper instruction following, place all mandatory instructions and behavioral directives at the absolute start of your system prompt to leverage the model's beginning bias. This is more effective than placing them later in the prompt.

Different models follow instructions differently. GLM 4.7 responds best to firm, direct language that removes ambiguity. Establish rules immediately using strong, explicit directives like MUST and STRICTLY. Avoid soft, suggestive language that the model may treat as optional.

For example:

Because GLM 4.7 is multilingual, we’ve found that it can sometimes switch languages in its responses.

If you’re migrating from a language model that defaults to English, it’s helpful to include a directive such as:"Always respond in English" (or your preferred language) in your system prompt to prevent unexpected outputs.

Occasionally, we’ve observed that the model may output reasoning traces in Chinese on the first turn. Explicit language control prevents this behavior.

One of GLM 4.7’s biggest strengths is its ability to effectively maintain and follow roles and personas. Its internal “thinking blocks” mirror role prompts closely, allowing precise control over tone and domain knowledge.

To take advantage of the models’ ability to role play: give the model an explicit persona, or create multi-agent systems each with their own personas.

For example:

GLM 4.7 performs a single reasoning pass per prompt before acting and does not continuously re-evaluate mid-task. This is sometimes referred to as 'interleaved thinking', which is supported by models like the Sonnet/OAI models.

In interleaved thinking, the model will alternate between:

This allows the model to pause, reflect on intermediate results, and adjust its approach dynamically throughout the task execution.

Without interleaved thinking, it is encouraged to prompt better task completion in GLM 4.7. You can do this by breaking tasks into small, well-defined sub-steps. For example:

This incremental approach produces cleaner results and closely matches GLM’s execution-first tendencies.

GLM 4.7 often includes internal thought/reasoning blocks in its output. For many straightforward tasks, this reasoning overhead is unnecessary and slows down responses.

To minimize reasoning:

While GLM 4.7's reasoning can be excessive for simple tasks, it becomes valuable for complex problem-solving that requires step-by-step thinking.

To enhance reasoning:

Following from rule #4, one of the most powerful patterns when working with GLM 4.7 (or any LLM) is to employ specialized critic agents to review and validate outputs before allowing the main agentic flow to advance in its plan. Rather than relying on a single agent to both generate and validate code, create dedicated sub-agents with specific expertise:

By splitting responsibilities across multiple agents, each with a focused persona (see Rule #4), you create a robust pipeline where generation and validation are decoupled.

GLM 4.7 excels at reasoning compared to other open source models. However, if your use case relies on frontier reasoning capabilities, you may find that GLM 4.7 falls short on the toughest 10% of use cases.

Here are three architectural patterns you can employ to effectively utilize GLM 4.7 in your applications:

By leveraging GLM 4.7's 17x faster output speed and lower costs for the majority of tasks, you can realize significant speed and cost savings without sacrificing overall quality.

Use clear_thinking to decide how much internal “thinking state” GLM 4.7 should carry across calls. For agent loops, multi‑step plans, and coding sessions that build on prior reasoning, set clear_thinking: false so the model preserves its internal state between turns. For one‑off calls, batch jobs, or when you see unwanted drift from previous steps, set clear_thinking: true so each response is based only on the visible prompt.

And now, ready to see it in action?

Run the fastest inference in the world with top in-classintelligence, and sane economics.

When you run GLM 4.7 on Cerebras, you’re using our Wafer‑Scale Cluster, but the way you work with the model stays familiar. You can use our long context of around 131k tokens and allow for responses, up to about 40k output tokens via max_completion_tokens, so the model has enough room to take in the prompt and produce a complete answer.

You can also decide how much internal “thinking” the model should do. If you care more about speed and straightforward output, you can turn reasoning off with disable_reasoning: true to keep responses shorter and cleaner. If you’re building agents or coding loops and want the model to keep that internal state across turns, leave clear_thinking: false so it doesn’t reset between calls.

For sampling, a good starting point on Cerebras is temperature=1 with top_p=0.95 . These defaults work well for most workloads on our system. Once you see how GLM 4.7 behaves in your application, you can adjust one of these settings at a time to get the style and variability you need.

Once you’ve set these parameters, you’re in a good place to start tuning for your specific use case.

If you’re already standardized on the OpenAI Python SDK, Cerebras is OpenAI-compatible, just pass GLM-specific fields using extra_body .

We want to honor our amazing community that tests and provides feedback on models early. Your benchmarks, bug reports, and enthusiasm are what makes our ecosystem thrive.

Performance comparisons are based on third-party benchmarking or internal testing. Observed inference speed improvements versus GPU-based systems may vary depending on workload, configuration, date and models being tested.

1237 E. Arques Ave Sunnyvale, CA 94085

来源

Cerebras:Blog