IAlignmentMethod<T>

Interfaces · AiDotNet.Interfaces

Defines the contract for AI alignment methods that ensure models behave according to human values and intentions.

Implements: IModelSerializer

Known implementations: AdversarialPreferenceAlignment<T>, RLHFAlignment<T>

How It Works

AI alignment focuses on making AI systems that reliably do what humans want them to do, even in novel situations where their behavior wasn’t explicitly programmed.

For Beginners: Think of AI alignment as “teaching good behavior” to AI systems. Just like teaching children values and ethics so they make good decisions on their own, alignment methods help AI systems understand and follow human intentions.

Common alignment approaches include:

  • RLHF (Reinforcement Learning from Human Feedback): Train models using human preferences
  • Constitutional AI: Teach models principles to guide their behavior
  • Red Teaming: Systematically test for harmful or unintended behaviors

Why AI alignment matters:

  • Prevents models from pursuing goals in harmful ways
  • Ensures models are helpful, harmless, and honest
  • Critical for deploying powerful AI systems safely
  • Helps models generalize human values to new situations

Methods

Method Summary
AlignmentMethodOptions<T> GetOptions() Gets the configuration options for the alignment method.
AlignmentMetrics<T> EvaluateAlignment(IPredictiveModel<T, Vector<T>, Vector<T>> model, AlignmentEvaluationData<T> evaluationData) Evaluates how well a model is aligned with human values.
IPredictiveModel<T, Vector<T>, Vector<T>> AlignModel(IPredictiveModel<T, Vector<T>, Vector<T>> baseModel, AlignmentFeedbackData<T> feedbackData) Aligns a model using feedback from human evaluators or preferences.
IPredictiveModel<T, Vector<T>, Vector<T>> ApplyConstitutionalPrinciples(IPredictiveModel<T, Vector<T>, Vector<T>> model, string[] principles) Applies constitutional principles to guide model behavior.
RedTeamingResults PerformRedTeaming(Func<string, string> model, SafetyPipeline<T> pipeline) Performs red teaming to identify potential misalignment or harmful behaviors.
void Reset() Resets the alignment method state.