跳到正文
DEV Community· Avneet bansal·· 2 小時前AI 評分65

Claude Sonnet 5.5 effort 等級實測:720 次呼叫中,僅精確裝箱題的答案隨設定改變

Sonnet 5.5 Effort Levels: 720 Real Calls, and the One Case Where the Setting Changed the Answer

AI 導讀

作者在 Amazon Bedrock 上以 Sonnet 5.5 的 8 種 effort 設定完成 720 次呼叫測試,發現準確率差異主要出現在精確裝箱題。測試涵蓋 4 組合成任務,總成本約 USD 9;抽取、修正程式錯誤和一般容量規劃的得分大致相同,但預設 high 的成本與延遲較高。

正文

🎚️ Sonnet 5.5 Effort Levels: 720 Real Calls, and the One Case Where the Setting Changed the Answer

TL;DR

  • Sonnet 5.5 on Amazon Bedrock thinks by default (adaptive thinking, effort high). I ran 8 settings over 4 test sets, 720 calls in total, for about USD 9 at list price.
  • On extraction, bug fixing and ordinary capacity-planning questions, every setting scored the same (one ambiguous ticket aside). The default cost 1.5 to 2.8 times more and ran 1.5 to 2 times slower than turning up-front thinking off, and max cost 4 to 9 times more.
  • On an exact-search problem (fewest nodes that fit a set of pods), the low and no-thinking settings scored 75% to 83%. high scored 92%. xhigh and max scored 100%. xhigh cost half of max.
  • Every wrong answer was the same one: the greedy first-fit-decreasing answer, one node too many.

Why a sweep

The Bedrock documentation for Sonnet 5.5 says the effort levels are calibrated differently from Sonnet 5 and recommends running a fresh effort sweep on your own evaluations. It gives generic starting points: medium for well-specified agentic coding, medium or low for latency-sensitive work, high otherwise. It does not say what each level costs you or buys you on a particular kind of task. This post measures that on four small test sets.

Three facts from the documentation shape the test:

  • Adaptive thinking is on by default, and the default effort is high.
  • thinking: {"type": "disabled"} returns a 400 error on Sonnet 5.5. The lowest setting is between_tools, which turns off up-front thinking and works only at low, medium and high.
  • Thinking tokens are billed as output tokens and are reported in usage.output_tokens_details.thinking_tokens.

Setup

  • Model: us.anthropic.claude-sonnet-5-5 on Amazon Bedrock, us-west-2, max_tokens 32,000. No call hit the limit.
  • 8 settings: adaptive thinking at low, medium, high, xhigh and max, and between_tools at low, medium and high.
  • All data is synthetic, generated from a fixed seed, and every answer is scored by code. Nothing came from a customer.
  • Cost uses the third-party list price of USD 2.20 per million input tokens and USD 11.00 per million output tokens. Check the Bedrock pricing page before you rely on the cost columns.
Test set Tasks Repeats What it checks
Extraction 20 incident tickets 1 Four fields as JSON, with distractors such as an older severity and a downstream service
Capacity planning 15 problems of 6 to 15 pods 2 Minimum nodes, exact answer, 7 of the 15 built so that the shortcuts fail
Bug fixing 8 small Python functions 2 The fix must pass hidden unit tests
Hard capacity planning 12 problems of 16 to 20 pods 2 Same question, where first-fit-decreasing or the sum-based bound gives the wrong answer

Result 1: on three test sets, the setting did not change accuracy

Setting Extraction (20) Capacity planning (30) Bug fixing (16)
between_tools, low / medium / high 20 / 20 / 20 30 / 30 / 30 16 / 16 / 16
adaptive, low 19 30 16
adaptive, medium 19 30 16
adaptive, high (the default) 19 29 16
adaptive, xhigh 20 30 16
adaptive, max 20 30 16

The three extraction misses come from two tickets with the same wording. Each states an error count and then says that a few dozen errors "belong to an unrelated maintenance window". Adaptive low and high returned 8505 instead of 8575 on one ticket, and adaptive medium returned 63425 instead of 63497 on the other, because they subtracted the maintenance errors. That is ambiguity in my wording more than a reasoning failure, and the between_tools and max runs read it the way I intended.

What changed was cost and time:

Setting Extraction cost per 100 calls p50 Capacity cost per 100 calls p50 Bug-fix cost per 100 calls p50
between_tools low USD 0.08 0.7 s USD 0.65 3.7 s USD 0.29 1.5 s
adaptive high (default) USD 0.22 1.4 s USD 1.10 5.7 s USD 0.43 2.2 s
adaptive max USD 0.66 3.8 s USD 2.52 10.2 s USD 2.66 11.2 s

Two details are worth knowing. First, adaptive low and medium did not think at all on any call in the sweep (0 thinking tokens on all 66 calls per setting in the three sets above). Second, the default high thought on 13 of 20 extraction calls, 28 of 30 capacity calls and 6 of 16 bug fixes, so it decides per request, and it paid for thinking that did not change the answer.

Result 2: on exact search, the setting decided the answer

The hard set asks for the minimum number of nodes of 10,000 millicores for 16 to 20 pods. An exact solver gives the true answer. Greedy first-fit-decreasing, the usual shortcut, gives a wrong answer on 9 of the 12 problems, and the sum-based lower bound is wrong on 3. I selected problems where the shortcuts fail.

