Self-Consistency
Summary (confidence: high)
- Proposto por Wang et al. (2022) para substituir a decodificação gulosa no chain-of-thought.
- Gera múltiplos caminhos de raciocínio diversos e seleciona a resposta mais consistente (votação majoritária).
- Melhora o desempenho em tarefas de raciocínio aritmético e de senso comum.
Definição (confidence: high)
Técnica que amostra múltiplas cadeias de raciocínio (via CoT com temperatura > 0) e depois agrega as respostas por votação majoritária. Isso reduz o impacto de caminhos de raciocínio incorretos que podem surgir por acaso em uma única geração.
Funcionamento (confidence: high)
- Para uma mesma pergunta, geram-se N cadeias de raciocínio diferentes.
- Cada cadeia produz uma resposta final.
- A resposta final é selecionada por votação majoritária (a resposta mais frequente).
prompt-engineering-techniques | chain-of-thought | prompt-engineering-guide
Relationship to CoT Family (confidence: medium)
Viewed through the lens of the captured HF survey, self-consistency is the “sample-many, vote” member of the CoT family: it trades added inference cost for robustness by marginalizing over reasoning paths — sampling N diverse chains at temperature > 0 and selecting the most common answer, so a single bad reasoning path no longer sinks the whole generation. It sits alongside chain-of-thought (single path), zero-shot CoT (no examples), and tree-of-thoughts (branching search).
Implications
The cost/robustness trade-off is the key decision: self-consistency multiplies tokens (N generations) to reduce variance. It is a natural fit for tasks where correctness beats latency/cost (e.g. math, extraction), and pairs with llm-settings-and-parameters — the temperature must be raised above 0 for the diverse sampling to matter.
Sources
- raw/prompts/articles/promptingguide-pt-techniques-consistency.md
- raw/external/huggingface-co-advanced-prompt-engineering-bc976d6b.md