Elamur Research

CHAI: Clustered Head Attention for Efficient LLM Inference

Paper · 2024 · Saurabh Agarwal, Bilge Acun, Basil Hosmer et al.

Summary

Attention gives a language model access to the preceding text, but maintaining that access has a growing cost. During generation, a network keeps representations of earlier tokens in memory and repeatedly compares the current position with them. CHAI investigates a particular source of waste within this process: different attention heads sometimes perform almost the same selection over the same history. Each head may be active and sharply focused, yet several heads can focus alike. The paper asks whether their repeated selection calculations can be replaced by shared work without requiring another training run.

The authors’ answer is Clustered Head Attention, abbreviated CHAI. Its starting point is the separation between an attention head’s weighting operation and the information that operation combines. Queries and keys determine the weights assigned to positions; values supply the representations being weighted. CHAI chooses groups of heads whose weighting patterns resemble one another and evaluates a representative pattern for each group. It retains the separate values. That boundary is central to the proposal: the experiments show that replacing values with a representative’s values causes considerably more damage than sharing the query–key calculation alone.

The grouping procedure has preparation and runtime components. Attention observations from 1024 C4 samples guide a separate cluster count for each layer. These counts remain unchanged when the authors move between evaluation datasets. For an incoming request, the network initially executes ordinary attention. After the first five tokens have supplied observations, K-Means assigns heads to the predetermined number of clusters. Those assignments are retained during the remaining generation. The arrangement reflects the authors’ empirical findings that redundancy differs across layers, that useful groupings depend on context, and that memberships frequently settle sufficiently early to permit reuse.

Tests involve OPT-66B and the LLaMA networks with 7B and 33B parameters. The task suite includes PIQA and HellaSwag, alongside ARC’s challenge and easy variants and BoolQ. The headline efficiency claims are up to 21.4% lower combined key-and-value cache storage and acceleration reaching 1.73×. No fine-tuning is required. Accuracy is not preserved exactly: some task measurements fall below the original attention baseline, while others remain close or increase slightly. Request-dependent assignments outperform the fixed CHAI grouping in the reported accuracy entries, and the LLaMA results are substantially less affected than the more aggressive settings of the pruning comparisons.

The evidence supports an economical way to exploit repeated attention behavior after training, but it needs careful numerical reading. The abstract’s 3.2% maximum accuracy deviation does not align with every maximum stated later in the discussion. First-token acceleration is described as 1.72× in the body and 1.73× in a caption. Continuation latency receives a separate claim involving 5×, with different wording between caption and prose. These inconsistencies prevent treating the headline as a complete, uniformly specified performance guarantee. The more informative result is the combination of task-specific accuracy measurements, a clearly delimited sharing intervention, and separate observations about cache storage and execution time.

Interesting ideas

Reuse decisions before merging representations. Several components can agree on which inputs deserve emphasis while encoding those inputs differently. CHAI exploits this distinction by sharing the weighting calculation and preserving the material being weighted. The same design question arises in retrieval, document interpretation, and evidence processing: can the expensive selection be reused while each consumer retains its own representation? The value-sharing experiment makes this a testable architectural boundary rather than a general instruction to merge similar components.

Let adaptation happen at different timescales. Some properties can be estimated before a request arrives; others require seeing that request. CHAI assigns cluster capacity during preparation and cluster membership during execution. This division avoids repeating the whole search whenever the context changes. It is useful in systems where resource limits are relatively stable but the best allocation of those resources varies with the document, query, or workload.

Pay for observation only when it predicts reusable behavior. An optimization can lose its benefit if discovering redundant work requires executing that work repeatedly. CHAI observes an initial portion of generation and uses it to govern the continuation. The general lesson is to measure persistence before committing to an early decision. A short diagnostic period can support cheaper repeated execution, provided later behavior remains sufficiently compatible with what the diagnostic observed.

Find duplication among useful components. A component need not be weak or inactive to offer a sharing opportunity. The paper contrasts heads with almost uniform attention against heads that are selective in similar ways. This distinction transfers to ensembles, rule systems, and specialist workers. Eliminating an unhelpful contributor and sharing the work of helpful contributors are different interventions, with different evidence requirements and failure modes.

Adjust compression to local diversity. CHAI’s layer-specific calibration responds to the fact that redundancy is uneven. A single grouping budget would ignore stages where independent behavior remains important and stages where repetition is abundant. Similar profiling can guide approximations in multi-stage pipelines. The relevant question is how much distinction a particular stage needs to preserve, rather than how much reduction a uniform policy can impose.

Evaluate the complete resource tradeoff. Reduced arithmetic, reduced retained state, and acceptable task behavior are separate achievements. CHAI measures each, and its timing discussion also distinguishes preparation from continuation. This perspective applies to any adaptive optimization: the selection mechanism must earn its own cost, storage savings must be measured at the correct scope, and output quality must be checked through the final task rather than inferred from an intermediate similarity score.

Deep dive: CHAI: Clustered Head Attention for Efficient LLM Inference

CHAI clusters attention heads during inference to save computation and cache memory; explore its design, accuracy results, and limits. · about 36 minutes to read

How Mova uses it

Mova’s native linguistic core is a Rust system organized around explicit rules, structured representations, and learned parameters. Its GPU parser is a separate transformer-based path. CHAI’s immediate setting—autoregressive attention during generation—therefore differs from most of Mova’s native computation. The connections below concern both a possible GPU investigation and broader transfers to reading, routing, evidence handling, and evaluation. The status labels describe proposed correspondences with documented mechanisms; they do not establish an implemented CHAI application or a measured benefit.

Idea: Reuse a selection while retaining separate interpretations. Where: Section 3.4, Figure 3, and Section 4.5’s value-sharing comparison. Area: semantic processing. Mova: частково є (prag frames and world representations preserve different roles for structured information). If several readers retrieve the same passage, they could reuse passage selection while independently retaining participants, quantities, epistemic status, and conclusions. Agreement about a passage would not establish that their interpretations are interchangeable. Why Mova: this could reduce repeated retrieval while protecting distinctions required for explanations and sound knowledge admission.

Idea: Put durable capacity choices before contextual assignments. Where: Sections 3.2–3.3 and Figure 10. Area: operational routing. Mova: частково є (layers supplies registered domains and transparent routing; the deputy resolves configured capabilities). An experimental scheduler could establish an admitted processing budget independently of the specialists chosen for a particular document. The budget and assignment would remain separately inspectable. Why Mova: this could make contextual allocation cheaper without concealing which operations were available or selected.

Idea: Test an early observation period before fixing a continuation policy. Where: Section 3.3 and Figure 9. Area: sequential execution. Mova: нове (an analogous policy for native reading is not established in the documented scope). A reader might inspect an initial segment before deciding which optional analyses to continue. Its observation window would require independent measurement; the paper’s five-token choice supplies no suitable constant for Mova. Why Mova: longer reading tasks might avoid repeated allocation decisions when early evidence proves predictive.

Idea: Distinguish duplicated insight from absent insight. Where: Section 2’s DejaVu discussion and Figure 4. Area: analysis of specialists. Mova: нове (a general diagnostic for this distinction is not documented). Several mouse profiles could each produce useful but overlapping observations. An analysis should distinguish that case from profiles that produce no discriminative information, because sharing and disabling have different consequences. Why Mova: valuable observations might be computed economically without treating agreement as evidence of uselessness.

Idea: Measure redundancy separately for each processing stage. Where: Section 3.1 and Figures 6–8. Area: approximation policy. Mova: частково є (docs/gpu-exec.md distinguishes exact stages from evaluated approximants). A further experiment could profile repeated work within parsing, frame extraction, and retained-graph querying independently. Any sharing budget would follow those measurements instead of a universal reduction setting. Why Mova: stages that preserve different kinds of information should not inherit the same tolerance for approximation.

Idea: Judge an optimization by quality, time, and retained state. Where: Sections 4.2–4.4. Area: evaluation. Mova: вже є (tools/dictindex separates storage, timing conditions, coverage, and result hashes; GPU execution reports agreement). CHAI reinforces this existing separation when assessing reused computations. A smaller intermediate store would need its own behavioral and timing checks. Why Mova: independent measurements prevent a memory improvement from being mistaken for improved understanding or faster execution.

