Structural control
aisteer360.algorithms.structural_control.base
Structural control base classes.
This module provides the abstract base class for methods that create persistent changes to the model, either through weight updates or architectural changes.
Two base classes are provided:
StructuralControl
: Base class for all structural control methods.NoStructuralControl
: Identity (null) control; used when no structural control is defined in steering pipeline.
Structural controls implement steering through model weight or architecture modifications, transforming base parameters θ to θ', resulting in generations following y ~ p_θ'(x).
Examples of structural controls:
- Fine-tuning (full or parameter-efficient like LoRA)
- Model merging (e.g., via MergeKit)
- Direct Preference Optimization (DPO)
- Adapter layers and modules
- Weight interpolation and averaging
See Also:
aisteer360.algorithms.structural_control
: Implementations of structural control methodsaisteer360.core.steering_pipeline
: Integration with steering pipeline
NoStructuralControl
Bases: StructuralControl
Identity structural control.
Used as the default when no structural control is needed. Passes the model through unchanged.
Source code in aisteer360/algorithms/structural_control/base.py
72 73 74 75 76 77 78 79 80 81 |
|
args = self.Args.validate(*args, **kwargs)
instance-attribute
enabled = False
class-attribute
instance-attribute
steer(model, **__)
Null steer operation; returns model.
Source code in aisteer360/algorithms/structural_control/base.py
79 80 81 |
|
StructuralControl
Bases: ABC
Abstract base class for structural control steering methods.
Modifies model parameters or architecture persistently, returning a new model instance with transformed weights.
Methods:
Name | Description |
---|---|
steer |
Training logic (required) |
Source code in aisteer360/algorithms/structural_control/base.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
|
args = self.Args.validate(*args, **kwargs)
instance-attribute
enabled = True
class-attribute
instance-attribute
steer(model, tokenizer=None, **kwargs)
abstractmethod
Required steering/preparation.
Source code in aisteer360/algorithms/structural_control/base.py
61 62 63 64 65 66 67 68 69 |
|