LLM Learning Roadmap
✨ Awesome-Anything
🖼️ Digital Image Processing
🍃 LLM Components
🌱 LLM Pre-training
☘️ LLM Post-Training
🍀 LLM Popular Models
🪴 LLM Applications
🌿 LLM Optimization
🌾 LLM Compression
🌵 LLM Hands-on Practice
🌴 LLM Must-read Papers
🌳 LLM Q&A
🐝 VLM Image Encoders
📝 MISC.
9.4 Prompting
9.4.1 Self-Refine: Iterative Refinement with Self-Feedback
Paper link: https://arxiv.org/abs/2303.17651
Research Background
The Self-Refine process mimics a three-step human-like approach of problem-solving, where the initial output from an LLM is refined through a series of iterative feedback steps. The biggest advantage of this method is that it requires no supervised training data, additional training, or reinforcement learning. A single LLM is used for generation, refinement, and feedback.
Research Method
Overall Structure
Generate → Self-feedback → Revise → Self-feedback → Revise → …
This approach combines a model’s instruction-following and evaluation abilities, which are necessary for the Self-Refine process. If the evaluation ability is insufficient for a specific task, the method will not be effective. However, if external evaluation is accurate, introducing external feedback can also make the process effective.

Self-Refine is an iterative self-refinement algorithm that alternates between two generation steps (self-feedback and revision). These steps work together to produce high-quality outputs.
Given an initial output generated by model M, it is input back into the same model to obtain feedback. Then, the feedback is again fed into the same model to improve the previously generated draft. This process is repeated for a specified number of iterations, or until the model determines that no further refinement is necessary.
As illustrated, given an input (0), Self-Refine first generates an output and sends it back to the same model M to obtain feedback (1). The feedback is then fed back into M, which refines the previously generated output (2). Steps (1) and (2) are repeated iteratively until the stopping condition is met. Self-Refine is instantiated with models such as GPT-3.5 and does not require human assistance.

Self-Refine algorithm:

Experiments
The study conducted experiments on three tasks (code optimization, sentiment transfer, and acronym generation), using different feedback generation methods, including:
- Self-Refine feedback
- Generic feedback: The feedback generated by the LLM is more general rather than highly specific. For example, in a code optimization task, the strategy might be “Improve the efficiency of the code” rather than “Avoid repeated calculations in the for loop.”
- No feedback: This removes the LLM-generated feedback step, simply passing the previous output back to the LLM for rewriting.

This study evaluated three tasks, analyzing how the results of Self-Refine change with different numbers of refinement iterations. below denotes the -th iteration. The figure shows that as the number of iterations increases, the quality of the generated responses improves, but the magnitude of improvement gradually diminishes.

In a code optimization task, the initial output (y0) had a score of 22.0. After three iterations (y3), the score increased to 28.8. Similarly, in a sentiment reversal task, the initial output scored 33.9, and after three iterations, it improved to 36.8.
These findings suggest that it is necessary to strike a balance between quality/improvement and the number of iterations. Multiple iterations introduce factors such as delay, cost, and speed limitations.
9.4.2 Tree of Thoughts: Deliberate Problem Solving with Large Language Models
Paper link: https://arxiv.org/abs/2305.10601
Research Background
When we handle new problems, we often make repeated adjustments and explorations before we can reach a final solution. During the exploration process, we generate some heuristic information that helps produce new discoveries. Therefore, a tree structure is needed for LLMs.
- Tree-structured search is a general problem-solving process in AI.
- Compared with LLMs, symbolic AI has limited generality due to its manually designed heuristic algorithms.
- Hence, combining the generalization ability of LLMs with the advantages of tree structures may lead to better performance.
Method

ToT (Tree of Thoughts): The core idea of ToT is replacing the linear Chain of Thought (CoT) with a tree structure. Using GPT-4, branches are generated, and conditions are evaluated to decide which branches are suitable to extend or prune.
Key Steps:
- Task Decomposition (Manually Defined)
- The granularity should not be too fine. Otherwise, evaluation becomes difficult (e.g., generating a single token).
- The granularity should not be too coarse. Otherwise, it becomes hard to produce accurate results (e.g., generating an entire book).
- Generating “Thoughts”
- Multiple independent samplings: suitable for cases with large generation spaces.
- Generate all at once: suitable for smaller generation spaces, to avoid redundant problems.
- Evaluating the Feasibility of “Thoughts”
- CoT Scoring / Ranking.
- CoT Voting.
- Can be repeated independently multiple times, performing CoT Self-Consistency (CoT-SC).
- Tree Search
- BFS (Breadth-First Search): During each iteration, keep the top N best nodes.
- DFS (Depth-First Search): During each iteration, limit the depth of the tree.


Comparison between CoT, CoT-SC, and ToT
Item | CoT | CoT-SC | ToT |
“Thought” Exploration | — | — | Has both DFS and BFS exploration methods |
Effectiveness | ★ | ★★ | ★★★ |
Token Consumption | ★ | ★★★ | ★★★ |
Prompt Tuning Cost | ★ | ★ | ★★ |
Applicable Scenarios | Complex tasks | Situations with limited correct labels | Complex tasks |
LLM Capability Requirements | CoT | CoT | CoT, Evaluation |
SFT (Supervised Fine-Tuning) | Not required | Not required | Not required |
Experiment and Result
Model: GPT-4
Tasks: Three tasks that require searching or detailed planning

Application
Game of 24

ToT Setup: Generate all possibilities at once + graded evaluation (sure / maybe / impossible) + BFS

Creative Writing

ToT Setup: Multiple independent samplings + voting + BFS
Procedure:
- Generate 5 plans.
- Vote 5 times to select the best plan, then use that best plan to generate 5 segments.
- Vote 5 times again to select the best segment as the final result.
Performance:

The paper only evaluated logical coherence, and ToT performed better. Iterative-Refine also worked well for this task, and it can be combined with ToT.
Mini crosswords

ToT Setup: Multiple independent samplings + generate all at once + graded evaluation (sure / maybe / impossible) + DFS

Research Summary
Although these experiments are relatively simple, they reflect abilities that are important in the real world. For example, the Game of 24 represents scientific exploration, creative writing represents the task of writing an article, and word puzzles represent optimization problems under specific constraints.
ToT Principle: It combines self-evaluation and considers the possibilities of each “thought step”, finding the correct solution from the entire thought tree.
Prev
9.3 o1 Techinical Paper
Next
9.5 LLM-as-Judge
Loading...