Enum LoraTargetModules
- Namespace
- LMKit.Finetuning
- Assembly
- LM-Kit.NET.dll
Selects which weight matrices of the base model receive trainable LoRA adapters. Combine flags with a bitwise OR, or use Attention or All for the common presets.
[Flags]
public enum LoraTargetModules
Fields
None = 0No modules. Not a valid training target on its own.
AttentionQuery = 1Attention query projection.
AttentionKey = 2Attention key projection.
AttentionValue = 4Attention value projection.
AttentionOutput = 8Attention output projection.
FeedForwardGate = 16Feed-forward gate projection.
FeedForwardUp = 32Feed-forward up projection.
FeedForwardDown = 64Feed-forward down projection.
Output = 128Final output (unembedding) projection.
ExpertsGate = 256Mixture-of-Experts gate projection (MoE models only).
ExpertsUp = 512Mixture-of-Experts up projection (MoE models only).
ExpertsDown = 1024Mixture-of-Experts down projection (MoE models only).
ExpertsGateUp = 2048Fused Mixture-of-Experts gate+up projection (MoE models only).
Attention = AttentionQuery | AttentionKey | AttentionValue | AttentionOutputThe four attention projections (query, key, value, output). This is the default and the recommended starting point.
AttentionAndFeedForward = Attention | FeedForwardGate | FeedForwardUp | FeedForwardDownAttention plus the dense feed-forward projections. A good balance of capacity and cost for tasks that teach new content, not just style.
All = -1Every supported module, including MoE experts.
Remarks
Attention-only adaptation (the default) is the memory-light choice and covers most stylistic and instruction-following fine-tunes. Adding the feed-forward projections increases capacity for knowledge-heavy tasks at the cost of a larger adapter and more memory. Expert projections apply only to Mixture-of-Experts models and match no tensors on dense models.