Skip to content

Add SIMBAAlignmentOptimizer implementation#3

Closed
alkispoly-db wants to merge 2 commits intodefault_optimizer_dspy_basefrom
default_optimizer_simba
Closed

Add SIMBAAlignmentOptimizer implementation#3
alkispoly-db wants to merge 2 commits intodefault_optimizer_dspy_basefrom
default_optimizer_simba

Conversation

@alkispoly-db
Copy link
Owner

Summary

This PR adds the SIMBA (Simplified Multi-Bootstrap Aggregation) optimizer implementation.

Changes

  • Implement SIMBAAlignmentOptimizer extending DSPyAlignmentOptimizer
  • Add SIMBA-specific optimization logic with bootstrap aggregation
  • Support configurable batch size and seed parameters
  • Export SIMBAAlignmentOptimizer from optimizers package
  • Apply ruff formatting to all optimizer code

Description

SIMBA provides bootstrap aggregation optimization for judge prompts, using simplified parametrization compared to other DSPy algorithms. This implementation follows the DSPy SIMBA algorithm specification and provides a concrete optimizer that can be used to improve judge performance.

This is the third and final PR in a stack of 3 PRs that refactor the optimizer code:

  1. Utils files for traces and DSPy (PR Add utility functions for DSPy-based judge optimizers #1)
  2. DSPy base class for optimizers (PR Add DSPyAlignmentOptimizer base class for DSPy-based optimizers #2)
  3. [This PR] SIMBA optimizer implementation

Test plan

  • Code passes linting with uv run ruff check
  • Code formatted with uv run ruff format
  • Manual testing of import functionality
  • End-to-end testing with actual judges and traces

Generated with Claude Code

- Implement SIMBA (Simplified Multi-Bootstrap Aggregation) optimizer
- Extend DSPyAlignmentOptimizer with SIMBA-specific optimization logic
- Support configurable batch size and seed parameters
- Export SIMBAAlignmentOptimizer from optimizers package

SIMBA provides bootstrap aggregation optimization for judge prompts,
using simplified parametrization compared to other DSPy algorithms.

Signed-off-by: Alkis Polyzotis <alkis.polyzotis@databricks.com>
Signed-off-by: Alkis Polyzotis <alkis.polyzotis@databricks.com>
@alkispoly-db
Copy link
Owner Author

Closing to recreate against correct base branch

alkispoly-db pushed a commit that referenced this pull request Oct 31, 2025
Signed-off-by: B-Step62 <yuki.watanabe@databricks.com>
alkispoly-db pushed a commit that referenced this pull request Oct 31, 2025
)

Signed-off-by: B-Step62 <yuki.watanabe@databricks.com>
alkispoly-db added a commit that referenced this pull request Dec 17, 2025
Implements 6 of 9 review comments from smoorjani:

**API Simplification (Comment #1):**
- Remove last_turn_scorer parameter from public API
- Simplify constructor to use default Pydantic initialization
- Parameter kept as internal field for composition pattern

**Code Quality (Comments #3, mlflow#6, mlflow#8):**
- Remove duplicated kwargs validation (already in base class)
- Remove unnecessary one-line docstring from _evaluate_turn
- Use CategoricalRating enum instead of string literals ("yes"/"no")

**Logic Improvements (Comments mlflow#7, mlflow#9):**
- Move empty results check from _compute_aggregate to __call__
- Add per-turn details for success case (symmetric with failure case)

**Code Reuse Analysis (Comments mlflow#4, mlflow#5):**
- Researched _validate_session: serves different purpose (session ID validation)
- Researched resolve_conversation_from_session: returns different type (list[dict])
- Keeping inline implementations as they serve different purposes

**Deferred (Comment #2):**
- _create_judge() architecture issue deferred per reviewer (non-blocking)

All 5 KnowledgeRetention tests passing.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Signed-off-by: Alkis Polyzotis <alkis.polyzotis@databricks.com>
alkispoly-db added a commit that referenced this pull request Feb 24, 2026
- Refactor _ToggleableSpanProcessor from inheritance to composition,
  wrapping MlflowV3SpanProcessor as inner processor (comment mlflow#5)
- Add Langfuse and Arize/Phoenix to integration tiles (comment #2)
- Simplify arize.mdx span type mapping to 1-to-1 note (comment #3)
- Remove standalone otel.mdx; existing OTel docs suffice (comment mlflow#4)
- Verified None preview works against Databricks backend (comment #1)

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Alkis Polyzotis <alkis.polyzotis@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant