Reflection In AI, reinforcement learning is a process by which language model agents improve from trial to trial by translating feedback into short verbal self-reflections and taking them into account in the next attempt. The process does not adjust model weights and can be used without fine-tuning or neutral training. Therefore, it is also called „verbal reinforcement“: reinforcing learning through verbal feedback.
How reflection works
The agent processes a task and receives feedback from its environment, such as success, failure, or an error message. The system converts this feedback into a short textual summary. The system stores this self-reflection and provides it as additional context the next time the agent attempts the task. The loop continues until the reviewer classifies the result as correct or the maximum number of attempts is reached.
Building blocks and memory
Reflection consists of three components. The actor is a language model that generates text and actions, for example via chain of thought or ReAct. The evaluator assesses the result, for example by exact matching, heuristics, or another language model. In program code, it uses self-written tests. The self-reflection model analyzes the failure and formulates what should be done differently.
Short-term memory contains the course of the current episode. Long-term memory stores the reflections. Due to the limited context length, it usually contains only 1 to 3 entries.
Advantages and limitations
Reflection is lightweight. The feedback is more nuanced and understandable than a mere number. In decision-making, thinking, and programming tasks, the method shows significant improvements. However, it depends on the model’s ability to evaluate itself. Faulty tests lead to incorrect reflections. There is no formal guarantee of success. If a task requires a great deal of exploration, the method may remain stuck in local minima.
Reflection in LATS
Language Agent Tree Search (LATS) combines tree search with self-reflection by the language model and feedback from the environment. At the end of each run, the model produces a brief assessment of what went well and what didn’t. It uses this assessment to inform the next round of training.
Reference to SAP Business One
The availability check in SAP Business One forgets a case as soon as the user selects an option. A thought experiment (no existing function and no announcement) shows the difference: A system that records how a case ended could incorporate that experience into the next display.
Demarcation
Reflection is not training. The process improves the next attempt based on stored text in context, not on adjusted model weights. The term self-regulation is related: the ability of autonomous systems to adapt and correct their own actions.
Sprint and Swirl: How an AI agent divides work and learns from trials
LATS: Considering several paths simultaneously with AI — and the availability check in SAP B1
ReAct and RLEF: How Artificial Intelligence Learns from Real Mistakes — and What Automated Bank Reconciliation in SAP Business One Has to Do with It
SAP B1 10.0 FP2608: Service Layer AI as a transactional layer
Process Reward Models: Why a correct result does not yet prove a correct method
