IA3 › Parameter Count Analysis
Language AI HandbookAll chapters IA3 › Parameter Count AnalysisOne section · Sections in this chapter4 / 11 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
Understanding IA3's parameter count in exact quantitative terms is important for making informed decisions about when to use it versus alternatives. Let's derive the per-layer and total parameter counts carefully, then compare them to LoRA across representative model scales.
For a single standard transformer layer with hidden dimension and feed-forward dimension (typically ), IA3 introduces exactly three vectors. The total count per layer derives from summing these three vector lengths:
Substituting the typical :
where:
- : the hidden dimension of the model
- : the feed-forward dimension (typically )
- : combined parameters for the key rescaling vector and value rescaling vector
- : parameters for the feed-forward rescaling vector
This linear scaling with hidden dimension is gentle. As models grow from (BERT-base) to (LLaMA-7B) to (larger frontier models), IA3's per-layer parameter count grows proportionally. Because the original model's weight matrices grow quadratically with (a weight matrix has parameters), IA3's share of the total parameter count decreases as models get larger. IA3 therefore becomes relatively more efficient as models grow.
For LoRA adapting the same components (keys, values, and both feed-forward projections) with rank , the parameter count per layer is:
where:
- : the LoRA rank
- : the hidden dimension
- : the feed-forward dimension ()
- : the and matrices for both key and value projections (each projection needs an matrix and a matrix)
- : the and matrices for both feed-forward projections (mapping between and dimensions)
The necessary difference is the factor of : LoRA's per-layer count grows linearly with rank. Even at (the smallest possible rank), LoRA requires parameters per layer versus IA3's . At the commonly used rank , LoRA needs parameters per layer, versus IA3's , roughly 19 times more. At rank 16, the ratio grows to approximately 37 times more parameters.
For concrete numbers with LLaMA-7B (, , 32 layers) and rank :
- IA3 per layer: parameters
- IA3 total (32 layers): parameters
- LoRA per layer (rank 8): parameters using the actual
- LoRA total (32 layers): parameters
- LoRA/IA3 ratio: approximately 19.4 times more parameters for LoRA
This compression, from about 11.9 million parameters for LoRA to 614,400 for IA3, is what makes IA3 stand apart. You could store about 19 IA3 task-specific adaptations in the memory required for a single rank-8 LoRA adaptation configured this way. For production systems serving many tasks, this density advantage can be decisive.
def count_parameters(
d_model: int, d_ff: int, num_layers: int, lora_rank: int = 8
):
"""Compare parameter counts for IA3 vs LoRA."""
# IA3: rescaling vectors for keys, values, and feed-forward
ia3_per_layer = 2 * d_model + d_ff # l_k, l_v, l_ff
ia3_total = ia3_per_layer * num_layers
# LoRA: low-rank matrices for same components
# Each adapted weight needs r*(d_in + d_out) parameters
lora_k = lora_rank * (d_model + d_model) # Key projection adaptation
lora_v = lora_rank * (d_model + d_model) # Value projection adaptation
lora_ff1 = lora_rank * (d_model + d_ff) # First FFN projection adaptation
lora_ff2 = lora_rank * (d_ff + d_model) # Second FFN projection adaptation
lora_per_layer = lora_k + lora_v + lora_ff1 + lora_ff2
lora_total = lora_per_layer * num_layers
return {
"ia3_per_layer": ia3_per_layer,
"ia3_total": ia3_total,
"lora_per_layer": lora_per_layer,
"lora_total": lora_total,
"ratio": lora_total / ia3_total,
}
# LLaMA-7B setup
llama_7b = count_parameters(d_model=4096, d_ff=11008, num_layers=32)
# GPT-2 setup
gpt2 = count_parameters(d_model=768, d_ff=3072, num_layers=12)Parameter Comparison: IA3 vs LoRA (rank=8) ================================================== LLaMA-7B (4096 hidden, 32 layers): IA3 total: 614,400 params LoRA total: 11,927,552 params LoRA/IA3 ratio: 19.4x more params for LoRA GPT-2 (768 hidden, 12 layers): IA3 total: 55,296 params LoRA total: 1,032,192 params LoRA/IA3 ratio: 18.7x more params for LoRA

For LLaMA-7B, IA3 requires 614,400 trainable parameters, while LoRA with rank 8 on the same key, value, and feed-forward projections needs approximately 11.9 million. This 19.4-fold difference makes IA3 particularly attractive when memory is severely constrained or when you need to maintain and serve many task-specific adaptations simultaneously.