Idea: Investigate correlated attention before attempting a parser optimization. Where: Section 3.1 and Figures 2, 6, and 7. Area: GPU dependency parsing. Mova: нове (CHAI-specific profiling of gparse is not established). The GPU parser could be examined for attention patterns that repeat within a layer. Its parsing architecture and task differ from the paper’s generation setting, so neither useful redundancy nor transferable acceleration can be assumed. Why Mova: an observational study could determine whether an implementation effort has a real target.

Idea: Share derived work over the existing document graph. Where: Section 3.1’s grouping objective. Area: native reading. Mova: частково є (world/src/knowledge/retention/mice.rs gives specialists a common parse and retained graph). Beyond sharing those inputs, Mova could inspect whether profiles repeatedly execute identical graph queries or extraction steps. Exact memoization and approximate grouping would need separate treatment. Why Mova: computation saved on repeated graph access could remain available for distinct proof obligations.

Idea: Keep intermediate resemblance weaker than logical equivalence. Where: Section 3.1’s approximate within-cluster condition. Area: mathematical conformance. Mova: вже є (docs/hybrid-system.md, groupants, and correspondence tooling distinguish observable agreement from equivalence). A cluster of similar outputs could justify an explicitly scoped approximant, but not silently authorize substitution of logical rules. Why Mova: the declared observation must explain what has been established and where a shortcut can fail.

Idea: Preserve evidence identity through shared execution. Where: Figure 3 and Section 4.5. Area: provenance. Mova: частково є (tools/dictindex retains posting identifiers, credits, and original sentence references). Shared extraction could still return separate references to the supporting occurrences and their licences. CHAI’s value preservation motivates the separation architecturally; it does not supply a provenance policy. Why Mova: reducing repeated work should not erase the sources needed to review a dictionary proposal.

Idea: Protect epistemic distinctions when outputs look similar. Where: Section 4.5’s contrast between attention sharing and full-head sharing. Area: pragmatics and knowledge admission. Mova: частково є (Frame::evid, EvidKind::Inferred, and retention checks distinguish reported or inferred content). A proposed cache for frame interpretation should include epistemic status in its identity or return structure. Otherwise similar propositions could be reused across incompatible assertion conditions. Why Mova: computational overlap must not promote hearsay into an asserted fact.

Idea: Freeze calibration choices before downstream evaluation. Where: Section 3.2’s reuse of C4-derived cluster counts. Area: assessment design. Mova: частково є (held-out gates and separation of teaching from assessment are documented). A reuse policy could be calibrated on admitted development material and then held fixed during assessment. The calibration corpus, configuration, and source identity should accompany the result. Why Mova: this would help separate a transferable optimization from adjustments tailored to assessment items.

Idea: Establish whether contextual assignment justifies its machinery. Where: Section 3.3 and Tables 1–3. Area: controlled comparison. Mova: нове (this comparison for shared native observations is not documented). An adaptive grouping policy could be tested against a fixed grouping under the same declared capacity. The result would isolate the contribution of context-sensitive assignment from the contribution of sharing itself. Why Mova: additional routing logic should provide a measurable benefit commensurate with its cost.

Idea: Include arbitrary grouping as a diagnostic control. Where: Figure 1 and Appendix Figure 14. Area: evaluation controls. Mova: частково є (school reports and regression gates already use negative controls). A research evaluation could compare a proposed similarity rule against uninformed groupings under controlled conditions. Production execution would retain Mova’s deterministic contract. Why Mova: a control can expose a complicated selection rule whose apparent success comes merely from reducing work.

Idea: Ablate the precise boundary being shared. Where: Section 4.5 and Table 4. Area: experiment design. Mova: частково є (changes to rules and parameters are regression-gated). For reading, separate experiments could reuse retrieval, reuse an extraction, or reuse a conclusion. Each intervention would be checked independently rather than described under a single broad optimization label. Why Mova: this would reveal where important distinctions disappear as reuse becomes more aggressive.

Idea: Measure the persistence of an assignment. Where: Section 3.3 and Figure 9. Area: longitudinal analysis. Mova: нове (persistence of warm-up-based native assignments is unknown). If early observations select specialists, a diagnostic run could record when subsequent material would have selected differently. A topic shift or newly introduced entity would remain a reason to reconsider an assignment. Why Mova: this could identify the conditions under which a cheap continuation policy becomes unreliable.

Idea: Charge adaptation to the request that needs it. Where: Section 4.4’s distinction between first-token and continuation timing. Area: performance accounting. Mova: частково є (tools/twin compares prospective and observed costs; dictionary measurements specify timing exclusions). Experiments with adaptive reuse should expose observation, selection, and state-preparation costs alongside later execution. Why Mova: savings during repeated work are useful only when the complete task benefits.

Idea: Remove executable work rather than merely describing sparsity. Where: Section 2’s hardware discussion and Section 4.4. Area: systems engineering. Mova: частково є (compiled knowledge, typed constants, and native Rust handlers make operations explicit). A proposed reuse rule should reduce actual queries, memory transfers, or calculations in the implementation being measured. Why Mova: logical simplification alone cannot establish a runtime improvement.

Idea: Retain a clearly identified reference path. Where: Section 4’s comparisons against ordinary multi-head attention. Area: regression diagnosis. Mova: вже є (CPU execution is the reference for assessed claims). Any new sharing mechanism should have an explicit execution identity and remain comparable with the established behavior. Why Mova: a reference makes changed answers traceable when lower resource use accompanies reduced agreement.

Idea: Report individual tasks and failure cases. Where: Tables 1–3. Area: evaluation reporting. Mova: вже є (school traces and parser diagnostics retain item-level or task-specific evidence). Reuse experiments should preserve construction-sensitive failures and source conditions rather than reporting only a favorable maximum. Why Mova: a broad efficiency claim can conceal damage to the particular linguistic distinctions Mova is intended to explain.

Idea: Inspect naturally uneven groups. Where: Section 4.5 and Figure 13. Area: scheduling and workload analysis. Mova: нове (comparable grouping measurements for mouse observations are not established). An experiment could determine whether many specialists repeatedly share a common operation while a smaller set performs distinctive work. Equal allocation would remain a hypothesis instead of a default conclusion. Why Mova: observed skew could guide caching while preserving uncommon analyses.

Idea: Separate an execution shortcut from a learning event. Where: Sections 3.4–3.5’s inference-only intervention. Area: architecture. Mova: вже є (docs/hybrid-system.md distinguishes receipts, reviewed knowledge, and parameter training). Reusing an observation should not admit a dictionary meaning, revise a seed, or convert a worker result into supervision. Why Mova: evidence that an execution path is economical is different from evidence that new knowledge is trustworthy.

Idea: Test combined optimizations jointly. Where: Section 2’s quantization discussion. Area: experimental compatibility. Mova: частково є (groupants and approximant tooling require declared assumptions and evidence). Shared graph computations, compressed storage, and GPU stages might interact through both cost and error. Their combined behavior would need measurement instead of an assumed accumulation of benefits. Why Mova: individually acceptable shortcuts can alter each other’s practical value.

Idea: Keep selected representatives inspectable. Where: Sections 3.3–3.5 and Figure 10. Area: explainability. Mova: частково є (routing decisions and bounded worker results already retain diagnostic information). A proposed grouping mechanism could record the compared observation, assigned group, selected representative, and source-bound scope. The paper does not establish which representative policy would suit Mova. Why Mova: failures become easier to diagnose when the reused computation can be identified.

Idea: Connect a similarity score to downstream consequences. Where: Section 3.1’s correlation evidence and Section 4.2’s task evaluation. Area: statistics and validation. Mova: частково є (confidence reliability analyses and held-out behavioral gates are documented). Similarity between native observations should be checked against final answer behavior, not treated as a sufficient safety criterion. Why Mova: an appealing intermediate statistic may overlook the rare distinction that changes a logical conclusion.

These are research proposals or connections to existing practice. No CHAI-derived acceleration, memory reduction, or quality result is established for Mova by the documented evidence. In particular, the paper’s numerical gains should not be transferred to the native readers or GPU parser.

The problem and its context

The cost is in repeated access to history

