Skip to content

Configurable Solution Generation Prompts #17

@alirezamshi

Description

@alirezamshi

Description

The solution_generation method has a hardcoded prompt. Users can only configure LLM models but cannot customize the generation behavior or provide domain-specific guidance.

Current limitation:

# llm_tree_search.py L433-440
solution_generation_prompt = """
    You are a world class problem solver. Generate {per_step_solution_count} exact solutions...
"""

Goal

Allow users to customize solution generation via config:

  • Custom system prompt template
  • Domain-specific directions/constraints
  • Solution format requirements

Proposed Config

search_strategy:
  type: "llm_tree_search"
  params:
    idea_generation_model: "gpt-4.1"
    idea_generation_prompt: |
      You are an expert in {domain}. Generate solutions that...
    idea_generation_directions:
      - "Prefer memory-efficient approaches"
      - "Consider edge cases for large inputs"
    idea_generation_format: "numbered_list"  # or "xml_tags"

Implementation

  1. Add new params to LlmSteeredTreeSearch.__init__
  2. Template the solution_generation_prompt with user values
  3. Update strategies.yaml with new param defaults

References

  • solution_generation method
  • src/execution/search_strategies/strategies.yaml - Strategy presets
  • src/config.yaml - Mode configurations

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0Highest Priority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions