Skip to content

Conversation

@keerthi166
Copy link
Contributor

Support for Fast (S1) and Slow (S2) solvers (AI models) in Sampling strategy based on SOFAI cognitive architecture https://sites.google.com/view/sofai/home.

  1. S1 solvers are fast and cheap, but less accurate Ex.: Large Language Models
  2. S2 solvers are more accurate but also more costly Ex.: Large Reasoning Models, symbolic solvers for problems with large search spaces
  3. Meta-cognitive (MC) component evaluates the response from S1 solver and decide whether to iterate with S1 solver along with feedback or use S2 solver to improve decisions.

@mergify
Copy link

mergify bot commented Jan 13, 2026

Merge Protections

Your pull request matches the following merge protections and will not be merged until they are valid.

🟢 Enforce conventional commit

Wonderful, this rule succeeded.

Make sure that we follow https://www.conventionalcommits.org/en/v1.0.0/

  • title ~= ^(fix|feat|docs|style|refactor|perf|test|build|ci|chore|revert|release)(?:\(.+\))?:

@nrfulton nrfulton self-requested a review January 14, 2026 22:16
Copy link
Contributor

@nrfulton nrfulton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requested some code organization changes. The most important is to not modify Requirement.

sample_validations=sampled_scores,
sample_contexts=sample_contexts,
sample_actions=sampled_actions,
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a really long method with lots of state. I had quite a lot of trouble following what's happening. Can you please break this up into some private methods that operate independently of one another (except threading through inputs and outputs), and provide a comment block explaining what's going to happen in each step?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated with new methods:
_run_s1_solver_loop() - S1 iteration loop with validation and repair
_prepare_requirements_for_validation() - Judge backend wrapping logic
_run_s2_solver() - S2 fallback with mode handling
_prepare_s2_context() - Context preparation for each S2 mode

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. We discussed adding a bit of inline documentation about the for loop during s1.

@nrfulton
Copy link
Contributor

nrfulton commented Jan 14, 2026

  • There are ruff formatter errors
  • There are ruff linter errors
  • There are type errors
  • I left some comments in the code review (above)

Please address these issues and let me know when the PR is ready for re-review.

Please also note that @jakelorocco will be pushing a slight re-org of the codebase at some point in the coming day or two. This will impact your PR; we will need you to merge with his branch. After removing your changes to Requirement there will likely be no merge conflicts, but you will need to update your import statements. This should be relatively easy and Jake will post guidance in the release notes for 0.3.0.

Please also install and run pre-commit hooks prior to letting me know this PR as ready for review. I recently added dev environment setup instructions to the Mellea tutorial covering the installation of pre-commit hooks. If you run into issues with your local environment, please ask for guidance here.

@nrfulton
Copy link
Contributor

@keerthi166 FYI, Jake's changes are in.

@keerthi166
Copy link
Contributor Author

@keerthi166 FYI, Jake's changes are in.

Thanks @nrfulton. We are working on the PR with the Jake's changes. We will be sending PR any minute now.

Comment on lines +636 to +637
# Exit conditions: success returns immediately; no-improvement breaks
# early to S2 escalation; loop budget exhaustion flows to S2 escalation.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect; thanks.

@nrfulton nrfulton merged commit cbf3913 into generative-computing:main Jan 16, 2026
4 checks passed
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.

3 participants