The paper belongs to research on efficient networks and compression, with an emphasis on execution after training. Its concern is practical: a large network can require several GPUs for an individual request, while attention contributes substantial arithmetic and intermediate storage. The authors describe situations in which multi-head attention accounts for over 50% of the compute and memory burden. That statement motivates the target; it is not a measured fraction established for every network and workload in the evaluation.

A transformer represents tokens through a sequence of processing blocks. In the decoder-only architecture discussed here, a block contains self-attention and an MLP. Attention allows a position to draw on other permitted positions in its context. The MLP supplies another learned transformation within the block. CHAI intervenes in attention instead of attempting to replace the entire decoder block.

The head structure gives attention several separately learned ways to weight context. The paper’s examples include 32 heads in each LLaMA-7B layer and 64 in each LLaMA-65B layer. Each additional head brings its own projections and attention calculation. It also brings associated state that must be available when generation continues.

Caching changes the balance of work. Rather than rebuilding representations of previous positions at every continuation step, an inference system retains their keys and values. This avoids recomputation, but the stored history expands with sequence length. Attention thus presents related but distinct costs: generating or reading representations, comparing queries with keys, normalizing attention scores, and applying the resulting weights to values.

CHAI seeks an opportunity that affects both arithmetic and retained state. It asks whether the same sequence is being scored repeatedly in sufficiently similar ways that some query–key paths can be omitted. The proposed reduction follows the head dimension, while preserving the token history and the distinct value representations.

Earlier efficiency strategies address different parts of the problem

The authors place their work alongside several established approaches. Hardware-aware methods improve the execution of attention operations. The references include FlashAttention-2, whose title emphasizes parallelism and work partitioning. CHAI’s account groups this work with broader hardware–software efforts; its own contribution is a reduction in selected attention work instead of a new custom kernel.

Distillation is another route. The paper cites DistilBERT and Distilling Step-by-Step, among other examples. These references establish distillation as part of the efficiency landscape. CHAI pursues a different operational requirement: apply an intervention to an already trained network without learning a smaller replacement.

Architecture search and alternative transformer constructions also appear in the discussion. Reformer is among the cited works. The paper does not supply a direct experimental comparison with every architectural approach it names. Those references explain the surrounding design space, whereas the main accuracy comparisons concern pruning and CHAI’s own static variant.

Quantization reduces numerical precision. CHAI cites approaches including GPTQ and LLM.int8(). The authors argue that quantization and attention grouping target different sources of expense. Their suggestion of compatibility is plausible within that distinction, but the paper does not test a combined configuration.

Why removing components is difficult

Pruning aims to reduce a trained network by discarding weights or structures. The paper describes earlier procedures that require gradients, iterative optimization, or additional training. Such preparation can itself be expensive at the scale of the networks under discussion. CHAI’s motivation includes avoiding that adaptation burden.

There is also a gap between sparse mathematics and fast hardware execution. The authors argue that removing scattered weights does not reliably produce acceleration on GPUs without suitable sparse-operation support. This makes structured changes attractive: reducing heads, layers, or matrix rank can alter executable work more directly. Yet those approaches may still require costly decisions or recovery training.

The cited study of specialized heads examines attention-head pruning. CHAI moves the immediate criterion from individual importance to shared behavior. If two useful heads produce similar selection patterns, a representative calculation might serve both. Neither head needs to be wholly dispensable for that narrower intervention to be considered.

DejaVu provides the closest runtime comparison. As described in CHAI, it predicts which portions of the network can be skipped for a given context. Its attention-pruning argument draws on heads whose weights are broadly uniform over tokens. CHAI’s authors inspect that behavior and find a contrast between their OPT and LLaMA examples.

In OPT-66B, the visualizations contain heads that give similar weight across positions. In the LLaMA-7B example, heads tend to concentrate on particular positions instead. The latter pattern leaves less room for a criterion based on uniformity. It nonetheless permits another kind of repetition: several heads can concentrate on the same position.

The authors suggest that longer training and more data could explain the difference between the network families. That explanation is conjectural within this paper. The experiments do not retrain matched architectures under controlled data and duration settings to establish the cause.

Sharing by architecture and sharing by observation

Multi-query attention and GQA introduce component sharing as an architectural choice. CHAI discusses these approaches as ways to reduce cache demands, while emphasizing the expense of training or adapting a network to use them. The discussion refers to LLaMA 2 in that context.

CHAI’s contrast is observational. Rather than assuming a particular sharing structure before training, it examines the behavior of independently parameterized heads afterwards. A configuration is then chosen from the redundancy that actually appears. The learned weights stay intact, although the runtime computation no longer follows every original query–key path.

Token-oriented cache compression is another neighboring idea. The paper describes methods that retain selected important or recent token states. According to its comparison, such procedures can still execute the full transformer calculation before deciding what to keep. CHAI tries to omit some calculation as well as reduce stored keys.

Speculative decoding operates at a different level again. A draft generator proposes tokens, and a target network checks them. The authors acknowledge its latency benefits while noting the resources needed for both participants. CHAI instead reduces work inside the target’s attention process. The paper offers no joint experiment showing how these approaches interact.

The method, step by step

What the attention calculation contains

Consider a layer receiving token representations collected in a matrix called x. The paper denotes the sequence length by T and the representation dimension by d. Thus x has T rows and d columns. A head is indexed by h, and H denotes the head count.

The learned projections produce keys, queries, and values. The paper presents these as separate matrix products.

Kʰ = xW_Kʰ

Kʰ denotes the keys belonging to head h. The superscript h identifies a head; it does not indicate exponentiation. W_Kʰ is the learned key projection for that head, and x is the input representation matrix.

Qʰ = xW_Qʰ

Qʰ contains the queries for head h. W_Qʰ is the corresponding learned projection. Different heads can produce different queries from the same x because their projection matrices differ.

Vʰ = xW_Vʰ

Vʰ contains that head’s values, while W_Vʰ is its value projection. These values are the material combined after the weighting pattern has been established. They need not coincide merely because two heads choose similar weights.

The paper then gives a scaled attention expression.

Aʰ = σ(Qʰ(Kʰ)ᵀ / √d)

Aʰ is the head’s attention matrix. The transpose operation, marked by ᵀ, arranges the keys so that multiplication compares queries with keys. The symbol σ denotes softmax, which turns comparison scores into normalized attention weights. The scale uses √d, following the notation printed in the paper.

This equation separates the operation that chooses weights from the operation that combines values. The next expression collects the resulting weighted representations across heads.

y = ⊕ₕ AʰVʰ

The output is y. The symbol ⊕ indicates concatenation over the heads indexed by h. Each product AʰVʰ applies one head’s attention matrix to that head’s values. This compact notation expresses the concatenation shown in expanded form by the authors, without depending on the endpoint indexing of that expansion.

The optimization question now becomes precise. When several Aʰ matrices resemble one another, some of their calculation may be shared. Nothing in that premise establishes that the associated Vʰ matrices are equivalent. CHAI preserves this distinction throughout its principal design.

The grouping objective concerns behavior

The paper defines a set S containing the query–key pairs for the heads in a layer. It seeks groups Sᵢ whose members produce similar results under a simplified attention function.

f(Q, K) = σ(QKᵀ)

Here f maps queries Q and keys K to attention weights. The grouping formulation leaves out the scale appearing in the earlier attention equation. Its role is to express the behavior being compared, rather than provide a separate account of all implementation details.

The groups must cover the original collection.

⋃ᵢ₌₁ᵏ Sᵢ = S

The index i identifies a group, k is the chosen cluster count, and Sᵢ is the collection assigned to group i. The union symbol requires every original pair in S to appear in the grouping. The operational procedure uses clustering to assign heads.

Within a group, the intended relationship is approximate agreement.

f(Qⁿ, Kⁿ) ≈ f(Qᵐ, Kᵐ)

The superscripts n and m identify heads in the same cluster. The approximation sign means their weighting patterns should be close enough for the proposed sharing intervention. It is not a theorem that their complete contributions to the network are identical.

There are inconsistencies in the printed notation: one member of the stated query–key collection contains a value symbol, and the ordering of arguments varies. The prose and architecture diagrams resolve the intended object. CHAI groups heads by similarity of attention scores produced from queries and keys, while values remain separate.

