Understanding LLM Inference Architecture: Asymmetric Computation and Cache Sharing

    This article examines how large language models process inputs and generate outputs at the inference level, explaining the distinct computational demands of prefill and token-by-token generation. It analyzes asymmetric computation, shared key-value caches, sparse activation, and the gap between parameter counts and real cost. It also covers which workloads benefit most from these designs, how to build reproducible performance and quality evaluations, and the deployment challenges they introduce. Readers will gain a framework for assessing architectural claims based on mechanisms, measurable benefits, and acceptable trade-offs rather than version labels.

    Evaluate Model Architecture by Computation Path, Not Version Labels

    When discussing new large language models, attention tends to focus on parameter counts, benchmark scores, and generation speed. But for developers and enterprises, the more important questions are: how does the model process input, how does it generate output, where do the main resource costs occur, and can these changes improve real-world cost and experience?

    Consider the difference between a summarization task with a long input document but only a few sentences of output, and a task with short input but thousands of output tokens. These place very different pressure on the inference system. The former depends heavily on input-processing efficiency; the latter depends on sustained generation capability. Even if two models have similar overall benchmark results, their performance on these two kinds of tasks can differ significantly.

    So when discussing designs such as “asymmetric computation” and “cache sharing,” we should treat them as general architectural problems rather than marketing labels for a particular model. Evaluation can be organized into three layers:

    1. Mechanism: Which computations are actually reduced, and why is it possible to reduce them?
    2. Verifiable benefit: Are latency, throughput, and memory usage improved under clearly specified conditions?
    3. Acceptable cost: Is model quality, deployment complexity, or operational stability affected?

    Prefill and Token-by-Token Generation: Two Different Workloads in One Model

    Autoregressive language model inference typically consists of two phases: prefill and token-by-token generation. The “token” here usually refers to a model token, which does not necessarily correspond to a complete word in natural language.

    What Prefill Does

    Prefill processes the input sequence that is already available. With causal attention, each position can only attend to itself and earlier positions. Because the entire input is available, the system can process multiple positions in parallel within operators, rather than waiting for new tokens one at a time as in generation.

    Prefill mainly accomplishes two things:

    • Computing representations of the input sequence at the relevant layers and building the key-value cache needed for subsequent generation.
    • Computing the next-token prediction distribution from the final representation at the end of the input.

    The key-value cache stores the reusable historical keys and values used in attention. During generation, new tokens can read this cache directly, avoiding recomputation of the corresponding portions of the entire history.

    Note that the cache is not the same as all of the model’s intermediate state. Whether feed-forward activations, residual representations, and final output logits need to be retained depends on the specific computation being performed.

    What Token-by-Token Generation Does

    Each generation step processes one new position, reads the existing cache, computes the current representation, updates the cache, and predicts the next token.

    This process has a strict sequential dependency: typically the current output must be determined before generation of the next position can proceed. Therefore, generation-phase efficiency cannot be improved simply by scaling up a single computation; it is also affected by weight loading, cache access, request batching, and scheduling policy.

    As the context grows, the amount of historical cache that must be read also grows. This means “faster input processing” and “faster sustained output” are not the same metric, and they should be measured separately.

    Standard Architectures Already Have Limited Opportunities for Asymmetric Optimization

    Input-output computational asymmetry does not necessarily mean the model must use a completely different network structure. Even in a conventional autoregressive architecture, the necessary computations for the two phases are not identical under specific inference conditions.

    Consider a standard pre-norm residual structure, where a layer can be abstracted as:

    attention sublayer → residual update → feed-forward sublayer → residual update.

    The attention keys and values are typically computed from the representation entering that attention sublayer. For the last network layer, the final feed-forward sublayer no longer influences the key-value cache of any higher layer, because there are no further attention layers above it.

    If prefill only needs to build the cache and predict the first output token, then for non-final positions in the input, the output of the last layer’s feed-forward network is generally not used by later steps. The final vocabulary projection for those positions also need not be executed. The system only needs to keep the complete computation for the final position, which is used for the next-token prediction.

    This conclusion has clear boundaries:

    • It depends on the specific network structure and where the cache is produced; it cannot be mechanically generalized to all architectures.
    • If the task requires per-position prediction scores, full hidden representations, or other outputs for the input, these computations cannot be skipped.
    • Training typically requires loss computation at many positions, which is a different scenario from this inference optimization.
    • Whether theoretically skippable computations are actually skipped depends on operator implementations and graph optimization in the execution framework.

    Vocabulary projection only at necessary positions is already common inference practice. Existing execution optimizations should not be double-counted as benefits of a new architecture.

    More importantly, in a model with many layers, skipping part of the final layer’s computation usually accounts for only a small fraction of total cost. This is therefore a local optimization and cannot by itself explain a significant overall speedup.

    How Cache Sharing Expands the Optimization Space on the Input Side

    To obtain larger gains, the relationship between cache generation and cache consumption must be reorganized, rather than merely trimming a small amount of computation in the last layer.

    A general design approach is to divide the network into distinct functional regions:

    • One part builds reusable context representations or attention caches.
    • Another part reads these representations and performs the further computation needed for prediction.
    • Multiple reading layers, subject to architectural constraints, share the cache produced by a designated module instead of each maintaining a complete, independent historical key-value state.

    In such a structure, the main work of prefill can be concentrated in the context-building part. For historical positions that no longer participate in cache generation and do not need per-position output predictions, subsequent parts have room to reduce computation.

    This differs fundamentally from simply compressing cache precision. The former changes how the network produces and consumes historical information; the latter mainly changes the storage format of the cache. They solve different problems.

    At the same time, cache sharing should not be understood as directly merging the caches of multiple layers in an existing model. Different layers’ representation spaces, attention head structures, and learned functions may differ, and they generally cannot be interchanged unconditionally. Genuine sharing requires the relationship to be established during model design and training, and validated through evaluation.

    It is also important to distinguish two easily confused mechanisms: cross-layer cache sharing addresses how caches are organized within the network; cross-request prefix reuse addresses the repeated computation that occurs when multiple requests share the same input prefix. These two can coexist, but they should not be conflated.

    Parameter Count, Activated Parameters, and Actual Cost Are Not Equivalent

    When discussing sparsely activated models, at least two quantities must be distinguished: total parameter count and the parameters involved in a single computation.

    Total parameter count reflects all learnable weights contained in the model. Activated parameter count describes the subset of weights actually involved in computation for a given step. For example, a mixture-of-experts structure can select only a subset of experts for each token, so that total parameter scale and per-token computation scale no longer grow in lockstep.

    Asymmetric architectures introduce a further phase difference: input processing and output generation may pass through different module combinations, so their activation scales may also differ.

    However, a reduction in activated parameters does not mean cost drops in the same proportion, for several reasons:

    1. Weights still must be stored. Parameters not activated for a given token are usually still held in device memory or another storage tier.
    2. Compute volume is not the same as execution time. Attention access, memory bandwidth, operator launch overhead, and inter-device communication can all become bottlenecks.
    3. Sparse routing can be imbalanced. Some experts receive higher load, which hurts batching efficiency.
    4. Cache overhead depends on context length and concurrency. As long-context requests increase, cache can become the dominant resource consumption.
    5. Multimodal inputs add independent costs. Images, audio, and similar inputs involve encoding, representation transformation, and longer effective sequences.

    Therefore, models should not be evaluated by comparing a single set of parameter numbers. It is necessary to clarify what the numbers measure and analyze them alongside the actual execution path.

    Where Asymmetric Architectures Are Most Likely to Help

    1. Long-Input, Short-Output Tasks

    Document summarization, material review, and information extraction often require reading large amounts of content while producing only short results.

    In such tasks, prefill can account for a large share of the work. If the architecture can reduce redundant computation on the input side, it can improve time-to-first-token and increase the number of requests that can be admitted per unit time.

    However, long inputs still require complete context modeling. Whether information localization, detail extraction, and cross-segment reasoning capability are preserved must be verified separately; it cannot be inferred from speed alone.

    2. Long-Output Tasks

    Report generation, long-form explanation, and program text generation involve many output tokens. In these cases, even if prefill is significantly accelerated, total completion time may still be dominated by token-by-token generation.

    A simplified relationship is:

    Total response time ≈ queueing time + prefill time + generation time.

    If only prefill is optimized while generation accounts for most of the time, the end-to-end improvement will naturally be limited. This reflects a general principle of system optimization: speeding up one local module does not mean the whole system speeds up by the same factor.

    3. Multi-Turn Interaction Tasks

    Multi-turn dialogue continuously processes conversation history. Whether the architecture supports incremental cache updates, prefix reuse, and stable cache lifecycles directly affects the realized benefit.

    If a large amount of historical state must be rebuilt every turn, an advantage measured in a single long-input test may not carry over to real interactive scenarios.

    Building a Reproducible Evaluation

    Professional evaluation should cover performance, quality, and resources simultaneously, rather than presenting only a single generation-speed number.

    1. Fix the Test Conditions

    At minimum, record the hardware configuration, weight precision, context length, output length, concurrency, batching strategy, and whether cache reuse is enabled.

    Results from tests under different conditions generally cannot be compared directly. In particular, distinguish single-request low-latency tests from high-concurrency throughput tests.

    2. Measure Key Metrics Separately

    Recommended metrics include:

    • Time to first token: reflects queueing, input processing, and the first prediction step combined.
    • Inter-token latency: reflects the rhythm of sustained generation.
    • Total completion time: the actual time a user needs to complete one task.
    • Throughput: report both request throughput and token throughput to avoid ambiguity.
    • Peak memory usage: covering weights, caches, and runtime temporary space.
    • Tail latency and failure rate: stability under congested conditions.

    Latency should be reported as the median and higher percentiles. Reporting only averages can mask long waits experienced by some requests.

    3. Quality Testing Must Run Alongside Performance Testing

    Quality tests should cover short-text understanding, long-context retrieval, cross-segment synthesis, format constraints, factual consistency, and the reasoning capabilities required by the target business.

    Pay particular attention to similar distractors, long-range dependencies, and different input lengths. Cache sharing changes how information is transmitted through the network, and its impact may not be fully captured by a single aggregate score.

    4. Use Ablations to Locate the Source of Gains

    Where conditions permit, separately disable input-side computation skipping, shared caches, or prefix reuse, and observe metric changes.

    Only in this way can you distinguish whether gains come from architectural changes, execution-framework optimizations, or request distribution and cache hit rates. All results should be reported with their measurement conditions, rather than generalized into unconditional capability claims.

    Deployment Issues That Still Need Solving

    Asymmetric computation changes the distribution of resource demands. Input processing leans toward large-batch computation, while token-by-token generation depends more on bandwidth and low-latency scheduling. An inference system therefore needs to monitor queue length, resource utilization, and time consumption separately for the two phases.

    Phase-separated deployment is one possible engineering option, but it is not the same thing as architectural asymmetry in the model. Even with an unchanged computation graph, the two phases can be assigned to different resources; conversely, an asymmetric model can run on a single device.

    If phase separation is adopted, cache transfer time, communication bandwidth, and scheduling overhead must be considered. If computation saved is offset by data movement, the actual benefit may be poor.

    Shared caches also require clear lifecycle management, including request isolation, reference release, memory reclamation, cleanup after exceptions or interruptions, and compatibility between cache formats and model versions. For workloads involving sensitive information, cache reuse must also satisfy access-control requirements and must not cross privilege boundaries.

    Conclusion: Architectural Innovation Should Be Judged by Explainable, Measurable Benefits

    The core value of asymmetric computation is recognizing that prefill and token-by-token generation are different workloads, and aligning the amount of computation more closely with what is actually needed. Cache sharing further explores which historical representations must be kept independent, and which information can be reused under architectural constraints.

    Evaluating such technology should not stop at surface narratives like “more parameters but faster” or “a small version change but a big architectural change.” The more reliable method is to inspect the computation graph, cache dependencies, and test methodology, then map the results to the input-output distribution of the actual business.

    For developers, what truly matters is not whether a label is novel, but whether the model can, with acceptable quality, consistently reduce waiting time, resource usage, and cost per task. Only when these benefits are validated under real workloads has an architectural optimization completed the transition from technical design to engineering value.