Explain algorithms in step by step list
- User
Explain algorithms in step by step list
Assistant
The OptILM repository contains several algorithms designed to improve large language model (LLM) reasoning capabilities. Here's a breakdown of each, presented as step-by-step lists:
1. Best-of-N Sampling (BON):
- Generate Multiple Completions: Given a prompt, generate n different completions using the LLM with a temperature greater than 0 (e.g., temperature=1) to encourage variety.
- Rate Each Completion: For each completion, ask the LLM to rate its quality on a scale (e.g., 0-10) based on criteria like relevance, coherence, and helpfulness. Use a low temperature (e.g., temperature=0.1) for the rating process to ensure consistent evaluations.
- Select the Best: Identify the completion with the highest rating and return it as the final output.
2. Chain-of-Thought Decoding (CoT):
- Initial Token Selection: Get the top k most likely tokens for the first decoding step. This creates k initial paths.
- Path Generation: For each of the k initial tokens, generate a complete sequence using standard decoding methods (e.g., beam search, nucleus sampling) up to a specified maximum number of tokens.
- Confidence Calculation: For each generated sequence, calculate a confidence score (Δ) based on the probability difference between the chosen token and the next best alternative at each step. Higher Δ indicates greater confidence.
- Path Selection/Aggregation:
- Simple CoT: Select the path with the highest confidence score.
- Aggregated CoT: Group paths with the same (or very similar) final answers and sum their confidence scores. Return the answer with the highest aggregated score.
3. Chain-of-Thought with Reflection (CoT Reflection):
- Structured Prompting: Use a prompt that explicitly guides the LLM through a structured thought process, including sections for "thinking," "reflection," and "output."
- Thinking: The LLM generates step-by-step reasoning within the
<thinking>tags. - Reflection: The LLM reflects on its reasoning, checking for errors or areas for improvement within the
<reflection>tags. - Adjustment (Optional): Based on the reflection, the LLM can adjust its reasoning. This step might be implicitly incorporated within the reflection stage.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.