The formulation also leaves an important distinction between objective and guarantee. It describes the desired relationship among grouped heads but supplies no bound converting attention similarity into final prediction error. Benchmark results are therefore necessary to establish whether the approximation is acceptable.

First establish the structure of redundancy

The authors inspect correlations among head attention patterns before constructing the runtime scheme. Their LLaMA-7B analysis includes 1024 C4 samples and a view of an individual sample. The collection-level view reveals recurring structure; the individual view reveals what averaging can conceal.

A visual example contains groups with correlation above 0.95. That observation shows that strong agreement can occur. It should not be read as an explicitly enforced similarity threshold for every cluster in every experiment, because the method description does not establish such a universal rule.

The layer comparison is consequential. Earlier layers contain more varied attention behavior, while later layers show greater overlap. This means a uniform sharing policy would ignore an important property of the network. CHAI chooses how many representatives are needed separately for each layer.

The single-example comparison adds another constraint. Heads that correlate over a broad collection are not necessarily the best companions for a particular request. The amount of sharing and the identity of shared heads therefore become separate decisions.

This separation gives the method its preparation/runtime structure. Offline analysis estimates how many groups a layer needs. Request observations determine who belongs to those groups.

Calibrate the group count outside the request path

For each network, the authors collect attention information using 1024 samples from C4, associated with the unified text-to-text study. They inspect clustering error as the number of groups changes. Error is described as squared distance accumulated relative to the nearest cluster.

More clusters allow a closer fit to diverse head behavior. The elbow procedure looks for a region where adding groups brings less improvement in that fitting error. CHAI chooses counts near the flattening portion of the curve.

The choice is made independently for each layer. A layer with varied outputs can retain more representatives, while a highly correlated layer can use fewer. Figure 8 illustrates these different error profiles and marks the selected settings.

This procedure involves an offline judgment rather than a new learned predictor. The authors explicitly regard repeated elbow analysis as unsuitable during inference. Moving it outside the request path makes the runtime decision smaller, but does not remove the need for calibration.

The chosen counts are then reused across downstream datasets. They are not retuned separately for PIQA, HellaSwag, or the other reported tasks. This is relevant evidence about evaluation discipline: the same calibrated capacity is carried into different task settings.

No weight update is performed during count selection. Activation collection and clustering analysis are still work, but they differ from fine-tuning the network to compensate for the approximation.

Determine who shares from an initial observation

If membership were recalculated from full attention outputs at every continuation step, the sharing decision would arrive too late. The original work would already have happened. The system could report redundancy without avoiding it.

The authors instead study whether an early assignment persists. Figure 9 examines membership changes during next-token prediction. Their observation is that assignments change relatively little once the fifth token has been reached.

CHAI uses this empirical result to choose an initial observation period. Ordinary multi-head attention processes the beginning of a request. Once five tokens have been observed, K-Means forms the layer’s groups using the count already established offline.

The resulting memberships remain fixed throughout the continuation. Runtime adaptation therefore happens once for that request, rather than at every subsequent step. This arrangement lets later savings repay the initial observation and clustering cost.

CHAI-static removes this contextual membership decision. It reuses an assignment derived from the offline C4 analysis. Comparing it with CHAI tests whether observing the present request supplies useful information beyond the offline grouping structure.

One schematic caption describes the online step less precisely than the main account. The repeated procedural explanation distinguishes the roles clearly: offline analysis chooses counts, and online clustering assigns members.

From calibration to shared attention

The steps in order.

From calibration to shared attentionStep 1: Profile attention on C4 samples1. Profile attention on C4 samplesStep 2: Set each layer’s cluster count2. Set each layer’s cluster countStep 3: Process an incoming request normally3. Process an incoming request normallyStep 4: Gather the first five tokens4. Gather the first five tokensStep 5: Cluster heads using observed behavior5. Cluster heads using observed behaviorStep 6: Reuse representative attention within groups6. Reuse representative attention within groupsStep 7: Keep values and discard redundant keys7. Keep values and discard redundant keys

Execute only the selected weighting paths

After grouping, a representative supplies the attention weights used within its cluster. The redundant query–key routes no longer need independent execution. Their associated keys can also be removed from the retained history.

The distinct values are preserved. Each member’s information can still be weighted even when the weights come from a representative path. This is the narrower intervention supported by the paper’s principal experiments.

As a consequence, “key-and-value cache reduction” refers to the combined cache becoming smaller through key removal. It does not mean that the principal CHAI configuration eliminates both keys and values for every redundant head. This distinction explains why the cache saving has a different scope from the reduction in query–key calculations.

The implementation uses Meta’s xFormers. The authors emphasize that its reduced computation remains dense, so their implementation does not depend on the unavailable sparse kernels that complicate comparison with DejaVu.

There are therefore several resources to keep separate. Offline calibration has its own cost. Request initialization includes observation and clustering. Continued execution uses the selected shared paths. Retained storage includes every value but fewer keys. Accuracy measures the downstream consequence of all those choices together.

Experiments and results

Experimental scope and reading conventions

The hardware is NVIDIA V100. LLaMA-7B inference uses a single GPU, whereas LLaMA-33B uses four. OPT-66B runs on eight GPUs within a node. These are the stated conditions for the evaluation, and they constrain the interpretation of practical acceleration.

The accuracy suite draws on PIQA and HellaSwag. It also includes both ARC variants, associated with the ARC reasoning challenge, and the yes/no benchmark BoolQ. The paper uses slightly different capitalization and naming in places, but the evaluation concerns these tasks.

Unmodified multi-head attention provides the reference. The comparisons include CHAI-static and CHAI, together with DejaVu configurations. SpAtten appears in the LLaMA tables as a method that removes tokens and heads.

The main accuracy tables mix absolute scores and changes. The MHA row gives accuracy itself. Rows beneath it give deviations relative to that row. As a result, an entry such as -3.2 should be read as the printed accuracy change, not a negative absolute accuracy. The article retains those entries without reconstructing missing absolute results.

The paper does not clearly state the evaluation split for these task tables. It also gives no uncertainty intervals for their accuracy entries. Those omissions matter most when interpreting small favorable changes: a positive table entry is a reported observation, not proof of a reliable capability gain.

OPT-66B checks the comparison setup

OPT-66B is used partly to verify that the authors can reproduce DejaVu’s behavior. They use its available code and train its MLP predictor components. The comparison setting is 50% sparsity, following the configuration discussed in the paper.

For original attention, PIQA accuracy is 78.4 and HellaSwag accuracy is 71.1. The ARC-Challenge baseline is 41.6; ARC-Easy is 64.7. BoolQ records 65.4.

CHAI’s deviations are close to those reference values. PIQA has -0.15, and HellaSwag has 0.1. The two ARC changes are 0.1 for the challenge task and -0.1 for the easy task. BoolQ shows -0.6.

The static grouping is less favorable in the reported entries. This is evidence that the runtime membership step contributes even in a network family where the comparison pruning method already works comparatively well.

OPT-66B HellaSwag accuracy deviations from original attention

Observing the request improves the grouping result over the fixed alternative.

OPT-66B HellaSwag accuracy deviations from original attentionDejaVu-50%: -0.7DejaVu-50%-0.7CHAI-static: -1.7CHAI-static-1.7CHAI (this paper): 0.1CHAI (this paper)0.1
The numbers
System or settingreported accuracy deviation
DejaVu-50%-0.7
CHAI-static-1.7
CHAI (this paper)0.1

This chart concerns one task and one accuracy measure. It is not a latency comparison, and its entries do not establish equal computational reduction across methods. Its most direct use is to isolate the reported quality difference between fixed and request-dependent grouping.

LLaMA-7B exposes the cost of aggressive pruning

For LLaMA-7B, the original-attention accuracies are 79.8 on PIQA and 76.1 on HellaSwag. The ARC-Challenge result is 47.5, while ARC-Easy is 72.8. BoolQ reaches 76.0.

The CHAI row contains -2.0 on PIQA and -3.2 on HellaSwag. ARC-Challenge has -0.5. ARC-Easy shows 0.3, and BoolQ shows 0.1. These entries describe a mixed quality outcome, with losses on some tasks and small favorable changes on others.

