Asymmetric Architecture and Memory Enhancement: New Approaches to LLM Inference Optimization

    Large Language Model (LLM) inference is traditionally divided into prefill (compute-bound) and decode (memory-bound) phases, yet most architectures treat them identically. This article explores new optimization strategies, including asymmetric activation for phase-specific compute allocation and memory lookup mechanisms that separate fixed patterns from attention computation. It also provides guidance on interpreting performance metrics, a deployment checklist for long-context agent scenarios, and key risk considerations for production environments.

    1. Why Inference Phases Require Distinct Design

    Large Language Model (LLM) inference consists of two phases. The prefill phase processes the entire input prompt at once, allowing parallel token computation, and is typically compute-bound. The decode phase generates output tokens autoregressively; generating each token requires reading model weights and the historical KV cache, making it memory bandwidth-bound.

    Despite these different bottlenecks, traditional designs treat both phases uniformly. Most Mixture of Experts (MoE) models apply identical routing rules in both phases, activating a fixed number of experts per token. The differences between the phases usually stem from batching methods and compute shapes, rather than structural distinctions within the model itself.

    Understanding this is crucial because the following designs revolve around the distinct bottlenecks of these two phases.

    2. Asymmetric Activation: Allocating Compute by Phase

    One approach mentioned in the source material is the Causal Encoder-Decoder (CED) structure. Its core idea is to split the network into two parts:

    • The lower layers act as an Encoder, processing long inputs during the prefill phase and generating a compact KV representation.
    • The upper layers act as a Decoder, running during the decode phase. Its global KV directly reuses the projection results from the Encoder’s final layer instead of reconstructing them from its own hidden states.

    The design motivation is clear: the prefill phase has a high compute load, so reducing the activated parameters per token lowers Time-to-First-Token (TTFT) and compute costs. The decode phase is bandwidth-bound, so reusing a compact KV reduces memory pressure; therefore, moderately increasing the activated parameters during decoding may not decrease overall throughput.

    The source provides specific numbers: a certain model activates 8B parameters in the prefill phase and 16B parameters in the decode phase. However, these figures currently lack a model name, paper, or technical report version, and do not specify whether attention layers, embedding layers, or routing overhead are included. Until the original source is verified, this should be treated as unverified information and not used directly for architectural selection.

    This structure aligns well with Agent workloads. Agents often follow a “read much, write little” pattern: processing long documents, tool outputs, and multi-turn history, while generating relatively short outputs per turn. For such workloads, prefill costs are proportionally higher, and asymmetric design may yield benefits. However, the actual gain depends on the input-output length ratio and must be validated with real request distributions.

    3. Memory Lookup: Separating Fixed Patterns from Attention

    Another design focuses on the model’s “memory”. Traditional Transformers rely on the attention mechanism to handle both reasoning and memory, such as common phrases, entity names, and fixed collocations. These high-frequency patterns contribute little to reasoning but consume significant compute within attention.

    The source mentions an Engram-like memory augmentation mechanism, splitting the model’s capabilities into two parts:

    1. Reasoning tasks remain handled by the deep attention network.
    2. High-frequency local patterns and entity memory are handled via N-gram hash lookup.

    This concept is similar to N-gram Embedding lookup methods used in some open-source models. It should be noted that this is currently a research and model exploration direction, not an industry standard. Specific sources should be cited rather than presenting it as a definitive industry conclusion.

    The pseudocode below illustrates the data flow only; it is not directly executable and does not include error handling.

    1. # Example pseudocode: illustrates data flow only, not directly runnable
    2. # Assumed shapes:
    3. # hidden_states: [batch, seq, d_model]
    4. # recent_token_ids: IDs of the most recent n tokens, used for n-gram hashing
    5. # context_kv: Shared KV projected from the Encoder's final layer
    6. # ngram_table: Hash table mapping n-gram indices to d_model dimensional vectors
    7. # Actual implementation must handle hash collisions, index out-of-bounds, and device data transfers
    8. def decode_step(hidden_states, recent_token_ids, context_kv, ngram_table, topk=256):
    9. # 1. Hash the recent n-grams and look up the table to get local pattern vectors
    10. local_patterns = ngram_table.lookup(hash_ngram(recent_token_ids))
    11. # 2. Reuse shared KV, do not reconstruct for each layer
    12. keys, values = context_kv
    13. # 3. Two-level sparse indexing: first coarse-select topk candidate positions
    14. candidate_idx = coarse_select(hidden_states, keys, topk)
    15. # 4. Perform fine-grained attention only on candidate positions, and add the lookup results
    16. attn_out = sparse_attention(
    17. hidden_states + local_patterns, keys, values, candidate_idx
    18. )
    19. return attn_out

    The potential benefits of this design include reducing attention computation and lowering the KV cache size. However, several boundaries require verification:

    • A trade-off is needed between hash table capacity and memory usage; a larger table means fewer collisions but higher memory consumption.
    • The latency of the lookup operation depends on the table’s location; whether it resides in GPU memory or CPU memory makes a significant difference in latency.
    • For rare entities or novel combinations, a fixed n-gram table may not provide coverage, requiring validation through evaluation datasets.
    • Ablation studies (comparing performance with and without the lookup module) should be conducted to determine its actual contribution.

    4. How to Interpret Performance Metrics

    The source material provides several performance figures. The table below lists these claims alongside the missing information that readers should focus on for verification.

    Original Claim Missing Information Verification Points
    Total processing time reduced by nearly 40% in visual and multimodal experiments Model, hardware, input scale, measurement tools Find the original benchmark report and confirm the comparison baseline
    Language model phase processing time shortened by about two-thirds Batch size, context length, quantization method Confirm whether it is single-request latency or overall throughput
    Token generation speed increased from ~120 Token/s to over 350 Token/s Hardware model, concurrency, quantization status Token/s varies greatly under different batch sizes; distinguish between single-request and aggregate throughput
    Cache hit rate maintained above 99.5% Definition and statistical window of the hit rate Confirm whether it is measured by request, by token, or by cache block

    Given the missing conditions, these figures are better suited as directional references rather than direct selection criteria. Even with complete conditions, performance will vary with hardware, batching strategies, context length, quantization methods, and model versions; results may differ in a different environment.

    5. Deployment Checklist for Long-Context Agent Scenarios

    Before deployment, verify the following steps:

    1. Analyze the input-output ratio of the workload. Record the number of prefill tokens and decode tokens for each request. When inputs are significantly longer than outputs, the benefits of an asymmetric design are more likely to emerge.
    2. Estimate KV cache capacity. The cache size for standard Multi-Head Attention can be estimated using the formula: 2 × number of layers × number of KV heads × head dimension × context length × bytes per element × concurrency. Designs like shared KV will alter this calculation, so refer to the specific architecture.
    3. Define concurrency and batching strategies. When prefill and decode run concurrently, observe both Time-to-First-Token (TTFT) and Time-Per-Output-Token (TPOT) to avoid optimizing only one.
    4. Confirm the definition of cache hit rate. Clarify the statistical scope and time window before deciding whether to use it as a basis for capacity planning.
    5. Establish monitoring metrics. At a minimum, include TTFT, TPOT, throughput, memory usage, request queuing time, and error rates.
    6. Compare baselines in the same environment. Use identical hardware, quantization methods, and evaluation datasets to compare the original model with alternative solutions.

    6. Risks and Limitations

    • Limited applicability of performance conclusions. Hardware, batching, context length, cache hit rate, and model version all affect results. Do not directly apply test data from others.
    • Deep framework coupling. Certain optimizations rely on specific operator implementations or inference frameworks, potentially leading to high migration costs. Confirm version compatibility and licensing terms.
    • Memory lookup blind spots. A fixed n-gram table is effective for common patterns but may fail for rare or novel expressions. Targeted evaluation should be conducted before going live.
    • Cloud resource costs require empirical testing. When deploying in the cloud, GPU instance pricing, availability zones, and quotas will impact total cost. Base decisions on actual quotes and stress-test results rather than theoretical architectural estimates.

    7. Conclusion

    Asymmetric activation, memory lookup, and shared KV cache each target different bottlenecks in the inference process. They offer specific advantages for long-context agent scenarios, but most specific figures currently lack verifiable sources. When selecting an architecture, developers should first clarify their workload characteristics, conduct retests under unified baseline conditions, and then decide whether to adopt a specific architectural approach.