
Trading extra inference passes for accuracy on Amazon Bedrock
Read the full post on Builder CenterWhen an LLM isn't accurate enough, the usual move is to reach for a bigger model and pay more per call. Self-reflection offers a third option: let the model read its own answer, spot the problems, and revise. Two or three passes of a small model can often land where one pass of a large one does, and cost less doing it. GenAI Reflection for Amazon Bedrock is the open-source library we built for this. It wraps the Bedrock client, so adding reflection is a config change rather than a rewrite.
The verifier earns its keep the fastest. You supply a function that checks the output and feeds the result into the next round, which for text-to-SQL means running the query and returning either the error or the rows. Reflecting against real feedback beats reflecting in isolation, because the model has something to correct against other than its own judgement.
How much it helps depends on the task, and the spread is wider than we expected. Mathematical reasoning improved by up to 220% after one or two rounds, sentiment classification and some localisation work gained, and translation and text-to-SQL were mixed. Smaller models gained more than larger ones throughout, and returns flatten after three or four rounds. That variation is why the library ships an optimiser: give it a small labelled set and it searches combinations of model and reflection count against accuracy, cost and latency. The paper has the full benchmark across 10 models and 4 domains.