CHAI-static is weaker across the reported tasks. Its PIQA deviation is -4.0, and its ARC-Challenge deviation is -3.7. The other entries likewise favor CHAI’s contextual assignment.

DejaVu is evaluated at 10%, 30%, and 50% sparsity. The larger settings can be highly damaging in this network. The HellaSwag comparison makes the pattern particularly visible.

LLaMA-7B HellaSwag accuracy deviations by inference method

CHAI retains substantially more benchmark accuracy than the aggressive pruning settings.

LLaMA-7B HellaSwag accuracy deviations by inference methodDejaVu-10%: -4.7DejaVu-10%-4.7DejaVu-30%: -18.6DejaVu-30%-18.6DejaVu-50%: -50.7DejaVu-50%-50.7SpAtten: -42.5SpAtten-42.5CHAI-static: -4.3CHAI-static-4.3CHAI (this paper): -3.2CHAI (this paper)-3.2
The numbers
System or settingreported accuracy deviation
DejaVu-10%-4.7
DejaVu-30%-18.6
DejaVu-50%-50.7
SpAtten-42.5
CHAI-static-4.3
CHAI (this paper)-3.2

SpAtten also incurs large losses in the table. On PIQA its deviation is -41.4, and on ARC-Easy it is -40.2. Those observations support the authors’ claim that attention grouping provides a better quality outcome than the tested alternatives in this setting.

They do not establish that CHAI dominates every possible tuning of those alternatives at a matched resource budget. The table reports particular configurations, and the runtime comparison is incomplete. Quality and reduction settings must remain attached to their respective methods.

There is also a reporting discrepancy. The evaluation prose assigns CHAI a maximum degradation of 3.7% for LLaMA-7B, whereas the CHAI table row contains -3.2 as its largest negative entry. The 3.7 value appears in the static row on a different task. The paper does not explicitly resolve the mismatch, so the task-level entries provide the clearest usable evidence.

LLaMA-33B remains close to original attention

LLaMA-33B’s reference scores are 82.1 for PIQA and 82.8 for HellaSwag. ARC-Challenge records 57.8, ARC-Easy records 80.0, and BoolQ records 83.1.

For CHAI, the corresponding deviations are 0 on PIQA and -0.14 on HellaSwag. ARC-Challenge gives -0.21, while ARC-Easy gives 0.9. BoolQ has -0.04.

These measurements indicate close agreement with original attention across the reported tasks. The small changes should still be understood as benchmark outcomes under the stated setup. They do not imply identical predictions or establish that every individual question is unaffected.

The comparison with static membership is again favorable. CHAI-static has -0.5 on PIQA, -1.3 on ARC-Challenge, and -3.7 on ARC-Easy. The contextual procedure therefore matters even when the principal method’s deviations are small.

DejaVu’s 10% configuration is also relatively close on several tasks, but greater sparsity produces much larger losses. SpAtten has substantial negative entries as well. This fits the paper’s argument that the opportunity used by CHAI differs from removing heads judged individually unimportant.

The prose states 0.14% as the maximum CHAI degradation for this network. The table’s -0.21 on ARC-Challenge is incompatible with that maximum. Again, the contradiction should not be hidden by selecting the more favorable statement.

Memory savings concern the combined cache

For LLaMA-7B, the reported combined key-and-value cache reduction reaches 21.4%. The paper places that result beside a storage example: at sequence length 2048, the cache occupies around 1.2 GB, while weights occupy around 12 GB.

These are different memory categories. CHAI does not reduce the learned weight storage through its principal mechanism. It removes selected cached keys while retaining all values, reducing the history-related component.

The authors point to longer contexts and more simultaneous requests as possible uses of the released memory. The paper does not quantify those deployment outcomes directly. A measured reduction in cache size supports the possibility, but it is not itself a measured serving-capacity increase.

Latency needs a named measurement boundary

The first-token metric covers a request beginning from fresh context, including the work to construct its retained history. The continuation metric assumes that history is already available. These boundaries lead to different relationships between attention work, setup cost, and memory access.

In the first-token discussion, clustering overhead is included. At sequence length 2048, the body reports acceleration up to 1.72× for LLaMA-7B. The corresponding caption gives 1.73×.

For next-token timing, clustering overhead is excluded because membership has already been established. The body describes acceleration over 5× at sequence length 2048, whereas the caption says up to 5×. Figure 12’s overall caption and the paper’s headline emphasize 1.73×.

The qualitative pattern is that larger sequences offer more benefit. The exact quantitative account must nevertheless preserve which timing boundary is being discussed and which statement supplies the number. Treating all these claims as one interchangeable end-to-end result would obscure the paper’s own distinctions.

DejaVu’s hardware runtime is not measured against CHAI. The authors say the required specialized kernels were unavailable, preventing that comparison. Their argument that low sparsity is unlikely to yield large acceleration remains an expectation, not an experimental result.

What the ablations show

Shared weights do not make shared values safe

The most direct component ablation expands the sharing boundary. Ordinary CHAI retains each head’s values. The CHAI-QKV variant instead reuses the representative’s values as well as its query–key behavior.

Table 4 reports absolute task accuracy rather than the deviations used in the main tables. On ARC-Challenge, original attention scores 47.5, CHAI scores 47.0, and CHAI-QKV scores 41.29. The direction is clear: sharing the entire head’s representation is more damaging than sharing its weighting calculation.

The PIQA measurements show the same pattern.

PIQA accuracy when representative values are also reused

The narrower sharing boundary preserves more accuracy than full-head reuse.

PIQA accuracy when representative values are also reusedOriginal attention: 79.8Original attention79.8CHAI (this paper): 77.8CHAI (this paper)77.8CHAI-QKV: 61.93CHAI-QKV61.93
The numbers
System or settingaccuracy
Original attention79.8
CHAI (this paper)77.8
CHAI-QKV61.93

The CHAI label is starred because it identifies the principal proposed method. Original attention remains more accurate in this comparison.

This ablation explains why attention correlation must be interpreted carefully. Correlation concerns how positions are weighted. A head’s value projection can transform those positions into a representation that remains important even when another head supplies a similar distribution of weights.

The experiment therefore supports a specific architectural choice. It does not establish that values can never be compressed, nor that every conceivable value-sharing scheme would fail. It tests representative-value reuse in the configuration reported by the authors.

Context supplies useful membership information

The fixed CHAI variant retains membership from offline analysis. CHAI observes the current request before assigning heads. Their comparison tests whether the input-specific grouping matters after the cluster capacity has been chosen.

Every reported task entry in the main tables favors the contextual variant over CHAI-static. This pattern strengthens the claim that average correlation is insufficient to identify a universally suitable assignment.

The comparison is useful because it separates descriptive evidence from operational evidence. A correlation plot can show that heads overlap; it cannot by itself show that contextual assignment improves the approximation. The static comparison addresses that latter question through task performance.

It still does not exhaust the design space. The paper does not compare every possible assignment rule, observation window, or reclustering policy. Its conclusion is that the particular request-dependent procedure improves on its particular static alternative.

Membership persistence makes early observation worthwhile

Figure 9 examines changes in cluster membership as generation proceeds. The authors observe little additional change after the fifth token and use that result to justify the warm-up period.

This analysis addresses a central feasibility problem. Clustering every step could consume the work saved by grouping. Freezing a demonstrably useful early assignment allows the benefit to accumulate during later generation.

The persistence result is empirical rather than a guarantee. The paper does not show that all future continuations preserve the same grouping, nor does it prove that unchanged membership means unchanged approximation error.

Those are different properties. Heads may remain in the same cluster while the importance of their differences changes. Conversely, a changed cluster assignment might still produce similar downstream behavior. Membership analysis motivates the scheduling decision; benchmark accuracy evaluates its consequences.

Different layers need different budgets

The collection-level correlation plots show more repeated attention behavior toward later layers. Earlier layers retain a greater degree of variation. This supports the decision to choose cluster counts locally.

The elbow analysis examines fitting error as cluster capacity increases. Its selected points indicate where the authors judge additional capacity to have diminishing value. This gives a behavioral basis for the settings instead of choosing the same reduction everywhere.

The analysis does not demonstrate that those settings optimize a formal combination of accuracy, storage, and latency. Clustering error is an intermediate diagnostic. A point that looks attractive in that diagnostic still needs downstream evaluation.

