HARP: Hesitation-Aware Reframing in Transformer Inference Pass

Romain Storaï, Seung-won Hwang
12/10/2024
cs.CLcs.AIcs.LG

No official code found. Best implementation: romsto/HARP (5 stars, Apache-2.0, last commit 2024-12-11).

Abstract

This paper aims to improve the performance of large language models by addressing the variable computational demands in inference steps, where some tokens require more computational resources than others. We present HARP, a simple modification to "off-the-shelf" Transformer forward pass. Drawing from hesitation and the framing effect in decision-making, HARP selectively applies additional computation when the model encounters uncertainty during token generation. Our method mimics human cognitive processes by pausing at difficult decision points and reframing inputs for a different perspective. Unlike other approaches, HARP is model-agnostic, training-free, and easy to implement. We evaluate our method across various downstream tasks and model sizes, demonstrating performance improvements up to +5.16%. Notably, HARP achieves these gains while maintaining inference times twice faster than beam search. Simple and yet with significant gains, HARP provides insights into the potential of adaptive computation for enhancing the performance of Transformer-based language models.

View on arXivView PDF

Code Implementations(1)

romsto/HARPCommunity100%
Apache-2.0

Official Implementation of HARP: Hesitation-Aware Reframing in Transformer Inference Pass (Romain Storaï and Seung-won Hwang, 2024)

51PythonDec 11, 20241 years agoApache-2.0

Similar Papers

Cite this paper

@article{stora2024harp,
  title  = {HARP: Hesitation-Aware Reframing in Transformer Inference Pass},
  author = {Romain Storaï and Seung-won Hwang},
  year   = {2024},
  eprint = {2412.07282},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2412.07282v2}
}

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/2412.07282.svg)](https://codeofpaper.com/paper/2412.07282)

Discussion