Why Long Chain-of-Thought Reasoning Is Slower in LLMs

    This article explains why a model variant marketed for fast responses can still take longer end to end on long chain-of-thought tasks. It breaks down the two key metrics, TTFT and TPS, examines how layered timeouts create a hard "time wall" on long requests, and why different access channels behave inconsistently. It closes with practical mitigations and architecture recommendations for keeping long reasoning workloads stable.

    1. The Phenomenon: Why a “Faster” Variant Ends Up Slower

    In everyday use of AI coding tools and LLM services, developers often run into a counterintuitive pattern: a model variant positioned for “fast responses” can take longer end to end than the standard version when handling long chain-of-thought tasks. The core observations can be summarized in three points:

    • Both time to first token and output tokens per second are unsatisfactory at the same time.
    • Long reasoning requests hit a near-hard cutoff that looks like a “time wall.”
    • Behavior is inconsistent across access channels (the official client, third-party coding tools, and direct API calls).

    This cannot be attributed to a single cause. It is the combined result of model architecture, inference infrastructure, gateway policies, and client implementation. The sections below break it down layer by layer.

    2. Metric Breakdown: What Actually Affects TTFT and TPS

    Time to first token (TTFT) is made up of queue wait, prompt prefill, network round trips, and scheduling overhead. Output tokens per second (TPS) is mainly determined by memory bandwidth during decoding, batching strategy, and concurrency pressure.

    A key point: a “lighter” model does not automatically mean a faster end-to-end path. If the new architecture is not yet well optimized in operator implementations, cache reuse, or batch scheduling, both prefill and decoding can regress. A rough segment timing logic looks like this:

    1. def profile_stream(resp):
    2. t0 = time.perf_counter()
    3. first = next(resp) # first token arrives
    4. ttft = time.perf_counter() - t0
    5. n, t_last = 1, time.perf_counter()
    6. for _ in resp:
    7. n += 1
    8. t_last = time.perf_counter()
    9. tps = (n - 1) / (t_last - t0) # decoding throughput
    10. return {"ttft": ttft, "tps": tps}

    Only by splitting total time into “queue + prefill + decode + gateway forwarding” can you tell whether the bottleneck is on the model side or the pipeline side.

    3. Engineering Causes of the “Time Wall”

    When a long reasoning request is interrupted after a certain duration and returns an error code, it usually comes from multiple layers of timeouts stacking up: client read timeout, idle timeout on the gateway or load balancer, server-side task limits, and connection recycling policies on intermediate proxies. If any layer gives up before the model finishes reasoning, the chain is cut.

    This also explains the channel differences: an official account-bound client may enable long-connection keep-alive and asynchronous resumption, while generic API calls are often bound by stricter synchronous timeouts. So “same model, different behavior” is mostly a difference in pipeline configuration, not a deliberate weakening of model capability.

    4. Practical Mitigations

    1. Front-load prompt constraints: state in the first line of the system prompt to “control reasoning depth and prioritize producing results,” reducing unproductive expansion.
    2. Streaming output with heartbeats: enable streaming responses and configure keep-alive to avoid triggering idle timeouts during long periods with no data.
    3. Segment and decompose tasks: split overly long reasoning into multiple smaller rounds to reduce single-request duration.
    4. Timeout and retry strategy: distinguish idempotent from non-idempotent requests and use exponential backoff.
    5. Observability: use logging services and monitoring alerts to build dashboards and threshold alerts for TTFT, TPS, and error codes.
    6. Elastic capacity: build asynchronous tasks and peak-shaving pipelines on container platforms and message queues, separating long reasoning from synchronous requests.

    5. Selection and Architecture Recommendations

    In a general cloud environment such as Baidu AI Cloud, it is recommended to wrap model calls in a dedicated gateway layer that unifies timeouts, retries, rate limiting, and metrics collection; for long tasks, adopt an asynchronous design and return results via a message queue. This both avoids the pipeline time wall and keeps the business stable while model-side optimization is still incomplete. Looking rationally at “faster variant, slower result,” the essence is a matter of pipeline and infrastructure maturity, and engineering measures can significantly improve it.