The paper’s contribution here is a practical allocation strategy grounded in observed heterogeneity. It shows why layer identity matters without deriving a universal mapping from correlation to the ideal cluster count.

Useful groupings need not be balanced

Figure 13 studies cluster sizes at Layer-18 of LLaMA-7B using C4 observations. The authors describe cases where a large share of heads belongs to a common cluster, with other heads remaining in smaller groups.

This makes the redundancy more concrete. The method is not merely pairing heads or dividing a layer into equal blocks. It allows a common attention behavior to account for much of the duplication while preserving representatives for less common behavior.

That skew also matters for interpretation. A reduction strategy based on equal group sizes would impose a different structural assumption. The observed grouping is driven by behavior, and behavioral similarity can be unevenly distributed.

The analysis concerns the illustrated layer and samples. It should not be generalized into a fixed cluster-size law for all layers or requests.

Informed selection is compared with arbitrary combination

The accuracy-versus-cost figures include random combinations and static selection. The described settings involve combining 4, 8, 16, and 24 heads. This comparison asks whether choosing heads from observed behavior matters beyond simply reducing their independent execution.

The authors present CHAI as achieving the more favorable tradeoff in those plots. The text does not enumerate the full plotted coordinates, so it does not support reconstructing additional numerical accuracy or runtime values.

These comparisons complement the other analyses. Random grouping tests the usefulness of informed selection; static grouping tests context dependence; value sharing tests the component boundary. Together they explain the design more convincingly than an efficiency headline alone.

Limitations

Restrictions the authors explicitly discuss

The method incurs accuracy changes. The authors describe those changes as small in their preferred configuration, but the intervention is approximate. Neither the equations nor the experiments establish that outputs remain identical to original attention.

Calibration is required for each network. The offline collection and elbow inspection are preparation steps even though they do not update learned weights. Describing CHAI as requiring no fine-tuning should not be confused with saying that it requires no adaptation work.

Requests also incur an initial observation and clustering cost. The authors include that cost in the first-token discussion and exclude it from continuation timing. Both conventions can be useful, provided the boundary is visible. The steady continuation metric does not describe the entire request on its own.

The cache reduction has an explicit structural limit: values remain stored. The principal method removes redundant keys, not the entire corresponding history representation. The QKV experiment supplies evidence for that restraint by showing larger accuracy damage when representative values are reused.

The paper acknowledges that DejaVu’s specialized kernels were unavailable. Its measured runtime evidence is consequently narrower than its accuracy comparisons. A direct competing latency result cannot be inferred from the relative accuracy tables.

Compatibility with quantization is proposed rather than demonstrated. The authors argue that the interventions address different sources of expense, but no joint experiment establishes their combined memory use, acceleration, or accuracy.

Generalization boundaries visible to a careful reader

The evaluated setting is decoder-only inference with the named networks. The paper does not establish the same clustering behavior in encoder attention, transformer parsing, or non-neural execution systems. Broader transfers are hypotheses that need their own observations and experiments.

The task suite provides useful answer-accuracy measurements, but it does not characterize every property of generated text. Open-ended continuation quality, unusual inputs, and failures that occur outside these benchmarks remain outside the reported evidence.

The calibration source is limited as well. C4 observations support a reusable configuration in the tested downstream tasks. The study does not establish that the same counts would remain adequate under every domain or sequence distribution.

The chosen early observation period depends on persistence measured in the authors’ setting. A later change of subject or behavior could make fixed membership less suitable. The paper does not evaluate an extensive range of monitoring and reassignment policies that might address such cases.

The approximation objective contains no quantitative propagation guarantee. Similar weighting patterns can affect later computation differently depending on the values and subsequent layers. Correlation is evidence of an opportunity, while downstream accuracy remains the empirical check on exploiting it.

There are also reproducibility details that the narrative does not fully specify. It explains K-Means membership and representative attention, but does not provide a complete account of initialization, ties, representative choice, or every tensor arrangement. The conceptual algorithm is clearer than its complete executable specification.

Elbow selection introduces judgment. The paper gives fitting curves and chosen points, but no formal optimization that jointly balances task error and systems cost. A different calibration criterion could select different capacities. The study does not establish the reported choice as uniquely best.

The accuracy tables lack stated uncertainty intervals. Small positive deviations should therefore be treated cautiously. They demonstrate that the reported approximation sometimes remains very close to baseline performance; they do not establish a reliable improvement in the network’s underlying capabilities.

Resource claims have a defined scope

A reduction in the combined cache does not imply the same reduction in total device memory. Learned weights and other execution state remain. The paper’s separate cache and weight examples make that distinction important.

Likewise, fewer attention calculations do not establish a fixed speedup on all hardware. The experiments use the stated V100 setup and xFormers implementation. The authors argue that reducing dense work should have broad relevance, but they do not measure every framework, device, or serving arrangement.

The paper also does not directly quantify how cache savings translate into maximum context or concurrent request capacity. Those outcomes depend on the rest of the memory budget and execution arrangement. The authors’ suggested uses should remain possible consequences rather than reported deployment results.

Short requests deserve particular caution. An optimization with an initial observation cost has less continuation over which to recover that cost. The paper’s timing discussion makes overhead relevant, but it does not establish a universal request-length threshold for profitability.

The pruning comparisons also use different reduction settings. Better accuracy at a named setting does not alone prove a superior frontier under every matched resource budget. The incomplete runtime comparison restricts how strongly one can rank the methods as complete serving systems.

Numerical inconsistencies restrict precision

The abstract reports a 3.2% maximum accuracy deviation. The later LLaMA-7B discussion gives 3.7%, although the CHAI row’s largest printed loss is -3.2. These statements cannot all be treated as one consistent maximum.

For LLaMA-33B, the prose names 0.14% as the maximum degradation, while ARC-Challenge has a CHAI deviation of -0.21. The task entry should remain visible rather than being replaced by the more favorable general statement.

Latency reporting has a related problem. The first-token body text gives 1.72× at sequence length 2048, while its caption gives 1.73×. The continuation claim uses over 5× in the body and up to 5× in the caption.

The distinction between first-token and continuation timing explains why different kinds of acceleration can coexist, but it does not resolve the conflicting wording within each kind. A precise account must attach each number to its stated metric and location.

The notation irregularities are less consequential for the main intuition, because the operational description consistently identifies what is shared. They still matter when treating the paper as a formal specification. The mathematical statement expresses an approximate grouping aim; it does not define an exact equivalence relation or certify an error bound.

The strongest supported conclusion is consequently bounded: observed similarity among attention patterns can support useful query–key sharing in the evaluated networks. The measured quality costs, preserved values, calibration procedure, hardware conditions, and reporting discrepancies are all part of that conclusion.

What came after

Cross-layer Attention Sharing for Pre-trained Large Language Models is a citing work dated 2026. Its title identifies attention reuse between layers as its subject. That creates a clear thematic connection with CHAI, which investigates sharing among heads inside a layer.

The citation information establishes neither the later algorithm nor its experimental outcome. It does not say whether that work adopts CHAI’s correlation analysis, uses an early observation period, preserves separate values, or performs offline cluster calibration. Those mechanisms should therefore not be attributed to it on the strength of the title.

The distinction between architectural directions is still useful. CHAI examines repeated selection across heads at a given depth; the later title points toward repetition across depths. Both concern whether independently executed attention needs to remain independent after training, but the conditions that make reuse appropriate can differ.

No further later studies are identified in the citation record available for this discussion. A detailed account of subsequent gains or of a broader research lineage would require evidence beyond that record. What can be said securely is that attention sharing remained an explicit research subject, and that the named later work considered a structural axis beyond the within-layer grouping studied by CHAI.

Cite

Cite as Saurabh Agarwal, Bilge Acun, Basil Hosmer, Mostafa Elhoushi, Yejin Lee, Shivaram Venkataraman, Dimitris Papailiopoulos and Carole-Jean Wu. 2024. CHAI: Clustered Head Attention for Efficient LLM Inference. arXiv:2403.08058.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.48550/arxiv.2403.08058 · arXiv 2403.08058