Setting Correct (of 24) Thinking tokens, median p50 Cost per 100 calls Cost per correct answer
between_tools low 18 (75%) 0 9.8 s USD 1.20 USD 0.016
between_tools medium 20 (83%) 0 9.3 s USD 1.22 USD 0.015
between_tools high 18 (75%) 0 10.4 s USD 1.40 USD 0.019
adaptive low 18 (75%) 0 10.6 s USD 1.42 USD 0.019
adaptive medium 18 (75%) 0 12.2 s USD 1.51 USD 0.020
adaptive high (default) 22 (92%) 1,585 18.4 s USD 2.76 USD 0.030
adaptive xhigh 24 (100%) 2,144 17.9 s USD 3.75 USD 0.038
adaptive max 24 (100%) 5,763 41.2 s USD 7.76 USD 0.078

All 30 wrong answers across the eight settings were one node above the true minimum, which is the first-fit-decreasing answer. None was below it. Without thinking, the model gives the greedy answer. With enough thinking, it checks whether a tighter packing exists and finds it.

Setting between_tools at high did not help (75%), because effort only matters when thinking is on. Adaptive low and medium never thought on these problems either, and they scored the same as no thinking. Adaptive high thought on all 24 calls and scored 22. xhigh thought a little longer (median 2,144 tokens against 1,585) and scored 24.

Which setting for which case

Your case Setting I would start with Why, from these runs
Short extraction or classification, latency matters between_tools, low Same accuracy, about one third of the default's cost, half its latency
Routine, well-specified code fixes between_tools, medium or adaptive low 16 of 16 everywhere, cost 1.5 to 9 times lower than high or max
Answer must be exact and a greedy shortcut is wrong adaptive xhigh 100%, and about half the cost and latency of max
Anything you have not tested Run a small sweep first The default is not wrong, it just costs more than the easy cases need

I would not use max without a measured gain over xhigh. In this sweep it never gained anything and cost about twice as much with 2.3 times the median latency.

Limits of this sweep

  • One model, one region, one day. Results can shift when the model or its settings are updated.
  • 24 calls per setting on the hard set. The gap between 75% and 100% is large, but a bigger sample would give tighter numbers, and the difference between high (22) and xhigh (24) is within noise.
  • The tasks are synthetic and have one correct answer. Open-ended writing, long tool-use loops and multi-turn work were not tested. I dropped the tool-use case to keep the sweep focused.
  • Costs use a list price I did not verify on the AWS page.

Decide for your own workload in an afternoon

The post cannot tell you which setting your work needs, but the method fits on one page. Take 30 to 50 real cases that have a checkable answer, run them through the same settings, and compare accuracy against cost.

1. One request function. Effort goes in output_config, not in thinking, or the call fails with a 400 error. The thinking spend comes back in usage.

import json, time, boto3
brt = boto3.client("bedrock-runtime", region_name="us-west-2")

SETTINGS = {
    "no_thinking_low": ({"type": "between_tools"}, "low"),
    "adaptive_high":   ({"type": "adaptive"}, "high"),
    "adaptive_xhigh":  ({"type": "adaptive"}, "xhigh"),
}

def ask(prompt, setting):
    thinking, effort = SETTINGS[setting]
    body = {"anthropic_version": "bedrock-2023-05-31", "max_tokens": 32000,
            "thinking": thinking, "output_config": {"effort": effort},
            "messages": [{"role": "user", "content": prompt}]}
    t0 = time.time()
    r = json.loads(brt.invoke_model(modelId="us.anthropic.claude-sonnet-5-5",
                                    body=json.dumps(body))["body"].read())
    text = "".join(b.get("text", "") for b in r["content"] if b["type"] == "text")
    u = r["usage"]
    return {"text": text, "seconds": time.time() - t0, "stop": r["stop_reason"],
            "in": u["input_tokens"], "out": u["output_tokens"],
            "thinking": u.get("output_tokens_details", {}).get("thinking_tokens", 0)}

2. A scorer that does not trust the model. For the capacity problem the answer is checked against an exact solver. For bug fixes the corrected function runs against hidden unit tests.

def min_nodes(items, cap):           # exact minimum number of bins
    items, best = sorted(items, reverse=True), [len(items)]
    def go(i, bins):
        if len(bins) >= best[0]: return
        if i == len(items): best[0] = len(bins); return
        seen = set()
        for b in range(len(bins)):
            if bins[b] + items[i] <= cap and bins[b] not in seen:
                seen.add(bins[b]); bins[b] += items[i]; go(i + 1, bins); bins[b] -= items[i]
        bins.append(items[i]); go(i + 1, bins); bins.pop()
    go(0, [])
    return best[0]

3. Count wrong answers, not only the average. A setting that is wrong 25 times in 100 is not a rounding error. In my hard set the wrong answers were all the greedy one, which told me what the cheap settings skip.

4. Compare cost with what a wrong answer costs you. On the hard set, moving from no thinking to xhigh raised the cost by USD 2.55 per 100 calls and removed about 25 wrong answers per 100, which is about USD 0.10 per wrong answer avoided. If a wrong answer costs you more than ten cents (a bad capacity plan, a failed deployment, an engineer's review time), the extra thinking pays for itself. If the answer is a label that someone checks anyway, as in my extraction set, it does not.

5. Keep the setting per task type. You can choose the setting per request, so extraction can run with no thinking and the exact-answer step can run at xhigh. Choose one thinking mode per conversation and keep it, because switching modes invalidates the prompt cache, according to the Bedrock documentation.

Should you change anything?

  • If you migrated from an older Claude model without changing the request, thinking is now on and billed as output tokens. Check usage.output_tokens_details.thinking_tokens on your current traffic before you do anything else.
  • If most of your calls look like my extraction or bug-fix sets, between_tools at low or medium gave the same accuracy for less.
  • If any step in your pipeline needs an exact answer that a shortcut gets wrong, test xhigh on that step.
  • If you have no evaluation set yet, start with the default and measure, since the sweep above shows the default is safe but not always necessary.

來源:DEV Community · dev.to