Soft Self-Consistency Improves Language Model Agents

Han Wang, Archiki Prasad, Elias Stengel-Eskin, Mohit Bansal
2/20/2024
cs.CLcs.AIcs.LG

No official code found. Best implementation: HanNight/soft_self_consistency (25 stars, MIT, last commit 2024-09-11).

Abstract

Generations from large language models (LLMs) can be improved by sampling and scoring multiple solutions to select a final answer. Current "sample and select" methods such as self-consistency (SC) rely on majority voting to score answers. However, when tasks have many distinct and valid answers, selection by voting requires a large number of samples. This makes SC prohibitively expensive for interactive tasks that involve generating multiple actions (answers) sequentially. After establishing that majority voting fails to provide consistent gains on such tasks, we demonstrate how to increase success rates by softening the scoring criterion. We introduce Soft Self-Consistency (SOFT-SC), which replaces SC's discontinuous scoring with a continuous score computed from model likelihoods, allowing for selection even when actions are sparsely distributed. SOFT-SC improves both performance and efficiency on long-horizon interactive tasks, requiring half as many samples as SC for comparable or better performance. For a fixed number of samples, SOFT-SC leads to a 1.3% increase over SC in absolute success rate on writing bash programs, a 6.6% increase on online shopping (WebShop), and a 4.7% increase for an interactive household game (ALFWorld). Finally, we show that SOFT-SC can be applied to both open-source and black-box models.

View on arXivView PDF

Code Implementations(1)

MIT

Code for ACL 2024 paper "Soft Self-Consistency Improves Language Model Agents"

251PythonFeb 19, 20242 years agoMIT

Similar Papers

Cite this paper

@article{wang2024soft,
  title  = {Soft Self-Consistency Improves Language Model Agents},
  author = {Han Wang and Archiki Prasad and Elias Stengel-Eskin and Mohit Bansal},
  year   = {2024},
  eprint = {2402.13212},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2402.13212v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2402.13212.svg)](https://codeofpaper.com/paper/2402.13212)

Discussion