@misc{agarwal2024chai,
  title = {{CHAI: Clustered Head Attention for Efficient LLM Inference}},
  author = {Saurabh Agarwal, Bilge Acun, Basil Hosmer, Mostafa Elhoushi, Yejin Lee, Shivaram Venkataraman, Dimitris Papailiopoulos and Carole-Jean Wu},
  year = {2024},
  doi = {10.48550/arxiv.2403.08058},
  eprint = {2403.08058},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.48550/arxiv.2403.08058}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/agarwal-2024-chai-clustered-head-attention-efficient/

References

62 references, from the paper's own bibliography.

  1. Deja Vu: Contextual Sparsity for Efficient LLMs at Inference Time. https://github.com/FMInference/DejaVu, 2024. our card
  2. Ainslie, J., Lee-Thorp, J., de Jong, M., Zemlyanskiy, Y., Lebrón, F., and Sanghai, S. Gqa: Training generalized multi-query transformer models from multi-head checkpoints. arXiv preprint arXiv:2305.13245, 2023. our card
  3. Bisk, Y., Zellers, R., Gao, J., Choi, Y., et al. Piqa: Reasoning about physical commonsense in natural language. In Proceedings of the AAAI conference on artificial intelligence, volume 34, pp. 7432–7439, 2020. our card
  4. Brown, T., Mann, B., Ryder, N., Subbiah, M., Kaplan, J. D., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A., et al. Language models are few-shot learners. Advances in neural information processing systems, 33:0 1877–1901, 2020. our card
  5. Chen, T., Frankle, J., Chang, S., Liu, S., Zhang, Y., Wang, Z., and Carbin, M. The lottery ticket hypothesis for pre-trained bert networks. Advances in neural information processing systems, 33:0 15834–15846, 2020a. OpenAlex ↗ · Scholar ↗
  6. Chen, X., Cheng, Y., Wang, S., Gan, Z., Wang, Z., and Liu, J. Earlybert: Efficient bert training via early-bird lottery tickets. arXiv preprint arXiv:2101.00063, 2020b. OpenAlex ↗ · Scholar ↗
  7. Clark, C., Lee, K., Chang, M.-W., Kwiatkowski, T., Collins, M., and Toutanova, K. Boolq: Exploring the surprising difficulty of natural yes/no questions. arXiv preprint arXiv:1905.10044, 2019. our card
  8. Clark, P., Cowhey, I., Etzioni, O., Khot, T., Sabharwal, A., Schoenick, C., and Tafjord, O. Think you have solved question answering? try arc, the ai2 reasoning challenge. arXiv preprint arXiv:1803.05457, 2018. our card
  9. Dai, S., Genc, H., Venkatesan, R., and Khailany, B. Efficient transformer inference with statically structured sparse attention. In 2023 60th ACM/IEEE Design Automation Conference (DAC), pp. 1–6. IEEE, 2023. OpenAlex ↗ · Scholar ↗
  10. Dao, T. Flashattention-2: Faster attention with better parallelism and work partitioning. arXiv preprint arXiv:2307.08691, 2023. our card
  11. Dao, T., Fu, D., Ermon, S., Rudra, A., and Ré, C. Flashattention: Fast and memory-efficient exact attention with io-awareness. Advances in Neural Information Processing Systems, 35:0 16344–16359, 2022. OpenAlex ↗ · Scholar ↗
  12. Dettmers, T. 8-bit approximations for parallelism in deep learning. arXiv preprint arXiv:1511.04561, 2015. OpenAlex ↗ · Scholar ↗
  13. Dettmers, T. and Zettlemoyer, L. The case for 4-bit precision: k-bit inference scaling laws. In International Conference on Machine Learning, pp. 7750–7774. PMLR, 2023. our card
  14. Dettmers, T., Lewis, M., Belkada, Y., and Zettlemoyer, L. Llm. int8 (): 8-bit matrix multiplication for transformers at scale. arXiv preprint arXiv:2208.07339, 2022. our card
  15. facebookresearch. xformers - toolbox to accelerate research on transformers. https://github.com/facebookresearch/xformers, 2023. Accessed: December 12, 2023. OpenAlex ↗ · Scholar ↗
  16. Fan, A., Grave, E., and Joulin, A. Reducing transformer depth on demand with structured dropout. arXiv preprint arXiv:1909.11556, 2019. our card
  17. Fang, C., Zhou, A., and Wang, Z. An algorithm–hardware co-optimized framework for accelerating n: M sparse transformers. IEEE Transactions on Very Large Scale Integration (VLSI) Systems, 300 (11):0 1573–1586, 2022. OpenAlex ↗ · Scholar ↗
  18. Frankle, J. and Carbin, M. The lottery ticket hypothesis: Finding sparse, trainable neural networks. arXiv preprint arXiv:1803.03635, 2018. OpenAlex ↗ · Scholar ↗
  19. Frantar, E., Ashkboos, S., Hoefler, T., and Alistarh, D. Gptq: Accurate post-training quantization for generative pre-trained transformers. arXiv preprint arXiv:2210.17323, 2022. our card
  20. Ham, T. J., Jung, S. J., Kim, S., Oh, Y. H., Park, Y., Song, Y., Park, J.-H., Lee, S., Park, K., Lee, J. W., et al. A 3: Accelerating attention mechanisms in neural networks with approximation. In 2020 IEEE International Symposium on High Performance Computer Architecture (HPCA), pp. 328–341. IEEE, 2020. our card
  21. Ham, T. J., Lee, Y., Seo, S. H., Kim, S., Choi, H., Jung, S. J., and Lee, J. W. Elsa: Hardware-software co-design for efficient, lightweight self-attention mechanism in neural networks. In 2021 ACM/IEEE 48th Annual International Symposium on Computer Architecture (ISCA), pp. 692–705. IEEE, 2021. OpenAlex ↗ · Scholar ↗
  22. Hoffmann, J., Borgeaud, S., Mensch, A., Buchatskaya, E., Cai, T., Rutherford, E., Casas, D. d. L., Hendricks, L. A., Welbl, J., Clark, A., et al. Training compute-optimal large language models. arXiv preprint arXiv:2203.15556, 2022. our card
  23. Hooker, S. The hardware lottery. Communications of the ACM, 640 (12):0 58–65, 2021. OpenAlex ↗ · Scholar ↗
  24. Hsieh, C.-Y., Li, C.-L., Yeh, C.-K., Nakhost, H., Fujii, Y., Ratner, A., Krishna, R., Lee, C.-Y., and Pfister, T. Distilling step-by-step! outperforming larger language models with less training data and smaller model sizes. arXiv preprint arXiv:2305.02301, 2023. our card
  25. Jiao, X., Yin, Y., Shang, L., Jiang, X., Chen, X., Li, L., Wang, F., and Liu, Q. Tinybert: Distilling bert for natural language understanding. arXiv preprint arXiv:1909.10351, 2019. our card
  26. Kaplan, J., McCandlish, S., Henighan, T., Brown, T. B., Chess, B., Child, R., Gray, S., Radford, A., Wu, J., and Amodei, D. Scaling laws for neural language models. arXiv preprint arXiv:2001.08361, 2020. our card
  27. Kim, S., Gholami, A., Yao, Z., Mahoney, M. W., and Keutzer, K. I-bert: Integer-only bert quantization. In International conference on machine learning, pp. 5506–5518. PMLR, 2021. our card
  28. Kitaev, N., Kaiser, Ł., and Levskaya, A. Reformer: The efficient transformer. arXiv preprint arXiv:2001.04451, 2020. our card
  29. Kurtic, E., Campos, D., Nguyen, T., Frantar, E., Kurtz, M., Fineran, B., Goin, M., and Alistarh, D. The optimal bert surgeon: Scalable and accurate second-order pruning for large language models. arXiv preprint arXiv:2203.07259, 2022. OpenAlex ↗ · Scholar ↗
  30. Lagunas, F., Charlaix, E., Sanh, V., and Rush, A. M. Block pruning for faster transformers. arXiv preprint arXiv:2109.04838, 2021. our card
  31. Leviathan, Y., Kalman, M., and Matias, Y. Fast inference from transformers via speculative decoding. In International Conference on Machine Learning, pp. 19274–19286. PMLR, 2023. our card
  32. Liu, Z., Desai, A., Liao, F., Wang, W., Xie, V., Xu, Z., Kyrillidis, A., and Shrivastava, A. Scissorhands: Exploiting the persistence of importance hypothesis for llm kv cache compression at test time. arXiv preprint arXiv:2305.17118, 2023a. OpenAlex ↗ · Scholar ↗
  33. Liu, Z., Wang, J., Dao, T., Zhou, T., Yuan, B., Song, Z., Shrivastava, A., Zhang, C., Tian, Y., Re, C., et al. Deja vu: Contextual sparsity for efficient llms at inference time. In International Conference on Machine Learning, pp. 22137–22176. PMLR, 2023b. our card
  34. Michel, P., Levy, O., and Neubig, G. Are sixteen heads really better than one? Advances in neural information processing systems, 32, 2019. our card
  35. Prasanna, S., Rogers, A., and Rumshisky, A. When bert plays the lottery, all tickets are winning. arXiv preprint arXiv:2005.00561, 2020. OpenAlex ↗ · Scholar ↗
  36. Qin, Y., Wang, Y., Deng, D., Zhao, Z., Yang, X., Liu, L., Wei, S., Hu, Y., and Yin, S. Fact: Ffn-attention co-optimized transformer architecture with eager correlation prediction. In Proceedings of the 50th Annual International Symposium on Computer Architecture, pp. 1–14, 2023. OpenAlex ↗ · Scholar ↗
  37. Radford, A., Wu, J., Child, R., Luan, D., Amodei, D., Sutskever, I., et al. Language models are unsupervised multitask learners. OpenAI blog, 10 (8):0 9, 2019. OpenAlex ↗ · Scholar ↗
  38. Raffel, C., Shazeer, N., Roberts, A., Lee, K., Narang, S., Matena, M., Zhou, Y., Li, W., and Liu, P. J. Exploring the limits of transfer learning with a unified text-to-text transformer. The Journal of Machine Learning Research, 210 (1):0 5485–5551, 2020. our card
  39. Sajjad, H., Dalvi, F., Durrani, N., and Nakov, P. On the effect of dropping layers of pre-trained transformer models. Computer Speech & Language, 77:0 101429, 2023. OpenAlex ↗ · Scholar ↗
  40. Sanh, V., Debut, L., Chaumond, J., and Wolf, T. Distilbert, a distilled version of bert: smaller, faster, cheaper and lighter. arXiv preprint arXiv:1910.01108, 2019. our card
  41. Shazeer, N. Fast transformer decoding: One write-head is all you need. arXiv preprint arXiv:1911.02150, 2019. OpenAlex ↗ · Scholar ↗
  42. Shen, S., Dong, Z., Ye, J., Ma, L., Yao, Z., Gholami, A., Mahoney, M. W., and Keutzer, K. Q-bert: Hessian based ultra low precision quantization of bert. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pp. 8815–8821, 2020. OpenAlex ↗ · Scholar ↗
  43. Tambe, T., Hooper, C., Pentecost, L., Jia, T., Yang, E.-Y., Donato, M., Sanh, V., Whatmough, P., Rush, A. M., Brooks, D., et al. Edgebert: Sentence-level energy optimizations for latency-aware multi-task nlp inference. In MICRO-54: 54th Annual IEEE/ACM International Symposium on Microarchitecture, pp. 830–844, 2021. OpenAlex ↗ · Scholar ↗
  44. Thorndike, R. L. Who belongs in the family? Psychometrika, 180 (4):0 267–276, 1953. OpenAlex ↗ · Scholar ↗
  45. Touvron, H., Lavril, T., Izacard, G., Martinet, X., Lachaux, M.-A., Lacroix, T., Rozière, B., Goyal, N., Hambro, E., Azhar, F., et al. Llama: Open and efficient foundation language models. arXiv preprint arXiv:2302.13971, 2023a. our card
  46. Touvron, H., Martin, L., Stone, K., Albert, P., Almahairi, A., Babaei, Y., Bashlykov, N., Batra, S., Bhargava, P., Bhosale, S., et al. Llama 2: Open foundation and fine-tuned chat models. arXiv preprint arXiv:2307.09288, 2023b. our card
  47. Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, Ł., and Polosukhin, I. Attention is all you need. Advances in neural information processing systems, 30, 2017. our card
  48. Voita, E., Talbot, D., Moiseev, F., Sennrich, R., and Titov, I. Analyzing multi-head self-attention: Specialized heads do the heavy lifting, the rest can be pruned. arXiv preprint arXiv:1905.09418, 2019. our card
  49. Waleffe, R. and Rekatsinas, T. Principal component networks: Parameter reduction early in training. arXiv preprint arXiv:2006.13347, 2020. OpenAlex ↗ · Scholar ↗
  50. Wang, H., Agarwal, S., and Papailiopoulos, D. Pufferfish: Communication-efficient models at no extra cost. Proceedings of Machine Learning and Systems, 3:0 365–386, 2021a. OpenAlex ↗ · Scholar ↗
  51. Wang, H., Zhang, Z., and Han, S. Spatten: Efficient sparse attention architecture with cascade token and head pruning. In 2021 IEEE International Symposium on High-Performance Computer Architecture (HPCA), pp. 97–110. IEEE, 2021b. our card
  52. Wang, H., Agarwal, S., Tanaka, Y., Xing, E., Papailiopoulos, D., et al. Cuttlefish: Low-rank model training without all the tuning. Proceedings of Machine Learning and Systems, 5, 2023. OpenAlex ↗ · Scholar ↗
  53. Wang, S., Li, B. Z., Khabsa, M., Fang, H., and Ma, H. Linformer: Self-attention with linear complexity. arXiv preprint arXiv:2006.04768, 2020. OpenAlex ↗ · Scholar ↗
  54. Wang, Z., Wohlwend, J., and Lei, T. Structured pruning of large language models. arXiv preprint arXiv:1910.04732, 2019. our card
  55. Xia, H., Ge, T., Wang, P., Chen, S.-Q., Wei, F., and Sui, Z. Speculative decoding: Exploiting speculative execution for accelerating seq2seq generation. In Findings of the Association for Computational Linguistics: EMNLP 2023, pp. 3909–3925, 2023. our card
  56. Xiao, G., Lin, J., Seznec, M., Wu, H., Demouth, J., and Han, S. Smoothquant: Accurate and efficient post-training quantization for large language models. In International Conference on Machine Learning, pp. 38087–38099. PMLR, 2023. our card
  57. Yang, S., Lee, G., Cho, J., Papailiopoulos, D., and Lee, K. Predictive pipelined decoding: A compute-latency trade-off for exact llm decoding. arXiv preprint arXiv:2307.05908, 2023. OpenAlex ↗ · Scholar ↗
  58. You, H., Li, C., Xu, P., Fu, Y., Wang, Y., Chen, X., Baraniuk, R. G., Wang, Z., and Lin, Y. Drawing early-bird tickets: Towards more efficient training of deep networks. arXiv preprint arXiv:1909.11957, 2019. OpenAlex ↗ · Scholar ↗
  59. Zellers, R., Holtzman, A., Bisk, Y., Farhadi, A., and Choi, Y. Hellaswag: Can a machine really finish your sentence? arXiv preprint arXiv:1905.07830, 2019. OpenAlex ↗ · Scholar ↗
  60. Zhang, S., Roller, S., Goyal, N., Artetxe, M., Chen, M., Chen, S., Dewan, C., Diab, M., Li, X., Lin, X. V., et al. Opt: Open pre-trained transformer language models. arXiv preprint arXiv:2205.01068, 2022. our card
  61. Zhang, Z., Sheng, Y., Zhou, T., Chen, T., Zheng, L., Cai, R., Song, Z., Tian, Y., Ré, C., Barrett, C., et al. H $\_2$ o: Heavy-hitter oracle for efficient generative inference of large language models. arXiv preprint arXiv:2306.14048, 2023. our card
  62. Zhou, Y., Du, N., Huang, Y., Peng, D., Lan, C., Huang, D., Shakeri, S., So, D., Dai, A. M., Lu, Y., et al. Brainformers: Trading simplicity for efficiency. In International Conference on Machine Learning, pp. 42531–42542. PMLR, 2023. OpenAlex ↗ · Scholar ↗