Explain algorithms in step by step list
- User
Explain algorithms in step by step list
Assistant
Based on the files provided from the optillm repository, here's a step-by-step explanation of the key algorithms implemented:
-
Chain-of-Thought (CoT) with Reflection
- Step 1: Receive system prompt and initial query
- Step 2: Format prompt with and sections
- Step 3: Generate initial response with reasoning steps
- Step 4: Reflect on the reasoning to identify errors
- Step 5: Adjust reasoning based on reflection
- Step 6: Provide final answer within tags
-
Best of N Sampling
- Step 1: Generate N completions for the same prompt
- Step 2: Rate each completion on relevance, coherence, and helpfulness
- Step 3: Select the highest-rated completion
- Step 4: (Optional) Generate additional responses based on top completions
-
Mixture of Agents (MoA)
- Step 1: Generate multiple initial completions
- Step 2: Create critique prompt comparing all completions
- Step 3: Generate critiques for each completion
- Step 4: Create final prompt combining original query and critiques
- Step 5: Generate final optimized response
-
Monte Carlo Tree Search (MCTS)
- Step 1: Initialize search tree with initial state
- Step 2: Select node using UCT formula
- Step 3: Expand node by generating possible actions
- Step 4: Simulate random playout to terminal state
- Step 5: Backpropagate results up the tree
- Step 6: Repeat for specified number of simulations
- Step 7: Select best move based on visit counts
-
R Algorithm*
- Step 1: Initialize root node with problem statement
- Step 2: Generate multiple reasoning trajectories
- Step 3: Split trajectories and verify mutual consistency
- Step 4: Select most consistent trajectory
- Step 5: Extract final answer from selected trajectory
-
Re-Reading (RE2)
- Step 1: Receive initial query
- Step 2: Append "Read the question again" instruction
- Step 3: Generate response to reinforced prompt
- Step 4: Return enhanced response
-
Round Trip Optimization (RTO)
- Step 1: Generate initial code implementation (C1)
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.