179 questions
No questions match those filters.
What is self-consistency, and how does it improve on pl...
This is one of the questions in the full AI/ML interview bank. Pro unlocks all 1789 questions; Premium includes the same bank plus the highest daily Practice limit.
See plansThe mechanism only works if the sampled reasoning chains are actually diverse, which is why self-consistency requires temperature above zero — sampling the same chain-of-thought prompt five times at temperature 0 just returns the same reasoning path five times, since greedy decoding is deterministic, and voting over five identical answers is a wasted 5x cost with zero benefit. The technique is specifically exploiting the fact that different sampled paths make independent errors, so errors get diluted by the vote while the correct answer — which the model reaches by a genuinely more direct or more common route — keeps recurring.
Implementation is mechanically simple: run the same chain-of-thought prompt N times at a moderate temperature (0.5–0.8 is typical), extract the final answer from each generated chain with a small parsing step, then take the mode across the N answers. For open-ended text answers rather than a discrete final value, majority voting doesn’t apply directly, and self-consistency is usually restricted to tasks with a clean, extractable final answer — a number, a classification label, a multiple-choice option — rather than free-form generation.
The trade-off to state explicitly in an interview is cost versus accuracy: this is not a technique to apply by default. A well-prompted single call handles the large majority of tasks fine, and paying 5x tokens and latency for marginal accuracy gains on routine queries is a bad economic trade. Reserve it for the specific slice of decisions where a wrong answer is expensive enough that the extra inference cost is negligible by comparison — that’s the actual engineering judgment call, not just knowing the technique exists.